• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
Bartenders:
  • Piet Souris
  • Mikalai Zaikin

DSL vs standard programming language

 
Ranch Hand
Posts: 870
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've heard several speakers at No Fluff Just Stuff conferences recommend creating a DSL to simplify developing applications, and it sounds interesting to me, but I wonder about the practical aspects of it. When does it make sense to create and use a DSL instead of straight java? When new people join the project, they'll probably need to know java as well as learn the DSL -- won't they?

Thanks for your insight into this matter,
Burk
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The most common way of using DSLs in software projects according to my experience is to write most of the code in a general-purpose language like Java and implement one or more little corners using one or more DSLs. In short, it's not an either-or. You typically use both and often more than just one DSL.

And, again, your configuration files can be considered DSLs in their own right...
 
Burk Hufnagel
Ranch Hand
Posts: 870
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Lasse Koskela wrote:The most common way of using DSLs in software projects according to my experience is to write most of the code in a general-purpose language like Java and implement one or more little corners using one or more DSLs. In short, it's not an either-or. You typically use both and often more than just one DSL.



Lasse,
My concern is that while a DSL should make it easier to write the code for that project, it means that in addition to learning their way around the project, new team members will also have to learn the DSL - which increases the time before they'll be affective. And if there's more than one DSL they don't already know then that time increases again. So it's a trade-off and I'm trying to get a feel for how to decide when it makes sense to build and use a DSL and when it doesn't.

Burk
 
Ranch Hand
Posts: 686
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I always take what the speakers say with a pinch of salt. They always have something new to say! I agree with you Burk to some extent.

I have seen languages customized so much that they developers are so specialized they cannot get jobs further!
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Burk,

Burk Hufnagel wrote:My concern is that while a DSL should make it easier to write the code for that project, it means that in addition to learning their way around the project, new team members will also have to learn the DSL - which increases the time before they'll be affective. And if there's more than one DSL they don't already know then that time increases again. So it's a trade-off and I'm trying to get a feel for how to decide when it makes sense to build and use a DSL and when it doesn't.



Note that it's only the syntax that makes a difference - those new team members will need to learn the same logic by reading Java code any way - and the DSL (assuming it's a good fit/made well) should make grasping the logic easier. So yeah, it's a trade-off between learning the syntax/vocabulary of a DSL and the productivity boost provided by that DSL.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vyas Sanzgiri wrote:I have seen languages customized so much that they developers are so specialized they cannot get jobs further!


Note that DSLs aren't even supposed to be reusable or standardized. At least not as a primary concern. DSLs are supposed to improve productivity.

By the way, if a developer sticks to working with one language for so long and in such a way that he can't get a job elsewhere, is that the language's fault or the developer's?
 
Burk Hufnagel
Ranch Hand
Posts: 870
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Lasse Koskela wrote:Hi Burk,
Note that it's only the syntax that makes a difference - those new team members will need to learn the same logic by reading Java code any way - and the DSL (assuming it's a good fit/made well) should make grasping the logic easier. So yeah, it's a trade-off between learning the syntax/vocabulary of a DSL and the productivity boost provided by that DSL.



I would hope a DSL offers more than just a syntactic difference, otherwise why bother with it at all. My understanding is that using a DSL lets you think in terms of the domain instead of trying to convert domain idioms into a general purpose language.

Burk
 
Burk Hufnagel
Ranch Hand
Posts: 870
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Lasse Koskela wrote:Note that DSLs aren't even supposed to be reusable or standardized. At least not as a primary concern. DSLs are supposed to improve productivity.



I agree with your sentiments, though you should be able to reuse the DSL for other projects in the same domain. And I think that if you understand the domain, the language should be comprehensible otherwise there's something wrong with its design.

Burk
 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Lasse Koskela wrote:
Note that DSLs aren't even supposed to be reusable or standardized. At least not as a primary concern. DSLs are supposed to improve productivity.

By the way, if a developer sticks to working with one language for so long and in such a way that he can't get a job elsewhere, is that the language's fault or the developer's?



I agree to everything you are saying. But that is a big concern. Why would I invent something that will make me redundant?
 
Burk Hufnagel
Ranch Hand
Posts: 870
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vyas Sanzgiri wrote:I agree to everything you are saying. But that is a big concern. Why would I invent something that will make me redundant?



So you can go do something else? <grin>

Seriously, I don't see creating DSLs as making you redundant - I see it as making you more efficient because you spend less time to get the same amount of work done. In this economy, that talent is valuable to an organization - which makes you more valuable to the organization.

Burk
 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Ranch Hand
Posts: 35
Android VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am agree with Vyas Sanzgiri. I am working on DSL since one and a half year. And now I forget some of my java concepts and even syntax and everything. Now I'm afraid of surviving in the market. But after all I can see its a developer's fault. He/she should not stick with DSL for long time. But, still to DSL its..
 
Burk Hufnagel
Ranch Hand
Posts: 870
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dhaval,

That's a trap we as developers can fall in to, but it's not fair to blame the DSL. I've worked for several companies that had their own proprietary language, and the trick I've found is to either be on projects that don't use it or to keep involved in a community (user group) that's focused on a general purpose language like C or Java.

Burk
 
dhaval yoganandi
Ranch Hand
Posts: 35
Android VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Burk Hufnagel wrote:Dhavai,

That's a trap we as developers can fall in to, but it's not fair to blame the DSL. I've worked for several companies that had their own proprietary language, and the trick I've found is to either be on projects that don't use it or to keep involved in a community (user group) that's focused on a general purpose language like C or Java.

Burk



Yes correct.. I am not blaming DSL as it is a good thing from company perspective. And yeah.. its good suggestions to involved in community of general purpose programming language. Thanks for the suggestion Burk..

-Dhaval.
 
Burk Hufnagel
Ranch Hand
Posts: 870
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dhaval,

Sorry about misspelling your name (I went back and edited the post to correct it) I guess I wasn't quite awake when I first replied.

I think DSLs and proprietary languages can be a good thing for a company, but at the same time they definitely have a cost. Other than previous employees, you won;t find people who already know the language you're using so you have to spend the time and money to train each new developer. In addition, some excellent developers won't be interested in the job because the knowledge and skill they gain with the proprietary language is mostly useless to other potential employers. Another concern is that after training your new hire, it may be that they aren't very good with the new language because the programming model just doesn't fit with how they think - though you can probably screen those folks out during the hiring process.

All in all I see it as another trade-off.

Burk
 
dhaval yoganandi
Ranch Hand
Posts: 35
Android VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Burk Hufnagel wrote:Dhaval,

Sorry about misspelling your name (I went back and edited the post to correct it) I guess I wasn't quite awake when I first replied.

I think DSLs and proprietary languages can be a good thing for a company, but at the same time they definitely have a cost. Other than previous employees, you won;t find people who already know the language you're using so you have to spend the time and money to train each new developer. In addition, some excellent developers won't be interested in the job because the knowledge and skill they gain with the proprietary language is mostly useless to other potential employers. Another concern is that after training your new hire, it may be that they aren't very good with the new language because the programming model just doesn't fit with how they think - though you can probably screen those folks out during the hiring process.

All in all I see it as another trade-off.

Burk



No problem about the misspelling of my name.

Absolutely right.. these all are the problems with DSL. And yeah.. if new hired employee leave the job after training, it will be very difficult to get another employee and train him/her. And its totally waste of time and money for company. Then the question is why they prefer DSL ?
 
Burk Hufnagel
Ranch Hand
Posts: 870
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

dhaval yoganandi wrote:Then the question is why they prefer DSL ?



I think it's a language choice - the DSL lets you express what you're application is trying to do very clearly. As an example, some people don;t like Jave because you have to deal with checked exceptions, so instead of just writing the code to deal with a problem, you have to surround it with try/catch/finally blocks which clutter up the screen and can hide what the code is actually doing.

With a DSL your code can look more like high level instructions (validate credit card) instead of a series of instructions that implement the algorithm that validates the credit card. Does that make sense?

Burk
 
dhaval yoganandi
Ranch Hand
Posts: 35
Android VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Burk Hufnagel wrote:

dhaval yoganandi wrote:Then the question is why they prefer DSL ?



Does that make sense?

Burk



Yes it does. But, what about the new features and flexibilities we can get in GPLs? And I think it is very difficult to add new feature,flexibility and performance tuning in DSL architecture, unless and until it is well defined.

GPL = General Purpose Language

- Dhaval.
 
Burk Hufnagel
Ranch Hand
Posts: 870
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

dhaval yoganandi wrote:But, what about the new features and flexibilities we can get in GPLs? And I think it is very difficult to add new feature,flexibility and performance tuning in DSL architecture, unless and until it is well defined.

GPL = General Purpose Language

- Dhaval.



New features in a GPL are great - if you have a use for them. I suspect that you don't need to update DSLs as much because the domain isn't changing that quickly. Remember, a DSL is specific to a particular domain and unless it undergoes an extreme change there probably isn't a need to change the DSL. You might change the underlying implementation to take advantage of some new feature in the GPL it's implemented in, but that shouldn't affect the DSL itself.

Burk
 
Aaaaaand ... we're on the march. Stylin. Get with it tiny ad.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic