SDL in a M1 Mac - can't find dylib

2022-03-09 Thread Ethernaut
I can get it to run by copying to the build folder and renaming (to remove version numbers) each and every .dylib file in use, but there's gotta be a better way...

SDL in a M1 Mac - can't find dylib

2022-03-09 Thread Ethernaut
Thanks, but still doesn't work. The compiler still ignores any path I add. I'm currently setting these environment variables: export PATH=/opt/homebrew/Cellar:/opt/homebrew/lib:$PATH export CPATH=/opt/homebrew/include:$CPATH export LIBRARY_PATH=/opt/homebrew/Cellar:/opt/homeb

SDL in a M1 Mac - can't find dylib

2022-03-08 Thread Ethernaut
(Sorry if this is more of a SDL2/Homebrew question than Nim) Just got my new M1 MacBook pro, Nim is installed (via Homebrew) and seems to be running fine. However, when I try to compile and run anything using SDL2, I get an error saying `"could not load: libSDL2.dylib"`. If I compile with `-d:n

Just open sourced "easyess", an Entity Component System in Nim

2022-03-07 Thread Ethernaut
This is really cool, thanks for sharing! Will dive deeper into it later after work, but how do you handle Scene management? In my current project I opted to keep separate component arrays for each scene, so that entire scenes can be easily cleared and free up memory, but also so that all compon

Variable prints out its type correctly, but can't access members and I can't figure out why

2022-01-14 Thread Ethernaut
This one works! The only difference is this line right before the last block: when owner is ThingContainer: Run The template still automates going through each type index and returning the right thing (in reality there will be dozens of types, so automating this is a

Variable prints out its type correctly, but can't access members and I can't figure out why

2022-01-14 Thread Ethernaut
Thanks for you thoughtful reply! Unfortunately, won't using ref objects also cause the objects to not be stored contiguously in memory anymore? If you look at my obtuse example (sorry!) you'll see that the Container doesn't actually carry the Thing, just a handle to it (it needs to be a handle,

Variable prints out its type correctly, but can't access members and I can't figure out why

2022-01-14 Thread Ethernaut
Sorry, I posted that before your reply was visible! Not on computer now, will take a look a the suggestions tomorrow, thanks!

Variable prints out its type correctly, but can't access members and I can't figure out why

2022-01-14 Thread Ethernaut
I wrote down an approximation of what gets expanded by the template, and I think I get it now let item = thingA_list[7] if item.owner_type == 0: let owner = container_list[item.owner_index] # item is ThingContainer # body echo typeof(owner) ec

Variable prints out its type correctly, but can't access members and I can't figure out why

2022-01-13 Thread Ethernaut
Sorry for how obtuse this code is - it's a minimal repro of the problem that more or less mimics my original project, and I wanted to keep some aspects even if they don't make a whole lot of sense here. I have a series of "Thing" types and a container that stores handles to them (a reference to

Changing a generic return type automatically

2022-01-10 Thread Ethernaut
Thank you so much for the insights! I think most of my difficulties come from how hard it is to shed old habits shaped by dynamic languages. I do love Nim so far, though, despite it being way more complex than I initially assumed. Cheers!

Changing a generic return type automatically

2022-01-09 Thread Ethernaut
Thanks, those options are better than what I had! But now that I think about it, I definitely need some way to decide what to return at runtime. I mean, I don't **_need_** it, but it would be nice to have, and less prone to mistakes since it would be automated. Is there a mechanism to achieve t

Changing a generic return type automatically

2022-01-08 Thread Ethernaut
Hi, this is my first post. I've been learning Nim for about 6 months now. Consider this EXTREMELY SILLY and very dangerous code that casts and returns the correct value from two different sequences, based on an Enum value that acts as a switch: type things = enum word