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

Enhancement : more alignement with Javascript vocabulary #187

Open
jpolo opened this issue Jan 27, 2024 · 1 comment
Open

Enhancement : more alignement with Javascript vocabulary #187

jpolo opened this issue Jan 27, 2024 · 1 comment

Comments

@jpolo
Copy link

jpolo commented Jan 27, 2024

Happy new year, and happy v11 !

I have read with great interest the last v11 which is very promising ! The uncurry by default and many other features shows a great energy to stay close to the JS ecosystem (and get rid of the legacy buckle script branding)

If we analyze ReScript as product rather than a language, talking to JS developers that want safety rather than FP programmers that do not want to use Javascript is a brilliant idea.

In the mean time I've noticed that some names that just look strange if you do not have a fp/ocaml background. (What is Exn ??? would say the profan developer).

I would like to propose to ReScript to go one step further in a future release with a radical alignment between ReScript and ECMAScript by using the same vocabulary / coding standard.

Here are some examples :

  • XXX.make => JS uses XXX.create (ex: Object.create, React.createElement, etc)
  • Exn => JS uses Error or throw (ex: Result.getOrThrow instead of Result.getExn), in addition JS uses very few abbreviations
  • String.get => String.at
    etc.

Of course there might be other occurrences and some libraries could also have the same problems. (I could help providing a full API audit and renaming suggestions based on existing standards if needed)

IMHO, ReScript v11 represents this instant when the technology offers a great basis for an ecosystem to grow but this ecosystem is not too big so breaking changes are still acceptable

What do you think ?

@DZakh
Copy link
Contributor

DZakh commented Jan 31, 2024

  1. I'd like to keep make since even though it's different from Js, in ReScript, it's already a tradition
  2. 100% agree about Exn
  3. String.get and String.at are a little bit different things. One is compiled to "foo"[1], while another is "foo".at(1)

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

No branches or pull requests

2 participants