5 ms·
It’s striking how unreadable the V8 output is. Is that due to V8 itself or just this particular use of it?
by bambataa 8y ago
It’s striking how unreadable the V8 output is. Is that due to V8 itself or just this particular use of it?
- benbristow 8y agoI don't think the output really needs to be readable since they're going for speed over anything else. Who is normally reading this stuff?
- imtringued 8y agoThe devs who are working on the compiler. Not the end user.
- alangpierce 8y agoDepends on the context, but FWIW, CoffeeScript has an explicit design goal of producing human-readable output (even though it's just JS to run in the browser) so that people learning the language can try out examples and build intuition and trust in what JS is going to be produced. It also helps when using a debugger without source maps.
- eatonphil 8y agoIt's the product of whipping together some basic examples for proof of concept in a few weeks. :) To some degree it will always be "messier". 30-60% of generated code will just be converting between C++ and V8 types. But really, I just need to prioritize using more tmp values so I'm not shoving crazy amounts of logic in one line. It can definitely be difficult to debug. Things would be easier if I were generating C++ ASTs and pretty-printing it (I should probably do this in the future) but for the PoC I'm just emitting strings of C++. Chicken Scheme's generated C is more along the lines of what I'm aspiring to.