Unify name mangling rules
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 10.3k
- Forks
- 438
- PR merge metrics
- No merged PRs in 30d
Description
Since BuckleScript is going to release a v8 and maybe Reason a v4, I think now could be a good time to fix name mangling issues once for all and stick to one rule.
Right now we have this Reason code:
let foo = {"_to": 10, "_type": 1};
type bar = {
_to: int,
_type: string,
};
let bar = {_to: 10, _type: "bar"};
ReactDOMRe.renderToElementWithId(<input type_="text" />, "preview");
compiling to:
var foo = {
to: 10,
type: 1
};
var bar = {
_to: 10,
_type: "bar"
};
ReactDOMRe.renderToElementWithId(React.createElement("input", {
type: "text"
}), "preview");
which is definitely not coherent.
I'd be in favor of using trailing underscores since leading underscores is already used to name unused variables but I'd be happy with any coherent rule.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the Reason examples in the issue with their generated JavaScript, focusing on object keys, record fields, and JSX attributes. The issue does not specify a final naming rule, so completion depends on agreeing on one coherent rule and applying it consistently across these cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, ocaml
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100