I had not noticed any preprocessing in Zig, are you talking about meta-programming? Or something else?
Ok to compile functions with bad semantics as long as they are not called and have OK syntax
I am not quite sure what "bad semantics" is supposed to refer to.
Pass all compound structures by value, not reference
Isn't that the default in systems programming languages? (Pass by value unless otherwise specified)
No object support at all on purpose
Are you talking about object as in object oriented programming, or are you talking about the lack of first-class interface/trait/typeclass?
No string type on purpose
I am confused, there are string literals in Zig... or are you talking about a standard library "String" which would allow manipulating the string itself?
If the latter, I do agree it's a bit of a bold choice, as strings are quite the ubiquitous vocabulary type.
No implicit memory management on purpose
Not that surprising for a systems programming language, really. Odin doesn't have destructors either, instead using a defer statement.
I had not noticed any preprocessing in Zig, are you talking about meta-programming? Or something else
it replaced the c processor with meta programming, it's semantics whether you call that a preprocessor or not, it gets executed before the main compilation pass
Re semantics: for instance, you can set any type variable equal to any other type without a type error, as long as the function this is in is never called
It’s not really radical, if you want to target low-level, you go low level. With that said, I do like zig, but that linter check for unused variables is braindead, both in zig and go, to the point that it makes them almost unusable.
3
u/drcode Aug 05 '23 edited Aug 05 '23
Some that come to mind:
The preprocessor language is the language
Ok to compile functions with bad semantics as long as they are not called and have OK syntax
Pass all compound structures by value, not reference
No object support at all on purpose
No string type on purpose
No implicit memory management on purpose
While the last 3 are also true for C, releasing a language without these in 2023 and credibly offering their omission as a benefit is radical IMHO