Progress on migrating to Rescript

Hello fellow ReasonML enthusiasts :wave:

I was checking out some of the exercies on this track and noticed that they are still based on BuckleScript which has since rebranded to ReScript back in 2020 :scream_cat:

On GitHub, there are some issues and contributions regarding migrating to ReScript but it seems there hasn’t been much progress on this migration for quite some time.

It’s quite complicated to solve the exercises in this state. As a learner it’s quite hard to depend on the docs from either ReasonML, BuckleScript or Rescript, since the versions are quite outdated.

Is it the intention to continue with the migration to help resolve this situation?
There’s quite a lot of exercises to migrate which would take some effort but maybe could it be better to move to a supported platform?

Also asking first because I see that all open PRs relate to migrating some exercises are still open

Hoping I could help with this effort or any better alternative that could help learners find some reliable way forward.

1 Like

Hello :slight_smile: Thanks for posting!

I’m not sure we have anyone that really knows/can own the ReasonML/Rescript track currently. @BNAndras and @IsaacG have both committed in recent times but I don’t think to any great extent, which is why this is stalled.

If you’d like to take the work on, I’d be happy for you to do so? :slight_smile:

I’ve mostly been doing sporadic maintenance tasks on the track. I wouldn’t even know where to start on continuing the migration unfortunately. That said, I can help out where I can once we start.

1 Like

Thanks for your responses.

I would be happy to dedicate some hours towards this but it’s quite unclear where to start.

It seems the options available are:

  • Compile to JavaScript via ReScript. Basically going ahead with the migration
  • Migrate the build system from Bucklescript to dune, using native OCaml tools and avoiding the compilation to JS. dune is already used in the OCaml track and maybe there’s a chance to reuse even more stuff like the templates / tests?
  • Compile to JavaScript via Melange in combination with dune. Melange supports the ReasonML syntax. No need for migrating everything, probably just the build system and tests.

If I had to choose one I would go for the second option. I’m not sure the compilation to JS is necessary.

Maybe ReScript should be a totally separate track since the languages are now quite different from each other.

Thanks! :slight_smile:

From reading around, this seems to me to be the right approach. They seem to both be active languages. So maybe starting a new track for ReScript would be best?

@ErikSchierboom Do you have any wisdom?

1 Like

I agree that a separate ReScript track is worthwhile.

Switching ReasonML to ReScript in place would break over 2k student solutions. Current students may also want to keep doing ReasonML content instead of ReScript. The most recent exercise completion was this weekend so there’s still ongoing activity on the track.

A separate track for ReScript lets the maintainers start with a blank slate rather than updating things in place. That’d be invaluable and allow them more momentum once the effort gets underway.

However, I think we should take a look at the ReasonML track. If ReScript does takes off, it’ll have maintainers, but ReasonML might not. Are there any changes we could make to that track so it’s easier for us to maintain as a community?

3 Likes

Switching ReasonML to ReScript in place would break over 2k student solutions. Current students may also want to keep doing ReasonML content instead of ReScript.

100% agree

However, I think we should take a look at the ReasonML track. If ReScript does takes off, it’ll have maintainers, but ReasonML might not. Are there any changes we could make to that track so it’s easier for us to maintain as a community?

Happy to help with keeping the ReasonML track functioning.

Migrate the build system from Bucklescript to dune, using native OCaml tools and avoiding the compilation to JS.

I still believe this is the best option to ease the burden on maintenance by using supported build tools (dune) which seems like the default for OCaml and its ecosystem (including ReasonML)

Removing the tools dependent on the JS ecosystem should make the setup much simpler.

Thanks for your contributions, and happy to help with whichever direction seems the best for all.

2 Likes

I’m happy with a split if the differences are more than just trivial (which I assume they are).

1 Like

FWIW, I came here looking explicitly for a ReScript track, so that’s a clear +1 from me for a separate/new track for ReScript. (Alas, I can’t offer to help because I don’t speak it … yet.)

1 Like

I wouldn’t worry too much about that. There’s a lot of ways to contribute to building and maintaining a track. Plus there’s generally no better way to learn a language than to dive in. I barely knew any Arturo when I started building that track with Erik, and since then, I’ve had the opportunity to make some small but meaningful contributions to the language outside of Exercism.

1 Like

Coming back to this (probably after too long).

Since the current ReasonML track is already using the compile to JS route (via Bucklescript) it would make sense for the successor to keep the JS compilation and focus on switching to supported tools to enable this (Dune + Melange)

Also the ReasonML syntax is specifically targeted towards people coming from JS and I think it would make for a smoother migration.

Preparing something and will send over a PR so that there’s something concrete to look at / discuss.

2 Likes

To start things off, I’ve created a PR with just changes to the template.

It includes a minimal setup based on Melange + Dune, including tests. The idea is just to demo the envisioned setup before migrating any of the actual exercises.

If there’s any feedback on the setup, it’s better to get it sooner rather than later.

Happy to hear your thoughts on the setup and whether you see it working for the exercises.

Where can we find that?

Sorry forgot to add the link.
Here you go:

It’s been automatically closed (lack of maintainers :cry: ) but you can still find the template there

Opened it for you! :smiling_face:

1 Like

Nice. Thanks for reopening it :rocket:

So what’s the best way to make this happen and keep the track alive?

The current state of the track is not so encouraging since it still relies on bucklescript and that’s not a nice experience for anyone trying to solve an exercise due to lack of docs, unsupported stdlib, etc.

Would it need something like a v2 so that it doesn’t break the current solutions or what would be the best way forward?

Do you perchance have any interest in becoming a track maintainer?

I’m not 100% sure what it entails but happy to help out in any way I can.

Docs > Maintainers

1 Like

Thanks for the info. It does sound interesting to me.

At the very least I want to help make this track a viable option for anyone who wants to learn ReasonML without having to go through too many extra hoops.

1 Like