by banashark · 1y ago · 0 comments
I recall seeing a comparison of “transpile to js” languages and noted Kotlin and nim as the two that were outputting MBs of js compared to the tens or low hundreds of kbs that other languages were outputting.
echo echo 1 > j.nim
nim js j.nim
node j.js
>>> see 1\\n <<<<
ls -l j.js
>>> 36636 Sep 1 12:54 j.js <<<
nim js -d:release j.nim
ls -l j.js
>>> 11369 Sep 1 12:56 j.js <<<
So, with -d:release stripping away a lot of debugging logic, it's not so bad. Even with d:release there is probably ~50% of the text of that j.js that is just C comments which could be trivially stripped away. E.g., cpp<j.js|wc -c gives 6350 for that very same 11369 file. There are js minification things one could also run on the output. People do complain about this, but people complain a lot. It's probably not so uncompetitive for less trivial programs that do a little bit more work, both minified, apples-to-apples care & all that.When you have a page with many alpine/nim components like this, how does the size increase relative to the # of components added (roughly of course)?