www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Adding D Editor Support

reply John A. De Goes <john.withoutspam. n-brain.net> writes:
Hi,

We're adding support for the D language to UNA (http://www.n-brain.net). The
Personal Edition has been released free of charge (down from $100).

However, none of us have used D so we'd like a bit of help.

We've added support (in dev version) to matching messages of the form:

foo.d(5): Warning: silly variable name
foo.d(5): Error: spelling error in variable name "foobir"

Assuming this is correct, we'd like to proceed with adding commonly used source
code constructs, D idioms, and so forth. We call this 'source snippets'. Each
source snippet has a few letter textual key. Typing that key and invoking the
source snippet button inserts the snippet.

So I'm soliciting for everyone's favorite source snippet.
Jun 12 2008
next sibling parent reply Tower Ty <towerty msn.com.au> writes:
John A. De Goes Wrote:

 Hi,
 
 We're adding support for the D language to UNA (http://www.n-brain.net). The
Personal Edition has been released free of charge (down from $100).
 
 However, none of us have used D so we'd like a bit of help.
 
 We've added support (in dev version) to matching messages of the form:
 
 foo.d(5): Warning: silly variable name
 foo.d(5): Error: spelling error in variable name "foobir"
 
 Assuming this is correct, we'd like to proceed with adding commonly used
source code constructs, D idioms, and so forth. We call this 'source snippets'.
Each source snippet has a few letter textual key. Typing that key and invoking
the source snippet button inserts the snippet.
 
 So I'm soliciting for everyone's favorite source snippet.

Better adjust your link as what you want people to do is visit your web site I guess What benefits does your editor have that say KDevelop does not?
Jun 12 2008
next sibling parent BCS <ao pathlink.com> writes:
Reply to Tower,

 John A. De Goes Wrote:
 
 Hi,
 
 We're adding support for the D language to UNA
 (http://www.n-brain.net). The Personal Edition has been released free

Better adjust your link as what you want people to do is visit your web site I guess

link looks fine to me. (OTOH if there is a UNA only page it would be better)
Jun 12 2008
prev sibling parent John A. De Goes <john.withoutspam. n-brain.net> writes:
Hi Tower,

I'm not trying to persuade you to stop using KDevelop. By all means, continue
to use your favorite development tool. I'm just soliciting regular D
programmers on common constructs and idioms in the language, which are not easy
to pick up without months of experience developing in a language.

Regards,

John

Tower  Ty Wrote:

 John A. De Goes Wrote:
 
 Hi,
 
 We're adding support for the D language to UNA (http://www.n-brain.net). The
Personal Edition has been released free of charge (down from $100).
 
 However, none of us have used D so we'd like a bit of help.
 
 We've added support (in dev version) to matching messages of the form:
 
 foo.d(5): Warning: silly variable name
 foo.d(5): Error: spelling error in variable name "foobir"
 
 Assuming this is correct, we'd like to proceed with adding commonly used
source code constructs, D idioms, and so forth. We call this 'source snippets'.
Each source snippet has a few letter textual key. Typing that key and invoking
the source snippet button inserts the snippet.
 
 So I'm soliciting for everyone's favorite source snippet.

Better adjust your link as what you want people to do is visit your web site I guess What benefits does your editor have that say KDevelop does not?

Jun 12 2008
prev sibling next sibling parent reply "Chris R. Miller" <lordSaurontheGreat gmail.com> writes:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

John A. De Goes wrote:
 Hi,
=20
 We're adding support for the D language to UNA (http://www.n-brain.net)=

).
=20
 However, none of us have used D so we'd like a bit of help.

Well there's your problem! Come back later when you're educated. If=20 you're having trouble, there are plenty of people who will help you get=20 going with D.
Jun 12 2008
parent reply Frank Benoit <keinfarbton googlemail.com> writes:
Chris R. Miller schrieb:

 Well there's your problem!  Come back later when you're educated.

Why are you so unfriendly?
Jun 13 2008
parent reply "Chris R. Miller" <lordSaurontheGreat gmail.com> writes:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

Frank Benoit wrote:
 Chris R. Miller schrieb:
=20
 Well there's your problem!  Come back later when you're educated.

Why are you so unfriendly?

Editors made by people who don't use the language - rather, by people=20 who don't even know the language at all - are as a general rule very bad.= I'm a firm believer in using the software you make, so people who toss=20 in a few features to rope in a little more market share tend to tick me=20 off. Go big or go home, either do it right or not at all in my mind.
Jun 13 2008
next sibling parent reply John A. De Goes <john.withoutspam. n-brain.net> writes:
Chris R. Miller Wrote:
 Editors made by people who don't use the language - rather, by people 
 who don't even know the language at all - are as a general rule very bad.

Maybe that's because, as a general rule, they don't solicit feedback from the target community.
 I'm a firm believer in using the software you make, so people who toss 
 in a few features to rope in a little more market share tend to tick me 
 off.  Go big or go home, either do it right or not at all in my mind.

It's impossible for the developers of multi-language editors to become experts in all the languages those editors support. The best they can do is consult with experts. As for market share, you did hear me when I said UNA personal is now free? Regards, John
Jun 13 2008
parent Robert Fraser <fraserofthenight gmail.com> writes:
John A. De Goes wrote:
 As for market share, you did hear me when I said UNA personal is now free?

It's still a competitor tot hose of us who are making other free editors ;-P. But I see this as a good thing, since more competition = more benefit to everyone.
Jun 13 2008
prev sibling parent janderson <askme me.com> writes:
Chris R. Miller wrote:
 Frank Benoit wrote:
 Chris R. Miller schrieb:

 Well there's your problem!  Come back later when you're educated.

Why are you so unfriendly?

Editors made by people who don't use the language - rather, by people who don't even know the language at all - are as a general rule very bad. I'm a firm believer in using the software you make, so people who toss in a few features to rope in a little more market share tend to tick me off. Go big or go home, either do it right or not at all in my mind.

