top | item 37186563

(no title)

taklimakan | 2 years ago

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

discuss

order

spion|2 years ago

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.

makapuf|2 years ago

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

ghusbands|2 years ago

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

tgv|2 years ago

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.