Skip to content

Conversation

@hhugo
Copy link
Member

@hhugo hhugo commented Nov 2, 2022

cc @dbuenzli, in case you want to review

Copy link
Contributor

@dbuenzli dbuenzli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. The convention and mechanics looks good to me. I left a few comments.

@dbuenzli
Copy link
Contributor

dbuenzli commented Nov 2, 2022

One more thing. In case you have a single .js file I think it would be maybe a good idea to suggest calling it runtime.js by convention (or something else but that's what you did in ptime).

@hhugo
Copy link
Member Author

hhugo commented Nov 3, 2022

One more thing. In case you have a single .js file I think it would be maybe a good idea to suggest calling it runtime.js by convention (or something else but that's what you did in ptime).

added

Copy link
Contributor

@dbuenzli dbuenzli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a quick look at the changes it looks mostly ok to me. Thank you.

If you really want to polish I would rather call the runtime-files page, "How to compile a program" and make it centered on that but I guess most people are not interested in the base invocations and the current organisation is enough for build system fiddlers.

Btw. maybe I dreamt but at some point I thought I had bought you into converting the docs to .mld files :-) I still think it would be worthwhile, the docs should show up on ocaml.org (and in odig doc js-of-ocaml-compiler if you are a local documentation addict).

@hhugo
Copy link
Member Author

hhugo commented Nov 3, 2022

If there's no distinction then indeed it may be worth deprecating --toplevel and instruct people to use --dynlink when they want to compile a toplevel or use the Dynlink library (it's not entirely unnatural IIRC ocamlnat uses Dynlink).

I was more tempted to deprecated --dynlink and ask people to use --toplevel. I cannot come up with a good argument either way.

@dbuenzli
Copy link
Contributor

dbuenzli commented Nov 3, 2022

I cannot come up with a good argument either way.

Well you can use Dynlink without using a toplevel no ?

@hhugo
Copy link
Member Author

hhugo commented Nov 3, 2022

I cannot come up with a good argument either way.

Well you can use Dynlink without using a toplevel no ?

And you can use the toplevel without dynlink.

In theory, you're not allowed to use Dynlink inside the toplevel.

Dynlink can only be used if Js_of_ocaml_toplevel is initialized.

@dbuenzli
Copy link
Contributor

dbuenzli commented Nov 3, 2022

And you can use the toplevel without dynlink.

Somehow a #load directive is equivalent to dynlinking a module (I remember thinking when I was working on the library linking proposal that a lot of the bytecode toplevel loading business could likely be made to reuse Dynlink, and IIRC ocamlnat does actually use it).

Dynlink can only be used if Js_of_ocaml_toplevel is initialized.

That looks like a jsoo implementation detail. For me toplevel is really the interactive behaviour so it feels a bit strange to me to use the --toplevel flag if I just want to be able to dynamically load bytecode.

But in any case what do these flags do ? What do they enable ? And do they actually do exactly the same thing ?

Based on these answers maybe we can find a new entirely different technical name and deprecate the other twos if you find neither suitable.

@hhugo
Copy link
Member Author

hhugo commented Nov 4, 2022

If you really want to polish I would rather call the runtime-files page, "How to compile a program" and make it centered on that but I guess most people are not interested in the base invocations and the current organisation is enough for build system fiddlers.

I'd like to restructure the entire doc eventually but will leave the doc as is for now

Btw. maybe I dreamt but at some point I thought I had bought you into converting the docs to .mld files :-) I still think it would be worthwhile, the docs should show up on ocaml.org (and in odig doc js-of-ocaml-compiler if you are a local documentation addict).

I'd like some kind of agreement with other ocsigen devs before. Mostly concerned about the ocsigen.org website.

@hhugo
Copy link
Member Author

hhugo commented Nov 4, 2022

That looks like a jsoo implementation detail. For me toplevel is really the interactive behaviour so it feels a bit strange to me to use the --toplevel flag if I just want to be able to dynamically load bytecode.

But in any case what do these flags do ? What do they enable ? And do they actually do exactly the same thing ?

Based on these answers maybe we can find a new entirely different technical name and deprecate the other twos if you find neither suitable.

Let's move that discussion to #1324

@hhugo hhugo merged commit 1f3ecf6 into master Nov 4, 2022
@hhugo hhugo deleted the doc-meta branch November 4, 2022 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants