Live data from Hacker News

OCaml – Compiling Mini-ML to JavaScript

lexicallyscoped.com

1–5 of 5 posts

Re: OCaml – Compiling Mini-ML to JavaScript

#3
post #2

For representing `if` statements in JavaScript, what was the reasoning for using a function over a ternary?

I changed from the ternary representation to the function, because I didn't think the generated code was very readable. In hindsight I'm not sure it's that much improvement. From a performance view it's probably worse off.

Re: OCaml – Compiling Mini-ML to JavaScript

#4
post #3
post #2

For representing `if` statements in JavaScript, what was the reasoning for using a function over a ternary?

I changed from the ternary representation to the function, because I didn't think the generated code was very readable. In hindsight I'm not sure it's that much improvement. From a performance view it's probably worse off.

Rule 1: Do not make assumptions about JavaScript performance.