www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Mmrnmhrm 0.1 released

reply Bruno Medeiros <brunodomedeiros+spam com.gmail> writes:
This is the announcement of the first public release of Mmrnmhrm.
What is Mmrnmhrm? Mmrnmhrm (pronounced mer-nem-herm :P ) is an Eclipse 
IDE I've been working on, partially based on Descent, and aimed at 
bringing semantic IDE functionality (such as code completion, find 
definition, find references, etc.) to D.
This release (0.1) features basic IDE features, plus a working 
find-definition functionality (with editor hyperlinking), text hovering 
for definitions and references, and code completion. Here are some 
screenshots:
http://svn.dsource.org/projects/descent/downloads/mmrnmhrm_findref_hover1.png
http://svn.dsource.org/projects/descent/downloads/mmrnmhrm_codecompletion2.png

The find-definition and code-completion features are working well 
enough, but general IDE are not very extensive. Here's a detailed 
listing of features, and shortcomings:

== IDE features ==
New Project Wizard
Project Configuration Page
D Editor:
   Syntax Highlighting
   Content Outline
Syntax Highlighting configuration page
A Language Model supporting semantic features:
   Find Definition
   Code Completion
An AST Viewer (for IDE debugging purposes only)
-> (there is no builder support)

* D Language Model *
Here are some important notes about the language model:
   The language model is based on a source folders model like JDT
  -> but with Source Folders only, no library support, not even for the 
Standard Lib.
  -> the model is not automatically updated when there are resource 
changes. The model of a file is only updated automatically when the file 
is saved (or edited) from a Mmrnmhrm editor.
  -> If there are external resource changes one can update the entire 
model manually by pressing the Update Dee Model icon (button with the 
red D on the toolbar).

* Find Definition *
Locates any definition unit:
   Module, class, struct/union, variable, function parameter, template, 
template parameter, alias, typedef, named enums, enum members, unnamed 
enum members, named mixins, import aliases, import selections.
   -> Not supported: goto labels, version/debug identifiers
   Search scopes:
     Primary namespace/scope.
     Secondary namespace (where imports bring names);
     Super scope;
     Outer scope;
   -> Doesn't support/search: inside unnamed mixins, the scope of the 
with() statement, postcondition result defunit;

All kinds of references nodes supported except:
   -> Most expression nodes (including function calls). (I will try to 
support these next).
   -> special references (new, delete, this, super);
Some intrinsic/native types references are detected but there is nowhere 
to go.
   -> Does not do function or template overload resolution (if there are 
several matches, lists all homonyms).
   -> Some nodes that have some source range bugs (missing source range)

The Find Ref functionality is invoked by pressing F3 when in the Mmrnhrm 
D editor, or by clicking the Find Ref button placed in the toolbar. When 
using the toolbar button, Find Ref will work for in any text editor 
(including Descent's), however it won't be able to follow imports across 
modules, if the file is not on the build path of a Mmrnmhrm project. 
Find-ref is also available in the form of editor hyperlinking (hold Ctrl 
and select a reference with the mouse).

* Text Hover *
Text hover shows a text popup with some info (signature + DDoc) over the 
reference or definition under the mouse cursor.

* Code Completion *
Code completion
-> Has the same semantic power as find-ref to determine completions.
-> May not work 100% correctly (if at all) when a file has syntax 
errors. It does try to recover for some common syntax errors however.
-> Does not yet consider name shadowing.

== Installation ==
You can download Mmrnmhrm from here:
http://www.dsource.org/projects/descent/browser/downloads/mmrnmhrm-1.0
Install it by placing all latest version (0.1.0) jar files in the 
Eclipse plugin directory. Requires Eclipse 3.3 and JVM 1.5 or superior. 
Descent may or may not be installed as well, altough if it is, it's 
editor may take priority in opening .d files. (Note: if you edit the 
".project" file it is possible to have a project with both the Mmrnmhrm 
and Descent nature)

-- 
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Aug 17 2007
next sibling parent reply Deewiant <deewiant.doesnotlike.spam gmail.com> writes:
Bruno Medeiros wrote:
 This is the announcement of the first public release of Mmrnmhrm.

Let me be the first to awe at the Star Control reference. Good way of getting an untaken name for software, too. Any particular etymology? Oh, and the IDE looks good, too <g>. I don't use IDEs, though. -- Remove ".doesnotlike.spam" from the mail address.
Aug 17 2007
parent reply Bruno Medeiros <brunodomedeiros+spam com.gmail> writes:
Deewiant wrote:
 Bruno Medeiros wrote:
 This is the announcement of the first public release of Mmrnmhrm.

Let me be the first to awe at the Star Control reference. Good way of getting an untaken name for software, too. Any particular etymology?

 Oh, and the IDE looks good, too <g>. I don't use IDEs, though.
 

you use IDEs? -- Bruno Medeiros - MSc in CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Aug 18 2007
parent reply Deewiant <deewiant.doesnotlike.spam gmail.com> writes:
Bruno Medeiros wrote:
 Deewiant wrote:
 Bruno Medeiros wrote:
 This is the announcement of the first public release of Mmrnmhrm.

Let me be the first to awe at the Star Control reference. Good way of getting an untaken name for software, too. Any particular etymology?


Any particular reason why you chose the name?
 Oh, and the IDE looks good, too <g>. I don't use IDEs, though.

IDEs?

I like having only one editor, with a consistent configuration (appearance, behaviour, set of commands), regardless of what type of file I'm editing or what language I'm programming in. I'm currently doing my best to learn Vim, as it may be the best of both worlds: amazingly configurable to provide much IDE-like functionality whilst still being a good "simple" text editor. -- Remove ".doesnotlike.spam" from the mail address.
Aug 18 2007
parent reply Bruno Medeiros <brunodomedeiros+spam com.gmail> writes:
Deewiant wrote:
 Bruno Medeiros wrote:
 Deewiant wrote:
 Bruno Medeiros wrote:
 This is the announcement of the first public release of Mmrnmhrm.

getting an untaken name for software, too. Any particular etymology?


Any particular reason why you chose the name?

I wanted a cool, but also silly name (kinda to reflect the offshoot nature of Mmrnmhrm). Also, in the SC universe the Mmrnmhrm race merges with another race (*wink*).
 Oh, and the IDE looks good, too <g>. I don't use IDEs, though.

IDEs?

I like having only one editor, with a consistent configuration (appearance, behaviour, set of commands), regardless of what type of file I'm editing or what language I'm programming in. I'm currently doing my best to learn Vim, as it may be the best of both worlds: amazingly configurable to provide much IDE-like functionality whilst still being a good "simple" text editor.

If that is your major issue (consistency across contexts/languages), and not the text/CLI vs GUI issue which was recently discussed, then I would say Eclipse is still a strong bet. Both Descent and Mmrnmhrm try to emulate the look and feel of JDT (including details such as keybindings), and that is a trend that is becoming prevalent in other Eclipse based IDEs as well. Consider for example this demo video for a Ruby IDE based on Eclipse (and DLTK): http://us.xored.com/~haiodo/EclipseCon07/dltk-ruby.mov Eclipse itself is improving support for common IDE interaction infrastructure. For example, it recently added support for defining keybindings for IDE commands common to several IDEs in one single logical command (so that for example, if you want to change the keybinding of Open Declaration from F3 to something else, you don't have to do it for each Eclipse IDE you have, such as JDT, CDT, etc.) -- Bruno Medeiros - MSc in CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Aug 20 2007
parent Bruno Medeiros <brunodomedeiros+spam com.gmail> writes:
Bruno Medeiros wrote:
 Deewiant wrote:
 Bruno Medeiros wrote:
 Deewiant wrote:
 Bruno Medeiros wrote:
 This is the announcement of the first public release of Mmrnmhrm.

of getting an untaken name for software, too. Any particular etymology?


Any particular reason why you chose the name?

I wanted a cool, but also silly name (kinda to reflect the offshoot nature of Mmrnmhrm). Also, in the SC universe the Mmrnmhrm race merges with another race (*wink*).

In all fairness, even tough I have no problem remembering and prounouncing the name, in my IM talks with Ary I've found it's quite annoying to *type*, since you can't type it fast. :P (Maybe I should have gone with "Dopefish" :P) -- Bruno Medeiros - MSc in CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Aug 25 2007
prev sibling next sibling parent "Rioshin an'Harthen" <rharth75 hotmail.com> writes:
"Bruno Medeiros" <brunodomedeiros+spam com.gmail> kirjoitti viestissä 
news:fa4nad$1sab$1 digitalmars.com...
 Mmrnmhrm (pronounced mer-nem-herm :P )

And here I thought it's pronounced mern-merm... guess it's time to replay the SC saga...
Aug 18 2007
prev sibling parent reply Bill Baxter <dnewsgroup billbaxter.com> writes:
Bruno Medeiros wrote:
 This is the announcement of the first public release of Mmrnmhrm.
 What is Mmrnmhrm? Mmrnmhrm (pronounced mer-nem-herm :P ) is an Eclipse 
 IDE I've been working on, partially based on Descent, and aimed at 
 bringing semantic IDE functionality (such as code completion, find 
 definition, find references, etc.) to D.

What exactly is the relationship with descent? The urls point to descent's Dsource download area, and you say it's based in part on descent, but yet the announcement makes it sound like it is not descent. Is this going to become descent 2.0 or something? Like egcs vs gcc? --bb
Aug 19 2007
parent reply Ary Manzana <ary esperanto.org.ar> writes:
The main difference is that it has a big different point of view in 
developing the IDE. While Descent copies JDT and tries to adapt it from 
Java's logic to D (which can result in being very hard to understand for 
further modifications), Mmrnmhrm is made almost from scratch, reusing 
Descent's ported parser and copying some ideas from JDT, but not just 
copying the source code and changing what's appropriate.

