dbandstra's comments

dbandstra | 5 years ago | on: Zig in 30 Minutes

I wouldn't call that careless. So far, proposals to extend the for-loop have not passed the cost/benefit test. I think supporting iterators would require something like magic-methods, which so far are not a thing in Zig (language syntax doesn't interact with userland code).

The status quo for iterators is this:

  var it = getSomeIterable();
  while (it.next()) |item| {
      ...
  }
IMO it's "good but not great" (not great because it adds a var and the variable pollutes the outer scope). But the alternative is a bit of a pandora's box.

dbandstra | 5 years ago | on: Zig 0.7.1 Released – 69 bugs fixed

Zig is a lot more complex than C, but I think most of the language complexity came from filling in gaps rather than tacking things on. For example I think they have settled on having no dynamic dispatch feature (interface, trait, virtual method, etc) at the language level. The comptime feature is flexible enough that userland approaches seem to be good enough. I bet a lot of "complexity" in the future will come from competing idioms used in various third party libraries.

dbandstra | 5 years ago | on: Zig 0.7.1 Released – 69 bugs fixed

It's good to see the project soldier forward! Some things I am excited about for the future:

- Continued progress on the new "stage2" compiler, which is written in Zig itself (long promised, work started in earnest I think about six months ago). There will be an optional non-LLVM backend this time, which is good news for build times. Even in debug mode, most of build time currently is spent waiting for LLVM.

- Incremental compilation with live reloading (in-place binary patching). The stage2 compiler is being written with this feature from the start.

- I can't find the link, but I believe the plan for stage1 (the current compiler written in C++, with all its warts) is to simply delete it. Since the new compiler will also support compiling to C, the devs will simply have stage2 compile its own source into C at some point, and that will be the stage1 from that point forward.

dbandstra | 5 years ago | on: New Sauerbraten 2020 Edition Released

It's pretty amazing to see this project still going. I remember Sauerbraten more because of its unique engine. Maps are basically a big octree with something like marching-cubes applied, and can be edited in realtime (and in multiplayer).

The developers have many notable side projects in the gaming space, too. Aardappel has a programming language, Lobster[0]. And eihrul created the ENet library for UDP networking[1]. I think Sauerbraten itself uses ENet.

[0] http://strlen.com/lobster/ [1] http://enet.bespin.org/

dbandstra | 5 years ago | on: Quake's 3-D Engine: The Big Picture by Michael Abrash (2000)

The Quake 1 and 2 model formats were very similar, the interpolation was a rendering feature. After the Quake 1 engine source was released in late 1999 the interpolation was quickly added by fans (although it wasn't as easy as it sounds, as IIRC the original Quake 1 source (not QuakeWorld) didn't track entities across frames on the client-side, so that had to be added first).

The main difference between the two model format was how they encoded vertex coordinates. They both stored X, Y, Z coords as one byte each. But MDL (Quake 1's format) had a uniform scale/offset for transforming these into the final coordinate space, whereas in MD2, each animation frame had its own scale and offset. This seems like an upgrade but when combined with interpolation it could also result in a pretty ugly "vertex swimming" (jiggling) effect when you tried to portray subtle movements, like the idle anims for the player's weapons.

One of the many things I admired from Quake is that there was a pretty uniform scale of detail to everything. There wasn't really anything that had higher polygon detail, texture resolution, or animation rate compared to anything else in the world. Everything looked very solid and consistent because of that. Quantized vertex coords was one of those tricks that seems restrictive but it didn't hurt them with the game they designed

dbandstra | 5 years ago | on: Show HN: Twelve70 - Men's outfit generator and closet management

Cool, I missed that :) The temperature setting does seem to make it stop picking puffy jackets, although it's still coming up with some pretty heavy outfits. I'm sure that's just a matter of simple tweaking.

Will keep an eye on this, it's nice even if it picks some crazy outfits. At least it gets you thinking outside the box.

dbandstra | 5 years ago | on: Show HN: Twelve70 - Men's outfit generator and closet management

This is fun to mess around with. It would be nice if you could select "climate" (like daily weather or even season) as an additional input. It keeps adding puffy vests and jackets over an already warm shirt. Maybe loosen up the top/outerwear distinction? e.g. a flannel shirt could also serve as outerwear.

dbandstra | 5 years ago | on: Custom Allocators Demystified

This is a really nice system. Quake used it back in 1996 to fit the game in 8MB. They called it a "hunk"[0] and it worked pretty much exactly as you said.

The main drawback I find is that you can't use some generic data structure implementations that expect to be able to free memory out of order, unless you're fine with leaking before the final cleanup (if integrated into a generic allocator interface, the "free" method will probably be a no-op). For example, maybe you need a temporary hashmap to help with parsing a text file. It can be interesting to come up with implementations that work without freeing out of order.

Of course, you can always opt to use another, more general purpose allocator, on a block of memory retrieved from the hunk (see Quake's "zones").

[0] https://github.com/id-Software/Quake/blob/master/WinQuake/zo...

dbandstra | 6 years ago | on: Show HN: AI Dungeon 2 – AI-generated text adventure built with 1.5B param GPT-2

I keep getting surreal hells.

First: I see my pregnant sister nearby, I go back to work and then go to sleep. I wake up, and she is standing over my bed. I ask her about the baby, and she says that it's a boy, six months old, and it has the same name as me. I ask if the baby is me, and she says yes. She says she's taking him home. I say goodbye but she doesn't leave. The game then starts just echoing back what I type, until I type "stab sister", to which she replies "---- on me" (censored by the game). I keep trying to type things (scream, rip hair out) but the game starts just giving me fragments of sentences like " on the wall". Then eventually just " !" and then " ". I type "run out of house" and it says "Get out".

Second: A young girl approaches me, and walks past. I get a few lines about how empty the place is, perhaps it's been this way forever, "it would be strange if someone had come here before you". I lie down on the ground. The girl comes back and stares at me. She asks me if I'm a ghost. I look at my hands and they're glowing red hot. "This must be what ghosts feel like". I start to sweat and shake. I dunk my hands in a nearby stream of water, which causes them to become white hot. I scream in pain, and the girl simply smiles at me. She pulls me to her. I push her away. She runs away and comes back singing happily. My hands start to burn again, the girl laughs as I scream. I close my eyes and everything goes black. Then I open my eyes and she's there with a pitchfork. She starts to pull weeds out of my arms(!). She throws me to the ground and laughs. I type a command to fight back and it says that I overpower her, she falls unconscious and I throw her on a horse and "ride off into the night".

dbandstra | 6 years ago | on: Browser extensions are underrated: the promise of hackable software

I think this is a great idea. I maintain a personal extension as well. I've experimented with a few ideas for augmenting browser experience, but so far I'm mostly just hiding obtrusive elements on various websites (mostly by CSS, with some JS where sites obfuscate class names).

Even that would have taken multiple thirdparty extensions to accomplish - and probably would have required giving very broad permissions to them. Worth noting that Stylish, one of the extensions I might have used, was compromised with spyware a few years ago.

As for publishing, I don't publish mine because it forms a kind of personal fingerprint. The more I add to it the more personal it gets. I rather support the idea of everyone having their own custom extension. You can really improve your online quality of life and with the WebExtension API it's pretty painless.

page 1