5 Replies Last post: Jun 17, 2009 7:57 PM by Hendy Irawan  
Deus  Newbie 12 posts since
Jan 3, 2005
Currently Being Moderated

Jan 3, 2005 4:55 PM

Why always about syntax??

Hi everyone.

I just logged on for the first time, and I'm researching this LOP concept for the last two weeks only, yet, I have some questions, after reading this whole discussion board.

 

One thinking thread in my brain is stuck in the following loop: if DSLs are constructed to serve their purpose and ONLY their purpose (which is reusable), then, their purpose should be strongly narrow, am I right?

 

As opposed to general programming languages, which have broad usages, you wouldn't need such generic representation of the program as text is.

 

So if they are (narrow), then they don't need text representation at all, right? I mean, that can be an option, but mainly, if we stick to narrow DSL, an editor can be, as Sergey said, almost anything.

 

The point is, how big problem would be to learn a DSL, if it has strongly specialised editor just for itself? I mean, wow, it must be a REALLY hard job adapting myself to an editor where I can simply draw an user interface (like in VB) and select events, then attach DSL to event actions and simply write mathematic formula to calculate something. This is the concept Sergey was explaining, I suppose.

 

I understand that the starting point (defining root DSLs) would be time-consuming, but collecting class libraries to suit your needs also is. So there's no difference. Instead of programming class library you do DSL or two, and the next time new problem arise, you construct new DSL out of existing ones.

 

As the time goes, you could construct DSL in hours.

 

As I already wrote an email to Sergey (to which he never replied), I said I develop bussines apps today, but pursue game programming, and I can see a lot potential in LOP, mainly because more work could be redistributed to other working units (ie. leaving definition of physics properties to model designer), but that's only the top of the iceberg.

 

Anyway, I would like some feedback, pointed at the fact that you all stopped at text (cell) editors, and not specialised editors, and continue to argue about learning curve of human-adapted editor.

Maarten Hazewinkel Novice 181 posts since
Feb 19, 2003
Currently Being Moderated
Jan 5, 2005 2:38 PM in response to: Deus
Re: Why always about syntax??

I guess the reason we don't go further than a cell/text editor is familiarity. A cell/text editor is just a short step away from the familiar text editors we use all-day.

 

A second reason is that more specialised editors are harder to create and stand further away from the abstract syntax tree representations. A cell/text based editor is so close to that representations that it could be generated (nearly) automatically.

 

In many DSL applications, more specialised editors will be appropriate (even required) for domain-oriented people to effectively work with the system. Obvious kinds of editors in business situations are data-flow and work-flow types of editors. Many other types of editors will be invented, but they'll have to grow out of applying LOP and DSLs to specific areas, interacting with domain people to find the best representations.

 

We're starting a command-line era of LOP, but already knowning that we'll have to evolve to a GUI era. We just don't know exactly how that GUI is going to look/work. We can think and speculate, but keep in mind that as programmers we have an historical bias towards text-based solutions.

 

Maarten Hazewinkel

Rob Harwood Apprentice 896 posts since
Sep 10, 2002
Currently Being Moderated
Jan 9, 2005 3:03 AM in response to: Deus
Re: Why always about syntax??

The only danger of optimism is disappointment. If you can handle disappointment, and be realistic about the success of new ideas, then optimism is a great thing!

 

Regarding advanced GUIs/editors: We will be developing at least one DSL dedicated to arbitrary GUIs. One idea floating around is a language to represent Model View Controller. We'll be looking closely at Smalltalk, that's for sure!

 

From your comments, I think you would enjoy reading Thomas Kuhn's 'The Structure of Scientific Revolutions'. OOP was a big change when it came about. For you, and for me, it was natural. Read Kuhn to understand why.

 

Regarding typing vs. mouse. I don't think the keyboard is in any danger of extinction! There are many things which the keyboard makes much easier, especially for expert users, which programmers certainly will be, for any software tool. Clicking is good, but many times the keyboard is much faster. Ctrl-Space!!!

Rob Harwood Apprentice 896 posts since
Sep 10, 2002
Currently Being Moderated
Jan 9, 2005 2:52 AM in response to: Maarten Hazewinkel
Re: Why always about syntax??

You are absolutely correct on all the issues, Maarten.

 

One thing I would like to point out is that 'cell-based' editors can be very flexible. Most form-style interfaces (Swing panels, standard Swing controls) can be emulated by using a cell-based editor. If you consider 'configuration' as a special language, for example, IDEA's various configuration settings dialogs, all of these could be emulated with cell-based editors. This opens up a wide range of everyday interfaces that can already be handled by cell-based editors. Advantage: The editor is 'aware' of what you're doing and can help you with various features such as code-completion, etc. Something to think about.

Hendy Irawan Newbie 8 posts since
Jun 16, 2009
Currently Being Moderated
Jun 17, 2009 8:03 PM in response to: Rob Harwood
Re: Extending MPS "editor language" to support graphical visualization & editing

Deus, Maarten, and Rob, I agree with you guys in your unique respective views.

 

Cell-based editors are very flexible, and right now I think it's easy to write many things/models in MPS' "text-based" structured editor.

 

However a graphical editor/visualization is desirable or even necessary in some cases. And I think it's possible by "simply" (it won't be simple) using an extended editor language and implementing it.

 

As the editor right now is visualized based on AST, and the editor for a Concept itself is described using Editor language, then by:

  1. extending the Editor language with new concepts, for example "RadialLayout", "Glyph", "Circle", "Connector" etc.
  2. implementing (visualization, editing, or both) support for those new concepts in the editor implementation

 

it should be possible to do graphical editing.

 

Since the exact same editor is used to edit ConceptDeclaration, Concept Editor, and a model (Concept instance), JetBrains could've provided a "graphical editor" to edit a Concept or a Concept Editor or the other things for us to use. And since we're using the extended editor language to design the editor for our Concept, that means we can use graphical structures in it and therefore, our Models become graphically editable. :-)

 

Please tell me that the above scenario is possible/planned ?

 

Now, when that happens, I sure will want to extract the MPS viewer/editor somewhere else outside MPS. :-D *grin*

More Like This

  • Retrieving data ...