16:28 | <Jack Works> | question: why terser prefer , than ; |
16:28 | <Jack Works> |
|
16:29 | <Jack Works> | why
not
|
16:40 | <bakkot> | Jack Works: probably because it works better in other contexts:
can be minimized to |
16:41 | <bakkot> | so if you're writing a minimizer you just have a rule which says that sequences of expression statements get collapsed with , , and then after having applied that rule sometimes you can eliminate {} s, whereas there's no place where using ; instead of , is a benefit |
17:32 | <Jack Works> | oh, interesting |
17:32 | <Jack Works> | (because , is somehow harder to debug in devtools so I don't like it) |
17:35 | <bakkot> | https://unminify.io/ :) |
17:36 | <bakkot> | I haven't updated that in... I guess probably 5 years so it won't handle newer syntax |
17:36 | <bakkot> | but it does reverse that specific transform, among others |
17:48 | <Jack Works> | terser has an option to disable comma transform actually |
18:33 | <eemeli> | Isn't it obvious that , is about half the size of ; ? </tdz> |