wenyan-lang / wenyan

文言文編程語言 A programming language for the ancient Chinese.
https://wy-lang.org/
MIT License
19.57k stars 1.1k forks source link

Precompile stdlib and treeshaking #544

Open antfu opened 4 years ago

antfu commented 4 years ago

As stdlib getting big, should we consider precompile stdlib (into asc or something) into the package and make it treeshakeable?

For example, example 畫心 imports over 60kbs of stdlib because it uses

吾嘗觀「「算經」」之書。方悟「絕對」「平方根」之義。

image

Or maybe performance is not the main focus for now?

LingDong- commented 4 years ago

I think precompiling is a good idea! perhaps even directly into JS will be functionally the same? But yeah, I don't feel too urgent about it. Also I'm interested in how treeshaking is implemented, so eventually we can do it at the wenyan level :) will do some research.