953 karma · joined Mar 14, 2021 (5y ago) · 60 submissions
comment 1y ago · link · parent
That may be confusing, but basically `inline` is generating different code for the branches .a and .b, so in those cases the value of `ab` is known at compile time. So, the inner switch is running at compile time too. In the .a branch it just turns into a call to handle_a(), and in the .b branch it turns into a call to handle_b().
comment 1y ago · link · parent
In Zig I can pass an entire struct instance full of config values as a single comptime parameter and thread it anywhere in my program. The big difference here is that when you treat compile-time programming as a "special" thing that is supported completely differently in the language, you need to add these features in a painfully piecemeal way. Whereas if it's just re-using the machinery already in place in your language, these restrictions don't exist and your users don't need to look up what values can be comptime values...they're just another kind of thing I pass to functions, so "of course" I can pass a struct instance.
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
This has been a solitary and largely self-financed effort by Kent over many years. He must feel pretty great to finally see this happen!
comment 3y ago · link · parent
https://www.patreon.com/join/bcachefs
You can do a smaller pledge via the custom pledge button if you want.
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
https://github.com/ziglang/zig/blob/master/lib/std/multi_arr...
comment 4y ago · link · parent
I don't see the tragedy in that. Tracks in the US are privately owned and freight makes them more money than passenger rail. Don't think we'd gain anything by artifically changing that. Even in Europe planes are usually faster and cheaper than rail when traveling between countries.
comment 4y ago · link · parent
I think what we need is to figure out how to combine DataScript with a rules engine. I wrote a rules engine and made a writeup that compares the two together: "Using O'Doyle Rules as a poor man's DataScript" https://github.com/oakes/odoyle-rules/blob/master/bench-src/...
Subscribing to individual entities is nice but with a rules engine you have so much more fine-grained control over your reactions. And with the RETE algorithm this can be done efficiently. Most libraries in this space just ignore it and make their own ad-hoc solution -- an informally-specified, bug-ridden, slow implementation of half of a rules engine.
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
For terminals there is no way to do this. I think we need a new standard to represent terminal interfaces that preserves this info. I have some ideas on how to do this in a backwards compatible way but I'm on my phone at a BBQ right now so I can elaborate later :P
26.
Show HN: Nimwave – build TUIs for the terminal, web, and desktop(github.com ↗)
195 points · by sekao · 4y ago · 13 comments
comment 4y ago · link · parent
comment 4y ago · link · parent
I think the way to get more "timeless" software is to build a platform where the code and the data can be brought offline. PWAs do the first but not the second. The data needs to be in an enduring format like SQLite that can be queried offline. With that kind of system, an app or game (and the accompanying data) could remain usable 20 years from now, long after its author stopped distributing it.