4 ms·
There's just one feature Zig lacks, which would have allowed for full automation of interface definitions. In Zig you can programmatically construct data types
by wavemode 1y ago
There's just one feature Zig lacks, which would have allowed for full automation of interface definitions. In Zig you can programmatically construct data types with compile-time programming, but such types aren't allowed to have methods: https://github.com/ziglang/zig/issues/6709 https://github.com/ziglang/zig/issues/6709
This is an intentional limitation, because the language creator worries the feature would be abused.
- hmry 1y agoI strongly dislike "this feature could be abused, so we won't add it" as reasoning for language design decisions. It just doesn't sit right with me. I think designing to avoid "misuse" (i.e. accidentally shooting yourself in the foot) is great, but avoiding "abuse" just reads as imposing your taste onto all users of your language. I don't like this, so nobody should be able to do it. But oh well, if you're using Zig (or any other language using auteur-driven development like Odin or Jai or C3) you've already signed up for only getting the features that the benevolent dictator thinks are useful. You take the good (tightly designed with no feature bloat) and the bad ("I consider this decision unlikely to be reversed").
- deleted 1y ago[deleted]
- esjeon 1y ago> avoiding "abuse" just reads as imposing your taste onto all users of your language. I believe languages are all about bias. A language must represent the preference of the community using it. We should all learn from the case of Lisp, which is the simplest language and likely the most expressible language. The community suffered from the serious fragmentation driven by the sheer simplicity of the language and tons of NIH syndrome. It took them 30 years to get a standard CL, and another 20 years to get a de facto standard package repository (QuickLisp).
- childintime 1y agoPascal was like this. Turbo Pascal was just a plain vanilla Pascal which was deemed sufficient. But when Borland themselves wanted to make a GUI, suddenly there were many language extensions added and Delphi was born. Until then the users weren't taken seriously.