Hacker Newsnew | past | comments | ask | show | jobs | submit | octalide's commentslogin

Fantastic stuff! You should join the discord if that's your ballgame. If you DO run into problems, make sure to post an issue or let me know on discord!

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.


Absolutely. We have the ability to match the performance of C very easily in the future. Priority is fleshing out the compilation target backends, but that's coming after.

We're "fast enough" for the time being, but we can always be faster ;)


The performance is definitely something I'm happy with at this early stage. A few optimizations get you a LONG way. I'm glad to hear that you found it easy to read (that was a main goal of the design)!

Thanks for actually reading code :)


Yes LOL. This was a little bit of an oversight on my part from back in the day. Mach can produce MachO binaries (no affiliation) that run on the Mach kernel (no affiliation). I see it as more of a funny coincidence than an impending lawsuit, though. Maybe one day we'll change the name if a single letter ever becomes free XD


Partially, yes, but not in the way you're thinking.

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 :)


Please do! I've barely touched macos since I don't have the ability to properly test it from my end. If you want to take a crack at it, feel free to work on some of the open issues related to it!


To build mach from the archived bootstrap compiler, you need clang. That's it. git to clone the repo and a C compiler. That goes all the way through the self hosted compiler. Mach doesn't rely on LLVM, doesn't link to libc, doesn't use system linkers for object file management, etc. Everything is "in house".


You can shoot your legs all day in mach. There is no such thing as unsafe code, just poorly designed code.

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.


> There is no such thing as unsafe code, just poorly designed code.

It's incorrect. In many programming languages there is a clear separation between safe and unsafe code - via special unsafe blocks or something similar. Languages without such separation are always unsafe or (rarely) always safe.

So, I assume Mach is fully unsafe, like C is.


Not to derail this thread on Mach, which as I stated in another comment has some pretty appealing characteristics for me, but since you’re here and the dev of another ‘low-level’ programming language:

I read through a segment of your language’s docs when it was on the front page a couple of days ago ago. Since you’re talking safety’s is there a link (or just a suggested starting point) to read about Ü’s safety mechanisms and guarantees?

I feel like I sit along a different axis in the safe versus unsafe discourse, so I don’t discount languages like Zig or Mach for not providing opt-out safety for certain areas of concern and I don’t give extra credit to languages like Rust or Ü for having those features. What I am interested in is what choices where made and why, then what do those choices mean for me as a potential user of a language.


Rust have shown that safety can be achieved without sacrificing performance and many other aspects of language design. My language Ü proved this to be true too. So, I now see no reason not to incorporate safety mechanisms into newly-designed programming languages. For me adding no safety mechanisms is like not including safety belts and airbags in a newly-built car. That's why ask the same question again and again under each Show HN post presenting a new language.

> I feel like I sit along a different axis in the safe versus unsafe discourse

I can't believe someone can be neutral in this question. If you do actually write code in unsafe-languages, you are eventually forced to find a fix memory-related bugs and other bugs caused by their unsafety. Maybe you just don't need writing such low-level code and use some high-level language without direct memory access instead?

> what choices where made and why

In many cases there is no answer. My experience shows that many design decisions are made without thinking too long. One often just needs something to work right now rather than spending much time carefully designing each language feature. It's especially true for pretty-young language projects like Mach.


That's a good point. I was thinking about that specific thing this morning (how the documentation doesn't fill it out properly).

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


Thanks! The speed is almost entirely a dramatic optimization difference. From what I can tell, most of that difference comes from vectorization (like you stated) and other things like target-specific machine code optimization happening post-codegen.

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 :)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: