Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotreloading doesn't work with Complex stdlib module #114

Open
bsansouci opened this issue Jul 31, 2018 · 8 comments
Open

Hotreloading doesn't work with Complex stdlib module #114

bsansouci opened this issue Jul 31, 2018 · 8 comments

Comments

@bsansouci
Copy link
Collaborator

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 run IndexHot I get a:

ERROR loading plugin: error while linking lib/bs/bytecode/lib.cma.
Reference to undefined global `Complex'

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

@outkine
Copy link

outkine commented Dec 1, 2018

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'

@jozanza
Copy link

jozanza commented Dec 15, 2018

I also seem to be getting the Reference to undefined global `CamlinternalOO' error after adding some code that uses objects. 🤔

@bsansouci
Copy link
Collaborator Author

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 :)

@jozanza
Copy link

jozanza commented Dec 17, 2018

@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 😅

@bsansouci
Copy link
Collaborator Author

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.

@outkine
Copy link

outkine commented Dec 17, 2018

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.

@bsansouci
Copy link
Collaborator Author

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.

@jozanza
Copy link

jozanza commented Dec 17, 2018

Oh what's the Discord server for this sort of convo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants