Jump to page: 1 2 3
Thread overview
Mono-D v0.4.9.5 - Infinite analysis fix + Mixin analysis improvement
Jan 27, 2013
alex
Jan 27, 2013
Dicebot
Jan 27, 2013
alex
Jan 27, 2013
Dicebot
Jan 27, 2013
Jacob Carlborg
Jan 27, 2013
alex
Jan 27, 2013
Jacob Carlborg
Jan 28, 2013
alex
Jan 28, 2013
Jacob Carlborg
Jan 28, 2013
alex
Jan 28, 2013
F i L
Jan 28, 2013
alex
Jan 29, 2013
F i L
Jan 29, 2013
alex
Jan 29, 2013
Jacob Carlborg
Jan 29, 2013
alex
Jan 29, 2013
Jacob Carlborg
Jan 29, 2013
Bruno Medeiros
Jan 29, 2013
Jacob Carlborg
Jan 29, 2013
alex
Jan 30, 2013
Jacob Carlborg
Feb 01, 2013
alex
Feb 01, 2013
Paulo Pinto
Jan 29, 2013
Timon Gehr
Jan 29, 2013
alex
Jan 29, 2013
F i L
Jan 29, 2013
Jacob Carlborg
Jan 27, 2013
F i L
Jan 28, 2013
alex
January 27, 2013
Morning D folks,

Implemented some new features concerning pre-compile time mixin
analysis and expression evaluation:

http://mono-d.alexanderbothe.com/?p=814 (Screenshot included)

I'd furthermore suggest that the prospective generational GC (not
the current one, I mean the fictional that actually can collect
nearly everything wisely! ;)) also supports weak references -
because they're imho essential for a nice caching flow:

In this version of mono-d I used a weak-keyed dictionary to store
mixin expression results until the owner module is free'd and
probably reparsed. This allows me to be more lazy regarding the
deletion of those cache entries after I reparsed e.g. a module +
mem leaking is prevented + less muddy code in the module update
routines! :)


Cheers,
Alex
January 27, 2013
Gets better and better!

Makes me wonder though: if this works, may be it is possible to provide a context helper with mixin resulting code if all it parameters are already defined? Similar to C macro expansion helper in Eclipse.
January 27, 2013
On Sunday, 27 January 2013 at 11:31:58 UTC, Dicebot wrote:
> Gets better and better!
>
> Makes me wonder though: if this works, may be it is possible to provide a context helper with mixin resulting code if all it parameters are already defined? Similar to C macro expansion helper in Eclipse.

So like.. you click somewhere in your document, have an extra panel in which you can enter an expression (even a CTFE call later on), and get your expressions evaluated? Sure - even stuff like template mixins or similar..no problem :)
Uhm, even pre-defining variable contents shouldn't be a problem - then you would have a D math-script interpreter :D
January 27, 2013
On 2013-01-27 12:27, alex wrote:
> Morning D folks,
>
> Implemented some new features concerning pre-compile time mixin
> analysis and expression evaluation:
>
> http://mono-d.alexanderbothe.com/?p=814 (Screenshot included)

Nice. I'm not sure if this is what Dicebot suggested but would it be possible to implement a compile time view, like Descent had? It how showed template and string mixins are expanded. It also showed how some language features are lowered to other features, like the scope statement being lowered to try/catch/finally.

This clip shows the compile time view in action:

http://www.youtube.com/watch?v=oAhrFQVnsrY&noredirect=1

-- 
/Jacob Carlborg
January 27, 2013
On Sunday, 27 January 2013 at 12:05:28 UTC, alex wrote:
> On Sunday, 27 January 2013 at 11:31:58 UTC, Dicebot wrote:
>> Gets better and better!
>>
>> Makes me wonder though: if this works, may be it is possible to provide a context helper with mixin resulting code if all it parameters are already defined? Similar to C macro expansion helper in Eclipse.
>
> So like.. you click somewhere in your document, have an extra panel in which you can enter an expression (even a CTFE call later on), and get your expressions evaluated? Sure - even stuff like template mixins or similar..no problem :)
> Uhm, even pre-defining variable contents shouldn't be a problem - then you would have a D math-script interpreter :D

No, a bit different. I.e.
---------
string gen(int num)
{
    return format("auto a = %s", num);
}

mixin(gen("42");
---------

And when you hover over "mixin" keyword, temporary modal window appears with content "auto a = 42". Or even separate panel with full compile-time feature expansion like it was in Descent, as Jacob suggests.

I suppose it is hard to have full CTFE engine now, but at least simple cases may be useful.
January 27, 2013
On Sunday, 27 January 2013 at 12:20:51 UTC, Jacob Carlborg wrote:
> On 2013-01-27 12:27, alex wrote:
>> Morning D folks,
>>
>> Implemented some new features concerning pre-compile time mixin
>> analysis and expression evaluation:
>>
>> http://mono-d.alexanderbothe.com/?p=814 (Screenshot included)
>
> Nice. I'm not sure if this is what Dicebot suggested but would it be possible to implement a compile time view, like Descent had? It how showed template and string mixins are expanded. It also showed how some language features are lowered to other features, like the scope statement being lowered to try/catch/finally.
>
> This clip shows the compile time view in action:
>
> http://www.youtube.com/watch?v=oAhrFQVnsrY&noredirect=1

Well, not displaying the entire module but only displaying
resolved expressions. Dunno how to do this in a proper way - only
via tooltips or also in an extra panel? Which would be the most
useful?

Btw, since I'm not that involved in D's magic I definitely
haven't planned such extensive pre-compilation :D
January 27, 2013
On 2013-01-27 13:35, alex wrote:

> Well, not displaying the entire module but only displaying
> resolved expressions. Dunno how to do this in a proper way - only
> via tooltips or also in an extra panel? Which would be the most
> useful?

If it cannot show the entire module then I think a tooltip would be best suited.

> Btw, since I'm not that involved in D's magic I definitely
> haven't planned such extensive pre-compilation :D

It can be extremely helpful to see how a template/string mixin is expanded when debugging.

It can also be fun to see how the compiler behaves internally, i.e. scope-statements are lowered to try/catch/finally.

Any D IDE has quite a lot of expectations to live up since it most certainly will be compared with Descent.

-- 
/Jacob Carlborg
January 27, 2013
alex wrote:
> Morning D folks,
>
> Implemented some new features concerning pre-compile time mixin
> analysis and expression evaluation:
>
> ...

The new update seems very fast and stable. Trying the new
features, Thanks!
January 28, 2013
On Sunday, 27 January 2013 at 15:24:23 UTC, Jacob Carlborg wrote:
> On 2013-01-27 13:35, alex wrote:
>
>> Well, not displaying the entire module but only displaying
>> resolved expressions. Dunno how to do this in a proper way - only
>> via tooltips or also in an extra panel? Which would be the most
>> useful?
>
> If it cannot show the entire module then I think a tooltip would be best suited.
>
>> Btw, since I'm not that involved in D's magic I definitely
>> haven't planned such extensive pre-compilation :D
>
> It can be extremely helpful to see how a template/string mixin is expanded when debugging.
>
> It can also be fun to see how the compiler behaves internally, i.e. scope-statements are lowered to try/catch/finally.
>
> Any D IDE has quite a lot of expectations to live up since it most certainly will be compared with Descent.

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.
January 28, 2013
On Sunday, 27 January 2013 at 23:14:23 UTC, F i L wrote:
> alex wrote:
>> Morning D folks,
>>
>> Implemented some new features concerning pre-compile time mixin
>> analysis and expression evaluation:
>>
>> ...
>
> The new update seems very fast and stable. Trying the new
> features, Thanks!

And if not, you know the routine :)
« First   ‹ Prev
1 2 3