musictheory / NilScript

Objective-C-style language superset of JavaScript with a tiny, simple runtime
Other
50 stars 5 forks source link

Major: can `inline-enum` and `inline-const` always be true? #103

Closed iccir closed 8 years ago

iccir commented 8 years ago

Historically, inline-enum and inline-const were opt-in due to our build process in the oj 0.x days. We compiled each file separately during development - changes to one file couldn't force other files to be recompiled. These options were only enabled for the release version, which was compiled at the same time.

In oj 2.x, all files are passed into the compiler at the same time, and the compiler is smart enough to know which files use which enums/consts and thus which files need to be recompiled in response to a change.

This raises a question: is there any reason these are still options and not just always on?

iccir commented 8 years ago

@jmarr has inline-enum off, but that's due to compiling JSX files separately. Once his JSX are passed through oj, he thinks it can be on. His source base doesn't use @const at the moment.