4 ms·
That depends heavily on what the transpiled C looks like, machine-generated code can be pretty human-unreadable. In particular you generally lose all comments,
by simias 8y ago
That depends heavily on what the transpiled C looks like, machine-generated code can be pretty human-unreadable. In particular you generally lose all comments, you can end up with autogenerated variable and function names, huge functions with completely unidiomatic C code etc...
For instance here's what the chicken scheme transpiler outputs when told to compile a simple '(print "Hello, world!")': https://gist.github.com/simias/c96408a76eb7288fbd0d975f5dc995fc https://gist.github.com/simias/c96408a76eb7288fbd0d975f5dc99...
Good luck maintaining that...
- mrgriffin 8y agoI agree that modifying Chicken's output like you would handwritten C code would be an exercise in madness. But it's possible to design a language to have a nice transpilation story, for example PureScript deliberately puts restrictions on the names of types and operators so that they have a sane name in JS. Of course there's still a likely style mismatch, but what can you do? I suspect you already know this, but for the benefit of others.
- cies 8y agoAnd looking at V, which is the story here, it should not be too obfuscated.
- amedvednikov 8y agoI tried to make resulting C code very readable and simple: fn main() { println('hello world') } ==> int main() { printf("hello world\n"); return 0 }