Hacker News new | ask | show | jobs
by glutamate 1105 days ago
Ok show me another language which has near native performance, gradual typing (thinking TypeScript here), and lets me do lightweight functional and lightweight OO programming.
5 comments

> speed-comparison

a tiny tiny ten-line snippet of code

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

The second you remove threading and SIMD from those examples, they get rather close to JS. At most, you are making the argument that killing JS-SIMD for WASM and not adding native threading support was a mistake.
> The second you remove threading and SIMD

Anything else?

AsmJS coercion hints still work, so not really. Monomorphic code and some optimization can take you a surprisingly long way toward good performance. You certainly won’t find that in most untyped languages.
Much faster than Python or almost any non-native-compiled language (except Java)
Python is a notoriously slow language so that's not saying much.

And there are a number of languages on the JVM e.g. Java, Scala, Kotlin, Clojure as well as countless compiled ones which are near-native.

JVM languages do look interesting and with Graal there seems to be an evolutionary upgrade path from JavaScript code.
"Faster than Python" is a very different thing than "near native performance".
Typescript is very nice, just need to get rid of the javascript underneath.
I'm sure microsoft would absolutely love that!

and that's why it should never happen.

Deno?
I wouldn't class NodeJS as being near native based on benchmarks.

And its poor concurrency story compared to other languages e.g. Scala means that it's hard to push the runtime in real-world situations.

How about Dart/Flutter?
Moving the Web to Dart/Flutter would cost billions. How would it help in ANY way solving any challenge that currently exists? What even are these challenges? The OP is pretty blurry on that.
I forgot to add "not controlled by a single corporation" to my list of requirements. Also not gradually typed, I think? But I would consider it if it weren't all tied into Google and had a larger ecosystem.
Isn't Typescript "controlled" by Microsoft?
This is a good point, yes you are right about that.
Typescript is completely open source (Apache 2.0 licensed) and all of its roadmap, planning, issue tracking, peer reviewing, is also out in the open (in GitHub Issues). It's about as "controlled" by Microsoft as Linux is "controlled" by Red Hat at this point.
OK, but the point of comparison was Dart/Flutter, which I suppose is similarly open.

Open source does not mean that it's not controlled by a single person or organization. It's not meant as a critique though, as the alternative I guess is a language designed by committee, which has its own problems.

Last time I looked into it Flutter performance wasn't great.
lua
Luajit definitely. Lua not so much.
Javascript is jit? so it would be fair to compare the jit versions.
Sorry, I missed your reply.

In terms of performance and memory use, LuaJIT beats every other JIT out there. Lua is a much smaller language, and Mike Pall is a cyborg, so it's an unfair comparison when compared with such a huge language like JS.