Re: Descent 0.5.4 released

2009-03-24 Thread Saaa
> I could list everything here, but I think it would be easiest to just 
> download Poseidon.
Poseidon doesn't need to install..
The keywords are listed and selectable in Tools>Options>Editor>D styles>Key 
Words





Re: Descent 0.5.4 released

2009-03-24 Thread Trass3r

Jarrett Billingsley schrieb:

The worst offender, by far, is the D highlighter for Kate.  It has 24
separate styles for various syntactico-semantic elements, all of which
have different colors by default.  It looks like a rainbow vomited.
It's just so distracting :P


Yeah, but poseidon's style isn't that overloaded. I also prefer its 
syntax highlighting.


Re: Descent 0.5.4 released

2009-03-23 Thread Saaa

"Ary Borenszweig"  wrote in message 
news:gq9b51$bt...@digitalmars.com...
> Saaa escribió:
>>> Poseidon has 7 (custom) groups of keywords which have different colours.
>>> eg. import=orange, static=green, void=blue, this=purple
>>> To me it makes source much easier to navigate.
>>>
>> Not possible...?
>> But.. but.. my code looks soo boring now :(
>>
>> :)
>
> It's possible, yes. But I think the code will look like a mess. :-P
>
> I'll need a complete list of the keywords inside each group to do that. 
> And... I'm back to university, and work, and in a few days I'm on 
> vacations, so... I won't be able to do much.
Me understands..

I could list everything here, but I think it would be easiest to just 
download Poseidon.
That way you can marvel at its highlighting in private.
http://www.dsource.org/projects/poseidon/changeset/head/trunk?old_path=%2F&format=zip







Re: Descent 0.5.4 released

2009-03-23 Thread Jarrett Billingsley
On Mon, Mar 23, 2009 at 9:00 PM, Ary Borenszweig  wrote:
> Jarrett Billingsley escribió:
>>
>> On Sat, Mar 21, 2009 at 7:23 PM, Saaa  wrote:
>>>
>>> Poseidon has 7 (custom) groups of keywords which have different colours.
>>> eg. import=orange, static=green, void=blue, this=purple
>>> To me it makes source much easier to navigate.
>>
>> Honestly I don't know how people can cope with that.. if you use 30
>> colors, don't they stop having meaning?  :|
>
> Yes, I think the code will look like a mess. But maybe he's talking about
> primitive types with one color, attributes with other, etc. But something
> like:
>
> public static void ... {
> }
>
> with three different colors would just call my attention too much and I
> won't be able to focus on the real code. :-P
>

The worst offender, by far, is the D highlighter for Kate.  It has 24
separate styles for various syntactico-semantic elements, all of which
have different colors by default.  It looks like a rainbow vomited.
It's just so distracting :P


Re: Descent 0.5.4 released

2009-03-23 Thread Ary Borenszweig

Jarrett Billingsley escribió:

On Sat, Mar 21, 2009 at 7:23 PM, Saaa  wrote:

Poseidon has 7 (custom) groups of keywords which have different colours.
eg. import=orange, static=green, void=blue, this=purple
To me it makes source much easier to navigate.


Honestly I don't know how people can cope with that.. if you use 30
colors, don't they stop having meaning?  :|


Yes, I think the code will look like a mess. But maybe he's talking 
about primitive types with one color, attributes with other, etc. But 
something like:


public static void ... {
}

with three different colors would just call my attention too much and I 
won't be able to focus on the real code. :-P


Re: Descent 0.5.4 released

2009-03-23 Thread Christopher Wright

Jarrett Billingsley wrote:

On Sat, Mar 21, 2009 at 7:23 PM, Saaa  wrote:

Poseidon has 7 (custom) groups of keywords which have different colours.
eg. import=orange, static=green, void=blue, this=purple
To me it makes source much easier to navigate.


Honestly I don't know how people can cope with that.. if you use 30
colors, don't they stop having meaning?  :|


Yes, but they make me feel better, especially with a blue / mint green 
color scheme.


Re: Descent 0.5.4 released

2009-03-23 Thread Ary Borenszweig

Saaa escribió:

Poseidon has 7 (custom) groups of keywords which have different colours.
eg. import=orange, static=green, void=blue, this=purple
To me it makes source much easier to navigate.


Not possible...?
But.. but.. my code looks soo boring now :(

:)


It's possible, yes. But I think the code will look like a mess. :-P

I'll need a complete list of the keywords inside each group to do that. 
And... I'm back to university, and work, and in a few days I'm on 
vacations, so... I won't be able to do much.


Re: Descent 0.5.4 released

2009-03-23 Thread Jarrett Billingsley
On Sat, Mar 21, 2009 at 7:23 PM, Saaa  wrote:
>
> Poseidon has 7 (custom) groups of keywords which have different colours.
> eg. import=orange, static=green, void=blue, this=purple
> To me it makes source much easier to navigate.

Honestly I don't know how people can cope with that.. if you use 30
colors, don't they stop having meaning?  :|


Re: Descent 0.5.4 released

2009-03-23 Thread Saaa
> Poseidon has 7 (custom) groups of keywords which have different colours.
> eg. import=orange, static=green, void=blue, this=purple
> To me it makes source much easier to navigate.
>
Not possible...?
But.. but.. my code looks soo boring now :(

:)





Re: Descent 0.5.4 released

2009-03-21 Thread Saaa


>> Had a few problems with descent and PATH. Maybe it was something else but 
>> could it maybe be that you need to logout for eclipse to see changes in 
>> the PATH?
>
> Yes, probably. I'm not sure.
I mean log out of XP. Because normally you only need to restart the program.
A well, it works now. I'm happy again :D
>
>>
>> Well things seem to be working now but I miss poseidons syntax 
>> colourscheme.
>> Is it possible to have different colours per keyword(group)?
>
> What's a keyword group? You can change the colors, but you'd change all of 
> the keywords to another color (except "return": you can color returns with 
> a different color, useful to see all exit paths of a function).

Poseidon has 7 (custom) groups of keywords which have different colours.
eg. import=orange, static=green, void=blue, this=purple
To me it makes source much easier to navigate.




Re: Descent 0.5.4 released

2009-03-21 Thread Ary Borenszweig

Saaa escribió:

Started my descent quest..
Mostly because I wanted the : Highlighting of all occurrences of the current 
token under the cursor.

Also just to look what else might be interesting.

Had a few problems with descent and PATH. Maybe it was something else but 
could it maybe be that you need to logout for eclipse to see changes in the 
PATH?


Yes, probably. I'm not sure.



Well things seem to be working now but I miss poseidons syntax colourscheme.
Is it possible to have different colours per keyword(group)?


What's a keyword group? You can change the colors, but you'd change all 
of the keywords to another color (except "return": you can color returns 
with a different color, useful to see all exit paths of a function).


Re: Descent 0.5.4 released

2009-03-21 Thread Saaa
Started my descent quest..
Mostly because I wanted the : Highlighting of all occurrences of the current 
token under the cursor.
Also just to look what else might be interesting.

Had a few problems with descent and PATH. Maybe it was something else but 
could it maybe be that you need to logout for eclipse to see changes in the 
PATH?

Well things seem to be working now but I miss poseidons syntax colourscheme.
Is it possible to have different colours per keyword(group)?




Re: Descent 0.5.4 released

2009-03-10 Thread Trass3r

The compile-time view doesn't seem to use UTF, does it?

const LOC_MAIN_MENU_FILE_OPEN = "&Öffnen"; // (input file encoding is UTF-8)

becomes

const char[8] LOC_MAIN_MENU_FILE_OPEN = "&֖ffnen";

