Hacker Newsnew | past | comments | ask | show | jobs | submit | ElegantBeef's commentslogin

If you're cheap like me a used Pixel3a is a grand device.


Working on a hot code reloading library for Nim. It's a general solution, but specifically for my game framework.

An example of it in action: https://streamable.com/2mxktc

Source code: https://github.com/beef331/potato


As someone working a TUI game I wanted stuff like this myself so just wrote what I now refer to as a "terminot". Actual shaders and non grid align rendering. Nice to see people attempt to emulate it in a proper terminal emulator.

If anyone is interested in what a terminot does: https://streamable.com/t5kz2y


Hi yes interested, please share more!


There's not much more to share presently. The game presently is very far from having gameplay. The "terminot" part is MIT licensed inside the game repo. The game itself is presently GPL3 licensed.

Small hacking game: https://streamable.com/q840oc

Source: https://github.com/beef331/keyboardwarrior/blob/master/scree...


It does not formally have variadics, but since it has tuples you can have pretend variadic generics.


Again that's this language constraining you to that. With procedure overloading it's not required that you have to have that ugly API. For instance the following is valid Nim:

  type
    Cat = object # these are just 'struct' in a different skin
    Dog = object

  proc greet(c: Cat): string = "Meow"
  proc greet(d: Dog): string = "Bark"

  assert Dog().greet() == "Bark"
  assert Cat().greet() == "Meow"


I use pixie for my game framework. It's used to load textures, layout fonts, and render font atlases. It can be used for generative art but https://github.com/EriKWDev/nanim or sdl2 using renderer's makes more sense as they are gpu accelerated.


They likely read "overloadable enums" and went "Oh Rust calls their tagged unions enums" so assumed all languages did.


Oh, no, I actually misunderstood cobby's complaint: the field names, yes, those still have to be unique. Which is also a bit annoying, though I've seen discussions about changing it.


> It lacks proper sum types

We've talked about this before! You know it has sum types, just not the variation you want.


I know, I know! I do very much like the "type wrapper" approach more than the "object variant" approach.

Perhaps in the future we'll simply have both and have no reason to debate ;-)


> default behaviour is pass by value

Is not exactly true, smaller than 24 bytes is passed by value, the compiler optimizes larger calls and passes by reference implicitly.


For Rust at least one can use https://github.com/arnetheduck/nbindgen


That looks interesting. Unfortunately it looks like it hasn't been updated in a while? Is that because it's complete or a lack of interest?

For example, the approach mentioned at the bottom of the README of integrating via nlvm (https://github.com/arnetheduck/nlvm) sounded great but appears to be unpursued.


that looks interesting, thanks! Did you try it if it delivers on promises? There was not any new commit since 2020 so not sure if the project is stale by now.


I do not use Rust, so sadly I have not.


As a 2-step approach, you could also probably use https://github.com/mozilla/cbindgen and then Nim's native C FFI.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: