News for hackers. Stuff that matters.

pizza_man

It compiles to QBE IR and optionally C99, there hasn't yet been much focus on optimization of the generated QBE.
Good job. I found that AI wasn't very useful for the self hosting stage, it was good for the initial stage0 compiler written in Rust, but when rewriting stage0 -> stage1 it would just hallucinate language features, so I ended up having to do it myself. It was fun though, since the language is the perfect programming language in my view.
And you're going for the cuckold redditor approach, it's pathetic, and it probably won't work out for you.
The only thing that's poor is you and your comment.
That's exactly what a doom clone is, textured walls, maybe go to your bathroom if you have one and enjoy your doom clone, all of those textured walls.
How about you write Narishma 3D, and then I'll critique that?
Maybe put a question behind the question mark. That's what question marks are for.
It's an arena shooter, its visuals resemble DOOM, thus, I call it a DOOM clone.
which is literally what I said.
The contract system allows for static propagation of trust throughout a program. If some given invariant can be assumed to hold true for the duration of a function, its clearer what can and cant happen (semantically, as opposed to doing try/catch everywhere, and then missing some blindspots, and then adding more try/catch to cover those blindspots, this is actually resolved two-fold in Spectre by using option[T]/result[T, E] on top of the trust/contract system). Moreover, type-level invariants are evaluated at compile time where possible, and non-guarded pre/postconditions are stripped from release builds for performance, meaning you can get the performance of no runtime checks and the safety guarantees (assuming you test before building with --release) provided by contracts.
It couldn't be less relevant. It's noise that distracts from the interesting core of the topic. When I'm reading HN, I don't want a long string of "oh btw theres an account on this website called abc_defg". I doubt it's interesting to anyone with sense.
Why are all of your comments about accounts and post metadata, even where its not relevant?
What a great idea
It's neither. Kind of like your comment, which isn't worth a quarter of the page it's written on.
I'm not really big on blogging, but I'll write a summary of what I did, since this post seems to have gained some attention.

This is a rewrite of an emulator I wrote in Nim called Cemu, you can find the original over at https://gitlab.com/navid-m/cemu, it adds several features to the original version, including CPU speed changing with Y and H keys and a better control mapping, since the CHIP-8 ASDF controls were cumbersome for game ROMs like space invaders. It was also done as a practice to test the language for more practical applications that would involve external C libraries, in this case SDL2.

The rewrite was a good stress test for a few areas of the compiler I hadn’t exercised before, like FFI ergonomics, global handling and tooling ergonomics. Most of the core emulator logic stayed fairly close to the original, though the surrounding infrastructure (input handling, rendering loop, and timing) is cleaner and more robust now.

Overall, it’s still a fairly small project, but it served its purpose well in validating that the language can handle something more substantial, while also exposing a few rough edges that need smoothing out.