in the view.


Re: Descent 0.5.4 released

2009-02-09 Thread Ary Borenszweig

Ary Borenszweig escribió:
The Descent plugin for Eclipse provides an IDE for writing, launching 
and debugging code in D.


Explanations on how to get it from within Eclipse are here:

http://www.dsource.org/projects/descent


Hi,

I just uploaded a new version with some semantic fixes (0.5.4.20090209).


Re: Descent 0.5.4 released

2009-02-01 Thread BCS

Hello Ary,


BCS escribió:


For me an the other 0.25 shlups out there that are trying to run
descent without an internet connection, is there a zipfile download
for 0.5.4?


Here's a temporary one:

http://downloads.dsource.org/projects/descent/descent_0.5.4.20090131.z
ip

But... you'll need an internet connection to download it, right? I
don't understand your problem. :-(



thanks!




Re: Descent 0.5.4 released

2009-02-01 Thread BCS

Hello Frits,


Perhaps the computer he's running Eclipse on doesn't have an internet
connection?
This way he can download it onto (e.g.) an USB stick and install from
there.


you got it




Re: Descent 0.5.4 released

2009-02-01 Thread Frits van Bommel

Ary Borenszweig wrote:

BCS escribió:
For me an the other 0.25 shlups out there that are trying to run 
descent without an internet connection, is there a zipfile download 
for 0.5.4?


Here's a temporary one:

http://downloads.dsource.org/projects/descent/descent_0.5.4.20090131.zip

But... you'll need an internet connection to download it, right? I don't 
understand your problem. :-(


Perhaps the computer he's running Eclipse on doesn't have an internet 
connection?

This way he can download it onto (e.g.) an USB stick and install from there.


Re: Descent 0.5.4 released

2009-02-01 Thread Ary Borenszweig

BCS escribió:
For me an the other 0.25 shlups out there that are trying to run descent 
without an internet connection, is there a zipfile download for 0.5.4?


Here's a temporary one:

http://downloads.dsource.org/projects/descent/descent_0.5.4.20090131.zip

But... you'll need an internet connection to download it, right? I don't 
understand your problem. :-(


Re: Descent 0.5.4 released

2009-01-31 Thread BCS
For me an the other 0.25 shlups out there that are trying to run descent 
without an internet connection, is there a zipfile download for 0.5.4?





Re: Descent 0.5.4 released

2009-01-30 Thread Jacob Carlborg

Ary Borenszweig wrote:

Jacob Carlborg escribió:
I just updated descent and got this error: 
java.lang.UnsupportedClassVersionError: Bad version number in .class file


Can you try updating now?


It works now, and Ctrl+click for go to definition also works :) thanks.
You're doing a great job.


Re: Descent 0.5.4 released

2009-01-30 Thread Ary Borenszweig

Robert Fraser escribió:

Jason House wrote:
I have no great example handy, but I tried doing the equivalent of 
this example (dmd 2.022):


import std.algorithm;
void main(){
  auto x = sort!("aSadly, nothing happens with the ctrl+shift+hover trick.  The compile 
time view reports it as missing.  I checked the user libraries to make 
sure it was ok.  I have two: druntime and phobos.  The phobos path 
displays as usr/local/src/phobos (I navigated to /usr/local/src/phobos 
through the gui to select it).  I see the std subdirectory and 
algorithm.d inside of it.  I don't know what is going wrong with 
finding the import.


sort is really a wrapper around sortImpl, which has two bodies inside 
a static if.  It's trivial to figure out which one is used, but it'd 
be nice to have a way to see what was really done without all the 
static if's.


I think D2 support is weak in Descent; so that's likely the problem.


Yes, that's it. The port of DMD2 is not finished and that's why it might 
not work (like: it's a miracle if it works :-P)


Re: Descent 0.5.4 released

2009-01-29 Thread Robert Fraser

Jason House wrote:

I have no great example handy, but I tried doing the equivalent of this example 
(dmd 2.022):

import std.algorithm;
void main(){
  auto x = sort!("a

I think D2 support is weak in Descent; so that's likely the problem.


Re: Descent 0.5.4 released

2009-01-29 Thread Jason House
Ary Borenszweig wrote:

>>> Is that what you mean?
>> 
>> 
>> No :(
>> Templates are designed to do compile-time magic based on their input
>> arguments. Currently, I can't see that magic in the compile-time view.
>> The templates I looked at were still template foo(T) instead of somehow
>> showing the bodies for foo!(int) and foo!(char)
> 
> I can't expand every template instantiation because then it will be a
> mess, and the code formatter also won't work.
> 
> You can try pressing ctrl+shift and hovering the template instance. It
> should show you it's content (removing false static ifs and stuff).
> 
> Is this what you mean? Can you provide an example?

I have no great example handy, but I tried doing the equivalent of this example 
(dmd 2.022):

import std.algorithm;
void main(){
  auto x = sort!("a

Re: Descent 0.5.4 released

2009-01-29 Thread Ary Borenszweig

Jacob Carlborg escribió:
I just updated descent and got this error: 
java.lang.UnsupportedClassVersionError: Bad version number in .class file


Can you try updating now?


Re: Descent 0.5.4 released

2009-01-29 Thread Jacob Carlborg
I just updated descent and got this error: 
java.lang.UnsupportedClassVersionError: Bad version number in .class file


Re: Descent 0.5.4 released

2009-01-29 Thread Ary Borenszweig

Jason House escribió:

Ary Borenszweig Wrote:


Jason House escribió:
 

2. Actual template instances are not shown.

What do you mean?

I just tried:

---
class Foo(T) {

}

void lala() {
Foo!(int) foo;
}
---

and it was shown like:

---
class Foo(T) {

}

void lala() {
Foo foo;
}
---

(should be Foo!(int))

Is that what you mean?



No :(
Templates are designed to do compile-time magic based on their input arguments. 
Currently, I can't see that magic in the compile-time view. The templates I 
looked at were still template foo(T) instead of somehow showing the bodies for 
foo!(int) and foo!(char)


I can't expand every template instantiation because then it will be a 
mess, and the code formatter also won't work.


You can try pressing ctrl+shift and hovering the template instance. It 
should show you it's content (removing false static ifs and stuff).


Is this what you mean? Can you provide an example?


Re: Descent 0.5.4 released

2009-01-29 Thread Jason House
Ary Borenszweig Wrote:

> Jason House escribió:
> > Ary Borenszweig wrote:
> > 
> >> New features:
> >>   - Compile-time view
> > 
> > This is a great feature that I've been looking forward to.
> > When playing around with this, I noticed a few things that seemed odd to 
> > me.  They may be normal/expected if I understood the better how the front 
> > end/descent works.
> > 1. derr.writefln("foo") is translated as 1("foo")
> 
> Hehehe, Jarret is right here!
> 
> I've fixed this so that in this case I'll use the original source code 
> in the output view.

Jarrett's reply makes me realize the issue. I have version(unittest) import 
std.cstream;
I thought I told descent to use unittest in its list of versions. I'll double 
check my setup.

 
> > 2. Actual template instances are not shown.
> 
> What do you mean?
> 
> I just tried:
> 
> ---
> class Foo(T) {
>   
> }
> 
> void lala() {
>   Foo!(int) foo;
> }
> ---
> 
> and it was shown like:
> 
> ---
> class Foo(T) {
>   
> }
> 
> void lala() {
>   Foo foo;
> }
> ---
> 
> (should be Foo!(int))
> 
> Is that what you mean?


No :(
Templates are designed to do compile-time magic based on their input arguments. 
Currently, I can't see that magic in the compile-time view. The templates I 
looked at were still template foo(T) instead of somehow showing the bodies for 
foo!(int) and foo!(char)
 
> > 3. I have a template (called factory) that takes a string argument.  The 
> > compile time view translates
> >alias factory!("libego") gameDef;
> > into
> >alias void gameDef;
> 
> Bug. :-)
> 
> I've fixed these in a new version, 0.5.4.20090129.
> 
> Thanks for the feedback!

Thanks for Descent and the rapid fixed!

Unrelated to the new features, I have a few other observations
1. The auto-complete of parenthesis makes me lazy and I end up leaving off 
semicolons. Is there any feature to add those too?
2. Auto-complete of curly braces works differently than parenthesis. I usually 
type the matching symbol anyway. For parenthesis, everything just works, but I 
keep ending up with too many closing curly braces.

I'm very new to descent, so I still have time to correct my own behavior when 
editing code.



Re: Descent 0.5.4 released

2009-01-29 Thread Don

Ary Borenszweig wrote:
The Descent plugin for Eclipse provides an IDE for writing, launching 
and debugging code in D.


Explanations on how to get it from within Eclipse are here:

http://www.dsource.org/projects/descent

New features:
 - Compile-time view (Window -> Show View -> Other -> D -> Compile-time 
View): allows you to see things from the compiler point of view, which 
applies some transformations to the source code. 


It also removes conditionals that evaluate to false, and shows the results 
of mixins in-place. 


You've sold me. Finally, a reason to use an IDE!
Totally awesome.


Re: Descent 0.5.4 released

2009-01-29 Thread Extrawurst

Ary Borenszweig wrote:

Extrawurst wrote:

Extrawurst wrote:

Ary Borenszweig wrote:
The Descent plugin for Eclipse provides an IDE for writing, 
launching and debugging code in D.


Explanations on how to get it from within Eclipse are here:

http://www.dsource.org/projects/descent

New features:
 - Compile-time view (Window -> Show View -> Other -> D -> 
Compile-time View): allows you to see things from the compiler point 
of view, which applies some transformations to the source code. For 
example you can see what happens when you do a foreach, when you 
invoke an "extension method", when you do operator overloading; know 
what type has an auto variable; how struct fields are accessed?; 
compiler optimizations. It also removes conditionals that evaluate 
to false, and shows the results of mixins in-place. As always, this 
is far from perfect and a lot of things can be improved. For the 
lazies, I'll later upload a video about this. :-)
 - Now hovering over a mixin (over the "mixin" keyword) shows it's 
result in a popup.
 - Now hovering over a function or template instance with ctrl+shift 
shows it's compile-time result (with shift only: it's source code).
 - Added code templates for operator overloading, so that you don't 
have to remember all those names. Try them by typing "op" and 
pressing ctrl+space.
 - Fixed ticket #160: new completion proposals: "classinfo" and 
"outer" (when available) are shown for classes. "ptr" and "funcptr" 
are shown for delegates.


Please note that most of these features are experimental. (the 
compile-time view is mostly useful to experiment with small cases to 
see what the compiler is doing, like for example if you write "auto 
x = [1, 2, 3];", to see what type the compiler gives to x)


I also fixed the problem with the last version: I accidentally 
introduced a dependency with JDT and that was causing the problems 
most of you had, so in this version this dependency was removed and 
updating should work as usual.


Any suggestion, critic or bug report is welcome. You can use:
- the forums: http://www.dsource.org/forums/viewforum.php?f=107
- trac: http://www.dsource.org/projects/descent/report?action=new
- irc: at freenode, #d.descent

Enjoy!


Since the version 0.5.4.20090129 is available through the update 
manager  updating fails with:


An error occurred while collecting items to be installed
  Problems downloading artifact: osgi.bundle,descent.ui,0.5.4.20090127.
Exception connecting to 
http://downloads.dsource.org/projects/descent/update-site/plugins/descent.ui_0.5.4.20090127.jar. 



http://downloads.dsource.org/projects/descent/update-site/plugins/descent.ui_0.5.4.20090127.jar 

Exception connecting to 
http://downloads.dsource.org/projects/descent/update-site/plugins/descent.ui_0.5.4.20090127.jar. 



http://downloads.dsource.org/projects/descent/update-site/plugins/descent.ui_0.5.4.20090127.jar 



i think the feature.xml inside the updated plugin package needs to be 
updated to the new jar files.


Yes, I don't know what happened.

Can you try to update now? I think I fixed it.


works now, thanks.


Re: Descent 0.5.4 released

2009-01-29 Thread Ary Borenszweig

Extrawurst wrote:

Extrawurst wrote:

Ary Borenszweig wrote:
The Descent plugin for Eclipse provides an IDE for writing, launching 
and debugging code in D.


Explanations on how to get it from within Eclipse are here:

http://www.dsource.org/projects/descent

New features:
 - Compile-time view (Window -> Show View -> Other -> D -> 
Compile-time View): allows you to see things from the compiler point 
of view, which applies some transformations to the source code. For 
example you can see what happens when you do a foreach, when you 
invoke an "extension method", when you do operator overloading; know 
what type has an auto variable; how struct fields are accessed?; 
compiler optimizations. It also removes conditionals that evaluate to 
false, and shows the results of mixins in-place. As always, this is 
far from perfect and a lot of things can be improved. For the lazies, 
I'll later upload a video about this. :-)
 - Now hovering over a mixin (over the "mixin" keyword) shows it's 
result in a popup.
 - Now hovering over a function or template instance with ctrl+shift 
shows it's compile-time result (with shift only: it's source code).
 - Added code templates for operator overloading, so that you don't 
have to remember all those names. Try them by typing "op" and 
pressing ctrl+space.
 - Fixed ticket #160: new completion proposals: "classinfo" and 
"outer" (when available) are shown for classes. "ptr" and "funcptr" 
are shown for delegates.


Please note that most of these features are experimental. (the 
compile-time view is mostly useful to experiment with small cases to 
see what the compiler is doing, like for example if you write "auto x 
= [1, 2, 3];", to see what type the compiler gives to x)


I also fixed the problem with the last version: I accidentally 
introduced a dependency with JDT and that was causing the problems 
most of you had, so in this version this dependency was removed and 
updating should work as usual.


Any suggestion, critic or bug report is welcome. You can use:
- the forums: http://www.dsource.org/forums/viewforum.php?f=107
- trac: http://www.dsource.org/projects/descent/report?action=new
- irc: at freenode, #d.descent

Enjoy!


Since the version 0.5.4.20090129 is available through the update 
manager  updating fails with:


An error occurred while collecting items to be installed
  Problems downloading artifact: osgi.bundle,descent.ui,0.5.4.20090127.
Exception connecting to 
http://downloads.dsource.org/projects/descent/update-site/plugins/descent.ui_0.5.4.20090127.jar. 



http://downloads.dsource.org/projects/descent/update-site/plugins/descent.ui_0.5.4.20090127.jar 

Exception connecting to 
http://downloads.dsource.org/projects/descent/update-site/plugins/descent.ui_0.5.4.20090127.jar. 



http://downloads.dsource.org/projects/descent/update-site/plugins/descent.ui_0.5.4.20090127.jar 



i think the feature.xml inside the updated plugin package needs to be 
updated to the new jar files.


Yes, I don't know what happened.

Can you try to update now? I think I fixed it.


Re: Descent 0.5.4 released

2009-01-29 Thread Extrawurst

Extrawurst wrote:

Ary Borenszweig wrote:
The Descent plugin for Eclipse provides an IDE for writing, launching 
and debugging code in D.


Explanations on how to get it from within Eclipse are here:

http://www.dsource.org/projects/descent

New features:
 - Compile-time view (Window -> Show View -> Other -> D -> 
Compile-time View): allows you to see things from the compiler point 
of view, which applies some transformations to the source code. For 
example you can see what happens when you do a foreach, when you 
invoke an "extension method", when you do operator overloading; know 
what type has an auto variable; how struct fields are accessed?; 
compiler optimizations. It also removes conditionals that evaluate to 
false, and shows the results of mixins in-place. As always, this is 
far from perfect and a lot of things can be improved. For the lazies, 
I'll later upload a video about this. :-)
 - Now hovering over a mixin (over the "mixin" keyword) shows it's 
result in a popup.
 - Now hovering over a function or template instance with ctrl+shift 
shows it's compile-time result (with shift only: it's source code).
 - Added code templates for operator overloading, so that you don't 
have to remember all those names. Try them by typing "op" and pressing 
ctrl+space.
 - Fixed ticket #160: new completion proposals: "classinfo" and 
"outer" (when available) are shown for classes. "ptr" and "funcptr" 
are shown for delegates.


Please note that most of these features are experimental. (the 
compile-time view is mostly useful to experiment with small cases to 
see what the compiler is doing, like for example if you write "auto x 
= [1, 2, 3];", to see what type the compiler gives to x)


I also fixed the problem with the last version: I accidentally 
introduced a dependency with JDT and that was causing the problems 
most of you had, so in this version this dependency was removed and 
updating should work as usual.


Any suggestion, critic or bug report is welcome. You can use:
- the forums: http://www.dsource.org/forums/viewforum.php?f=107
- trac: http://www.dsource.org/projects/descent/report?action=new
- irc: at freenode, #d.descent

Enjoy!


Since the version 0.5.4.20090129 is available through the update manager 
 updating fails with:


An error occurred while collecting items to be installed
  Problems downloading artifact: osgi.bundle,descent.ui,0.5.4.20090127.
Exception connecting to 
http://downloads.dsource.org/projects/descent/update-site/plugins/descent.ui_0.5.4.20090127.jar. 



http://downloads.dsource.org/projects/descent/update-site/plugins/descent.ui_0.5.4.20090127.jar 

Exception connecting to 
http://downloads.dsource.org/projects/descent/update-site/plugins/descent.ui_0.5.4.20090127.jar. 



http://downloads.dsource.org/projects/descent/update-site/plugins/descent.ui_0.5.4.20090127.jar 



i think the feature.xml inside the updated plugin package needs to be 
updated to the new jar files.


Re: Descent 0.5.4 released

2009-01-29 Thread Extrawurst

Ary Borenszweig wrote:
The Descent plugin for Eclipse provides an IDE for writing, launching 
and debugging code in D.


Explanations on how to get it from within Eclipse are here:

http://www.dsource.org/projects/descent

New features:
 - Compile-time view (Window -> Show View -> Other -> D -> Compile-time 
View): allows you to see things from the compiler point of view, which 
applies some transformations to the source code. For example you can see 
what happens when you do a foreach, when you invoke an "extension 
method", when you do operator overloading; know what type has an auto 
variable; how struct fields are accessed?; compiler optimizations. It 
also removes conditionals that evaluate to false, and shows the results 
of mixins in-place. As always, this is far from perfect and a lot of 
things can be improved. For the lazies, I'll later upload a video about 
this. :-)
 - Now hovering over a mixin (over the "mixin" keyword) shows it's 
result in a popup.
 - Now hovering over a function or template instance with ctrl+shift 
shows it's compile-time result (with shift only: it's source code).
 - Added code templates for operator overloading, so that you don't have 
to remember all those names. Try them by typing "op" and pressing 
ctrl+space.
 - Fixed ticket #160: new completion proposals: "classinfo" and "outer" 
(when available) are shown for classes. "ptr" and "funcptr" are shown 
for delegates.


Please note that most of these features are experimental. (the 
compile-time view is mostly useful to experiment with small cases to see 
what the compiler is doing, like for example if you write "auto x = [1, 
2, 3];", to see what type the compiler gives to x)


I also fixed the problem with the last version: I accidentally 
introduced a dependency with JDT and that was causing the problems most 
of you had, so in this version this dependency was removed and updating 
should work as usual.


Any suggestion, critic or bug report is welcome. You can use:
- the forums: http://www.dsource.org/forums/viewforum.php?f=107
- trac: http://www.dsource.org/projects/descent/report?action=new
- irc: at freenode, #d.descent

Enjoy!


Since the version 0.5.4.20090129 is available through the update manager 
 updating fails with:


An error occurred while collecting items to be installed
  Problems downloading artifact: osgi.bundle,descent.ui,0.5.4.20090127.
Exception connecting to 
http://downloads.dsource.org/projects/descent/update-site/plugins/descent.ui_0.5.4.20090127.jar.


http://downloads.dsource.org/projects/descent/update-site/plugins/descent.ui_0.5.4.20090127.jar
Exception connecting to 
http://downloads.dsource.org/projects/descent/update-site/plugins/descent.ui_0.5.4.20090127.jar.


http://downloads.dsource.org/projects/descent/update-site/plugins/descent.ui_0.5.4.20090127.jar


Re: Descent 0.5.4 released

2009-01-28 Thread Ary Borenszweig

Jason House escribió:

Ary Borenszweig wrote:


New features:
  - Compile-time view


This is a great feature that I've been looking forward to.
When playing around with this, I noticed a few things that seemed odd to me.  
They may be normal/expected if I understood the better how the front 
end/descent works.
1. derr.writefln("foo") is translated as 1("foo")


Hehehe, Jarret is right here!

I've fixed this so that in this case I'll use the original source code 
in the output view.



2. Actual template instances are not shown.


What do you mean?

I just tried:

---
class Foo(T) {

}

void lala() {
Foo!(int) foo;
}
---

and it was shown like:

---
class Foo(T) {

}

void lala() {
Foo foo;
}
---

(should be Foo!(int))

Is that what you mean?


3. I have a template (called factory) that takes a string argument.  The 
compile time view translates
   alias factory!("libego") gameDef;
into
   alias void gameDef;


Bug. :-)

I've fixed these in a new version, 0.5.4.20090129.

Thanks for the feedback!


Re: Descent 0.5.4 released

2009-01-28 Thread Jarrett Billingsley
On Wed, Jan 28, 2009 at 11:37 PM, Jason House
 wrote:
> 1. derr.writefln("foo") is translated as 1("foo")

Haw haw, that's because the DMDFE replaces symbols it doesn't know
with 1.  That's why the compiler spits out tons of bizarre "expected
function before parens, not '1' of type 'int'" after undefined symbol
errors.  Either you're not importing std.cstream, or Descent isn't
looking it up right.


Re: Descent 0.5.4 released

2009-01-28 Thread Jason House
Ary Borenszweig wrote:

> New features:
>   - Compile-time view

This is a great feature that I've been looking forward to.
When playing around with this, I noticed a few things that seemed odd to me.  
They may be normal/expected if I understood the better how the front 
end/descent works.
1. derr.writefln("foo") is translated as 1("foo")
2. Actual template instances are not shown.
3. I have a template (called factory) that takes a string argument.  The 
compile time view translates
   alias factory!("libego") gameDef;
into
   alias void gameDef;


Re: Descent 0.5.4 released

2009-01-28 Thread John Reimer

Thanks for the updates and fixes, Ary.


This is seriously good stuff!


I'll use dwt source to stress-test it again. :) 



-JJR




Re: Descent 0.5.4 released

2009-01-28 Thread Daniel Keep


Ary Borenszweig wrote:
> [snip]
> 
> Done!
> 
> Just update to the newer version (0.5.4.20090128).
> 
> (Yeah, it bothered me too. Now it always maintains the scroll, unless
> you switch to editing another module)

Magically delicious updates while-you-sleep!

  -- Daniel


Re: Descent 0.5.4 released

2009-01-28 Thread Ary Borenszweig

Daniel Keep wrote:


Ary Borenszweig wrote:

[snip]

Wow! Thanks for the joyful answer, Daniel. :-)

The attachment you sent doesn't compile, it gives a syntax error in the
mixed content for the IsExpression (only a type is allowed, not
"this."). Anyway, I'll change the
"!descent.core.dom.compilationu...@17c858d" message to something like
"Module foo has syntax or semantic errors due to mixins".


Cool.  Can I make one other inquiry?  Is it possible to get the CT
window to not scroll back to the top every time the source file changes?
 I've just been using it to debug a mixin (oh God I love this SO MUCH)
and I had to keep scrolling down every time I changed something.

Even if I had to manually pin the window, or specify which part of the
code to view the CT for, it'd really improve the feature.


Done!

Just update to the newer version (0.5.4.20090128).

(Yeah, it bothered me too. Now it always maintains the scroll, unless 
you switch to editing another module)




  -- Daniel


Re: Descent 0.5.4 released

2009-01-28 Thread Olli Aalto

Daniel Keep wrote:


I've never been big on IDEs; I never felt that they had enough
advantages over a plain text editor to make up for the slowness and
restrictions.



I code in java for a living, and wouldn't change eclipse as my editor 
for anything. But that's just me. :)



But this is just so freaking awesome, I'm seriously considering moving
over to Descent for my D development.  It's just a pity I can't have my
Vim editing commands, too :P



I haven't used this, but it might be something you'd like.
http://vimplugin.org/

O.


Re: Descent 0.5.4 released

2009-01-28 Thread Daniel Keep


Ary Borenszweig wrote:
> [snip]
> 
> Wow! Thanks for the joyful answer, Daniel. :-)
> 
> The attachment you sent doesn't compile, it gives a syntax error in the
> mixed content for the IsExpression (only a type is allowed, not
> "this."). Anyway, I'll change the
> "!descent.core.dom.compilationu...@17c858d" message to something like
> "Module foo has syntax or semantic errors due to mixins".

Cool.  Can I make one other inquiry?  Is it possible to get the CT
window to not scroll back to the top every time the source file changes?
 I've just been using it to debug a mixin (oh God I love this SO MUCH)
and I had to keep scrolling down every time I changed something.

Even if I had to manually pin the window, or specify which part of the
code to view the CT for, it'd really improve the feature.

  -- Daniel


Re: Descent 0.5.4 released

2009-01-28 Thread Don

Ary Borenszweig wrote:

Brad Roberts escribió:

Brad Roberts wrote:

Ary Borenszweig wrote:

Bill Baxter escribió:

Another question -- I was wondering what it does for CTFE functions.
I'm guessing it evaluates them and spits out the result.  If so that
could be very very helpful.  Especially for code-building CTFE mixins.
 I don't think you had an example like that in the vid.

It does! See the first part of the video, when I do:

int x = 1 + 2 + 3 + 4 + someFunc(5);

and it shows:

int x = 25;

It just evaluated someFunc. :-)

Given that int x isn't a const expression, is someFunc(5) supposed to be
evaluated at compile time like that?

Later,
Brad


Hrm.. unless it's just bog standard inlining and const folding going on,
which is quite possible.


Great observation! I remember functions like that not being evaluated 
unless the variable was declared const. I just debugged that and checked 
with DMD's source code, and it seems the expression in the initializer 
is evaluated if the variable declaration is not inside a function (check 
VarDeclaration::semantic2 and ExpInitializer::semantic, which invoked 
optimize at the end).


I wonder why is that behaviour defined like that...


Because then it's a static global. And static initializers get run at 
compile time.


Re: Descent 0.5.4 released

2009-01-28 Thread Qian Xu
Ary Borenszweig wrote:

> The Descent plugin for Eclipse provides an IDE for writing, launching
> and debugging code in D.

This build is not compatible with Eclipse3.3 und SuseEnt10(SP2) as well.
When I press CTRL+Space, I will see an error message:


The 'descent.ui.JavaNoTypeCompletionProposalComputer' proposal computer from
the 'descent.ui' plug-in did not complete normally. The extension has
thrown a runtime exception.

To avoid this message, disable the 'descent.ui' plug-in or disable the
'Other D Proposals' category on the content assist preference page.


There is no problem with Windows, but with SuseEnt10.
Is it possible to make it work again??

For more information, please another thread of mine in this group.

--Qian


Re: Descent 0.5.4 released

2009-01-28 Thread Ary Borenszweig

Ary Borenszweig escribió:
The Descent plugin for Eclipse provides an IDE for writing, launching 
and debugging code in D.


Explanations on how to get it from within Eclipse are here:

http://www.dsource.org/projects/descent

New features:
 - Compile-time view (Window -> Show View -> Other -> D -> Compile-time 
View): allows you to see things from the compiler point of view, which 
applies some transformations to the source code. For example you can see 
what happens when you do a foreach, when you invoke an "extension 
method", when you do operator overloading; know what type has an auto 
variable; how struct fields are accessed?; compiler optimizations. It 
also removes conditionals that evaluate to false, and shows the results 
of mixins in-place. As always, this is far from perfect and a lot of 
things can be improved. For the lazies, I'll later upload a video about 
this. :-)
 - Now hovering over a mixin (over the "mixin" keyword) shows it's 
result in a popup.
 - Now hovering over a function or template instance with ctrl+shift 
shows it's compile-time result (with shift only: it's source code).


Just a small remark: the probability that these things stop working is 
bigger if the code is spread in many modules. That's because I did some 
optimizations and lazy loading of some symbols, and sometimes it doesn't 
work (I'll fix that, eveeentualy). So this should work better in a 
single module. That's why this should be a good aid for prototyping new 
functionality that heavily uses mixins, templates and compile-time 
evaluation. :-)


Re: Descent 0.5.4 released

2009-01-28 Thread Ary Borenszweig

Brad Roberts escribió:

Brad Roberts wrote:

Ary Borenszweig wrote:

Bill Baxter escribió:

Another question -- I was wondering what it does for CTFE functions.
I'm guessing it evaluates them and spits out the result.  If so that
could be very very helpful.  Especially for code-building CTFE mixins.
 I don't think you had an example like that in the vid.

It does! See the first part of the video, when I do:

int x = 1 + 2 + 3 + 4 + someFunc(5);

and it shows:

int x = 25;

It just evaluated someFunc. :-)

Given that int x isn't a const expression, is someFunc(5) supposed to be
evaluated at compile time like that?

Later,
Brad


Hrm.. unless it's just bog standard inlining and const folding going on,
which is quite possible.


Great observation! I remember functions like that not being evaluated 
unless the variable was declared const. I just debugged that and checked 
with DMD's source code, and it seems the expression in the initializer 
is evaluated if the variable declaration is not inside a function (check 
VarDeclaration::semantic2 and ExpInitializer::semantic, which invoked 
optimize at the end).


I wonder why is that behaviour defined like that...



Nevermind,
Brad


Re: Descent 0.5.4 released

2009-01-27 Thread Vladimir Panteleev
On Tue, 27 Jan 2009 21:19:36 +0200, Ary Borenszweig   
wrote:


Where can I find a version of obj2asm for Windows to see what's going on  
in those cases?


Try the free version of IDA (Interactive DisAssembler) instead:
http://www.hex-rays.com/idapro/idadownfreeware.htm

--
Best regards,
 Vladimir  mailto:thecybersha...@gmail.com


Re: Descent 0.5.4 released

2009-01-27 Thread Brad Roberts
Brad Roberts wrote:
> Ary Borenszweig wrote:
>> Bill Baxter escribió:
>>> Another question -- I was wondering what it does for CTFE functions.
>>> I'm guessing it evaluates them and spits out the result.  If so that
>>> could be very very helpful.  Especially for code-building CTFE mixins.
>>>  I don't think you had an example like that in the vid.
>> It does! See the first part of the video, when I do:
>>
>> int x = 1 + 2 + 3 + 4 + someFunc(5);
>>
>> and it shows:
>>
>> int x = 25;
>>
>> It just evaluated someFunc. :-)
> 
> Given that int x isn't a const expression, is someFunc(5) supposed to be
> evaluated at compile time like that?
> 
> Later,
> Brad

Hrm.. unless it's just bog standard inlining and const folding going on,
which is quite possible.

Nevermind,
Brad


Re: Descent 0.5.4 released

2009-01-27 Thread Brad Roberts
Ary Borenszweig wrote:
> Bill Baxter escribió:
>> Another question -- I was wondering what it does for CTFE functions.
>> I'm guessing it evaluates them and spits out the result.  If so that
>> could be very very helpful.  Especially for code-building CTFE mixins.
>>  I don't think you had an example like that in the vid.
> 
> It does! See the first part of the video, when I do:
> 
> int x = 1 + 2 + 3 + 4 + someFunc(5);
> 
> and it shows:
> 
> int x = 25;
> 
> It just evaluated someFunc. :-)

Given that int x isn't a const expression, is someFunc(5) supposed to be
evaluated at compile time like that?

Later,
Brad


Re: Descent 0.5.4 released

2009-01-27 Thread Bill Baxter
On Wed, Jan 28, 2009 at 10:33 AM, Ary Borenszweig  wrote:
> Bill Baxter escribió:
>>
>> On Wed, Jan 28, 2009 at 12:46 AM, Ary Borenszweig 
>> wrote:
>>>
>>> Ary Borenszweig wrote:
>>>
>>> Here's the video!
>>>
>>> http://www.youtube.com/watch?v=oAhrFQVnsrY
>>>
>>> :-)
>>>
>>
>> By the way, in the vid you use a plain int param in your opApply
>> delegate, instead of "ref int".  I think this will not work.  At least
>> I seem to remember finding that opApply doesn't work unless I make all
>> the delegate's arguments ref.
>>
>> I think some of that came from an auto-complete code template, so if
>> the code template doesn't include the 'ref' it should, as a hint to
>> the programmer.
>
> I'll correct that, then.
>
>>
>> Another question -- I was wondering what it does for CTFE functions.
>> I'm guessing it evaluates them and spits out the result.  If so that
>> could be very very helpful.  Especially for code-building CTFE mixins.
>>  I don't think you had an example like that in the vid.
>
> It does! See the first part of the video, when I do:
>
> int x = 1 + 2 + 3 + 4 + someFunc(5);
>
> and it shows:
>
> int x = 25;
>
> It just evaluated someFunc. :-)