Also, (at least for now) it is more focused on semantic stuff, so it has 
"go to definition" and autocompletion funcionalities, which Descent lacks.

I think it's a great project, and what I think is the greatest thing is 
that Descent and Mmrnmhrm have disjoint funcionalities, so in some point 
they may merge into a single project which has both of the two worlds. 
One other possibility is that any or both projects will be merged into 
one that is based on DLTK ( http://www.eclipse.org/dltk/ ).

Descent sooner or later will have "go to definition" and autocompletion, 
but I'd like to try reusing DMD's semantic code first, which we know 
it's ok (except for some bugs, of course), instead of implementing 
semantic based on the specs like in Mmrnmhrm (this has the disadvantage 
that it may have more bugs, but the advantage that is not so 
compiler-oriented, so it's easier to understand). As you see, there are 
a lot of points in consideration for implementing a D IDE.

Bill Baxter escribió:
 Bruno Medeiros wrote:
 This is the announcement of the first public release of Mmrnmhrm.
 What is Mmrnmhrm? Mmrnmhrm (pronounced mer-nem-herm :P ) is an Eclipse 
 IDE I've been working on, partially based on Descent, and aimed at 
 bringing semantic IDE functionality (such as code completion, find 
 definition, find references, etc.) to D.

What exactly is the relationship with descent? The urls point to descent's Dsource download area, and you say it's based in part on descent, but yet the announcement makes it sound like it is not descent. Is this going to become descent 2.0 or something? Like egcs vs gcc? --bb

Aug 19 2007
parent reply Bruno Medeiros <brunodomedeiros+spam com.gmail> writes:
 Bill Baxter escribió:
 Bruno Medeiros wrote:
 This is the announcement of the first public release of Mmrnmhrm.
 What is Mmrnmhrm? Mmrnmhrm (pronounced mer-nem-herm :P ) is an
 Eclipse IDE I've been working on, partially based on Descent, and
 aimed at bringing semantic IDE functionality (such as code
 completion, find definition, find references, etc.) to D.

What exactly is the relationship with descent? The urls point to descent's Dsource download area, and you say it's based in part on descent, but yet the announcement makes it sound like it is not descent. Is this going to become descent 2.0 or something? Like egcs vs gcc? --bb


Hum, yes, I should have clarified that a bit in my announcement, (even though of that info is in the Descent forums). Ary explained it well, so let just add: Ary Manzana wrote:
 The main difference is that it has a big different point of view in 
 developing the IDE. While Descent copies JDT and tries to adapt it from 
 Java's logic to D (which can result in being very hard to understand for 
 further modifications), Mmrnmhrm is made almost from scratch, reusing 
 Descent's ported parser and copying some ideas from JDT, but not just 
 copying the source code and changing what's appropriate.
 

That's correct, but for the record, another of the reasons it's made from scratch (except for the ported DMD parser), is because this is my MSc. thesis work, and my thesis professor advised me to have a body of work that would work standalone, and that was done in it's majority by me (or at least that it's dependencies were below (the parser), and not up).
 Also, (at least for now) it is more focused on semantic stuff, so it has 
 "go to definition" and autocompletion funcionalities, which Descent lacks.
 
 I think it's a great project, and what I think is the greatest thing is 
 that Descent and Mmrnmhrm have disjoint funcionalities, so in some point 
 they may merge into a single project which has both of the two worlds. 
 One other possibility is that any or both projects will be merged into 
 one that is based on DLTK ( http://www.eclipse.org/dltk/ ).
 
 Descent sooner or later will have "go to definition" and autocompletion, 
 but I'd like to try reusing DMD's semantic code first, which we know 
 it's ok (except for some bugs, of course), instead of implementing 
 semantic based on the specs like in Mmrnmhrm (this has the disadvantage 
 that it may have more bugs, but the advantage that is not so 
 compiler-oriented, so it's easier to understand). As you see, there are 
 a lot of points in consideration for implementing a D IDE.
 

It would be nice to have DMD's semantic analysis available in the IDE, for example, by having semantic errors highlighted without having to compile externally. However, I think trying to do any semantic feature that isn't already exactly supported by DMD (like find-ref), will require understanding and subsequent modification/use of DMD semantic code. However I find that Walter's code is very unstructured and user-unfriendly (to put it in nice terms ;p), and trying to use it in it's original form for IDE features is not the best approach. That's why in Mmrnmhrm/dtool DMD's AST is converted to a different, more structured AST hierarchy. For example, in Mmrnmhrm's editor hyperlinking, how does it know how to underline the element under the mouse cursor or not? It simply finds the ASTNode in the cursor's text offset, and then checks to see if that node is an instance of a Reference class. That's 2-3 lines of code. How would one do that in DMD's AST, without having both false positives (selecting non-references) and false negatives (not selecting references), I ask? Anyone is welcome to answer, including Walter. ;) Ary, if you're still interested in that avenue, don't forget you can reuse Mmrnmhrm find-ref test cases :) -- Bruno Medeiros - MSc in CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Aug 20 2007
parent reply Robert Fraser <fraserofthenight gmail.com> writes:
Bruno Medeiros Wrote:

 It would be nice to have DMD's semantic analysis available in the IDE, 
 for example, by having semantic errors highlighted without having to 
 compile externally.
 However, I think trying to do any semantic feature that isn't already 
 exactly supported by DMD (like find-ref), will require understanding and 
 subsequent modification/use of DMD semantic code.

