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

Port to OCaml and OPAM #80

Open
bluddy opened this issue Apr 16, 2018 · 9 comments
Open

Port to OCaml and OPAM #80

bluddy opened this issue Apr 16, 2018 · 9 comments

Comments

@bluddy
Copy link

bluddy commented Apr 16, 2018

It'd be lovely to have Reprocessing supported on OCaml proper and installable via OPAM.

It's unlikely js_of_ocaml would be able to handle the webgl stuff, but native should be fine.

@hcarty
Copy link

hcarty commented Apr 16, 2018

jsoo does have at least some webgl support. It includes a demo or few in the source tree. Sadly the rendered docs and hosted demo are currently down due to a host migration.

@bsansouci
Copy link
Collaborator

This is on me I think. We'd need to get bsb-native on OPAM. I have an issue open bsansouci/bsb-native#41 but haven't been prioritizing it because other people have been complaining about things a bit louder than you ;)
I'd love some help with this, as I'm not the most familiar with OPAM.

@bluddy
Copy link
Author

bluddy commented Apr 17, 2018

Any reason why you prefer to go with this approach? Shouldn't it be possible to just add some jbuild files?

@bsansouci
Copy link
Collaborator

@bluddy I think we want to keep the simplicity of the bsb-native setup for reprocessing. That said I’d love to make this available for opam and jbuilder users. I’m working on making bsb-native output the files that jbuilder / ocamlfind can understand :)

@Schmavery
Copy link
Owner

One thing that complicates "just adding some jbuild files" is the use of bsb-specific constructs for cross-compilation.
ex:

#if BSB_BACKEND = "bytecode" then
include Reprocessing_Hotreload_Bytecode
#else
include NoHotreloading
#end

Maybe the jbuild file could copy over some precomputed version of this file but it would be somewhat labour-intensive to get set up everywhere. We used to use a ppx to do this swapping, but ran into issues with it on Windows, plus using the builtin functionality is easier and faster than needing to depend on a ppx.

@bluddy
Copy link
Author

bluddy commented May 22, 2018

The OCaml-y way to accomplish this is using the cppo preprocessor. Files are sometimes given a .cpp.ml extension to indicate that they're using this preprocessor. Dune has a section in the manual describing how to use cppo files.

@bsansouci
Copy link
Collaborator

Yeah this would work, though we'd need to use cppo's syntax, but I think getting bsb-native up on opam will be a better move. Once that's done, it'll be usable from a bsb-native project or a jbuilder project.

@dogfishbar
Copy link

Circling back on this. I'd like to port a variation of the Asai/Uehara OCaml Universe library to run in the browser. I was hoping to layer it on top of Reprocessing. Is anything happening with porting Reprocessing to OCaml? Thanks!

@Schmavery
Copy link
Owner

Schmavery commented Jun 25, 2019

Hey @dogfishbar, thanks for checking in -- to be clear, there's nothing stopping anyone from writing reprocessing apps/libraries in OCaml, the build system handles having .ml or .re files without any extra configuration. This issue is more for mirroring the reprocessing-related npm libraries on opam.

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

5 participants