toshok / toshok/echojs

frozen constant objects should live in the data segment

Open
#11 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
431
Forks
20
PR merge metrics
No merged PRs in 30d

Description

similar to toshok/echo-js#10.

pirouette does the following to map objective-c enums:

var enum = Object.create(null);
Object.defineProperty (enum, "foo", 5);
...
Object.freeze(enum);

esprima does the same with its syntax object, which is a set of constant strings.

If we can statically determine that an object is constructed and populated with constants - and then frozen, we can move the construction/population out of code entirely, and put it in the data segment of the executable instead.

Contributor guide

No contributing guide indexed for this repository

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 by reviewing the issue's examples from pirouette and esprima, focusing on Object.create, Object.defineProperty, and Object.freeze. No repository files or tests are identified; done would require statically recognizing frozen objects populated with constants and placing their construction in the executable's data segment instead of generated code.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.