Ask HN: Are you writing your own programming language?
LLMs make this more tractable as a one person hobby and I have seen a lot of interesting LLM-driven languages posted here with new ideas, but not all of them in one place? Are you writing one? Are you using actually using it? What are the new ideas you are exploring? It is okay if it is mostly “slop”, I just want to see what people are doing
(
8 comments
| on HN
)
At this point, it's mostly for fun, educational purposes and an attempt to build the smallest, but generally useful language with a good balance of dynamic performance, native code compilation, self hosting and a language that is both easy to learn and easy to understand it's design and implementation.
I call it Mu (µ) lang. You can find it at https://mu-lang.org
I've also experimented with building a full UNIX(ish) OS and Kernel in Mu itself. So that means, about ~2k Assembly, the rest in Mu. It's at about a 80/20 (Mu/Asm) and works fairly well!
So yes, Claude is able to write in Mu quite well -- But this isn't surprising, because I believe large language models sort of settle on the structure and patterns of languages and generalizes fairly well. So this kind of didn't surprise me at all.
If you have a pok around the site, you'll see why. Mu is deliberately very small and minimal. I've also chosen not to implement floating point arithmetic, because I wanted to see if I could get Mu programs to run on micro controllers one day, which many of them don't have FPU(s) -- especially the smaller ones.
Today, with AI and LLMs, creating a language is probably an easier task, but I still think it's smarter to do what I did. Any language you create will necessarily be mediocre and full of bugs. Don't reinvent the wheel.
Additionally, I’ve been really fascinated by the idea of a language that makes LLM observation and rewrites at runtime possible. There is an interface to get profile data and replace functions at runtime based on the analysis of an LLM.
Lastly, I’ve always wanted a language that could model more of the external environment and make those easier/safer to interact with. I think of libraries like Kysely as an example of making that easier. It’s a really cool time to be playing around with these.
—-
I poked around at this idea myself and it is a great idea to try and probably a security nightmare to implement. It also isn’t far off from what the JVM does anyway and would probably not work as well.
I actively use it for most programming, these days (command-line only), and use it every year during Advent of Code.
Theres no need for any data-hazard checks in your code, the compiler will do it for you. If you want an analogy, where "ARC" freed programmers from having to manually manage memory, this is "ARC for algorithms", freeing you from having to care where the code runs.
It measures the computing environment at runtime not compile-time, and its opportunistic, so it will schedule work on the most-efficient worker at any given time - be that single-CPU, multiple-threads on the CPU, SIMD or similar hardware, GPU, multiple GPUs, or across a network via an installed daemon.
Here's some results for single-threaded CPU:
Or, on a Mac M3 Max, looking at GPU vs fastest CPU: The data-parallel sections are automatically detected, I've recently added a C front-end using clang to generate LLVM IR, which is then converted to our IR, which is then parallelised as usual.The language itself is fairly modern (classes, protocols for interfaces, blocks for closures, callbacks, exceptions) and each platform is a cross-compiler for each other platform, so I have a binary on my iPhone which was created, compiled, and signed with my dev-certificate all on a linux box. Works great :)