4 ms·
Something like that would be amazing, like the godsend that Scala was for the JVM back when Java was very, very imperative and totally stagnant, though Scala di
by dividedbyzero 4y ago
Something like that would be amazing, like the godsend that Scala was for the JVM back when Java was very, very imperative and totally stagnant, though Scala didn't/doesn't transpile to Java, but compiles to JVM bytecode directly. I don't think the same would be possible for Go, which is a shame, but AFAIK there is no such intermediate to target. And given how limited Go itself is, I wouldn't be all that optimistic that a transpiling approach could support many advanced features without tanking performance because you just can't model them efficiently in Go at all, even if you limit enforcement of most guarantees to the transpiler.
- kubb 4y agoWhat kind of difficult to support advanced features do you have in mind?
- kaba0 4y agoI’m not who you are responding to, but optimizing recursions (e.g. tail-call elimination), loop fusion, etc. Functional languages (at least haskell) does plenty of optimizations not generally possible in imperative codes.
- kubb 4y agotail call elimination is possible by converting the tail-recursive function to a loop. in fact Go could support it, but the team doesn't want to do that. I agree that everything Haskell does would be hard, but everything e.g. Clojure does should be possible
- vnorilo 4y agoI think Clojure on Go (Gojure)? Would probably do nearly as well as the JVM hosted version if done well.