One of the main reasons I think that having DMD's semantic code available will, in the end, be a boon, is template and mixin code. It's impossible to bind every symbol reference without expanding mixins and templates (which may require CTFE). I think reusing DMD's code here might work better than reinventing the wheel, especially as it'll pick up bug fixes, etc. However I find that
 Walter's code is very unstructured and user-unfriendly (to put it in 
 nice terms ;p), and trying to use it in it's original form for IDE 
 features is not the best approach.

It wasn't meant for extensibility or user consumption at all. But the gotos and #defines are making me very sad ;(. That's why in Mmrnmhrm/dtool DMD's
 AST is converted to a different, more structured AST hierarchy.
 For example, in Mmrnmhrm's editor hyperlinking, how does it know how to 
 underline the element under the mouse cursor or not? It simply finds the 
 ASTNode in the cursor's text offset, and then checks to see if that node 
 is an instance of a Reference class. That's 2-3 lines of code. How would 
 one do that in DMD's AST, without having both false positives (selecting 
 non-references) and false negatives (not selecting references), I ask? 

Well, the descent AST is (as far as I gather it, I've just inherited the semantic stuff from Ary), a slightly modifided version that does indeed have source positions and is able to figure out what token is under the cursor.
 Anyone is welcome to answer, including Walter. ;)
 Ary, if you're still interested in that avenue, don't forget you can 
 reuse Mmrnmhrm find-ref test cases :)
 

Anyways, it appears that the eclipse IDE front is evolving quickly, so all of you who like descent or =~ m/m\w*m/i should look forward to some impressively-featured IDEs within the next year.
Aug 20 2007
next sibling parent Ary Manzana <ary esperanto.org.ar> writes:
Robert Fraser escribió:
 Bruno Medeiros Wrote:
 
 It would be nice to have DMD's semantic analysis available in the IDE, 
 for example, by having semantic errors highlighted without having to 
 compile externally.
 However, I think trying to do any semantic feature that isn't already 
 exactly supported by DMD (like find-ref), will require understanding and 
 subsequent modification/use of DMD semantic code.

One of the main reasons I think that having DMD's semantic code available will, in the end, be a boon, is template and mixin code. It's impossible to bind every symbol reference without expanding mixins and templates (which may require CTFE). I think reusing DMD's code here might work better than reinventing the wheel, especially as it'll pick up bug fixes, etc.

That's exactly why I'm betting on DMD's semantic code.
 
  However I find that 
 Walter's code is very unstructured and user-unfriendly (to put it in 
 nice terms ;p), and trying to use it in it's original form for IDE 
 features is not the best approach.

It wasn't meant for extensibility or user consumption at all. But the gotos and #defines are making me very sad ;(.

It's amazing the number of gotos Walter uses. But, amazingly, all of them just are for one reason: not to duplicate (even a single line of) code.
 
  That's why in Mmrnmhrm/dtool DMD's 
 AST is converted to a different, more structured AST hierarchy.
 For example, in Mmrnmhrm's editor hyperlinking, how does it know how to 
 underline the element under the mouse cursor or not? It simply finds the 
 ASTNode in the cursor's text offset, and then checks to see if that node 
 is an instance of a Reference class. That's 2-3 lines of code. How would 
 one do that in DMD's AST, without having both false positives (selecting 
 non-references) and false negatives (not selecting references), I ask? 

Well, the descent AST is (as far as I gather it, I've just inherited the semantic stuff from Ary), a slightly modifided version that does indeed have source positions and is able to figure out what token is under the cursor.

I think he ment the Reference class.
Aug 20 2007
prev sibling parent reply Ingo Oeser <ioe-news rameria.de> writes:
Robert Fraser wrote:

 Bruno Medeiros Wrote:
 However I find that
 Walter's code is very unstructured and user-unfriendly (to put it in
 nice terms ;p), and trying to use it in it's original form for IDE
 features is not the best approach.

It wasn't meant for extensibility or user consumption at all. But the gotos and #defines are making me very sad ;(.

The gotos are OK, since they are usually forward, which reduces code duplication. I will always favour goto over code duplication. So I had no problems following the DMD-FE here (1.020). But those big monster functions scare me much more. Many other projects in the D community have the same problem. Maybe screens with 1000 lines or editors with lots of folding are common, so people don't notice :-/ Many switch statements used could be separated into module local (e.g. static) functions/methods. The code reuse could happen with many smaller functions (e.g. each implementing a case) then. But maybe some non-gcc compilers used are bad at inlining. This is very hard to do with C++ classes, but more easy with D or plain C. static retval_t special_case(context_t context, params...) { /* handle complex special case with about 10-30 lines */ } retval_t big_red_switch(params...) { context_t context; foreach(param in params) { switch (param) { case easy_one: return foo; case easy_two: context.bar = param; context.boo = xyz; break; case hard_one: context.bar = special_case(context, param, xyz); break; case hard_two: context.bar = special_case(context, param + 3, xizzy); break; default: break; } } } Important: special_case() is module local, invisible outside and may therefore be inlined by the compiler at will. But defining new methods in C++ is quite a churn and I'm happy, that D makes that easy be doing it directly in the class scope. Best Regards Ingo Oeser
Aug 21 2007
parent reply BCS <BCS pathlink.com> writes:
Ingo Oeser wrote:
Many switch statements used could be separated into module local
 (e.g. static) functions/methods. The code reuse could happen with many
 smaller functions (e.g. each implementing a case) then. But maybe some
 non-gcc compilers used are bad at inlining.
 
 This is very hard to do with C++ classes, but more easy with D or plain C.
 
 static retval_t special_case(context_t context, params...)
 {
         /* handle complex special case with about 10-30 lines */
 }
 
 retval_t big_red_switch(params...)
 {
         context_t context;
         foreach(param in params)
         {
                 switch (param)
                 {
                 case easy_one:
                         return foo;
                 case easy_two:
                         context.bar = param;
                         context.boo = xyz;
                         break;
                 case hard_one:
                         context.bar = special_case(context, param, xyz);
                         break;
                 case hard_two:
                         context.bar = special_case(context, param + 3, xizzy);
                         break;
 
                 default:
                         break;
                 }
         }
 }

funny I known a guy who, in c#, has taken to writing function as class constructors so that he can have "nested" functions. Sounds a lot like what you are suggesting.
Aug 21 2007
parent Ingo Oeser <ioe-news rameria.de> writes:
BCS wrote:

 funny I known a guy who, in c#, has taken to writing function as class
 constructors so that he can have "nested" functions. Sounds a lot like
 what you are suggesting.

That is very creative :-) Question is: Can the C++ compiler inline them, if that is feasable? If yes, please post examples and if Walter likes it, I can send patches :-) Best Regards Ingo Oeser
Aug 21 2007