The more competition the better I say. If people decide they don't like n-brain, they won't use it. Let the people decide. Having D in yet another editor gives people choice. Its yet another marketing resource for D. The more people that use D the better support D will get. Also many languages share the same core mechanics so having a multi-language editor is not all bad. Hell, VS was never designed for Lua or DSL but I need to switch to that sometimes and I want to use something I'm familiar with. -Joel
Jun 13 2008
prev sibling next sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
John A. De Goes wrote:
 Assuming this is correct, we'd like to proceed with adding commonly
 used source code constructs, D idioms, and so forth. We call this
 'source snippets'. Each source snippet has a few letter textual key.
 Typing that key and invoking the source snippet button inserts the
 snippet.
 
 So I'm soliciting for everyone's favorite source snippet.

Can you give us some examples of what form these snippets take in other languages like C++ and Java?
Jun 12 2008
parent John A. De Goes <john.withoutspam. n-brain.net> writes:
Hi Walter,

See my other reply in this same thread for examples of commonly used constructs
in Java.

Regards,

John

Walter Bright Wrote:

 John A. De Goes wrote:
 Assuming this is correct, we'd like to proceed with adding commonly
 used source code constructs, D idioms, and so forth. We call this
 'source snippets'. Each source snippet has a few letter textual key.
 Typing that key and invoking the source snippet button inserts the
 snippet.
 
 So I'm soliciting for everyone's favorite source snippet.

Can you give us some examples of what form these snippets take in other languages like C++ and Java?

Jun 12 2008
prev sibling next sibling parent reply Georg Wrede <georg nospam.org> writes:
John A. De Goes wrote:
 Hi,
 
 We're adding support for the D language to UNA
 (http://www.n-brain.net). The Personal Edition has been released free
 of charge (down from $100).
 
 However, none of us have used D so we'd like a bit of help.
 
 We've added support (in dev version) to matching messages of the
 form:
 
 foo.d(5): Warning: silly variable name foo.d(5): Error: spelling
 error in variable name "foobir"
 
 Assuming this is correct, we'd like to proceed with adding commonly
 used source code constructs, D idioms, and so forth. We call this
 'source snippets'. Each source snippet has a few letter textual key.
 Typing that key and invoking the source snippet button inserts the
 snippet.
 
 So I'm soliciting for everyone's favorite source snippet.

Either there's something about your company that those who've already posted in this thread know and don't like, or the guys simply were in a bad mood. Personally I'm glad that D support is being added by a new vendor, that is always welcome. --- You've already probably downloaded the DMD compiler to get the documentation and lists of reserved words, etc. Witht that same download comes a wealth of source code, from which it should be possible to collect the most used idioms. They aren't all that different from what the typical Java or C idioms are, so it might be enough to just have most basic construct snippets.
Jun 12 2008
parent reply John A. De Goes <john.withoutspam. n-brain.net> writes:
Thanks for the friendly reply. Looks like I caught people on a bad day. :-)

I have identified all the basic constructs, but wonder if I may be missing some
things. For example, in Java, the following idioms are quite common (the first
two, in concurrent programming):

synchronized (object) {
    object.notifyAll();
}

synchronized (object) {
    while (!condition) {
        try {
            object.wait();
        }
        catch (InterruptedException e) {
            break;
        }
    }
}

new Runnable() {
    public void run() {
    }
}

public static void main(String[] args) {
}

These among many others. But I lack the familiarity with D to make such
judgements. I was hoping regular D programmers had some oft-used favorites they
could throw in.

Regards,

John


Georg Wrede Wrote:

 John A. De Goes wrote:
 Hi,
 
 We're adding support for the D language to UNA
 (http://www.n-brain.net). The Personal Edition has been released free
 of charge (down from $100).
 
 However, none of us have used D so we'd like a bit of help.
 
 We've added support (in dev version) to matching messages of the
 form:
 
 foo.d(5): Warning: silly variable name foo.d(5): Error: spelling
 error in variable name "foobir"
 
 Assuming this is correct, we'd like to proceed with adding commonly
 used source code constructs, D idioms, and so forth. We call this
 'source snippets'. Each source snippet has a few letter textual key.
 Typing that key and invoking the source snippet button inserts the
 snippet.
 
 So I'm soliciting for everyone's favorite source snippet.

Either there's something about your company that those who've already posted in this thread know and don't like, or the guys simply were in a bad mood. Personally I'm glad that D support is being added by a new vendor, that is always welcome. --- You've already probably downloaded the DMD compiler to get the documentation and lists of reserved words, etc. Witht that same download comes a wealth of source code, from which it should be possible to collect the most used idioms. They aren't all that different from what the typical Java or C idioms are, so it might be enough to just have most basic construct snippets.

Jun 12 2008
next sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
Along those lines, here's one I use all the time:

   import std.stdio;

   int main(string[] args)
   {
     return 0;
   }
Jun 12 2008
parent John A. De Goes <john.withoutspam. n-brain.net> writes:
Looks good to me. Thanks.

Regards,

John

Walter Bright Wrote:

 Along those lines, here's one I use all the time:
 
    import std.stdio;
 
    int main(string[] args)
    {
      return 0;
    }

Jun 13 2008
prev sibling parent reply Ary Borenszweig <ary esperanto.org.ar> writes:
Here are the snippets used by Descent:

http://dsource.org/projects/descent/browser/trunk/descent.ui/templates/default-templates.xml

There should probably be more, because we didn't spend much time with 
that file.

John A. De Goes a écrit :
 Thanks for the friendly reply. Looks like I caught people on a bad day. :-)
 
 I have identified all the basic constructs, but wonder if I may be missing
some things. For example, in Java, the following idioms are quite common (the
first two, in concurrent programming):
 
 synchronized (object) {
     object.notifyAll();
 }
 
 synchronized (object) {
     while (!condition) {
         try {
             object.wait();
         }
         catch (InterruptedException e) {
             break;
         }
     }
 }
 
 new Runnable() {
     public void run() {
     }
 }
 
 public static void main(String[] args) {
 }
 
 These among many others. But I lack the familiarity with D to make such