Rockin!


>> This compile time view could be a great debugging and learning aid for
>> D.  I think it's quite exciting.  I wonder if someone can get it
>> working on something like http://paste.dprogramming.com/
>
> You mean, web? The java code can be used in the backend for that with little
> modification, I think that's quite possible.

Yeh, web.  There's already a site where you can paste in D code and
the server will compile and run the code for you.  A compile-time view
button on that page would be great.  Not that you should be the one to
do it or anything.  Just thinking it would be nifty, that's all.

--bb


Re: Descent 0.5.4 released

2009-01-27 Thread Ary Borenszweig

Bill Baxter escribió:

On Wed, Jan 28, 2009 at 12:46 AM, Ary Borenszweig  wrote:

Ary Borenszweig wrote:

Here's the video!

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

:-)



By the way, in the vid you use a plain int param in your opApply
delegate, instead of "ref int".  I think this will not work.  At least
I seem to remember finding that opApply doesn't work unless I make all
the delegate's arguments ref.

I think some of that came from an auto-complete code template, so if
the code template doesn't include the 'ref' it should, as a hint to
the programmer.


I'll correct that, then.



Another question -- I was wondering what it does for CTFE functions.
I'm guessing it evaluates them and spits out the result.  If so that
could be very very helpful.  Especially for code-building CTFE mixins.
 I don't think you had an example like that in the vid.


