by omeid2 · 7y ago · 0 comments
I think one of the issues of Gnome Project is this, they use a language specifically designed for Gnome/GTK+ and as if that was not enough, it has two different syntax, one--Vala which is sort-of-kind-of C#-like and the other being Genie which is sort of kind of python-like.
Only if your language (and standard library) is of comparable complexity to that of widespread languages. C has more quirks than it lets on, C++ is a monstrously complex beast, Java has an enormous standard library…
If however you keep the syntax and semantics of your language simple, they can be learned in a matter of minutes. If you keep the "standard" library focused towards your application, it won't require more effort than any other regular application.
The real problem with custom languages, I think, is that very few programmers can actually write one. Most others don't even see the need, I think in part because of motivated cognition (If I delude myself into thinking I don't need something, I don't have to face the fact that I can't do it). Though the main problem is probably education: we are taught that languages are chosen, not made. As for how they are made… well, that's the realm of geniuses who have way too much time to spare.
Every programmer should have an introduction to programming languages, and we need more specialists who can whip up a DSL in a couple days. Our craft would be very different (and I think much better) if we did that.
Also, once you understand the problem space well enough, a custom syntax can be a nice bonus.
Functional programming, especially Haskell, tends to use the term 'embedded domain-specific language' ( http://wiki.c2.com/?EmbeddedDomainSpecificLanguage )
Lisps tend to call them DSLs or sometimes "mini languages"
Forth calls them "vocabularies"
Couple of other terms i've seen...
* Pidgin - An attempt to get away from DSL ambiguity!
* Slang - This is what Perl6 calls them
Rebol / Red
NB. Here's an old Wikipedia link listing (some) languages that were good for creating dialects (DSLs) - https://web.archive.org/web/20140708161345/http://en.wikiped...
> There's also an option to generate C code to support more platforms and achieve [(possibly)] better performance
Another reason x-compilation to C matters: providing an escape in case the community thins out and no further updates are made on the V lang.
For instance here's what the chicken scheme transpiler outputs when told to compile a simple '(print "Hello, world!")': https://gist.github.com/simias/c96408a76eb7288fbd0d975f5dc99...
Good luck maintaining that...
I suspect you already know this, but for the benefit of others.
fn main() { println('hello world') } ==>
int main() { printf("hello world\n"); return 0 }