Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

While I do agree that it is possible to do something like that, I think we can all agree that the following (available in Rust) is soooooo much nicer:

    let stuff = include_bytes!("my.file");


While include_bytes is nice, xxd -i in a makefile is pretty workable solution in the scale of things.


Fair point, however I believe the OP made the game work for many different OSes, and I don't think xxd or Makefiles are the best when you have to deal with Windows (whereas Rust's include_bytes! provides a platform-independent solution).

I had never heard of xxd until your comment though, so thank you very much!


Somehow I'm reminded of the old adage "UNIX is IDE for C"


Now I have to rewrite my arcade game emulator in rust just so I can use that to load rom images...


include_bytes! is for compile-time inclusion of files though, not for runtime.


Yeah but when it only runs 15 games with a max size of 32K... But yeah it makes it non-distributable because it would then include the images.


[flagged]


Please don't comment uncivilly, regardless of what you think of someone else's comment.

https://news.ycombinator.com/newsguidelines.html

https://news.ycombinator.com/newswelcome.html




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

Search: