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

Use Melange #4

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Use Melange #4

wants to merge 7 commits into from

Conversation

jchavarri
Copy link
Member

@jchavarri jchavarri commented Nov 21, 2022

Updates the project to use Melange.

  • tomorrow becomes a "universal" library, shared by native and Melange builds
  • yesterday keeps being interface shared / impl specific, by copying the mli into the specific platform folders
  • date libs is just rearranged to work on both platforms

Besides that:

  • all the npm / js specific stuff is removed
  • esy is replaced with opam

Edited, old description: This PR is an exploration to see if it's possible to use simple copy# rules to share code between Melange and native libraries.

The idea is to put all shared code in a separate folder, and then add rules in the platform specific library like:

(rule
 (target tomorrow.ml)
 (action
  (copy# ./../shared/tomorrow.ml tomorrow.ml)))

One can also copy interfaces in case both implementation libs need to comply with some mli.

The main downsides are:
- boilerplate to create the copying rules
- even if merlin can provide some type information in the shared code if it is built, it is expected to be failing as the cm*s of the modules in the implementation won't be available in the shared folder

@jchavarri jchavarri changed the title Use Melange + copy# for shared code Use Melange Oct 5, 2023
@jchavarri jchavarri requested review from Khady and feihong October 5, 2023 18:12
@jchavarri jchavarri marked this pull request as ready for review October 5, 2023 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant