January 28, 2013
On 2013-01-28 13:32, alex wrote:

> K..Created an extra panel, and the actual mixin evaluation is working,
> too. But now there are some last adjustments required to have the entire
> mechanism as few annoying and performance-reducing as possible.

Cool, I guess it's time to give Mono-D another try.

-- 
/Jacob Carlborg
January 28, 2013
On Monday, 28 January 2013 at 20:20:42 UTC, Jacob Carlborg wrote:
> On 2013-01-28 13:32, alex wrote:
>
>> K..Created an extra panel, and the actual mixin evaluation is working,
>> too. But now there are some last adjustments required to have the entire
>> mechanism as few annoying and performance-reducing as possible.
>
> Cool, I guess it's time to give Mono-D another try.

http://i.imgur.com/3i5R4Mn.png?1

A first shot - I guess in cases of having template parameters, stuff should get 'expanded' to the final type, right? Well then I still have to work on it. Anyway it also works for template mixins and mixin statements. You just move the caret into a mixin, wait half a sec and then get the evaluated string displayed in a halfway good style.
Ah, regarding the style..I also have to optimize it again - never touched any 'pretty printing' of entire ASTs before ;)
January 28, 2013
alex wrote:
> http://i.imgur.com/3i5R4Mn.png?1
>
> A first shot - I guess in cases of having template parameters, stuff should get 'expanded' to the final type, right? Well then I still have to work on it. Anyway it also works for template mixins and mixin statements. You just move the caret into a mixin, wait half a sec and then get the evaluated string displayed in a halfway good style.
> Ah, regarding the style..I also have to optimize it again - never touched any 'pretty printing' of entire ASTs before ;)

Now that's impressive. Can't wait to see exactly what will come of the expression evaluation :D
January 28, 2013
On Monday, 28 January 2013 at 21:14:07 UTC, F i L wrote:
> alex wrote:
>> http://i.imgur.com/3i5R4Mn.png?1
>>
>> A first shot - I guess in cases of having template parameters, stuff should get 'expanded' to the final type, right? Well then I still have to work on it. Anyway it also works for template mixins and mixin statements. You just move the caret into a mixin, wait half a sec and then get the evaluated string displayed in a halfway good style.
>> Ah, regarding the style..I also have to optimize it again - never touched any 'pretty printing' of entire ASTs before ;)
>
> Now that's impressive. Can't wait to see exactly what will come of the expression evaluation :D

Yeah I just named it "Expression evaluation" - dunno why, just thought that it could be used in a more general way than 'only' for mixin insight.

Should I do an extra input box where you could type in expressions and other things that could be evaluated? Just thinking of a prototype of an interactive D script console or so.. :)
January 29, 2013
alex wrote:
> Yeah I just named it "Expression evaluation" - dunno why, just thought that it could be used in a more general way than 'only' for mixin insight.
>
> Should I do an extra input box where you could type in expressions and other things that could be evaluated? Just thinking of a prototype of an interactive D script console or so.. :)

That sounds very useful. It would be awesome if you could evaluate the returned value of functions that already exist in your program, or (like your picture shows) write simple test functions to evaluate. Of course not all functions will work, but It would be great in some areas. So, just to be clear, say you have the following function in your project:

    int foo(int x, int y)
    {
        return x * y + 5;
    }

Then in the expression "command line", you just type:

    foo(1, 2)

Hit Enter, and you get a message: "7". You could also write larger test functions in the Expression Evaluation body (like in your screenshot) which could do more complicated stuff (still limited of course).

---