It does! See the first part of the video, when I do:

int x = 1 + 2 + 3 + 4 + someFunc(5);

and it shows:

int x = 25;

It just evaluated someFunc. :-)



This compile time view could be a great debugging and learning aid for
D.  I think it's quite exciting.  I wonder if someone can get it
working on something like http://paste.dprogramming.com/


You mean, web? The java code can be used in the backend for that with 
little modification, I think that's quite possible.




--bb


Re: Descent 0.5.4 released

2009-01-27 Thread Robert Fraser

Ary Borenszweig wrote:


---
int foo(int x) {
  return x * 2 * 2;
}

int bar(int x) {
  return 2 * 2 * x;
}
---

is transformed to this:

---
int foo(int x) {
  return x * 2 * 2;
}

int bar(int x) {
  return 4 * x;
}
---


Those should be shifts.


Re: Descent 0.5.4 released

2009-01-27 Thread Bill Baxter
On Wed, Jan 28, 2009 at 12:46 AM, Ary Borenszweig  wrote:
> Ary Borenszweig wrote:
>
> Here's the video!
>
> http://www.youtube.com/watch?v=oAhrFQVnsrY
>
> :-)
>

By the way, in the vid you use a plain int param in your opApply
delegate, instead of "ref int".  I think this will not work.  At least
I seem to remember finding that opApply doesn't work unless I make all
the delegate's arguments ref.

I think some of that came from an auto-complete code template, so if
the code template doesn't include the 'ref' it should, as a hint to
the programmer.

Another question -- I was wondering what it does for CTFE functions.
I'm guessing it evaluates them and spits out the result.  If so that
could be very very helpful.  Especially for code-building CTFE mixins.
 I don't think you had an example like that in the vid.

This compile time view could be a great debugging and learning aid for
D.  I think it's quite exciting.  I wonder if someone can get it
working on something like http://paste.dprogramming.com/

--bb


Re: Descent 0.5.4 released

2009-01-27 Thread Trass3r
The code is compatible to both. Currently trying with D1. The function 
becomes this:


public static char[] mixinLuaRegisterFunction(char[] lua_state, char[] name,
char[] lua_library_dot_name)
{
	return ("mixin (mixinLuaRegisterFunctionAtLine (\"" ~ lua_state ~ "\", 
\"" ~ name ~ "\", \"" ~ lua_library_dot_name ~ "\", __LINE__));");

}

Furthermore the function is defined in another module and imported. 
mixin is used in the main module.


Re: Descent 0.5.4 released

2009-01-27 Thread Saaa

> Which ones are the -O ones?
Erm, the ones I invoke with -O :)
I thought they were seperate from the semantic pass van Bommel mentioned

> You can see which optimizations are applied in the front end in optimize.c
Thanks!

