Skip to content

Replace ocaml style oo with js style #4967

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

Merged
merged 12 commits into from
Feb 24, 2021
Merged

Replace ocaml style oo with js style #4967

merged 12 commits into from
Feb 24, 2021

Conversation

bobzhang
Copy link
Member

No description provided.

@bobzhang bobzhang changed the title wip: replace ocaml style oo with js style Replace ocaml style oo with js style Feb 24, 2021
@bobzhang bobzhang merged commit 1fe7d23 into master Feb 24, 2021
@hhugo
Copy link
Contributor

hhugo commented Feb 24, 2021

Does this mean that ocaml object and classes are definitely dropped, even when using the ocaml syntax ?

@bobzhang
Copy link
Member Author

@hhugo yes. It does not translate to JS semantics well so that the generated code is bloated and not debuggable. Do you have any use case in mind? The primary use case seems to be supporting some existing code which jsoo already does a very good job, but the maintainance overhead is non-trivial, lots of our internal data representation changes also need take care of objects part which is easy to get it wrong.

@hhugo
Copy link
Contributor

hhugo commented Feb 25, 2021

I'm just asking to understand the situation better

chenglou added a commit to chenglou/syntax that referenced this pull request Feb 27, 2021
Fixes rescript-lang#277
Fixes rescript-lang#263

Now that rescript-lang/rescript#4967 has landed:
- Parse `{"foo": int}` as ocaml `{. foo: int}`. Previously it parsed into ocaml `{. foo: int} Js.t`
- Remove a tiny printing optimizations for `Js.t`.
- For React's PPX 3, generate objects directly instead of `Js.t` objects. cc @rickyvetter @ryyppy for ppx4.
- The re->res converter automatically removes the `Js.t` part.
- Said converter has a bug (rescript-lang#263) that converts `Js.t({..}) as 'a` into `{..} as 'a` from naturally forgetting to special-case that path. Now this bug is conveniently ~~made into a feature~~ obsolete.
chenglou added a commit to chenglou/syntax that referenced this pull request Feb 27, 2021
Fixes rescript-lang#277
Fixes rescript-lang#263

Now that rescript-lang/rescript#4967 has landed:
- Parse `{"foo": int}` as ocaml `{. foo: int}`. Previously it parsed into ocaml `{. foo: int} Js.t`
- Remove a tiny printing optimizations for `Js.t`.
- For React's PPX 3, generate objects directly instead of `Js.t` objects. cc @rickyvetter @ryyppy for ppx4.
- The re->res converter automatically removes the `Js.t` part.
- Said converter has a bug (rescript-lang#263) that converts `Js.t({..}) as 'a` into `{..} as 'a` from naturally forgetting to special-case that path. Now this bug is conveniently ~~made into a feature~~ obsolete.
chenglou added a commit to rescript-lang/syntax that referenced this pull request Feb 27, 2021
Fixes #277
Fixes #263

Now that rescript-lang/rescript#4967 has landed:
- Parse `{"foo": int}` as ocaml `{. foo: int}`. Previously it parsed into ocaml `{. foo: int} Js.t`
- Remove a tiny printing optimizations for `Js.t`.
- For React's PPX 3, generate objects directly instead of `Js.t` objects. cc @rickyvetter @ryyppy for ppx4.
- The re->res converter automatically removes the `Js.t` part.
- Said converter has a bug (#263) that converts `Js.t({..}) as 'a` into `{..} as 'a` from naturally forgetting to special-case that path. Now this bug is conveniently ~~made into a feature~~ obsolete.
@ELLIOTTCABLE
Copy link
Contributor

This is … very bad. Yikes.

This level of invasive backwards-compatibility (cross-compatibility?) breakage against upstream OCaml … really, really makes BuckleScript useless for me. Is this where ReScript is heading?

Does this also mean that we'll never see a rebase past 4.06.1? /=

No, JSOO is not a good replacement.

kevinbarabash pushed a commit to kevinbarabash/rescript-compiler that referenced this pull request Dec 24, 2021
Fixes rescript-lang#277
Fixes rescript-lang#263

Now that rescript-lang#4967 has landed:
- Parse `{"foo": int}` as ocaml `{. foo: int}`. Previously it parsed into ocaml `{. foo: int} Js.t`
- Remove a tiny printing optimizations for `Js.t`.
- For React's PPX 3, generate objects directly instead of `Js.t` objects. cc @rickyvetter @ryyppy for ppx4.
- The re->res converter automatically removes the `Js.t` part.
- Said converter has a bug (rescript-lang#263) that converts `Js.t({..}) as 'a` into `{..} as 'a` from naturally forgetting to special-case that path. Now this bug is conveniently ~~made into a feature~~ obsolete.
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