CASC-Lang / Yakou

An experimental JVM Language inspired by Rust.
38 stars 2 forks source link

Deprecate phase Check (Prelude) #54

Closed ChAoSUnItY closed 2 years ago

ChAoSUnItY commented 2 years ago

Summary

Check (Prelude) is used to emit compiled unchecked files into bytecode and load it in current compilation process, this is needed because ClassWriter::getCommonType(String, String) from ASM lib requires types already exists in JVM environment. But we can override it by checking caching to make sure class exists with our internal type table.

Pros:

By profiling our compiler, it seems it has some relatively heavy performance penalty from ClassLoader::defineClass(byte[]). With this proposal, we can reduce lots of time on compilation.

Cons:

Our typing system needs to be refined so no cached class will be requested to ClassLoader::loadClass(String) calling and throws exception.

Current status

ChAoSUnItY commented 2 years ago

Closed due to compiler rework from #57.