3 ms·
Interesting that it is written in Pascal: https://github.com/castle-engine/castle-engine https://github.com/castle-engine/castle-engine The minimal demos are
by flohofwoe 2y ago
Interesting that it is written in Pascal:
https://github.com/castle-engine/castle-engine https://github.com/castle-engine/castle-engine
The minimal demos are still surprisingly big though (same ballpark as Unity web builds for similar simple demos).
For a language without runtime I would expect a couple hundred kilobytes at most for those simple demos (but the download is 6.4 MB compressed and decompresses to 43 MByte, and takes significant time after the download is finished to start). Would be interesting to figure out why dead code doesn't seem to be removed by the compiler (e.g. is it because of the engine design, or because the Pascal-to-WASM compiler doesn't support dead code elimination). Also why is the compressed to uncompressed ratio so big, there seems to be a lot of duplicate code or data in those WASM files.
- wffurr 2y agoObject Pascal has a substantial runtime library called RTL: https://en.m.wikipedia.org/wiki/Free_Pascal_Runtime_Library https://en.m.wikipedia.org/wiki/Free_Pascal_Runtime_Library Also per azakai in another thread, wasm-opt shrinks this binary to 14 MB. Still a lot.
- pjmlp 2y agoSimilar to this unofficial C runtime called POSIX, that most C applications rely on.
- actuallyalys 2y agoUsing RTL doesn’t necessarily result in large binaries. In my (non-WASM) experience, they’re more in line with the “hundreds of kilobytes” flohofwoe suggests.
- actuallyalys 2y agoPascal can definitely produce small binaries (and it looks like it does dead code elimination, under the name “smartlinking” [0]), so it may be a limitation of the WASM backend like you said or not enabled for some reason. [0]: https://www.freepascal.org/docs-html/user/userse13.html https://www.freepascal.org/docs-html/user/userse13.html