octalide
Joined 4 years ago
Joined 4 years ago
We're "fast enough" for the time being, but we can always be faster ;)
Thanks for actually reading code :)
LLMs have done a significant amount of the "typing", but I was behind the wheel at every stage of development and wrote almost the entirety of the original compiler designs by hand.
There was no point in development when I said "claude, write me a programming language". I simply would not have been able to finish this project in my lifetime by myself without the assistance of LLMs in both the scale and speed that they can operate as well as using them as an accelerated learning tool for myself. It's been a great boon to this project and I have zero regrets :)
The stdlib has patterns like zig's allocator design as well as Option and Result types that are used frequently through the stdlib itself and other projects written in mach. Achieving safety is very possible, and entirely optional.
Here's an easy comparison list for you. Mach vs:
- C: More modern and consistent syntax with a dramatically simplified tooling system (no 3rd party tooling required out of the box, even for dependencies).
- Go: More control over the "nitty gritty" stuff that go abstracts away too frequently. No garbage collector. Honestly, I love Go and lots of inspiration was taken directly from it, so I have no beef with the language lol.
- Rust: Dramatically simpler language to use. Flat out. Rust's tooling and ecosystem is the best bar none... but then you have to write code in Rust ;)
- Zig: Simpler version of a similar language philosophy, but without the "features" that can often become footguns like the metaprogramming system zig uses for types. Zig is a great example of a language done right, but I do personally feel that it attempts to make some things "do more" than they should. I'm also not a fan of the syntax personally lol
Mach will eventually get to that point for most targets (or as close as possible). I stated 4x slower as the worst case I've observed so far. In some cases, we were only about 1.3x slower which is fantastic IMO.
LLMs were critical for me to be able to do this. I did not understand how compilers worked when I started this project. Once I was able to understand it, having an LLM churn out the enormous amounts of code was the only way for me to ever have been able to practically release a working codebase in a reasonable timeframe. It leaves a bad taste in peoples mouths (even mine), but it's an invaluable tool that simply can't go overlooked these days. To say mach was "vibe coded" is completely incorrect. To say it was largely "implemented" (typed out) by an AI is far closer to reality. I plan to use that tool for the rest of my career.
That's okay if you prefer something else! Mach isn't made to be the "please everyone" language! I'm glad you took the time to check it out and shared your opinion with me :)
The only thing I may consider in the future is something along the lines of a VERY weak macros system, but that's a highly well explored and well known footCANNON that I'm not keen on implementing. I do have designs in mind if it ever becomes an essential, but for the foreseeable future, any sort of metaprogramming is practically off the table.
On safety... That's a big one. I'm absolutely prepared to take smoke for that all day and I know I will be. Memory management is one of those problems that every programmer has to deal with at some point in their career, whether it's fighting a GC, fighting a borrow checker, or fighting poorly written code. I decided to go "back to basics" and encourage programmers to fight their own knowledge of the system and to be more aware of the code they are writing. Yes, that means that it can be more difficult to write code that is... "safe"... but when it comes down to it, Rust and C are both compiled to CPU instructions that have no concept of memory management intrinsically. Taking the load off the developer has the side effect of removing total control with it. In my opinion, it's a situation of throwing the baby out with the bath water for a benefit that can be fully achieved through best practices and proper understanding of the code you're writing. Does that help clarify my stance? I hope it does lol
Glad you took the time to explore the project! Thank you for that!
This entire system was designed by ONLY myself up to this point, so I've effectively had blinders on the entire time. I personally like the drastic simplicity of the language, but if it gets in the way of the majority of the users who want to work with the language, then at a very minimum, a conversation should be had about the pain points. Finding that balance between being appropriately hard-headed and willing to adopt features I may not have originally intended to adopt is a difficult line to balance on.
As a note, I've made some massive upgrades to stability and the release pipeline since this post if you're still interested in the project.