gren-lang / gren-lang/compiler

Keep only one "mangled property identifier" syntax

Open
#63 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accepted enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.