aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Dumbing it down: How or when to let users interact with DSL? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Dumbing it down: How or when to let users interact with DSL?" Watch "Dumbing it down: How or when to let users interact with DSL?" New topic
Author

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

andrew ennamorato
Ranch Hand

Joined: Oct 03, 2007
Posts: 100
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

Joined: Oct 01, 2001
Posts: 814
    
    3
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


SCJP, SCJD, SCEA 5 "Any sufficiently analyzed magic is indistinguishable from science!" Agatha Heterodyne (Girl Genius)
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Oct 01, 2001
Posts: 814
    
    3
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

Joined: Oct 03, 2007
Posts: 100
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

Joined: Aug 03, 2005
Posts: 166
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 !


A Moment's insight is sometimes worth a Life's experience.
Burk Hufnagel
Ranch Hand

Joined: Oct 01, 2001
Posts: 814
    
    3
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dumbing it down: How or when to let users interact with DSL?
 
Similar Threads
DSL performance
The "Scala Posse"
Creating Domain-Specific and General Programming Languages
Generic vs. DSL
Why DSLs? What will we get out of your book?