-
Notifications
You must be signed in to change notification settings - Fork 416
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
ocamlmktop support? #104
Comments
Would it be possible to just request a toploop target from jbuilder? E.g. |
Could be - although it would be nice for the normal |
jbuilder always creates two targets for executables: To install the byte-code, you can simply add an explicit install stanza, that's what utop does for instance: https://github.com/diml/utop/blob/master/src/top/jbuild#L20. I guess we could have a Regarding adding a stanza for toplevel, I'm not entirely sure. There are many case where you want to create a toplevel-like executable where I guess if this is a recurrent pattern we can add a specific stanza, but in the meantime maybe just an example in the quick-start will do? |
@diml - ah, I hadn't considered doing it via an I agree with you - I think an example solves it (I didn't think to look at utop...). Cases like the one you show are still fine, of course - however, it's possibly still a good aspiration to be able to run ocamlmktop - adding |
Indeed, I clarified this. Detecting that a dependency is not available in native mode would be possible but it'd require more work.
I think ocamlmktop mostly exists for historical reasons, as before the compiler libraries where not distributed. If we added a toplevel stanza, it would be a lot simpler to make it a syntactic sugar for In the meantime I added a |
I'm closing this since there is now enough in jbuilder to define and install toplevels |
I think it is still would be useful to have a command in jbuilder to launch toplevels configured with the right directories. Right now to experiment in REPL I need Instead I think it would be useful just to have Thoughts? |
@andreypopp see #114 |
I'm not sure what the best route for this is - perhaps a
toploop
stanza?For opam-admin.top, I have patched its main module to call
Topmain.main ()
at the end and then simply link withcompiler-libs.toplevel
and add(ocamlc_flags (-linkall)
. Even this approach has problems, as there's no way to indicate to jbuilder that the executable in question must be bytecode (at least for now).The text was updated successfully, but these errors were encountered: