←back to thread

Things Zig comptime won't do

(matklad.github.io)
458 points JadedBlueEyes | 1 comments | | HN request time: 0s | source
Show context
no_wizard ◴[] No.43744932[source]
I like the Zig language and tooling. I do wish there was a safety mode that give the same guarantees as Rust, but it’s a huge step above C/C++. I am also extremely impressed with the Zig compiler.

Perhaps the safety is the tradeoff with the comparative ease of using the language compared to Rust, but I’d love the best of both worlds if it were possible

replies(5): >>43744960 #>>43745201 #>>43745418 #>>43745573 #>>43749228 #
pjmlp ◴[] No.43749228[source]
Most of Zig's safety was already available in 1978's Modula-2, but apparently languages have to come in curly brackets for adoption.
replies(1): >>43749295 #
chongli ◴[] No.43749295[source]
languages have to come in curly brackets for adoption

Python and Ruby are two very popular counterexamples.

replies(1): >>43749394 #
pjmlp ◴[] No.43749394[source]
Not really, Ruby has plenty of curly brackets, e.g. 5.times { puts "hello!" }.

In both cases, while it wasn't curly brackets that drove their adoption, it was unavoidable frameworks.

Most people only use Ruby when they have Rails projects, and what made Python originally interesting was Zope CMS.

And nowadays AI/ML frameworks, that are actually written in C, C++ and Fortran, making Python relevant because scientists decided on picking Python for their library bindings, it could have been Tcl just as well, as choices go.

So yeah, maybe not always curly brackets, but definitly something that makes it unavoidable, sadly Modula-2 lacked that, an OS vendor pushing it no matter what, FAANG style.

replies(1): >>43752986 #
pklausler ◴[] No.43752986[source]
Which AI/ML frameworks are written in Fortran?
replies(1): >>43753397 #
1. pjmlp ◴[] No.43753397[source]
Probably none, it was more a kind of expression, given the tradition of "Python" libraries, that are actually bindings to C, C++, Fortran libraries.