Navigation
Search
|
Zig’s lovely syntax
Monday August 11, 2025. 04:50 PM , from OS News
It’s a bit of a silly post, because syntax is the least interesting d detail about the language, but, still, I can’t stop thinking how Zig gets this detail just right for the class of curly-braced languages, and, well, now you’ll have to think about that too.
On the first glance, Zig looks almost exactly like Rust, because Zig borrows from Rust liberally. And I think that Rust has great syntax, considering all the semantics it needs to express (see “Rust’s Ugly Syntax”). But Zig improves on that, mostly by leveraging simpler language semantics, but also through some purely syntactical tasteful decisions. ↫ Alex Kladov Y’all know full well I know very little about programming, so there’s much interesting stuff I can add here. The only slightly related frame of reference I have is how some languages – as in, the ones we speak – have a pleasing grammar or spelling, and how even when you can’t actually speak a language, some of them intrinsically look attractive and pleasing when you see them in written form. I mean, you can’t look at Scottisch Gaelic and not notice it just looks pleasing: Dh’ éirich mi moch air mhaduinn an-dé‘S gun ghearr mi’n ear-thalmhainn do bhrìgh mo sgéilAn dùil gu ‘m faicinn fhéin rùn mo chléibhOch òin gu ‘m faca ‘s a cùl rium féin. ↫ Mo Shùil Ad Dhèidh by Donald MacNicol I have no idea if programmers can look at programming languages the same way, but I’ve often been told there’s more overlap between programming languages and regular language than many people think. As such, it wouldn’t surprise me if some programming languages look really pleasing to programmers, even if they can’t use them because they haven’t really learned them yet.
https://www.osnews.com/story/143030/zigs-lovely-syntax/
|
25 sources
Current Date
Aug, Wed 13 - 20:22 CEST
|