-
Notifications
You must be signed in to change notification settings - Fork 13
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
Included a js_of_ocaml version of superbol in the .vsix #93
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems quite promising. We'll just have to check the impacts on performance (we can see to edit some of the NIST85 sources to check that 😉 — to be configured with dialect = "cobol85"
).
We'll refrain from merging right now, though: I'd rather let drom
continue to automatically manage/generate some of the files edited here.
src/lsp/superbol-free/dune
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please investigate whether that can be achieved via fields of the corresponding package.toml
. Same for superbol_free_lib/dune
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed the drom files. Running drom build
generates a bunch of main.ml
files everywhere tho, not sure what's up about that. Not included in this commit, in spite of drom "helpfully" (not at all) deciding to add its changes to the index.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might depend on drom
's version. I typically use opam exec -- drom project
to generated the files instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I, too, hate the way drom
interacts with git
. (Fabrice mentioned he welcomed PRs on drom
, notably to disable auto-indexing).
package.json
Outdated
"null" | ||
], | ||
"default": null, | ||
"description": "Path to the external `superbol` command. If `null`, use the bundled `superbol-free`." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note this conflicts with pending edits in #72 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in this case there is a dune.drom-tpl
to edit instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a change I made — drom
modified this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw something related to js_of_ocaml
so I though it was edited manually. We should probably check those lines were not introduced on purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should ask @ddeclerck they were introduced in a commit "fix cross-compilation" (09b9ce7)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dune.drom-tpl
is based on https://github.com/OCamlPro/drom-share/blob/master/packages/js_program/dune_
. I had to add it so I could add a missing !(package-dune-stanzas)
(which comes from the package.toml
file and disables compiling the VSCode extension when cross-compiling : js_of_ocaml is neither available nor needed in cross-compilation environments). Obviously, this is a temporary solution ; the template dune file should be modified in the aforementioned drom-share
repository. If someone feels like contributing to drom
.
Makefile.header
Outdated
opam exec -- dune build $(SRCDIR)/$(PROJECT).bc.js --profile=release | ||
mkdir -p _out | ||
$(CP) _build/default/$(SRCDIR)/$(PROJECT).bc.js _out/ | ||
build-release: _out/$(CLIENT_PROJECT).bc.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not _out/$(SERVER_PROJECT).bc.js
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I simply forgot :)
FWIW, I have checked on a bunch of files from NIST85 and the performance difference, if any, is not noticeable on my machine — except that with the This is probably due to tail recursion not being handled properly by |
Yes I just made the same observations… do you think adding some |
As far as I know the |
Ah ok. That was in case that annotation could also be checked by |
|
Marking as draft because it seems I made a mistake somewhere — I thought this was using the bundled |
Several changes done here (at least the parts that change hard-wired entries to variables) seem reasonable in any case. Can those get it with a direct commit/separate PR so that the actual "javascript server" PR will include less changes? |
Labeling this as history. Performance issues with the Javascript+effects version seem to be too hard to deal with at the moment. Another way towards a "pure" web extension could be to compile the LSP server into WASM using |
4f4a4a1
to
077f9f9
Compare
This is a first step towards fixing OCamlPro#76 (but does not entirely fixes it). It avoids the need to install an external superbol executable, and should work on all platforms. The bundled superbol-free.bc.js is used if the option `superbol.path` is set to `null`, which is the new default. Some performance investigation is needed -- if we find out that the js_of_ocaml version is too slow for practical use, we can make this not be the default.
528fdca
to
bf5d33f
Compare
De-historizing after more investigations… |
@@ -47,6 +47,7 @@ install: [ | |||
depends: [ | |||
"ocaml" {>= "4.14.0"} | |||
"dune" {>= "2.8.0"} | |||
"zarith_stubs_js" {>= "0.17"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum… we need to investigate what impact that has. Ideally we'd find a way to avoid this dependency in the opam
file (or have a flag that says the dependency is only valid for js
target — not sure this is doable)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None I think, it only contains a .js
file, so it won't be used unless compiled in JS mode
This is a first step towards fixing #76 (but does not entirely fixes it). It avoids the need to install an external superbol executable, and should work on all platforms.
The bundled superbol-free.bc.js is used if the option
superbol.path
is set tonull
, which is the new default. Some performance investigation is needed -- if we find out that the js_of_ocaml version is too slow for practical use, we can make this not be the default.