Why does the class library needs to be compiled every time?

Why does the class library needs to be compiled every time SC boots, even when there are no files changed?

Because it’s fast and caching it would provide little benefit - also, caching would be hard because the guts use raw pointers everywhere.

1 Like

Actually, sclang could cache the compiled byte code for each class file, but it would still need to run the code. However, I agree with @jordan that it wouldn’t be worth the effort.

FYI, sclang uses certain optimizations (e.g. the global method table) that requires all Classes to be compiled at once during startup. Unlike most modern interpreted programming languages, it currently does not support dynamic module loading.

1 Like