• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dumbing it down: How or when to let users interact with DSL?

 
andrew ennamorato
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This thread that was already answered sort of hits on my question, but since part of this is a contest anyway, thought I'd start my own. ;)

I was lucky enough to attend Guillaume Laforge's talk on DSLs at SpringOne in Oct 2009. He talked about developing a DSL intended for scientists and doctors studying malaria medicines and how they interact (or something along those lines). It was really interesting and really gave me a good feel for what a DSL really is.

However, the one thing I struggle with understanding in regards to DSLs is how to put them in the hands of users. I get the idea of writing a DSL so that a developer can make streamlined or more efficient calls in Scala or Groovy or whatever. But IMO, the real power of a DSL is the ability to define something that a non-programmer can use.

Say I have a stock trader as my customer and I want to write a DSL for him. I'd want something like:


But if I were to do that, how would the user interact with it? Would he need to compile it? Or just run it as a script/executable? Hand it off to a development team to execute? Do we need a GUI around it? You don't have to answer each question, but this is where I struggle with the idea of DSLs - how do you make it accessible to non-developers?

Is that something that is covered in the book?
 
Burk Hufnagel
Ranch Hand
Posts: 814
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrew,
I don't know about the book, but you might want to look at FitNesse (http://fitnesse.org/FitNesse.UserGuide.OneMinuteDescription) which is essentially a DSL fur business people to write acceptance tests. It looks like a spreadsheet with inputs and the expected output, and is used by they FIT testing framework to verify that an application works as expected.

I hope this helps,
Burk
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to expose a DSL to the user is completely up to you--it could just be a text snippet stored in a DB, it could be constructed using a GUI, it doesn't matter. The user should not ever need to "compile" anything--and if it's a Groovy/Scala/JRuby/equivalent DSL there'd be no need to anyway.
 
Burk Hufnagel
Ranch Hand
Posts: 814
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David,
I agree. I think that part of the purpose of using a DSL is to make it less like traditional programming and more like explaining how to do something to another person.
Burk
 
andrew ennamorato
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So if a DSL is stored in a DB, or a GUI...how does it get executed? I guess that's my real question.
The user does something - fills out a field in a GUI, types in a text editor, etc. But what happens from there? Do they run the file? Does a developer/programmer need to take their DSL "code" and compile it for them?

I'm wondering what a real-world scenario looks like. For example, I might consider a waiter/waitress' hand written notes to be a DSL. They write down your order, but still hand it off to a cook to be executed. This is the part I am still not clear on.
 
Tauri Valor
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
andrew ennamorato wrote:So if a DSL is stored in a DB, or a GUI...how does it get executed? I guess that's my real question.


I guess it would be something like this:

Waiter takes the order in an spread sheet kind of thing which is better understandable by the waiter and cook as the tokens of the language are more specific to the menu/recipe .. on confirming the order , its stored in the DB, the stored spread sheet appears on the cooks screen... . Data transfer and data storage will be handled internally by the DSL..
just guessing, am I right experts ?

Thanks experts, I hope I will get a clear picture of DSL by end of this week !
 
Burk Hufnagel
Ranch Hand
Posts: 814
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
andrew ennamorato wrote:So if a DSL is stored in a DB, or a GUI...how does it get executed? I guess that's my real question.
The user does something - fills out a field in a GUI, types in a text editor, etc. But what happens from there? Do they run the file? Does a developer/programmer need to take their DSL "code" and compile it for them?

I'm wondering what a real-world scenario looks like. For example, I might consider a waiter/waitress' hand written notes to be a DSL. They write down your order, but still hand it off to a cook to be executed. This is the part I am still not clear on.


Well one of the ways you can create an acceptance test using FITnesse, is to enter input vales and the expected output into what looks like a spreadsheet on a web site (this is done by editing a wiki page). When they submit the page, the values are passed to the FIT testing framework which executes the tests using the supplied values and compares the actual results with the expected ones to determine which tests passed and which ones failed.

I hope that helps,
Burk
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic