3 ms·
Having @ and .{ } all over the place is hardly lovely, as is having modules like JavaScript's CJS.
by pjmlp 1y ago
Having @ and .{ } all over the place is hardly lovely, as is having modules like JavaScript's CJS.
- Akronymus 1y agoIt's especially bad on a qwertz keyboard as well.
- flohofwoe 1y agoThat's why "real programmers" use English keyboard layout regardless of the physical keyboard ;) Curly brace syntax would never have been invented in Europe (case in point: Python and Pascal).
- Akronymus 1y agoOh for sure. I am using qwerty myself. And my fav language (f#) has relatively few curly braces.
- christophilus 1y agoF# is wonderful. I wish someone would make an F# that compiled as fast as OCaml or Go and which had Go’s standard library and simple tooling.
- pjmlp 1y ago.NET ecosystem is only matched by Java, and Native AOT exists, even if there are some issues with printf, due to its current implementation.
- pjmlp 1y agoReal programmers deliver business value, regardless of what keyboard they have at their disposal. Just like great musicians make the difference in the band, regardless of the instruments scattered around the studio.
- lenkite 1y agoJSON is everywhere nowadays - How can one complain about curly braces {} ? EU programmers would have already mapped {} after their first REST API.
- hinkley 1y agoI’ve been using Dvorak for 28 years and I still fat finger punctuation daily.
- fallow64 1y agoEvery file is an implicit struct, so importing a module is just importing a struct with static members. You can also do something like: ```Point.zig x: i32, y: i32, const Self = @This(); fn add(self: Self, other: Self) Self { // ... } ```
- pjmlp 1y agoYeah, which is basically how requires() kind of works.
- minitech 1y agoThere’s nothing wrong with the CommonJS approach except that it’s not designed for static analysis (and whether that was really an issue is debatable). In Zig, it’s compile-time.
- pjmlp 1y agoFor starters being text based for what is supposed to be a systems language, that should support binary distribution.
- minitech 1y agoSupporting binary distribution seems unrelated to the ways in which it’s “like JavaScript’s CJS”, especially in the context of this post about syntax.
- pjmlp 1y agoNot really, because I expect to also have binary distribution of modules, as in systems languages like Modula-2, Mesa, Object Pascal/Turbo/Delphi, D, Ada,....