judgements. I was hoping regular D programmers had some oft-used favorites they
could throw in.
 
 Regards,
 
 John
 
 
 Georg Wrede Wrote:
 
 John A. De Goes wrote:
 Hi,

 We're adding support for the D language to UNA
 (http://www.n-brain.net). The Personal Edition has been released free
 of charge (down from $100).

 However, none of us have used D so we'd like a bit of help.

 We've added support (in dev version) to matching messages of the
 form:

 foo.d(5): Warning: silly variable name foo.d(5): Error: spelling
 error in variable name "foobir"

 Assuming this is correct, we'd like to proceed with adding commonly
 used source code constructs, D idioms, and so forth. We call this
 'source snippets'. Each source snippet has a few letter textual key.
 Typing that key and invoking the source snippet button inserts the
 snippet.

 So I'm soliciting for everyone's favorite source snippet.

posted in this thread know and don't like, or the guys simply were in a bad mood. Personally I'm glad that D support is being added by a new vendor, that is always welcome. --- You've already probably downloaded the DMD compiler to get the documentation and lists of reserved words, etc. Witht that same download comes a wealth of source code, from which it should be possible to collect the most used idioms. They aren't all that different from what the typical Java or C idioms are, so it might be enough to just have most basic construct snippets.


Jun 13 2008
parent John A. De Goes <john.withoutspam. n-brain.net> writes:
Hi Ary,

Nice! Thank you so much. I'd be happy to send you our template file when it's
finished.

Regards,

John

Ary Borenszweig Wrote:

 Here are the snippets used by Descent:
 
 http://dsource.org/projects/descent/browser/trunk/descent.ui/templates/default-templates.xml
 
 There should probably be more, because we didn't spend much time with 
 that file.
 

Jun 13 2008
prev sibling next sibling parent reply Robert Fraser <fraserofthenight gmail.com> writes:
John A. De Goes wrote:
 We've added support (in dev version) to matching messages of the form:
 
 foo.d(5): Warning: silly variable name
 foo.d(5): Error: spelling error in variable name "foobir"

There's multi-line error messages (for example, if there's an ambiguous overload), and occasionally messages don't have a line, just a file.
Jun 12 2008
next sibling parent "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Robert Fraser" <fraserofthenight gmail.com> wrote in message 
news:g2sp22$1dnc$1 digitalmars.com...
 John A. De Goes wrote:
 We've added support (in dev version) to matching messages of the form:

 foo.d(5): Warning: silly variable name
 foo.d(5): Error: spelling error in variable name "foobir"

There's multi-line error messages (for example, if there's an ambiguous overload), and occasionally messages don't have a line, just a file.

And occasionally they have the right line but wrong file, and sometimes, _sometimes_ they have nothing at all. But those aren't intended ;)
Jun 13 2008
prev sibling parent reply John A. De Goes <john.withoutspam. n-brain.net> writes:
Robert Fraser Wrote:
 There's multi-line error messages (for example, if there's an ambiguous 
 overload), and occasionally messages don't have a line, just a file.

Crap. Now it's easy enough to support a new style of error reporting, if the format is consistent, but not so easy when it's hard to break things down into a small number of patterns. Multiline errors are particularly difficult because it's often not apparent when they end, or what is the most important part of the message. Without documentation on the format, the best I can do is to experiment with the compiler and try to elicit all possible errors/warnings. And hope they fall into a small number of consistent patterns (which seems likely given that all the errors I encountered so far matched the above patterns). Anyone having inside knowledge of the format care to save me some time here? (Walter, you listening? :-) Regards, John
Jun 13 2008
next sibling parent reply Lutger <lutger.blijdestin gmail.com> writes:
John A. De Goes wrote:

 Robert Fraser Wrote:
 There's multi-line error messages (for example, if there's an ambiguous
 overload), and occasionally messages don't have a line, just a file.

Crap.

Here is the ambiguous overload: crap.d(13): function crap.foo called with argument types: (int) matches both: crap.foo(uint) and: crap.foo(ulong) I have not heard about UNA before, it looks really nice!
Jun 13 2008
parent John A. De Goes <john.withoutspam. n-brain.net> writes:
Thanks, Lutger. This should prove possible to support.

Regards,

John

Lutger Wrote:

 John A. De Goes wrote:
 
 Robert Fraser Wrote:
 There's multi-line error messages (for example, if there's an ambiguous
 overload), and occasionally messages don't have a line, just a file.

Crap.

Here is the ambiguous overload: crap.d(13): function crap.foo called with argument types: (int) matches both: crap.foo(uint) and: crap.foo(ulong) I have not heard about UNA before, it looks really nice!

Jun 13 2008
prev sibling next sibling parent reply "Steven Schveighoffer" <schveiguy yahoo.com> writes:
"John A. De Goes" wrote
 Anyone having inside knowledge of the format care to save me some time 
 here?

The front end for D is open source: http://www.dsource.org/projects/dmdfe That might help. Good luck, I have trouble understanding what some of the errors mean anyways :) -Steve
Jun 13 2008
parent John A. De Goes <john.withoutspam. n-brain.net> writes:
Thanks Steve (and also Walter). I'm grepping the code now.

Regards,

John

Steven Schveighoffer Wrote:

 "John A. De Goes" wrote
 Anyone having inside knowledge of the format care to save me some time 
 here?

The front end for D is open source: http://www.dsource.org/projects/dmdfe That might help. Good luck, I have trouble understanding what some of the errors mean anyways :) -Steve

Jun 13 2008
prev sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
John A. De Goes wrote:
 Without documentation on the format, the best I can do is to
 experiment with the compiler and try to elicit all possible
 errors/warnings. And hope they fall into a small number of consistent
 patterns (which seems likely given that all the errors I encountered
 so far matched the above patterns).
 
 Anyone having inside knowledge of the format care to save me some
 time here? (Walter, you listening? :-)

No problem. dmd.zip comes with compiler source, just grep for calls to the function "error(". No need to experiment!
Jun 13 2008
next sibling parent John A. De Goes <john.withoutspam. n-brain.net> writes:
Turns out the ambiguous argument types is really the only true multiline (i.e.
the one error that cannot be understood just by looking at what follows the
colon on the first line).

-------------------