You just gave me an awesome idea though. I know this would be a ton of work (I'm not making a feature request here), but how realistic would it be with your system to do a "side-by-side" expression evaluation with "example data" (where applicable)? :D

Meaning, imagine your screen looks like:

    CODE                       | EXAMPLE RESULTS
   ------------------------------------------------------------
                               |
    int foo(int x, int y)      | params: (2, 3) // editable
    {                          |
        return x * y + 5       | returns: 11    // not-editable
    }                          |
                               |

That would simply amazing! I don't expect you to make that, lol, only want to know if it's possible (or foreseeable) with your expression evaluation engine. Is it?
January 29, 2013
alex wrote:
> ...

Oh, ps. On a completely unrelated note, Just wanted to say that the new Active Profiler display is completely awesome. Thanks!
January 29, 2013
On Tuesday, 29 January 2013 at 00:48:24 UTC, F i L wrote:
> ...
> That sounds very useful. It would be awesome if you could evaluate the returned value of functions that already exist in your program, or (like your picture shows) write simple test functions to evaluate. Of course not all functions will work, but It would be great in some areas. So, just to be clear, say you have the following function in your project:
>
>     int foo(int x, int y)
>     {
>         return x * y + 5;
>     }
>
> Then in the expression "command line", you just type:
>
>     foo(1, 2)
>
> Hit Enter, and you get a message: "7". You could also write larger test functions in the Expression Evaluation body (like in your screenshot) which could do more complicated stuff (still limited of course).

http://mono-d.alexanderbothe.com/?attachment_id=817
My progress so far. Lots of internals to manage though. The
execute-button isn't implemented yet but you can toggle the
"Automatically take the mixin at the caret location" button.
Concerning things like foo(1,2) - yes, the evaluation engine
directly takes the symbols straight out of its parsed modules. So
as you create a method body you'll be able to execute stuff
in-line. But yeah, remember that CTFE isn't implemented yet ;) -
Perhaps I'll do/finish it during the next GSoC.

Haha, as a systematical performance pre-improvement I could
directly redirect some phobos methods like sqrt() to the .net one
- which would save huge amounts of time then.

> You just gave me an awesome idea though. I know this would be a ton of work (I'm not making a feature request here), but how realistic would it be with your system to do a "side-by-side" expression evaluation with "example data" (where applicable)? :D
>
> Meaning, imagine your screen looks like:
>
>     CODE                       | EXAMPLE RESULTS
>    ------------------------------------------------------------
>                                |
>     int foo(int x, int y)      | params: (2, 3) // editable
>     {                          |
>         return x * y + 5       | returns: 11    // not-editable
>     }                          |
>                                |
>
> That would simply amazing! I don't expect you to make that, lol, only want to know if it's possible (or foreseeable) with your expression evaluation engine. Is it?

Side-by-side? This could be your contribution then :P
I actually did watch this one video where that one guy just
edited some javascript in his uber-editor and the WebGL
animations reacted on his coding in pseudo-realtime in the
browser :D
January 29, 2013
On 2013-01-28 23:09, alex wrote:

> Yeah I just named it "Expression evaluation" - dunno why, just thought
> that it could be used in a more general way than 'only' for mixin insight.
>
> Should I do an extra input box where you could type in expressions and
> other things that could be evaluated? Just thinking of a prototype of an
> interactive D script console or so.. :)

Sure, why not.

-- 
/Jacob Carlborg
January 29, 2013
On 2013-01-29 03:14, alex wrote:
> On Tuesday, 29 January 2013 at 00:48:24 UTC, F i L wrote:

>> Meaning, imagine your screen looks like:
>>
>>     CODE                       | EXAMPLE RESULTS
>>    ------------------------------------------------------------
>>                                |
>>     int foo(int x, int y)      | params: (2, 3) // editable
>>     {                          |
>>         return x * y + 5       | returns: 11    // not-editable
>>     }                          |
>>                                |
>>
>> That would simply amazing! I don't expect you to make that, lol, only
>> want to know if it's possible (or foreseeable) with your expression
>> evaluation engine. Is it?
>
> Side-by-side? This could be your contribution then :P
> I actually did watch this one video where that one guy just
> edited some javascript in his uber-editor and the WebGL
> animations reacted on his coding in pseudo-realtime in the
> browser :D

Yeah, that was soooo cool. I also liked the code bubbles. Instead of having a file as the minimum abstraction unit in the IDE/editor it was a function/class/method.

-- 
/Jacob Carlborg
January 29, 2013
On 01/29/2013 03:14 AM, alex wrote:
> On Tuesday, 29 January 2013 at 00:48:24 UTC, F i L wrote:
>> ...
> http://mono-d.alexanderbothe.com/?attachment_id=817
> My progress so far. Lots of internals to manage though. The
> execute-button isn't implemented yet but you can toggle the
> "Automatically take the mixin at the caret location" button.
> Concerning things like foo(1,2) - yes, the evaluation engine
> directly takes the symbols straight out of its parsed modules. So
> as you create a method body you'll be able to execute stuff
> in-line. But yeah, remember that CTFE isn't implemented yet ;) -
> Perhaps I'll do/finish it during the next GSoC.
> ...

Probably you should do JIT using System.Reflection.Emit.