Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
That being said: I'm on my way to creating something that lets me resolve URLs (for web server routing) completely on the stack!
-
@jestdotty Honestly I am very glad I skipped rust. My least favorite part of c++ by FAR was template classes and when I think of Rust, I just think of being unable to avoid crazy template-like syntax as part of my everyday usage whereas even in c++ I only had like 2 legitimate reasons to make a template.
Zig has a certain beauty about it. They treat classes like first-class citizens. As long as your task can be done at comptime, they allow a squish and soft interpretation of the type system and it's a little wonky at first, but absolutely freeing once you get the hang of it. -
@azuredivay it doesn’t transpile to c. They’re actually, I believe, even looking into ditching LLVM and making something in-house to get even better results.
-
@AlgoRythm Swift is also a great language which lets you compute and synthesize things at compile time.
When the zig-fan youtuber ThePrimeTime first tried Swift, he instantly fell in love with it 😂 -
@retoor in case you wanted to imply that Swift is slow, it isn’t. 🙂
Swift is the awesome looking and lightning fast car. Also quite beginner friendly. More so than C# or Rust for example. -
@retoor the fastest regex engine I have ever used was in Node.JS
There must be years of intense optimization there. Interested in adding that to the benchmark mix. -
@Lensflare I’m glad prime promotes Zig so much. Not only does it get me hype, but it adds recognition to the language.
I found it originally from davepl’s prime number sieve benchmark between every programming language. Zig came ahead of even ASM. -
@retoor I’m not sure about c binary compatibility with node without some sort of binding layer. Never tried.
I believe that the node regex engine is googles RE2 engine based off the knowledge that Google maintains v8. I know the default c++ and even the boost c++ regex engines both are awful. Never tried c regex though. -
@retoor yeah zig and c are best friends whereas rust and c are like mutuals. Not a great look for a machine language IMO
-
@retoor after I finished my HTML parser, I started on a query interpreter a la document.querySelector[All]. At that point I got bored of c++ and state machines.
-
@retoor I used a state machine for both the lexer and parser. It handled self closing tags and was lenient with dirty HTML such as automatically filling in missing end tags. It’s a great project honestly! Too bad I hate c++
-
@retoor the global namespace in c is ten thousand miles long. Zig solved this oh so nicely with its import system.
Though I will admit I am a OOP lover. Inheritance is highly overused but it’s beautiful when used correctly. The rest of OOP kinda sucks though. -
@retoor why do you keep saying that Swift is slow? 🥺
It’s faster than C# because it’s compiled to machine code, not to byte code which is then interpreted. It doesn’t have GC to slow it down and has a lot of value semantic primitives which avoids slow heap allocation. It doesn’t have a notoriously expensive and slow exception mechanism like C# does, because again, value semantics and GC.
It relies on the type system to encode many things right into it at compile time rather than relying on dynamic resolution at compile time which slows C# down.
And it has a macro system which allows code execution at compile time.
It’s a perfect blend of convenient and elegant syntax and high speed that you would only expect from a low level language like C.
Related Rants

I gotta say. Zig generics / comptime code gen remind me of old (pre-prototype) JavaScript code where you construct an object using parameters and return that object to be used as a class (except in this case it's actually turned into a class at comptime instead of an object masquerading as class)
rant
zig