Open bsansouci opened 6 years ago
The same is true for CamlinternalOO
.
Complete error:
[1/1] Building lib.cma
bsb running with pid: 11680
Reloading hotloaded module
ERROR loading plugin: error while linking lib/bs/bytecode/lib.cma.
Reference to undefined global `CamlinternalOO'
I also seem to be getting the Reference to undefined global `CamlinternalOO'
error after adding some code that uses objects. 🤔
Interesting! I had no idea that OCaml wold forgo the OO runtime stuff if no objects were used. I'd recommend not using objects for now while I look into a fix :)
@bsansouci yeah I switched it up and found an alternative way to encapsulate things. I'm pretty new to reasonml, and using objects was probably not the best approach anyways 😅
I wasn't gonna say it, but yeah, you'll get a lot of benefits from using records, functions and modules without the drawbacks of objects. Since you're new too, I think it'll be interesting for you to try these. They've substantially changed the way I code, leading to generally simpler and more robust code overall! But I don't necessarily want to disallow objects because they do have benefits.
I think OCaml/Reason is a great learning tool because it gives you those two options. I'm planning on making two versions of my game - one with objects and one with modules - and then seeing which one works better.
Amazing effort, I'd love to hear how it's going and can offer help for how to shape your game in the functional way. Ping me on discord.
Oh what's the Discord server for this sort of convo?
Just writing this down so we remember to look into it one day. I have a project that uses the
Complex
module and the hotreloading is not liking it. When I runIndexHot
I get a:No idea why because
Complex
should be a module part of the stdlib... But maybe it has some dirty compiler hardcoded hacks to run faster and so you can't dynlink a module that uses Complex