jeremycw
Joined 12 years ago
Joined 12 years ago
I get that hand rolling assembly is fun but as a theoretical future maintainer I would much prefer C to ASM.
For example:
addr.sin_family = AF_INET;
addr.sin_port = htons(1965);
Could become: addr.sin_family = AF_INET, addr.sin_port = htons(1965);Imagine a scenario where you are testing out a brand new RISC-V development board. The vendor has only provided a C compiler for this board as is often the case. You want to be able to use the zig language to write programs for your new development board but no zig compiler exists for this board yet. That means you need to compile the zig compiler from source. The latest version of the zig compiler is written in zig. Again you don't have a zig compiler so how will you compile the zig compiler from source? You need a way to go from C compiler to Zig compiler. That's what this is describing. It does not make sense to maintain two completely separate versions of the compiler. The "real" one written in Zig and the "bootstrap" one for compiling from C. So the zig source is compiled into WASM and stored in the repo. On a system with only a C compiler this WASM can be ran instead of a native zig binary. The WASM version can then be used to compile an actual native zig binary.
The article starts with examples that just define the state machine by hand. This is a much better approach and scales to larger code much better. You can grep "def start!" and just read what the method does. A state machine DSL is really not providing much value and eventually just gets in the way.
If you naively go about refactoring something like:
POST /users
Thinking all you need to do is match the output of the current request and match the record it makes in the users table you're potentially missing a ton of side effects you didn't even know about.The problem has always been the side effects and until one of these gems can track and compare side effects in an intelligent way I don't see how they are that useful.
Then something like this reminds me that if we as a species were able to unlock the secrets of bio-chemistry (not sure if that's the right term) it would be a game changer unlike any seen so far. And the fact that there is a huge corpus of evidence out there in the world called "life" proving some of the possibilities already gives me hope that while we may never have FTL, the future could still be pretty wild.
Not necessarily. ECS is a local maxima when developing a general purpose game engine. Since it's general purpose it can do nothing more than provide a lowest common denominator interface that can be used to make any game. If you are building a game from scratch why would you limit yourself to a lowest common denominator interface when there's no need? Just write the exact concrete code that needs to be there to solve the problem.
> Our job as engineers is to make software that functions according to some set of desires, and those desires may directly conflict with approaching an optimal transform.
All runtime desires of the software must be encoded in the transform. So no software functionality should get in the way of approaching the optimal transform. What does get in the way of approaching the optimal transform is code organization, architecture and abstraction that is non-essential to performing the transform.
It's that all games essentially (and most software in general) boil down to: transform(input, current_state) -> output, new_state
Then, for some finite set of platforms and hardware there will be an optimal transform to accomplish this and it is our job as engineers to make "the code" approach this optimal transform.
"Alabama prisoners' organs vanish, and there's a whole lot of passing the buck" could easily be "Deceased prisoners' organs taken by University of Alabama against families wishes" but that's not going to get the clicks.