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

Make it build with Melange #293

Merged
merged 5 commits into from
May 25, 2021
Merged

Conversation

anmonteiro
Copy link
Contributor

This sets up a build with Melange.

  • af208e5 just sets up dependencies (upgrades bisect_ppx to get ppxlib support, upgrades bastet to 2.0)
  • b7fcc55 makes the project build with Melange:
    1. disables warning 60 (unused module) – there were some of these in functor arguments; OCaml 4.12 started to emit some more of these warnings
    2. removes \ (backslash) escapes in the bsconfig.json arguments to bisect_ppx. Dune treats \ as a first class citizen, so these escapes aren't needed.
    3. Renames <#> (flipMap) to <$$>: OCaml 4.12 apparently disallows any infix operator that has # in its name. I chose <$$> randomly, and I'm not aware of any conventions for flipMap. Suggestions appreciated for a better name here.

@mlms13
Copy link
Member

mlms13 commented Mar 28, 2021

Thanks so much for doing this! I was just reaching out to @johnhaley81 to see if there was anything I could do to help this effort, and it looks like it's done! I should be able to review sometime over the next few days (definitely feel free to ping me on Discord if I don't by next weekend).

For the flipMap infix, it looks like Bastet uses <@>. I don't have a strong preference, but maybe we could do the same for consistency.

@anmonteiro
Copy link
Contributor Author

Thanks @mlms13!

I thought about <@> too, but sounds like it's taken by flap

@anmonteiro
Copy link
Contributor Author

anmonteiro commented Mar 28, 2021

Do you have thoughts on CI? Should I try to set up a build with both ReScript and Melange, or just one of them?

Can be a separate PR too.

Copy link
Member

@andywhite37 andywhite37 left a comment

Choose a reason for hiding this comment

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

This all looks good to me! Thanks for doing the work to get this upgraded - long live melange! As far as CI build - if you wanted to submit a build for melange that would be appreciated - I haven't really kept up with how that would be done in these different ecosystems. We can also check out how it's done in other projects if you know of any we could copy.

I'm fine with <$$> - I think <#> was somewhat arbitrary too. I'll let @mlms13 take a look too before we merge.

@mlms13
Copy link
Member

mlms13 commented Mar 29, 2021

I thought about <@> too, but sounds like it's taken by flap

Ah yeah, good call. I think we maybe picked <#> because that's what Purescript does. Purescript uses <@> for flap, which is probably where we got that one too, so I guess we should leave that one unchanged. Since <#> is no longer an option, I don't really have much of a preference; <$$> is good with me.

Do you have thoughts on CI?

I think CI was broken for other reasons before this PR. Specifically, I think the OCaml base image we were using for the Giuthub Actions went away, and we couldn't switch to the better-supported OCaml image because it didn't support 4.06. But now we should be able to use a good OCaml version, so that's awesome! 🤗 No need to make that change as part of this PR, though... CI fixes can be tackled separately.

Copy link
Member

@mlms13 mlms13 left a comment

Choose a reason for hiding this comment

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

A couple super minor comments, but overall, this looks really great and basically ready to merge.

Since this opens us up to supporting newer OCaml features that will be incompatible with the Rescript compiler (specifically looking at you, letops), we probably want to have a conversation about how we want to manage versions from here on out. Maybe we make a 1.0 release that is the final Relude release to officially work with the Rescript compiler, then we turn our attention to a 2.0 branch that leverages some of the newer OCaml goodies.

But it looks like this PR probably still works with the Rescript compiler, so we might not need to make that call right now.

__tests__/extensions/Relude_Extensions_Ord_test.re Outdated Show resolved Hide resolved
__tests__/js/Relude_Js_Json_test.re Outdated Show resolved Hide resolved
@anmonteiro
Copy link
Contributor Author

Just fixed the code review items, thanks for the review all!

@mlms13
Copy link
Member

mlms13 commented May 25, 2021

Oops, we never merged this! Let's party, yeah?!

@mlms13 mlms13 merged commit a6e44ea into reazen:master May 25, 2021
@anmonteiro anmonteiro deleted the anmonteiro/melange branch May 26, 2021 20:07
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.

3 participants