6 ms·
The downside to this is that unless your language gets widespread adoption, you can corner your community into a bubble and drastically increase the barrier to
by omeid2 8y ago
The downside to this is that unless your language gets widespread adoption, you can corner your community into a bubble and drastically increase the barrier to contribution.
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.
- cies 8y agoFrom the website: > 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.
- simias 8y agoThat depends heavily on what the transpiled C looks like, machine-generated code can be pretty human-unreadable. In particular you generally lose all comments, you can end up with autogenerated variable and function names, huge functions with completely unidiomatic C code etc... For instance here's what the chicken scheme transpiler outputs when told to compile a simple '(print "Hello, world!")': https://gist.github.com/simias/c96408a76eb7288fbd0d975f5dc995fc https://gist.github.com/simias/c96408a76eb7288fbd0d975f5dc99... Good luck maintaining that...
- mrgriffin 8y agoI agree that modifying Chicken's output like you would handwritten C code would be an exercise in madness. But it's possible to design a language to have a nice transpilation story, for example PureScript deliberately puts restrictions on the names of types and operators so that they have a sane name in JS. Of course there's still a likely style mismatch, but what can you do? I suspect you already know this, but for the benefit of others.
- cies 8y agoAnd looking at V, which is the story here, it should not be too obfuscated.
- amedvednikov 8y agoI tried to make resulting C code very readable and simple: fn main() { println('hello world') } ==> int main() { printf("hello world\n"); return 0 }
- loup-vaillant 8y ago> unless your language gets widespread adoption, you can corner your community into a bubble and drastically increase the barrier to contribution. 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.
- andy_ppp 8y agoElixir allows you to build powerful DSLs within the language using macros and optional syntax. Also, if you write CSS well you end up with a DSL describing your screens. What other languages give you this power?
- portroyal 8y agoThe Tool Command Language and Toolkit (Tcl/Tk).
- islon 8y agoAll Lisps and schemes?
- draegtun 8y agoWhat other languages give you this power? 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.wikipedia.org/wiki/Dialecting https://web.archive.org/web/20140708161345/http://en.wikiped...
- floatboth 8y agoGenie seems super dead. Also, Vala is not that important for Gnome. Many apps are written in C, JavaScript, Python and Rust.