190 karma · joined April 2, 2017
Edit: also, the print stuff, I feel that’s in line with the Zig Zen - make the language simple to understand. Now the print function has a very clear type. Otherwise you need a “smart” print function (like Rust does with a macro or C does with varargs). Easier to understand, not easier to type.
Another upside with Zig coming from the embedded world is Zigs idea of doing async/await - since you define the building blocks yourself, it’s really easy to create an async/await-implementation e.g. on top of epoll, but for those times when your hacking on bare metal, you can just write an implementation which fits that particular hardware. It’s really, really good.
Autoconf often does a good job in having some “—with-libX11=some-path” but sometimes people just do weird stuff with their packages.
But maybe I’m just butthurt from trying to package stuff to nixos and having too many “smart build tools” fail.
* In C, the convention is "move(destination, source)". See memcpy, snprintf, strftime, others, but not all functions follow this convention. PHP is known for having lots of functions in standard library with differing conventions.
* It's easier to tell that "move(from=X, to=Y)" is correct than "move(X, Y)" though?
* I agree with the over-verbosity, but your last point that "annotating your arguments makes your code over-verbose and harder/slower to comprehend; instead, put all these guards and magic in the definition of the function" - isn't that also making your code harder/slower to comprehend, but this time you're putting the mindwork in understanding the function instead?
struct copy_args_s {
char * src;
size_t src#;
char * dest;
size_t dest#;
};
int copy(struct copy_args_s args) {
...
}
int main() {
copy((struct copy_args_s){ .src = "foo", .src_len = 3, .dst = "bar", .dst_len = 3 });
}
Or with some macro magic: struct copy_args_s {
char * src;
size_t src#;
char * dest;
size_t dest#;
};
int copy(struct copy_args_s args) {
...
}
#define copy(...) copy((struct copy_args_s){__VA_ARGS__})
int main() {
copy(.src = "foo", .src_len = 3, .dst = "bar", .dst_len = 3);
}2. We have HEAD, can we do service discovery using HEAD?
3. Why not let a topic be a HTTP URL? “PUB /user/john/position HTTP/1.1\r\ndata...”.
4. Subscription expiration as a way to force subscribers to renew and upon renew get redirected to other servers is pretty cool. NATS has a special message (the INFO message) to do the same, but you might be in the middle of an important request-reply session you don’t want to abort.
5. The authors could have made this protocol very “non-http-ish” by implementing what amounts to Redis but in HTTP. I’m glad they didn’t. This still feels like HTTP, which is great.
right? Seeing as you can git update-ref branches, but you need to git symbolic-ref HEAD.
But seriously, the fact that there is a .gitmodules file lulls you into a sense that that file is "the configuration file". If you don't know about these other files, then it's natural to edit .gitmodules. When you make errors, the fixing those errors are pretty hard. There is no "git submodule remove x" or "git submodule set-url" or "git submodule mv".
For example, do you know how, on the top of your head, to get an existing submodule to track a branch?
How do you think someone who does not quite understand git would do it? Even with a pretty ok understanding of git infernal, you can put yourself deep in the gutter. (case in point, if you enter the submodule directory and push head to a new commit, you can just "git add submodule-directory" to get point the submodule to the new commit. But if you were to change upstream url or branch or something else in the submodule, you're screwed. That's not intuitive by a long shot)
Edit: git submodule sync is not enough by the way... You can fuck up your repo like crazy even if you sync the two configuration files.