News for hackers. Stuff that matters.
Re:A Case for a New Language by wwarner on Saturday February 23, 2019 @07:29PM (#19236314)
I'm neither a fan of new languages nor dsl's, so I'm in a minority? Rather than a dsl, I want a great API, and before apis I want compact and expressive utilization of existing apis.
Re:A Case for a New Language by lewisf on Saturday February 23, 2019 @07:45PM (#19236368)
I also agreed with this until very recently. Jumped into a new language and realized how language features can help shape great APIs.
Re:A Case for a New Language by heavenlyblue on Saturday February 23, 2019 @08:28PM (#19236553)
DSL is more like a generalisation of config files.
Re:A Case for a New Language by karmakaze on Sunday February 24, 2019 @10:11AM (#19238820)
Mose DSLs I encounter started as configs and tend to be inelegant because they're incidental rather than planned languages. I applaud thinking in terms of languages up front and exercising restraint to keep it to the bare minimum.
Re:A Case for a New Language by mutagen on Saturday February 23, 2019 @10:27PM (#19236938)
While that is one quite useful application of DSLs, they're certainly used more widely than config files. Care to expand further?
Re:A Case for a New Language by heavenlyblue on Sunday February 24, 2019 @03:14AM (#19237666)
I said "generalisation". You're thinking I mean DSLs in a static way - where they compile to a single static structure that is like a configuration file. I am trying to redefine the term here instead, because it seems more appropriate.

Essentially what I am asking here is: where do we set the line between "scripts" and "configuration files"? Because scripts are simply configuration files with a tree-like structure as they represent programs.

Scripts "configure the execution paths of your program".

A DSL thus is just a configuration file with a set of rules of applying those tree-like structures to each other.

Re:A Case for a New Language by elcomet on Sunday February 24, 2019 @04:47AM (#19237929)
Scripts are definitely not configuration file.

I would say the line is Turing-completeness.

For me, DSL are half way between configuration files and scripts. If they are not Turing complete they are configuration languages. If they are, then they are programming language (with a specific use case).

And I think that it is usually a bad idea to have configuration files in Turing complete languages (with exceptions, it can certainly be done well).

Re:A Case for a New Language by heavenlyblue on Sunday February 24, 2019 @10:24AM (#19238873)
>> Scripts are definitely not configuration file.

>> I would say the line is Turing-completeness.

>> For me, DSL are half way between configuration files and scripts

_you_ would say.

>> If they are not Turing complete they are configuration languages. If they are, then they are programming language (with a specific use case).

Or, you could say that DSLs are what they are: "Domain Specific Languages". Which means that can either be a set of static definitions a-la configuration file, or on another side they can be scripts.

All of these definitions fit really well the meaning of "Domain Specific Language".

Re:A Case for a New Language by geocar on Sunday February 24, 2019 @05:43AM (#19238074)
The decision to bring a new language into the world is not one taken lightly. There are simply too many languages.

DSLs are nonetheless a "necessary" evil; Most languages are too narrow to be useful for everything, so anywhere you see a boundary in your language -- something that might be done better in another -- your code will be shorter, it will be faster, and you will make fewer bugs.

But what if we can create a language with no boundaries? That language would not need a DSL.

Re:A Case for a New Language by dmitriid on Sunday February 24, 2019 @12:49AM (#19237335)
A good API (and the client to that API) is indistinguishable from a DSL

:)

Re:A Case for a New Language by humanrebar on Saturday February 23, 2019 @11:27PM (#19237129)
I think it's worth demonstrating that more pedestrian approaches are insufficient before writing a new language. New languages can be worth the effort, but they are certainly expensive approaches, all things considered.