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

Migrate from ulex to sedlex #1792

Closed
XVilka opened this issue Jun 26, 2019 · 18 comments · Fixed by #2203
Closed

Migrate from ulex to sedlex #1792

XVilka opened this issue Jun 26, 2019 · 18 comments · Fixed by #2203

Comments

@XVilka
Copy link

XVilka commented Jun 26, 2019

Long story short - ulex is dying, mainstream depends on the camlp4, which is dead, fork depends on the camlp5, which seems dead too. This prevents from porting F* to more modern OCaml versions and dependencies versions.

See these links for more information:

Sedlex is an active maintained project by OCaml community: https://github.com/ocaml-community/sedlex

@catalin-hritcu
Copy link
Member

@ad-l

@catalin-hritcu
Copy link
Member

@avsm also strongly encourages us to get rid of the camlp4 dependency:
ocaml/opam-repository#14377 (comment)

@XVilka
Copy link
Author

XVilka commented Jun 28, 2019

Related also FStarLang/karamel#138

@ad-l
Copy link
Contributor

ad-l commented Jun 28, 2019

We considered moving to sedlex when we first implemented Unicode support but at that time sedlex had significant limitations (in particular whith custom implementations of lexing buffer). I'm happy to have another look and discuss this at the next F* meeting

@XVilka
Copy link
Author

XVilka commented Jul 10, 2019

Note, the Kremlin PR was merged

@XVilka
Copy link
Author

XVilka commented Aug 8, 2019

And the official Camlp4 deprecation announcement: https://discuss.ocaml.org/t/the-end-of-camlp4/4216

@XVilka
Copy link
Author

XVilka commented Sep 12, 2019

Note, that 4.09 release will be ready quite soon, but camlp4 won't be available for that version.

@XVilka
Copy link
Author

XVilka commented Sep 23, 2019

@XVilka
Copy link
Author

XVilka commented Jan 19, 2020

OCaml 4.10 is going to be released soon and the first beta is already available. Obviously, still can't be used with camlp4.

@fangyi-zhou
Copy link
Contributor

Is it being worked on? I can try to submit a PR if that's not the case

@catalin-hritcu
Copy link
Member

@fangyi-zhou I've asked the F* team, and it seems no one is working on this. So patches welcome!

@XVilka
Copy link
Author

XVilka commented Mar 4, 2020

@fangyi-zhou you can use the Kremlin commit as a reference in case there are issues with this task: FStarLang/karamel@4acd7cc

@fangyi-zhou
Copy link
Contributor

It's more complicated than the kremlin commit because there is also the FStar.ULexing module that uses some APIs sedlex doesn't support.
I pushed my progress to https://github.com/fangyi-zhou/FStar/tree/sedlex

@XVilka
Copy link
Author

XVilka commented Mar 6, 2020

@fangyi-zhou depending on what must be enhanced in Sedlex it might be useful to ask its developers or send a pull request https://github.com/ocaml-community/sedlex/issues

@catalin-hritcu
Copy link
Member

Our Homebrew formula's deletion (#1938) is also a consequence of the camlp4/ulex dependency:
Homebrew/homebrew-core#49745

@fangyi-zhou
Copy link
Contributor

Sorry I didn't manage to make a pull request. On a separate note, maybe replace ulex with ulex-camlp5 as a quick workaround?

@XVilka
Copy link
Author

XVilka commented Jun 29, 2020

Quick workarounds tend to stay forever. IMHO, it's better to fix it properly. Nobody will fix ulex bugs in the future, there is no guarantee it will be compatible with the next OCaml version, etc.

@fangyi-zhou
Copy link
Contributor

If you're happy to dig into why sedlex hangs on compilation, I'm happy to make the rest of the changes

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

Successfully merging a pull request may close this issue.

5 participants