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

Installing more modules + separate Dynlink from Toplevellib #5540

Closed
vicuna opened this issue Mar 14, 2012 · 7 comments
Closed

Installing more modules + separate Dynlink from Toplevellib #5540

vicuna opened this issue Mar 14, 2012 · 7 comments

Comments

@vicuna
Copy link

vicuna commented Mar 14, 2012

Original bug ID: 5540
Reporter: @zoggy
Status: acknowledged (set by @protz on 2012-03-29T08:49:00Z)
Resolution: open
Priority: normal
Severity: feature
Version: 4.00.0+dev
Category: toplevel
Monitored by: mehdi @glondu

Bug description

Would it be possible to:

  • install the following modules: Errors, Location
    These are used by Toploop and Topdirs and it would be useful to be able to access the functions in them from third party tools. Moreover, PR please use locations of type Lexing.position in Odoc_info.location #5507 suggest using Location.t through ocamldoc; I would do so if it was possible to access the Location module from custom generators' code.

  • separate dynlink from toplevellib, requiring to link with dynlink.cma when linking with toplevellib.cma ? As it is now, it's impossible to use toplevellib and dynlink in the same executable (core dump or strange behaviour after load through dynlink).

That's all :)

@vicuna
Copy link
Author

vicuna commented Mar 26, 2012

Comment author: @xavierleroy

Installing more of / all of the compiler interfaces is being considered.

For your second wish (dynlink / toplevel compatibility), this raises some non trivial issues. Could you please tell us more about the usage scenario(s) that you have in mind?

@vicuna
Copy link
Author

vicuna commented Mar 26, 2012

Comment author: gerd

In GODI we install the compiler interfaces in a separate directory. This turned out as very helpful - some packages interacting deeply with the compiler can now be built without requiring the full ocaml sources.

I'd suggest to put them simply into a subdir of the stdlib.

@vicuna
Copy link
Author

vicuna commented Mar 27, 2012

Comment author: @zoggy

About dynlink/toplevel compatibility, I encountered the problem twice:

  1. In Chamo: this is a source code editor in ocaml, able to evaluate ocaml code to perform some operations (à la emacs) and able to load plugins, too.
  2. In Stog, a static web site generator, able to evaluate ocaml code and display (or not) the toplevel result, for example to show real examples, tested when the site is compiled; Stog also offers the possibilty to load plugins to define new callbacks associated to some tags.

A workaround exists: in bytecode version, rather than linking with dynlink, I load plugins with Topdirs.load_file. But it complicates the build process.

In native code versions, no problem since toplevellib.cmxa does not exist. Would it be hard to have a native version of the toplevel ?

@vicuna
Copy link
Author

vicuna commented Mar 29, 2012

Comment author: @protz

Moving to acknowledged since we probably want to package the compiler modules somehow.

@vicuna
Copy link
Author

vicuna commented Jul 4, 2012

Comment author: @xavierleroy

First wish (install more of the compiler internals) granted in 4.00.

Second wish (toplevel & dynlink that work together well) needs more work.

@vicuna
Copy link
Author

vicuna commented Jul 9, 2012

Comment author: @bobzhang

another use case for mixing dynlink with toplevellib, is that you can do some compile-time evaluation like D language, that's to say the user can specify which part of the program should be evaluated at compile time.

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

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

No branches or pull requests

1 participant