Designing a Language (2017)
I've been playing around with interpreted variants of brainfuck for genetic programming experiments. The intended audience of the language is the evolutionary algorithm, not a human. The central goals are to minimize the size of the search space while still providing enough expressivity to avoid the Turing tarpit scenario (i.e., where we need an infeasible # of cycles to calculate a result).
I've recently found that moving from a linear memory model to a stack-based model creates a dramatic improvement in performance. The program tape is still linear, but the memory is a stack interface. It seems the search space is made prohibitively large by using pointer-based memory access. Stack based makes it a lot easier to stick arbitrary segments of programs together and have meaningful outcomes. Crossover of linear program tapes does not seem practical without constraining the memories in some way like this.
I'm curious if there if any book or blogs that detail the design decisions, or the lack of, for some popular languages, from the perspective of language design and industry usage.
I could and have written a few toy interpreters, but I have no academic or industrial background (on the matter of language design), so it is useful to know why they put some features into a language, and why they don't. It is actually one of the most confusing parts of writing an interpreter for a toy language -- in all of my projects I simply pick a subset of an existing language I know about, e.g. Python or C.
In a similar vein is this 2003 post in an MIT discussion forum by Scott McKay [1].
I'd also highly recommend that anyone interested in this kind of thing listen to all three of the Dynamic Languages Wizards Series panels from 2001: runtime [2], language design [3], and compilation [4]
Note that though these are videos, there isn't that much compelling in the visual portion, you could easily rip them to audio files and lose little.
[1] https://libarynth.org/fifty_questions_for_a_prospective_lang...
[2] https://www.youtube.com/watch?v=4LG-RtcSYUQ
I think you should probably start by asking yourself if you should design a new language. Most new languages fall in the bucket of low value innovation that is instant tech debt for anyone who tries to use it for real
Even the successful ones are often pointless variations on a theme. Ruby, perl & python don't all need to exist for example, as they essentially do the same thing, about as poorly. Now python has won we should just drop the others
https://forum.rescript-lang.org/t/introducing-moonbit-and-a-... I happend to write a post sharing experience in building Rescript and MoonBit language
Related. Others?
So you want to design a programming language (2017) - https://news.ycombinator.com/item?id=30481035 - Feb 2022 (58 comments)
Programming Language Design - https://news.ycombinator.com/item?id=27895124 - July 2021 (1 comment)
That's nice summary of the space and how large it is. My recommendation is to just start with math expression parser and evaluator. You can start with Pratt but I would even recommend going with infix to reverse polish using stack.
Adding construct like IF or variables is naturally next step but you will have code in place and idea where to put it and how approach it.
I learned a lot about JVM runtime, how Zig is parsing itself, how Lua represents values... Too many good rabbit holes to fall in.
> Java and C#, for being enterprisey
I believe there are far more interesting stuff to learn about these languages, like the whole category of runtimes could have been mentioned, which can directly affect the language design itself (e.g. having GC vs some language feature for managing memory, open vs closed world model, having an async feature in the language or let the runtime handle it, etc)
I created this project with the aim of lowering the barrier to entry:
I’m pretty sure that most language designs skip the “formally” part of the cycle suggested in TFA
And that’s probably a good thing.
I started making a language, and I took many shortcuts.
I just parse my language, translate it to C, and use C compiler errors.
I don't add new semantics, I just add many things like strings, map, etc to make it usable and fast.
I don't know if it's a good idea and how difficult this will be.
I’m waiting for a llm focused language. We’re already seeing AI is better with strongly typed languages. If we think about how an agent can ensure correctness as instructed by a human, as the priority, things could get interesting. Question is, will humans actually be able to make sense of it? Do we need to?
Reading the headline my first thought was another kind of language : the linguistic language (English, Spanish, French, Esperanto etc.)
How does one create a new spoken/written language ?
Interesting page. The latest language I designed is an stack based intermediate language for a C compiler. Not realy intended for human usage, but readable in the sense that you can compare it with the original C code.
Nice summary, but in my experience with programming language design the macro usage issues loom large. What about base libraries, use of popular libraries, build tools, performance analysis, debugging, packaging and modularity, and so on. The core design matters and then cascades into all manner of differences.
My understanding after reading many of such posts is the following:
1) You are NOT serious (in effort to be invested, resources, knowledge), then don't do it. 2) You are MEH serious, then probably design some DLC in Lua or similar, will serve your case 99%. 3) You ARE serious, then go for it. Chances are that you might even post it here one day, but also almost no one will ever use it apart from some crazy fans.
What do these languages compile to? What's the build pipeline and runtime context?
No mention of INTERCAL!
This talks about programming language.
Right question is to design own linguistic language common between computer and across human.
I had some thoughts about designing a new language. However it's a huge undertaking and I don't know the answers to some questions:
1. Is there a need for the programming language?
2.If the answer to the previous question is yes, can I find enough people to help and enough resources?
3. If the answer to the previous question is yes, can we release a MVPin a reasonable amount of time?
4. If the answer to the previous question is yes, what is the chance it will gather a reasonable amount of users?
There are literally tons of programming languages that didn't make it. I wouldn't want to waste my and other people resources.
[flagged]
I would like to see Raku (https://raku.org) at least mentioned in the list of languages to be aware of. Why?
Here is a Raku implementation of Brainfuck to whet the appetite https://github.com/alabamenhu/PolyglotBrainfuck/blob/main/li...