This strategy is time-honored in the Lisp world, where making a language and writing a program are more intertwined, and the cost of making a language much lower, than they usually are.
This strategy is time-honored in the Lisp world, where making a language and writing a program are more intertwined, and the cost of making a language much lower, than they usually are.
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.
> 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 }
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.
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...
It's fairly trivial to expose C++ libraries to any other language context, IFF the library is wrapped to a DLL that respects the C ABI. The reverse is not true. You need to have some message passing mechanism in that case (yes, there are several not-so-hard ways to do that but that again, is added complexity).
Yes, and building a library (a DSL) in an existing powerful language that can do it (and there are many as people said in this thread) for exactly what you need, is _vastly_ simpler than making a new language toolchain (which linker? which codegen? which typing?).
A stack based language like forth would be even less work.
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
(Lisp) "dialect" seems to refer to a particular implementation/variant of Lisp, e.g. CommonLisp, Scheme, Racket, Clojure, MacLisp, NewLisp, etc. rather than a domain-specific language built in a Lisp.
(e.g. searching for "lisp dialect" gives pages like https://www.slant.co/topics/5928/~lisp-dialects )
Also, once you understand the problem space well enough, a custom syntax can be a nice bonus.
I don't how many other languages started like that. PHP for one. Probably a lot.
http://www.math.bas.bg/softeng/bantchev/place/erlang/a-histo...
Erlang is still a niche.
Both are examples of confirmation bias. There is a massive graveyard of one-man languages that no one used and then died.
The genius of PHP was in the code delivery model and the way you could intermix HTML and code in a single page to be served by Apache.
That democratized Web programming and programming at large. The rest of the language was bad, but it didn't matter for success (see "worse is better", where "better" means fitter for the market).
I wish programming languages made a type-level distinction between strings that are and aren't tainted by user input. That would make it so much harder to accidentally introduce injection vectors.
I totally agree that PHP was not well suited for writing large and complex programs, but its ubiquitous availability as a deployment platform made it an interesting target anyway.
The easy deployment also made it easy for people to learn it by themselves, and consequently there was a large pool of programmers who knew PHP, making it an interesting language from a hiring point of view.
And that's how we ended up with piles of crappy, proprietary and OSS PHP code in the wild. The quality of the language is only a minor factor its success.
This is an important point that is still underappreciated even today with all of our hindsight.
I was just trying to think of (well-known) languages written that way. I guess there've been just as many dead languages not written with a particular program in mind.
The software ecosystem is not well served by everyone being focused on the same few familiar programming approaches. Sure there are economies of scale—better tooling, programmer fungibility—but there is less intellectual diversity. More people should realize the tradeoffs here: yes you lose a lot when you start making your own language, but you also gain a lot. The program you're trying to write becomes more writeable. If that doesn't sound significant, it's because we're so conditioned to think the other way. There's another advantage, too: it's deeply intellectually rewarding. That provides staying power to work on significant projects over the long haul and is a solid motivation to do something many people think is crazy.
Then it seems that the problem has more to do with political economy than with programmer culture. Capital and managers want programmers to be cogs, not artisans.
Can’t expect programmers to change this political problem, either. Especially considering that the nerdier the technologist, the less political he or she is.
That and Maude is another fascinating language. Pure term re-writing and explicit definitions of all data structures seems almost like a higher level of abstraction or programming.
Processing on the other hand is more of a way for visual people to get into programming and do visual representations of data or art. A matter of fact the demo for V / Volt made me think of Processing and finding out that it can be cross platform made me wish Processing would produce native binaries like this that compile down to very small executables whilst still maintaining the same syntax (which is very Java-like, but not entirely necessary to reproduce a full on Java-like language for this purpose).
I totally agree, for certain projects it makes a lot of sense to build your own language. I wish those mainstream engines would stop embedding C# (and I love C#) and make something much more creative. There's the not-so-mainstream engines out there too that do implement their own languages like GameMaker and friends. DarkBasic also comes to mind.
Not sure about “one”, though, Usually you want more than one example before you generalize to a library -> framework -> language.
As one of my professors used to say (a lot):
“Man kann nur von etwas abstrahieren das man verstanden hat”
You can only abstract from something you have understood. And premature abstraction is probably one of our biggest problems.
I have this itch that there is an explicit slot in our native language infrastructure for a scripting language that is a bit less clunky than Lua, not so huge as Python, and more ClojureScript like than the other embedded lispies out there, that is trivial to embed, has a fantastic interface to C++ and is utterly pragmatic yet elegant.
A small subset of Python would probably do...
Creating a language is in an orthogonal dimension to the plane that Sapir-Whorf lives on. The realization that you can create and utilize constructed languages, not just the given languages, to solve problems. A computer programming language is a meta-tool, one uses the language to shape and reify ideas. So a computer programmer is a meta-tool user. Someone who creates computer languages is a meta-tool creator. And they are designing an idea that is congruent mathematically, mechanically (can we compute it) and mentally for a human. Maybe my version of the Turing test is, "design me a computer language to represent and solve X"
I find this applies to most development, once you muddy the distinction between program and language you can see how the concept applies to other things - that is, it's a continuum, and artificially and prematurely locking down the design and implementation of a lower level piece before exploring the landscape can hurt... though determining what is "premature" and what is not is of course pure intuition.
One example of this is video game designer and programmer Jonathan Blow, best known for creating the game Braid.
https://en.wikipedia.org/wiki/Braid_(video_game)
He's working on a language for writing games.
https://www.gamesindustry.biz/articles/2018-07-02-jonathan-b...
https://www.reddit.com/r/programming/comments/7okvam/jai_lan...
https://www.reddit.com/r/programming/comments/8ywd77/gamelab...
https://www.reddit.com/r/programming/comments/89209l/jonatha...
Here is one of many videos of him using the language:
https://www.youtube.com/watch?v=AAFkdrP1CHQ
A couple of moments in that video which I would like to highlight:
At 11:15, responding to a question from chat:
> Is there a specific reason the game is kind of in top-down 3D?
> Because that is what helps the game mechanics that we need for this game. If it was in first-person (laughs)... it would be kind of amusing... maybe we should do that (smiles) that'd be fun.
At 14:05, responding to another question from chat:
> Do I find the language scaling, well, now that I am dealing with a more complex program?
> Yes. I've been dealing with a program this complicated for like five or six months so this is nothing new.
At 14:15, responding to another question from chat:
> Do I have my own shader language?
> No, right now we are using OpenGL and [unintelligible] GLSL.
The answer to this third question indicates to me that he is focusing on getting something that works better for him than pre-existing alternatives without getting bogged down too much that every side of his language needs to be perfect right off the bat.
In other words, he is balancing the time to perfect his language against the time he wants to spend making games rather than spending 100% of his time working on the tooling and not getting to write any games.
He made Game Oriented Object Lisp (GOOL) for himself and the other people at Naughty Dog to use when making Crash Bandicoot for the original PlayStation.
He later made another language, Game Oriented Assembly Lisp (GOAL), for the Naughty Dog game Jak and Daxter: The Precursor Legacy for the PS2.
https://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp
He has written a series of articles about the making of Crash Bandicoot on his website. Well worth a read!
However Jon Blow's successful games, Braid and the Witness, were not written with that new language.
Until he open sources the code (or at least lets someone else try it/look at it) discussing his “language” is giving him too much credit.
Interesting, yes. More productive, not sure.
It's basically quality versus quantity, or in the words of Stalin: "quantity has a quality all its own".
So far scaling horizontally (more people working together) seems to fare far better than faring vertically (one or a few people being way more productive alone or in a small group).