| ▲ | alex_x 4 hours ago | |||||||
there is not much to brag about yet :'( About a year ago I was curious about building an ECS-based game engine with world simulations like in dwarf fortress, but obviously at much smaller scale while playing Starfield. Something cool started to materialise after tinkering so I thought why not turn it into a space-sim roguelike with a simulated living world. I use swift because it gives me fantastic devex with all its great type inference and macros + raylib gives me cross platform input handling / rendering and window management. C-interop setup is basically instant - you point compiler to c headers and the API becomes immediately visible on swift side As for swift ergonomics, I particularly love that I can now write very readable code, like: > world.addRelation(attacker, Attacks.self, target) > world.addRelation(player, Owns.self, sword) or > for (entity, position) in world.query(Position.self).with(Health.self, Velocity.self).without(Enemy.self) {} | ||||||||
| ▲ | kenshi 3 hours ago | parent | next [-] | |||||||
This sounds cool. You mentioned Swift's macros - would you mind talking a bit how you are using them? | ||||||||
| ||||||||
| ▲ | sivakon 2 hours ago | parent | prev [-] | |||||||
Do you use any bindings or directly use C functions (with a modulemap) in Swift? | ||||||||
| ||||||||