>
> For example this:
>
> ---
> int foo(int x) {
>   return x * 2 * 2;
> }
>
> int bar(int x) {
>   return 2 * 2 * x;
> }
> ---
>
> is transformed to this:
>
> ---
> int foo(int x) {
>   return x * 2 * 2;
> }
>
> int bar(int x) {
>   return 4 * x;
> }
> ---
>
> So it seems the optimize.c code just optimizes left subexpressions. I 
> wonder if -O does more that. Because if not, there's still a lof of room 
> for optimization in the compiler.
wow...

>
> Where can I find a version of obj2asm for Windows to see what's going on 
> in those cases?
I think it is in here:
http://www.digitalmars.com/eup.html
When is your birthday? :D





Re: Descent 0.5.4 released

2009-01-27 Thread Ary Borenszweig

Saaa wrote:

Which kind of optimizations are located in the front-end?
Not the -O ones, right?


Which ones are the -O ones? You can see which optimizations are applied 
in the front end in optimize.c


For example this:

---
int foo(int x) {
  return x * 2 * 2;
}

int bar(int x) {
  return 2 * 2 * x;
}
---

is transformed to this:

---
int foo(int x) {
  return x * 2 * 2;
}

int bar(int x) {
  return 4 * x;
}
---

So it seems the optimize.c code just optimizes left subexpressions. I 
wonder if -O does more that. Because if not, there's still a lof of room 
for optimization in the compiler.


Where can I find a version of obj2asm for Windows to see what's going on 
in those cases?





Saaa wrote:

How do you generate the compile-time view?
Since Descent has a Java port of the DMD frontend inside, it probably just 
runs the semantics passes on the AST and prints it back out... 





Re: Descent 0.5.4 released

2009-01-27 Thread Saaa
Which kind of optimizations are located in the front-end?
Not the -O ones, right?

> Saaa wrote:
>> How do you generate the compile-time view?
>
> Since Descent has a Java port of the DMD frontend inside, it probably just 
> runs the semantics passes on the AST and prints it back out... 




Re: Descent 0.5.4 released

2009-01-27 Thread Yigal Chripun

Daniel Keep wrote:
[snip]


I've never been big on IDEs; I never felt that they had enough
advantages over a plain text editor to make up for the slowness and
restrictions.

But this is just so freaking awesome, I'm seriously considering moving
over to Descent for my D development.  It's just a pity I can't have my
Vim editing commands, too :P

  -- Daniel


who said you can't? here's how you can have both:

eclipse (descnet is a plugin of it) has three default key mappings that 
can be used:

 - the default eclipse key bindings
 - emacs key-bindings
 - vim key bindings

besides that there's also a plugin that implements vim for eclipse, 
which I forgot it's name. you can google for it, I guess. the plugin 
integrates vim's text editing capabilities into an eclipse editor.

I didn't try the plugin with D code, but for C/C++ it works great.




Re: Descent 0.5.4 released

2009-01-27 Thread Ary Borenszweig

Jarrett Billingsley wrote:

On Tue, Jan 27, 2009 at 10:46 AM, Ary Borenszweig  wrote:

Here's the video!

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


I kind of just exploded a little watching that.  Some of my brain is coming out.


loool!!

And here's the winner phrase for my MSN status of the day. :-)


Re: Descent 0.5.4 released

2009-01-27 Thread BCS

Reply to Ary,


Ary Borenszweig wrote:


The Descent plugin for Eclipse provides an IDE for writing, launching
and debugging code in D.

Explanations on how to get it from within Eclipse are here:

http://www.dsource.org/projects/descent

New features:
- Compile-time view (Window -> Show View -> Other -> D ->
Compile-time
View): allows you to see things from the compiler point of view,
which


Here's the video!

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




Oh Goody! Oh Goody! Oh Goody! Oh Goody! 


I can't wait to try it with dparse:  
http://www.dsource.org/projects/scrapple/browser/trunk/dparser

OTOH last I checked I couldn't even edit it without that kind of stuff.




Re: Descent 0.5.4 released

2009-01-27 Thread Bill Baxter
On Wed, Jan 28, 2009 at 12:46 AM, Ary Borenszweig  wrote:
>
> Here's the video!
>
> http://www.youtube.com/watch?v=oAhrFQVnsrY
>
> :-)
>

The compile-time view looks quite useful!
I also really like the autocomplete code snippet for the opApply.  I
always dread having to write those.

--bb


Re: Descent 0.5.4 released

2009-01-27 Thread Frits van Bommel

Saaa wrote:
How do you generate the compile-time view? 


Since Descent has a Java port of the DMD frontend inside, it probably 
just runs the semantics passes on the AST and prints it back out...


Re: Descent 0.5.4 released

2009-01-27 Thread Saaa
Wow nice!

How do you generate the compile-time view? 




Re: Descent 0.5.4 released

2009-01-27 Thread Ary Borenszweig

Trass3r wrote:

Getting the results of a mixin doesn't seem to work if a function is used:

mixin (mixinLuaRegisterFunction ("L", "simpleFunction", "mylib.func"));

public static istring mixinLuaPushFunction (cstring lua_state, cstring 
name)

{
return cast(istring) (`mixin (mixinLuaPushFunctionAtLine ("` ~ 
lua_state ~ `", "` ~ name ~ `", __LINE__));`);

}


I tried this:

---
mixin(defineInt("bar"));

char[] defineInt(char[] name) {
return "int " ~ name ~ ";";
}
---

and it fails, but it also fails under DMD (1 and 2). If I change the order:

---
char[] defineInt(char[] name) {
return "int " ~ name ~ ";";
}

mixin(defineInt("bar"));
---

it works both in DMD and Descent.

Also, I see some istring and cstring. If you are using D2 it is more 
likely that it won't work, because D2 is still not fully ported to Descent.


Re: Descent 0.5.4 released

2009-01-27 Thread Trass3r

Getting the results of a mixin doesn't seem to work if a function is used:

mixin (mixinLuaRegisterFunction ("L", "simpleFunction", "mylib.func"));

public static istring mixinLuaPushFunction (cstring lua_state, cstring name)
{
return cast(istring) (`mixin (mixinLuaPushFunctionAtLine ("` ~ 
lua_state ~ `", "` ~ name ~ `", __LINE__));`);

}


Re: Descent 0.5.4 released

2009-01-27 Thread Ary Borenszweig

Daniel Keep wrote:


Ary Borenszweig wrote:

New features:
 - Compile-time view (Window -> Show View -> Other -> D -> Compile-time
View): allows you to see things from the compiler point of view, which
applies some transformations to the source code. For example you can see
what happens when you do a foreach, when you invoke an "extension
method", when you do operator overloading; know what type has an auto
variable; how struct fields are accessed?; compiler optimizations. It
also removes conditionals that evaluate to false, and shows the results
of mixins in-place. As always, this is far from perfect and a lot of
things can be improved. For the lazies, I'll later upload a video about
this. :-)


I've found one limitation of this, and it's a really weird one.  It
seems that some combination of a double-quoted string inside a
backtick-quoted string in a statement under a static if causes this to
fall over and break it's legs.  The CT window just shows stuff like this:


!descent.core.dom.compilationu...@17c858d


I've attached the smallest test case I was able to make; hope it helps,
because this is just about the BEST thing ever.  As someone who makes
heavy use of meta-programming, this is fantastic.

Incidentally, the backtick-quoted string seems to make the editor VERY
confused; try starting a `` literal, and pressing Enter inside.  Now
imagine trying to write a big code mixin like that...


 - Now hovering over a mixin (over the "mixin" keyword) shows it's
result in a popup.


*Glee*


 - Now hovering over a function or template instance with ctrl+shift
