← Back to context

Comment by taklimakan

2 years ago

That’s not how you’d implement fibonacci in Go

I'm not a fan of Go, but I have to admit that benchmark doesn't make any sense. If you use tail calls in a language that doesn't support TCO, then of course you'll get bad results.

I guess its easier to just throw in some numbers than compare idiomatic implementations and then discuss tradeoffs with some nuance.

Even if its just a language teaser, I'd still add a note on TCO to avoid misleading people though.

Yes, using WASM and Go in an contrived example and not mentioning tinyGo is not very honest.

  • Do you have reason to believe that tinyGo would do better on that particular benchmark?

    • Based on the name, I’d imagine part of TinyGo’s raison d`être would be a smaller binary size. Plus, seems optimized for speed rather than speed-of-compiler

That's not how you'd implement it in rust either. It's a pretty bad benchmark. From my experience, I'd guess it's lack of tail recursion and the switch statement. That one can be slow in Go.

It is however a good teaser for Moonbit.