dsymbol.c:    error("Dsymbol '%s' has no size\n", toChars());
dsymbol.c:    //printf("Dsymbol::error()\n");
func.c:     error(loc, "called with argument types:\n\t(%s)\nmatches
both:\n\t%s%s\nand:\n\t%s%s",
lexer.c:                    error("undefined escape hex sequence \\%c\n",c);
lexer.c:                    error("undefined escape sequence \\%c\n",c);
mars.c:     {   error("use -profile instead of -gt\n");
mars.c:     {   error("unrecognized file extension %s\n", ext);
root.c: error("Error reading file '%s'\n",name->toChars());
root.c: error("Error writing file '%s'\n",name->toChars());
root.c: error("Error appending to file '%s'\n",name->toChars());
template.c:     error("forward reference to template declaration %s\n",
tempdecl->toChars());
toobj.c:                    error("%s %s is hidden in %s\n",
fd->toParent()->toChars(), fd->toChars(), toChars());

Walter Bright Wrote:

 John A. De Goes wrote:
 Without documentation on the format, the best I can do is to
 experiment with the compiler and try to elicit all possible
 errors/warnings. And hope they fall into a small number of consistent
 patterns (which seems likely given that all the errors I encountered
 so far matched the above patterns).
 
 Anyone having inside knowledge of the format care to save me some
 time here? (Walter, you listening? :-)

No problem. dmd.zip comes with compiler source, just grep for calls to the function "error(". No need to experiment!

Jun 13 2008
prev sibling parent reply Ary Borenszweig <ary esperanto.org.ar> writes:
Walter Bright a écrit :
 John A. De Goes wrote:
 Without documentation on the format, the best I can do is to
 experiment with the compiler and try to elicit all possible
 errors/warnings. And hope they fall into a small number of consistent
 patterns (which seems likely given that all the errors I encountered
 so far matched the above patterns).

 Anyone having inside knowledge of the format care to save me some
 time here? (Walter, you listening? :-)

No problem. dmd.zip comes with compiler source, just grep for calls to the function "error(". No need to experiment!

But some errors are reported in the closed-source part... :-(
Jun 13 2008
parent reply Georg Wrede <georg nospam.org> writes:
Ary Borenszweig wrote:
 Walter Bright a écrit :
 John A. De Goes wrote:

 Without documentation on the format, the best I can do is to
 experiment with the compiler and try to elicit all possible
 errors/warnings. And hope they fall into a small number of consistent
 patterns (which seems likely given that all the errors I encountered
 so far matched the above patterns).

 Anyone having inside knowledge of the format care to save me some
 time here? (Walter, you listening? :-)

No problem. dmd.zip comes with compiler source, just grep for calls to the function "error(". No need to experiment!

But some errors are reported in the closed-source part... :-(

What's their format? Do they ever contain file/line numbers?
Jun 14 2008
parent reply John A. De Goes <john.withoutspam. n-brain.net> writes:
If the error reporting is done through inheritance of the class 'Lexer', then
they should obey the same general convention. Though I have no idea if the
private part has an dependencies on the public part.

Regards,

John

Georg Wrede Wrote:
 Ary Borenszweig wrote:
 Walter Bright a écrit :
 John A. De Goes wrote:

 Without documentation on the format, the best I can do is to
 experiment with the compiler and try to elicit all possible
 errors/warnings. And hope they fall into a small number of consistent
 patterns (which seems likely given that all the errors I encountered
 so far matched the above patterns).

 Anyone having inside knowledge of the format care to save me some
 time here? (Walter, you listening? :-)

No problem. dmd.zip comes with compiler source, just grep for calls to the function "error(". No need to experiment!

But some errors are reported in the closed-source part... :-(

What's their format? Do they ever contain file/line numbers?

Jun 14 2008
parent Georg Wrede <georg nospam.org> writes:
John A. De Goes wrote:
 If the error reporting is done through inheritance of the class
 'Lexer', then they should obey the same general convention. Though I
 have no idea if the private part has an dependencies on the public
 part.
 
 Georg Wrede Wrote:
 Ary Borenszweig wrote:
 Walter Bright a écrit :
 John A. De Goes wrote:
 
 Without documentation on the format, the best I can do is to 
 experiment with the compiler and try to elicit all possible 
 errors/warnings. And hope they fall into a small number of
 consistent patterns (which seems likely given that all the
 errors I encountered so far matched the above patterns).
 
 Anyone having inside knowledge of the format care to save me
 some time here? (Walter, you listening? :-)

No problem. dmd.zip comes with compiler source, just grep for calls to the function "error(". No need to experiment!

But some errors are reported in the closed-source part... :-(

What's their format? Do they ever contain file/line numbers?


Thanks, John, for the (attempt to) answer. I may have been too sloppy with my post, actually I was implicitly soliciting Walter's answer to this. The proprietary part of the compiler (AFAICT) is from the legacy(?, and still maintained) C++ compiler that Walter's written for years ago (and which still is one of the fastest around, and especially, it's THE first C++-direct compiler in existence (from what I've been told)). Therefore any formats in the closed-source are (IIUC) definitely not related to the open-source D-front-end. And very _specifically_, not inherited _from_ the OS front-end. Apologies for the diffuse target in my post, I was actually implicitly asking Walter, although it may have appearaed like I was asking you (an unreasonable question, if I ever saw one).
Jun 15 2008
prev sibling next sibling parent reply BLS <nanali nospam-wanadoo.fr> writes:
John A. De Goes schrieb:
 Hi,
 
 We're adding support for the D language to UNA (http://www.n-brain.net). The
Personal Edition has been released free of charge (down from $100).

 Assuming this is correct, we'd like to proceed with adding commonly used
source code constructs, D idioms, and so forth. We call this 'source snippets'.
Each source snippet has a few letter textual key. Typing that key and invoking
the source snippet button inserts the snippet.

A lot of DWT (SWT) JFace snippets are in my mind, but it depends on how flexible your snippet editor is. For instance : JFSF = class SimpleForm : ApplicationWindow { ......... } should become : class {1} : ApplicationWindow { ......... } so typing JFSF should open a popup asking for the the classname. In case that your IDE is that flexible, a couple a DWT, JFace snippets, are possible... Otherwise take it as enhancement suggestion :) Bjoern
Jun 12 2008
parent reply John A. De Goes <john.withoutspam. n-brain.net> writes:
Hi Bjoern,

Yes, this is possible. You just use a macro in the source snippet, e.g.
${CLASS}, and then when you insert it, it places the caret at the first macro:
filling it in replaces all instances of the macro, and hitting Enter takes you
to the next one. No pop up dialogs, but it accomplishes the same thing (with
less invasiveness and annoyance).

Where do DWT and JFace fit into the grand scheme of things? That is, are they
as ubiquitous in D as Swing and SWT are in the Java community?

Regards,

John

BLS Wrote:
 A lot of DWT (SWT) JFace snippets are in my mind, but it depends on how 
 flexible your snippet editor is.
 For instance :
 JFSF =
 class SimpleForm : ApplicationWindow {
 .........
 }
 should become :
 class {1} : ApplicationWindow {
 .........
 }
 so typing JFSF should open a popup asking for the the classname.
 
 In case that your IDE is that flexible, a couple a DWT, JFace snippets, 
   are possible... Otherwise take it as enhancement suggestion :)
 Bjoern

Jun 13 2008
parent reply BLS <nanali nospam-wanadoo.fr> writes:
John A. De Goes schrieb:
 Hi Bjoern,
 
 Yes, this is possible. You just use a macro in the source snippet, e.g.
${CLASS}, and then when you insert it, it places the caret at the first macro:
filling it in replaces all instances of the macro, and hitting Enter takes you
to the next one. No pop up dialogs, but it accomplishes the same thing (with
less invasiveness and annoyance).
 

 Where do DWT and JFace fit into the grand scheme of things? That is, are they
as ubiquitous in D as Swing and SWT are in the Java community?
 

language creator) declared SWT/DWT as standard GUI. DWT is ATM en pair with SWT 3.4M7, in other words bleeding edge. So yes, DWT/JFace/Forms is for D what SWT etc. means for Eclipse/Java. (It was allmost Frank Benoit, who made that hercules work) further information at : http://www.dsource.org/projects/dwt You'll also find links to DWT/JFace/Forms snippets on this page which are most probabely usefull as snippet templates.. OFF TOPIC Since about 3 years I am working on a realtime developer collaboration IDE. (slightly different in that I am using a C/S RDBMS as SCM) Would be interesting to exchange some ideas ... Regards, Bjoern
Jun 13 2008
parent John A. De Goes <john.withoutspam. n-brain.net> writes:
Thanks for the insight, Bjoern. Send me and e-mail and we can chat on real-time
collaboration (I'm very much interested in the work other people are doing in
this area).

Regards,

John

BLS Wrote:

 John A. De Goes schrieb:
 Hi Bjoern,
 
 Yes, this is possible. You just use a macro in the source snippet, e.g.
${CLASS}, and then when you insert it, it places the caret at the first macro:
filling it in replaces all instances of the macro, and hitting Enter takes you
to the next one. No pop up dialogs, but it accomplishes the same thing (with
less invasiveness and annoyance).
 

 Where do DWT and JFace fit into the grand scheme of things? That is, are they
as ubiquitous in D as Swing and SWT are in the Java community?
 

language creator) declared SWT/DWT as standard GUI. DWT is ATM en pair with SWT 3.4M7, in other words bleeding edge. So yes, DWT/JFace/Forms is for D what SWT etc. means for Eclipse/Java. (It was allmost Frank Benoit, who made that hercules work) further information at : http://www.dsource.org/projects/dwt You'll also find links to DWT/JFace/Forms snippets on this page which are most probabely usefull as snippet templates.. OFF TOPIC Since about 3 years I am working on a realtime developer collaboration IDE. (slightly different in that I am using a C/S RDBMS as SCM) Would be interesting to exchange some ideas ... Regards, Bjoern

Jun 13 2008
prev sibling parent reply "Nick Sabalausky" <a a.a> writes:
"John A. De Goes" <john.withoutspam. n-brain.net> wrote in message 
news:g2rt5g$28e3$1 digitalmars.com...
 Hi,

 We're adding support for the D language to UNA (http://www.n-brain.net). 
 The Personal Edition has been released free of charge (down from $100).

 However, none of us have used D so we'd like a bit of help.

 We've added support (in dev version) to matching messages of the form:

 foo.d(5): Warning: silly variable name
 foo.d(5): Error: spelling error in variable name "foobir"

 Assuming this is correct, we'd like to proceed with adding commonly used 
 source code constructs, D idioms, and so forth. We call this 'source 
 snippets'. Each source snippet has a few letter textual key. Typing that 
 key and invoking the source snippet button inserts the snippet.

 So I'm soliciting for everyone's favorite source snippet.

I know this isn't what you're asking for, and maybe it's already in there (I haven't looked), but *please* make sure the syntax hightlighting *properly* supports both C-style block comments *and* D's nested block comments. It's a minor issue of course, but a real pet peeve of mine. Most of the D editors I've tried either highlight D's nested comments (ie, "/+ +/") as if they behaved like the non-nestable "/* */" comments, or don't even recognize them as comments at all. BTW, Are you the same John De Goes that wrote a software-3D book about ten or so years ago? I still have that around here somewhere. Good book.
Jun 14 2008
parent reply John A. De Goes <john.withoutspam. n-brain.net> writes:
Nick Sabalausky Wrote:
 I know this isn't what you're asking for, and maybe it's already in there (I 
 haven't looked), but *please* make sure the syntax hightlighting *properly* 
 supports both C-style block comments *and* D's nested block comments. It's a 
 minor issue of course, but a real pet peeve of mine. Most of the D editors 
 I've tried either highlight D's nested comments (ie, "/+ +/") as if they 
 behaved like the non-nestable "/* */" comments, or don't even recognize them 
 as comments at all.

I'll confess right now that all comments are nestable, even C-style comments. It's something we'll be addressing in a later issue. Personally, I've always been annoyed that comments couldn't be nested. Clearly an artifact of early primitive parser technology.
 BTW, Are you the same John De Goes that wrote a software-3D book about ten 
 or so years ago? I still have that around here somewhere. Good book. 

Yep, one and the same. As far as I know, there's exactly one "John De Goes" in the whole world, and he's sitting right here talking to you. :-) Glad you enjoyed the book. I haven't done anything in the gaming industry for years, but I'm looking to get back into the industry, at least in a hobbyist role, later this year. Regards, John
Jun 14 2008
parent reply janderson <askme me.com> writes:
John A. De Goes wrote:
 Nick Sabalausky Wrote:
 I know this isn't what you're asking for, and maybe it's already in there (I 
 haven't looked), but *please* make sure the syntax hightlighting *properly* 
 supports both C-style block comments *and* D's nested block comments. It's a 
 minor issue of course, but a real pet peeve of mine. Most of the D editors 
 I've tried either highlight D's nested comments (ie, "/+ +/") as if they 
 behaved like the non-nestable "/* */" comments, or don't even recognize them 
 as comments at all.

I'll confess right now that all comments are nestable, even C-style comments. It's something we'll be addressing in a later issue. Personally, I've always been annoyed that comments couldn't be nested. Clearly an artifact of early primitive parser technology.
 BTW, Are you the same John De Goes that wrote a software-3D book about ten 
 or so years ago? I still have that around here somewhere. Good book. 

Yep, one and the same. As far as I know, there's exactly one "John De Goes" in the whole world, and he's sitting right here talking to you. :-) Glad you enjoyed the book. I haven't done anything in the gaming industry for years, but I'm looking to get back into the industry, at least in a hobbyist role, later this year. Regards, John

Maybe you'll consider D when you decide on a language for your new game. -Joel
Jun 14 2008
parent reply John A. De Goes <john.withoutspam. n-brain.net> writes:
I wish -- D is really what C++ should have been, and wasn't. But my next
'hobbyist' foray into games will probably involve the browser-based casual
gaming market.

Regards,

John

janderson Wrote:

 John A. De Goes wrote:
 Nick Sabalausky Wrote:
 I know this isn't what you're asking for, and maybe it's already in there (I 
 haven't looked), but *please* make sure the syntax hightlighting *properly* 
 supports both C-style block comments *and* D's nested block comments. It's a 
 minor issue of course, but a real pet peeve of mine. Most of the D editors 
 I've tried either highlight D's nested comments (ie, "/+ +/") as if they 
 behaved like the non-nestable "/* */" comments, or don't even recognize them 
 as comments at all.

I'll confess right now that all comments are nestable, even C-style comments. It's something we'll be addressing in a later issue. Personally, I've always been annoyed that comments couldn't be nested. Clearly an artifact of early primitive parser technology.
 BTW, Are you the same John De Goes that wrote a software-3D book about ten 
 or so years ago? I still have that around here somewhere. Good book. 

Yep, one and the same. As far as I know, there's exactly one "John De Goes" in the whole world, and he's sitting right here talking to you. :-) Glad you enjoyed the book. I haven't done anything in the gaming industry for years, but I'm looking to get back into the industry, at least in a hobbyist role, later this year. Regards, John

Maybe you'll consider D when you decide on a language for your new game. -Joel

Jun 15 2008
parent reply "Chris R. Miller" <lordSaurontheGreat gmail.com> writes:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

John A. De Goes wrote:
 I=10 wish -- D is really what C++ should have been, and wasn't. But my =

casual gaming market. That really is a shame. D has some great libraries to help you get=20 started! There's Arclib, which handles input, graphics, as well as=20 sound. It's based on OpenGL, so it's fast (but it's 2D, just floating=20 sprites on the top of the view frustum). There's also Derelict, which=20 gives SDL/OpenGL/OpenAL support. The there's also DAllegro (which I'm=20 using at the moment) which gives you the Allegro game library=20 (http://www.allegro.cc/). If you want to try some web-based games, DDBI can handle the database=20 layer, and FastCGI4D (http://dsource.org/projects/fastcgi4d) can handle=20 the serving web pages part. If you use D for the browser based stuff, you'll have the great=20 advantage of not needing to sink all the extra money into a server with=20 extra RAM to support J2EE, which can consume a frightful amount of memory= ! Just something to think about.
Jun 15 2008
parent reply Mike Parker <aldacron gmail.com> writes:
Chris R. Miller wrote:

 If you use D for the browser based stuff, you'll have the great 
 advantage of not needing to sink all the extra money into a server with 
 extra RAM to support J2EE, which can consume a frightful amount of memory!

Actually, when people use the term 'browser-based games' they are usually referring to Flash, Silverlight, Java Applets, or some sort of custom browser plugin (i.e. games that run within the browser). I'm thinking that's what John is referring to. D provides no benefit there. What you are talking about are generally referred to as 'web-based games' (i.e. games played via HTTP requests and/or browser scripting). And really, with Java you don't need a J2EE stack for that. A low-overhead app server like Jetty coupled with Servlets and JSP pages will do nicely. I'd prefer that to a PHP solution. D would work just as well in that environment, but my gut tells me there'd be little difference in memory overhead.
Jun 15 2008
next sibling parent reply "Nick Sabalausky" <a a.a> writes:
"Mike Parker" <aldacron gmail.com> wrote in message 
news:g34k0q$1uns$1 digitalmars.com...
 Chris R. Miller wrote:

 If you use D for the browser based stuff, you'll have the great advantage 
 of not needing to sink all the extra money into a server with extra RAM 
 to support J2EE, which can consume a frightful amount of memory!

Actually, when people use the term 'browser-based games' they are usually referring to Flash, Silverlight, Java Applets, or some sort of custom browser plugin (i.e. games that run within the browser). I'm thinking that's what John is referring to. D provides no benefit there. What you are talking about are generally referred to as 'web-based games' (i.e. games played via HTTP requests and/or browser scripting). And really, with Java you don't need a J2EE stack for that. A low-overhead app server like Jetty coupled with Servlets and JSP pages will do nicely. I'd prefer that to a PHP solution. D would work just as well in that environment, but my gut tells me there'd be little difference in memory overhead.

If there's anything like leaderboards or multiplayer, then that would require a backend, and that backend could be written in D. I would *love* for D to be a viable language for the front-end though. I truly despise Flash (including the official IDE), but I'm working on a project right now for which Flash is, unfortunately, the best option. [side rant] And the client (people, not browser) are on shared hosting so it's gotta use PHP for the backend, and I hate that every bit as much. [end side rant]. I truly wish I could just do the whole damn thing in D. Which does bring me to one of the few things I *do* think VMs are good for: Embedded webpage applets should be in a sandbox. That's why I would actually like to see D support compiling to the JVM (*in addition* to native code, of course). Because that way I could use D as a replacement for Flash. Come to think of it, doesn't the newest version of Flash support using C++ as an alternative to ECMAScript? I thought I heard that somewhere. If it does, maybe that opens the door for Flash-using-D? Anyone know? But then again anything beyond Flash 7 is poorly supported on embedded systems and as I understand it (which is to say: not very well) Adobe's newer "Flash Lite" strategy seems like more work for embedded browser developers than the old Flash SDK. But I'm probably wrong on that. Actually that reminds me, I have no idea how the Java Applet support is on embedded browsers. Might not be great either. Dang. And heck, as long as I'm in pipe-dream land, along with "using D for stuff embedded in webpages", some D-to-PHP and D-to-ASP converters would be nice. That'd let me use D for back-end even when I have no control over the server. 'Course, you'd be giving up anything nice about being natively-compiled, but at least I wouldn't have to use ASP/PHP/some-other-dynamically-typed-flavor-of-the-month (all I really mean by that last one is that to a non-fan of such languages like me, it seems like popular dynamically typed languages keep popping up all over the place). Sorry for rambling and ranting so far offtopic.
Jun 15 2008
parent reply Georg Wrede <georg nospam.org> writes:
Nick Sabalausky wrote:
 "Mike Parker" <aldacron gmail.com> wrote in message 
 news:g34k0q$1uns$1 digitalmars.com...
 
Chris R. Miller wrote:


If you use D for the browser based stuff, you'll have the great advantage 
of not needing to sink all the extra money into a server with extra RAM 
to support J2EE, which can consume a frightful amount of memory!

Actually, when people use the term 'browser-based games' they are usually referring to Flash, Silverlight, Java Applets, or some sort of custom browser plugin (i.e. games that run within the browser). I'm thinking that's what John is referring to. D provides no benefit there. What you are talking about are generally referred to as 'web-based games' (i.e. games played via HTTP requests and/or browser scripting). And really, with Java you don't need a J2EE stack for that. A low-overhead app server like Jetty coupled with Servlets and JSP pages will do nicely. I'd prefer that to a PHP solution. D would work just as well in that environment, but my gut tells me there'd be little difference in memory overhead.

If there's anything like leaderboards or multiplayer, then that would require a backend, and that backend could be written in D. I would *love* for D to be a viable language for the front-end though. I truly despise Flash (including the official IDE), but I'm working on a project right now for which Flash is, unfortunately, the best option. [side rant] And the client (people, not browser) are on shared hosting so it's gotta use PHP for the backend, and I hate that every bit as much. [end side rant]. I truly wish I could just do the whole damn thing in D. Which does bring me to one of the few things I *do* think VMs are good for: Embedded webpage applets should be in a sandbox. That's why I would actually like to see D support compiling to the JVM (*in addition* to native code, of course). Because that way I could use D as a replacement for Flash. Come to think of it, doesn't the newest version of Flash support using C++ as an alternative to ECMAScript? I thought I heard that somewhere. If it does, maybe that opens the door for Flash-using-D? Anyone know? But then again anything beyond Flash 7 is poorly supported on embedded systems and as I understand it (which is to say: not very well) Adobe's newer "Flash Lite" strategy seems like more work for embedded browser developers than the old Flash SDK. But I'm probably wrong on that. Actually that reminds me, I have no idea how the Java Applet support is on embedded browsers. Might not be great either. Dang. And heck, as long as I'm in pipe-dream land, along with "using D for stuff embedded in webpages", some D-to-PHP and D-to-ASP converters would be nice. That'd let me use D for back-end even when I have no control over the server. 'Course, you'd be giving up anything nice about being natively-compiled, but at least I wouldn't have to use ASP/PHP/some-other-dynamically-typed-flavor-of-the-month (all I really mean by that last one is that to a non-fan of such languages like me, it seems like popular dynamically typed languages keep popping up all over the place). Sorry for rambling and ranting so far offtopic.

(More off-topic rambling below.) The other week I actually bought a new computer (2.4GHz 4-CPU, 4GB, etc.) simply because I got an assignment for a client that my current computers couldn't handle. (For the record, I've moved to this Century!) Now, running Linux, I had the performance meter running on one of the desktops, and I was reading TV programs in a browser, D documentation on another, and E-mail in another. Then there was the desktop where I'd gathered all the windows I needed to study and try Lua. All of a sudden I heard the CPU fan revving up. I wondered what could be the reason for it since I hadn't done anything exceptional for half an hour. Turns out there's a banner ad on the TV programming page that flashes pictures as fast as it can, with no pauses. Until that particular commercial got on (because of an automatic background reload of the TV programming page) the CPU load was at 0.1 0.01 0.0 0.02. When it got started the load went to 0.1 0.3 0.0 0.02. In other words, one of my four CPUs was loaded to 30% simply because of this stupid banner. Since the CPU fan started revving up, I understood that the computer was using more power. Later I put a gadeget I have, that's a meter of Electric currency consuption, and it showed almost a 10% increase in power. On a 1-CPU machine the consumption should go up much more than that. Think about it. If such a web site is for TV programming in America, and it puts such a banner on its pages, we might have 50 million people having this page visible. A 10% increase in electricity consumption should mean 200W * +10% * 50M = over one megawatt. That's equal to the output of one nuclear power plant. So, don't believe this. I didn't. But I've done the math several times over, and I can't help getting to this answer. Greenpeace sure ought to go shoot the guy.
Jun 19 2008
parent reply Georg Wrede <georg nospam.org> writes:
Georg Wrede wrote:
 Nick Sabalausky wrote:
 
 "Mike Parker" <aldacron gmail.com> wrote in message 
 news:g34k0q$1uns$1 digitalmars.com...

 Chris R. Miller wrote:


 If you use D for the browser based stuff, you'll have the great 
 advantage of not needing to sink all the extra money into a server 
 with extra RAM to support J2EE, which can consume a frightful amount 
 of memory!

Actually, when people use the term 'browser-based games' they are usually referring to Flash, Silverlight, Java Applets, or some sort of custom browser plugin (i.e. games that run within the browser). I'm thinking that's what John is referring to. D provides no benefit there. What you are talking about are generally referred to as 'web-based games' (i.e. games played via HTTP requests and/or browser scripting). And really, with Java you don't need a J2EE stack for that. A low-overhead app server like Jetty coupled with Servlets and JSP pages will do nicely. I'd prefer that to a PHP solution. D would work just as well in that environment, but my gut tells me there'd be little difference in memory overhead.

If there's anything like leaderboards or multiplayer, then that would require a backend, and that backend could be written in D. I would *love* for D to be a viable language for the front-end though. I truly despise Flash (including the official IDE), but I'm working on a project right now for which Flash is, unfortunately, the best option. [side rant] And the client (people, not browser) are on shared hosting so it's gotta use PHP for the backend, and I hate that every bit as much. [end side rant]. I truly wish I could just do the whole damn thing in D. Which does bring me to one of the few things I *do* think VMs are good for: Embedded webpage applets should be in a sandbox. That's why I would actually like to see D support compiling to the JVM (*in addition* to native code, of course). Because that way I could use D as a replacement for Flash. Come to think of it, doesn't the newest version of Flash support using C++ as an alternative to ECMAScript? I thought I heard that somewhere. If it does, maybe that opens the door for Flash-using-D? Anyone know? But then again anything beyond Flash 7 is poorly supported on embedded systems and as I understand it (which is to say: not very well) Adobe's newer "Flash Lite" strategy seems like more work for embedded browser developers than the old Flash SDK. But I'm probably wrong on that. Actually that reminds me, I have no idea how the Java Applet support is on embedded browsers. Might not be great either. Dang. And heck, as long as I'm in pipe-dream land, along with "using D for stuff embedded in webpages", some D-to-PHP and D-to-ASP converters would be nice. That'd let me use D for back-end even when I have no control over the server. 'Course, you'd be giving up anything nice about being natively-compiled, but at least I wouldn't have to use ASP/PHP/some-other-dynamically-typed-flavor-of-the-month (all I really mean by that last one is that to a non-fan of such languages like me, it seems like popular dynamically typed languages keep popping up all over the place). Sorry for rambling and ranting so far offtopic.

(More off-topic rambling below.) The other week I actually bought a new computer (2.4GHz 4-CPU, 4GB, etc.) simply because I got an assignment for a client that my current computers couldn't handle. (For the record, I've moved to this Century!) Now, running Linux, I had the performance meter running on one of the desktops, and I was reading TV programs in a browser, D documentation on another, and E-mail in another. Then there was the desktop where I'd gathered all the windows I needed to study and try Lua. All of a sudden I heard the CPU fan revving up. I wondered what could be the reason for it since I hadn't done anything exceptional for half an hour. Turns out there's a banner ad on the TV programming page that flashes pictures as fast as it can, with no pauses.

Merely changing the applet to flip the pictures ten times a second would drop the CPU usage to almost undetectable levels. And the banner would still look the same.
 Until that 
 particular commercial got on (because of an automatic background reload 
 of the TV programming page) the CPU load was at 0.1 0.01 0.0 0.02. When 
 it got started the load went to 0.1 0.3 0.0 0.02.

Sloppy writing. The above is actually not the output of /uptime/ or such, I was thinking in percentages as seen from the cpu meter graph. So a 0.3 here means 30%. This does not change anything, it's still valid.
 In other words, one of my four CPUs was loaded to 30% simply because of 
 this stupid banner. Since the CPU fan started revving up, I understood 
 that the computer was using more power. Later I put a gadeget I have, 
 that's a meter of Electric currency consuption, and it showed almost a 
 10% increase in power. On a 1-CPU machine the consumption should go up 
 much more than that.
 
 Think about it. If such a web site is for TV programming in America, and 
 it puts such a banner on its pages, we might have 50 million people 
 having this page visible. A 10% increase in electricity consumption 
 should mean 200W * +10% * 50M = over one megawatt. That's equal to the 
 output of one nuclear power plant.

Suppose a banner ad company which has deals with, say, half of the most visited pages, decides to put a particular ad on everybody's screen (which could happen if a major company (Coca-Cola, Apple, etc) decides to bring out a product with a bang), that has such a badly designed Flash banner, the electric company really should see a stunning difference in electricity consumption.
 So, don't believe this. I didn't. But I've done the math several times 
 over, and I can't help getting to this answer.
 
 Greenpeace sure ought to go shoot the guy.

They should. It's really a frivolous use of other peoples' computing power and energy.
Jun 20 2008
parent reply Sean Kelly <sean invisibleduck.org> writes:
== Quote from Georg Wrede (georg nospam.org)'s article
 Georg Wrede wrote:
 All of a sudden I heard the CPU fan revving up. I wondered what could be
 the reason for it since I hadn't done anything exceptional for half an
 hour. Turns out there's a banner ad on the TV programming page that
 flashes pictures as fast as it can, with no pauses.

drop the CPU usage to almost undetectable levels. And the banner would still look the same.

No one ever said that banner ad creators had any degree of sense. There are some sites I refuse to go to now because of misbehaved banner ads the sites contained. In the case of unitedmedia.com (one site on my list), they had an ad for a while that acted like a mini browser bomb. They can't have possibly tested it at all. Sean
Jun 20 2008
parent "Nick Sabalausky" <a a.a> writes:
"Sean Kelly" <sean invisibleduck.org> wrote in message 
news:g3gq00$1kio$1 digitalmars.com...
 == Quote from Georg Wrede (georg nospam.org)'s article
 Georg Wrede wrote:
 All of a sudden I heard the CPU fan revving up. I wondered what could 
 be
 the reason for it since I hadn't done anything exceptional for half an
 hour. Turns out there's a banner ad on the TV programming page that
 flashes pictures as fast as it can, with no pauses.

drop the CPU usage to almost undetectable levels. And the banner would still look the same.

No one ever said that banner ad creators had any degree of sense. There are some sites I refuse to go to now because of misbehaved banner ads the sites contained. In the case of unitedmedia.com (one site on my list), they had an ad for a while that acted like a mini browser bomb. They can't have possibly tested it at all. Sean

I find that any form of animation on a page makes it literally impossible for me to actually read the page. So I disabled GIF animation and favicons, and installed Firefox's "Flashblock" and "QuickJava" plugins.
Jun 20 2008
prev sibling parent John A. De Goes <john.withoutspam. n-brain.net> writes:
Yes, that's correct. JavaScript most likely. No database component at all. And
for back end work, it's really
hard to beat the dynamic languages these days.

D is an excellent fit for systems-level programming, desktop games, and many
other areas, but when you
don't need the speed, you're paying for something you don't have to pay for --
by giving up the features
of a dynamic language.
Jun 16 2008