shows it's compile-time result (with shift only: it's source code).


Indeed, it does!  This is SO awesome; now I don't have to muck about
with pragma(msg,...) and compile-time formatting to check and make sure
I'm not feeding the compiler garbage.


[snip]

Enjoy!


I've never been big on IDEs; I never felt that they had enough
advantages over a plain text editor to make up for the slowness and
restrictions.

But this is just so freaking awesome, I'm seriously considering moving
over to Descent for my D development.  It's just a pity I can't have my
Vim editing commands, too :P

 -- Daniel



Wow! Thanks for the joyful answer, Daniel. :-)

The attachment you sent doesn't compile, it gives a syntax error in the 
mixed content for the IsExpression (only a type is allowed, not 
"this."). Anyway, I'll change the 
"!descent.core.dom.compilationu...@17c858d" message to something like 
"Module foo has syntax or semantic errors due to mixins".


Re: Descent 0.5.4 released

2009-01-27 Thread Jarrett Billingsley
On Tue, Jan 27, 2009 at 12:05 PM, Jarrett Billingsley
 wrote:
> On Tue, Jan 27, 2009 at 10:46 AM, Ary Borenszweig  
> wrote:
>> Here's the video!
>>
>> http://www.youtube.com/watch?v=oAhrFQVnsrY
>
> I kind of just exploded a little watching that.  Some of my brain is coming 
> out.
>

In a good way, of course.


Re: Descent 0.5.4 released

2009-01-27 Thread Jarrett Billingsley
On Tue, Jan 27, 2009 at 10:46 AM, Ary Borenszweig  wrote:
> Here's the video!
>
> http://www.youtube.com/watch?v=oAhrFQVnsrY

I kind of just exploded a little watching that.  Some of my brain is coming out.


Re: Descent 0.5.4 released

2009-01-27 Thread Lutger
How wonderful, thank you VERY much!

OT: I've found eclipse 3.4.x under 64-bit linux less than stable with 
descent, but the 3.5 stream release works pretty good so far. 



Re: Descent 0.5.4 released

2009-01-27 Thread Daniel Keep


Ary Borenszweig wrote:
> New features:
>  - Compile-time view (Window -> Show View -> Other -> D -> Compile-time
> View): allows you to see things from the compiler point of view, which
> applies some transformations to the source code. For example you can see
> what happens when you do a foreach, when you invoke an "extension
> method", when you do operator overloading; know what type has an auto
> variable; how struct fields are accessed?; compiler optimizations. It
> also removes conditionals that evaluate to false, and shows the results
> of mixins in-place. As always, this is far from perfect and a lot of
> things can be improved. For the lazies, I'll later upload a video about
> this. :-)

I've found one limitation of this, and it's a really weird one.  It
seems that some combination of a double-quoted string inside a
backtick-quoted string in a statement under a static if causes this to
fall over and break it's legs.  The CT window just shows stuff like this:

> !descent.core.dom.compilationu...@17c858d

I've attached the smallest test case I was able to make; hope it helps,
because this is just about the BEST thing ever.  As someone who makes
heavy use of meta-programming, this is fantastic.

Incidentally, the backtick-quoted string seems to make the editor VERY
confused; try starting a `` literal, and pressing Enter inside.  Now
imagine trying to write a big code mixin like that...

>  - Now hovering over a mixin (over the "mixin" keyword) shows it's
> result in a popup.

*Glee*

>  - Now hovering over a function or template instance with ctrl+shift
> shows it's compile-time result (with shift only: it's source code).

Indeed, it does!  This is SO awesome; now I don't have to muck about
with pragma(msg,...) and compile-time formatting to check and make sure
I'm not feeding the compiler garbage.

> [snip]
> 
> Enjoy!

I've never been big on IDEs; I never felt that they had enough
advantages over a plain text editor to make up for the slowness and
restrictions.

But this is just so freaking awesome, I'm seriously considering moving
over to Descent for my D development.  It's just a pity I can't have my
Vim editing commands, too :P

 -- Daniel
const TestMixin = `
public void dispose()
{
static if( is( this.opDispose() ) )
try
{
this.opDispose();
}
catch( Exception e )
{
// TODO: add some sort of callback for failed disposals.  For
// now, write to stderr.
Stderr.format("Disposal of {} failed with: {}", this, e);
}
}
`;

class TestClass
{
mixin(TestMixin);
}

void main()
{
return;
}


Re: Descent 0.5.4 released

2009-01-27 Thread Ary Borenszweig

Ary Borenszweig wrote:
The Descent plugin for Eclipse provides an IDE for writing, launching 
and debugging code in D.


Explanations on how to get it from within Eclipse are here:

http://www.dsource.org/projects/descent

New features:
 - Compile-time view (Window -> Show View -> Other -> D -> Compile-time 
View): allows you to see things from the compiler point of view, which 
applies some transformations to the source code. For example you can see 
what happens when you do a foreach, when you invoke an "extension 
method", when you do operator overloading; know what type has an auto 
variable; how struct fields are accessed?; compiler optimizations. It 
also removes conditionals that evaluate to false, and shows the results 
of mixins in-place. As always, this is far from perfect and a lot of 
things can be improved. For the lazies, I'll later upload a video about 
this. :-)


Here's the video!

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

:-)


Re: Descent 0.5.4 released

2009-01-27 Thread Aarti_pl

Ary Borenszweig pisze:
The Descent plugin for Eclipse provides an IDE for writing, launching 
and debugging code in D.


Explanations on how to get it from within Eclipse are here:

http://www.dsource.org/projects/descent



(...)


Enjoy!



You are doing really great job with Descent.

Thanks for your work!

BR
Marcin Kuszczak
(aarti_pl)


Descent 0.5.4 released

2009-01-27 Thread Ary Borenszweig
The Descent plugin for Eclipse provides an IDE for writing, launching 
and debugging code in D.


Explanations on how to get it from within Eclipse are here:

http://www.dsource.org/projects/descent

New features:
 - Compile-time view (Window -> Show View -> Other -> D -> Compile-time 
View): allows you to see things from the compiler point of view, which 
applies some transformations to the source code. For example you can see 
what happens when you do a foreach, when you invoke an "extension 
method", when you do operator overloading; know what type has an auto 
variable; how struct fields are accessed?; compiler optimizations. It 
also removes conditionals that evaluate to false, and shows the results 
of mixins in-place. As always, this is far from perfect and a lot of 
things can be improved. For the lazies, I'll later upload a video about 
this. :-)
 - Now hovering over a mixin (over the "mixin" keyword) shows it's 
result in a popup.
 - Now hovering over a function or template instance with ctrl+shift 
shows it's compile-time result (with shift only: it's source code).
 - Added code templates for operator overloading, so that you don't 
have to remember all those names. Try them by typing "op" and pressing 
ctrl+space.
 - Fixed ticket #160: new completion proposals: "classinfo" and "outer" 
(when available) are shown for classes. "ptr" and "funcptr" are shown 
for delegates.


Please note that most of these features are experimental. (the 
compile-time view is mostly useful to experiment with small cases to see 
what the compiler is doing, like for example if you write "auto x = [1, 
2, 3];", to see what type the compiler gives to x)


I also fixed the problem with the last version: I accidentally 
introduced a dependency with JDT and that was causing the problems most 
of you had, so in this version this dependency was removed and updating 
should work as usual.


Any suggestion, critic or bug report is welcome. You can use:
- the forums: http://www.dsource.org/forums/viewforum.php?f=107
- trac: http://www.dsource.org/projects/descent/report?action=new
- irc: at freenode, #d.descent

Enjoy!