gren-lang / gren-lang/compiler
Keep only one "mangled property identifier" syntax
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 503
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
Description
The compiler currently supports two syntaxes for mangling names in JS: { __mangled_name: 123 } (example) and { __$mangled_name: 123 } (example).
It looks like the only difference between the two is that:
__names get mangled in both debug and optimised mode, and__$names only get mangled in optimised mode.
Action
I think we should keep just one of them, with the semantics of __$. Having the actual names in debug mode makes it much easier to inspect output code.
In terms of syntax, I would prefer just the __ prefix, but this inconsequential.
Impact
Changing this in the compiler means we have to update all core packages' JS to only use one of the syntaxes.
Contributor guide
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 with the two VirtualDom.js examples linked in the issue and inspect the compiler code that handles both mangled-property syntaxes. Determine which prefix to retain, then update the compiler and all core packages' JavaScript so only that syntax remains while debug output preserves actual names; verify with the compiler's existing checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell, javascript
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100