HN user

kris-s

620 karma

krisshamloo.com

Posts12
Comments111
View on HN
Advent of Swift 7 months ago

The string processing is powerful, but inconvenient when you want to do things like indexing by offsets or ranges, due to Unicode semantics. (This is probably a good thing in general.)

This is being too generous to Swift's poorly designed String API. The author gets into it immediately after the quote with an Array<Character> workaround, regex issues, and later Substring pain. It's not a fatal flaw, a language backed by one of the richest companies in the world can have few fatal flaws, but AoC in particular shines a light on it.

I really like Swift as an application/games language but I think it unlikely it can ever escape that domain.

In absolute terms the number of people with deep knowledge here is probably higher than it’s ever been. The ratio has changed, which is what I think he’s actually lamenting here. He mentions civil engineering; one thing I find myself often bringing up is that software engineering is a brand new discipline. The operating domain of softare is immense, maybe infinite. So I’m less curmudgeonly than Jon is here, we’ve got a barely century or so of software experience as a species, there’s gonna be slop.

I would not have been as kind to FF7 as this author was. By any modern measure it is a bad game. The raw story material and the character design is fantastic. But the gameplay. The gameplay is so tedious the author couldn’t even continue without modifying the game.

Seems like Jonathan Blow, the creator of Jai, releases a game every decade or so. I wonder if the plan is to release his next game in a couple of years. Presumably it is written in this new language? Maybe the compiler will be released at the same time under the guise of “hey this is so production ready we have already shipped a game with it.”

The author mentions the following:

    fn add(x: Option<i32>, y: Option<i32>) -> Option<i32> {
        if x.is_none() || y.is_none() {
            return None;
        }
        return Some(x.unwrap() + y.unwrap());
    }
    The above looks kind of clunky because of the none checks it needs to perform, and it also sucks that we have to extract values out of both options and construct a new option out of that. However, we can much better than this thanks to Option’s special properties! Here’s what we could do

    fn add(x: Option<i32>, y: Option<i32>) -> Option<i32> {
        x.zip(y).map(|(a, b)| a+b)
    }
Do folks really prefer the latter example? The first one is so clear to me and the second looks inscrutable.

I don't know if I would agree that the final scene is more readable - especially the treasure chest. I can't deny it looks much nicer though! I spent a lot of time tweaking the sprites in my game for readability. I touch on it here [1] but maybe I should do a full tutorial with intermediate steps.

https://smoldungeon.com/design

It's still around in some places, CrossFit gyms still include sit-ups and GHD sit-ups in their programming. But CrossFit and ill-thought movements go hand in hand.

Thanks! Yeah it struggles with periodic functions that are wide. For example it successfully crosses zero with sin(PIxN/5) and delivers reasonable results for sin(PIxN/3). For your specific example you would probably need to provide something like N=1 to N=50.

These ideas extend well beyond the realm of streaming apps too - so much of the software I use day to day is shockingly bad. Far, far too much churn driven from ladder-climbing obsessed middle managers who want rewrites and redesigns and engagement to go up up up.

If you've never tried programming a game I would highly recommend it. There are many aspects that make a game a really interesting challenge: input, rendering, sound, and managing large global mutable state. Ludum Dare is a good excuse to dip your toes in.

and allow genetic algorithms to evolve their own inputs and reward functions on their own

I've been playing with genetic algorithms for years now as a hobby and this type approach was a dead end for me, the GA entities would just "game the system" as it were and would min/max in surprising ways.

My latest genetic algorithm creation https://littlefish.fish has performed far better at pattern recognition than I expected. I really think they've got massive potential.