Live data from Hacker News

Ask HN: What's the fastest programming language with a large standard library?

news.ycombinator.com

21–30 of 36 posts

Re: Ask HN: What's the fastest programming language with a large standard library?

#22
post #4

Java

20 years ago yes. Today it is a terrible monster that you use because of the lack of alternatives, not because it is fast or comfortable to use.

Java is pretty fast though, according to benchmarks. Your point regarding comfortable to use ... yeah, fair enough to some degree.

Re: Ask HN: What's the fastest programming language with a large standard library?

#23

C#/.NET in my opinion. Extremely extensive and high quality standard library and it keeps getting faster every release. Though it's kind of a difficult question to answer, what do you need the standard library to actually do?

Doesn't it have an ide problem on Linux?

Re: Ask HN: What's the fastest programming language with a large standard library?

#24

C#/.NET in my opinion. Extremely extensive and high quality standard library and it keeps getting faster every release. Though it's kind of a difficult question to answer, what do you need the standard library to actually do?

Doesn't it have an ide problem on Linux?

Not with Rider anymore as far as I know. I'm still on Visual Studio but colleagues report Rider is as-good or better.

Re: Ask HN: What's the fastest programming language with a large standard library?

#25
post #14

Earlier quoted context omitted.

I disagree Java 21 is really nice. Lots of modern features, tons of rock solid, battle tested open source libraries. Amazing tooling.

> Amazing tooling. Apparently you're comparing to java 20 years ago. Not to modern dev friendly ecosystems.

I've used vscode with typescript and python, but I found the amount of detail and coverage the inspections intellij has are better. The profilers that Java have are also the best I've seen. The profilers can show you crazy details on SQL queries being run, that get traced all the way through to the http endpoints (https://www.ej-technologies.com/resources/jprofiler/help/doc...).

Re: Ask HN: What's the fastest programming language with a large standard library?

#26

C#/.NET in my opinion. Extremely extensive and high quality standard library and it keeps getting faster every release. Though it's kind of a difficult question to answer, what do you need the standard library to actually do?

Agree, no other standard library has comparable degree of code vectorization either.

What does that mean?

Re: Ask HN: What's the fastest programming language with a large standard library?

#27

Earlier quoted context omitted.

Agree, no other standard library has comparable degree of code vectorization either.

What does that mean?

.NET's standard library is very heavily vectorized, vectorization is considered in all scenarios where it is applicable, the compiler will also apply it to copies of known length and string comparisons fully eliding and unrolling Memmove and SequenceEqual calls.

The gives languages that run on top of .NET massive performance advantage in a variety of scenarios versus any other language - C++ and Rust stdlibs are far more conservatively vectorized because neither language has stable SIMD vector API and even then out of modularity constraints a lot of routines have to either rely on autovectorization which is fragile or manually vectorized with intrisics for each individual platform.

A short non-exhaustive list of examples is

- Shared SIMD helper for Aho-Corasick, Rabin-Karp and other text search algorithms https://github.com/dotnet/runtime/blob/main/src/libraries/Sy...

- Bloom filter https://github.com/dotnet/runtime/blob/main/src/libraries/Sy...

- Base64 encoding and decoding https://github.com/dotnet/runtime/blob/main/src/libraries/Sy...

- Element search (memchr and the like) https://github.com/dotnet/runtime/blob/main/src/libraries/Sy...

- UTF-8 transcoding https://github.com/dotnet/runtime/blob/main/src/libraries/Sy...

The above are examples of 1% code that ends up used by 99% of other codebase in one way or another. Regex engine, JSON serialization and parsing, substringing and etc. all use these.

Re: Ask HN: What's the fastest programming language with a large standard library?

#28
If you go for fastest then C++ with its own standard library plus add a few third party ones will get most stuff done. Look here: https://en.cppreference.com/w/cpp/links/libs

Pick header only libraries if you are concerned about portability.

Now C++ is a pain in the ass to work with, and the world has moved on to better more convenient things. Do explore modern C# and Go for better developer productivity.

Re: Ask HN: What's the fastest programming language with a large standard library?

#29

Earlier quoted context omitted.

What does that mean?

.NET's standard library is very heavily vectorized, vectorization is considered in all scenarios where it is applicable, the compiler will also apply it to copies of known length and string comparisons fully eliding and unrolling Memmove and SequenceEqual calls. The gives languages that run on top of .NET massive performance advantage in a variety of scenarios versus any other language - C++ and Rust stdlibs are far…

Rust has had a stable SIMD vector API[1] for a long time. But, it's architecture specific. The portable API[2] isn't stable yet, but you probably can't use the portable API for some of the more exotic uses of SIMD anyway. Indeed, that's true in .NET's case too[3]. So .NET has to rely on "manually vectorized with intrisics for each individual platform" as well.

Rust does all this SIMD too. It just isn't in the standard library. But the regex crate does it. Indeed, this is where .NET got its SIMD approach for multiple substring search from in the first place[4]. ;-)

You're right that Rust's standard library is conservatively vectorized though[5]. The main thing blocking this isn't the lack of SIMD availability. It's more about how the standard library is internally structured, and the fact that things like substring search are not actually defined in `std` directly, but rather, in `core`. There are plans to fix this[6].

With all that said, I wouldn't necessarily disagree with the broader point in this thread. .NET's regex engine performance is quite impressive[7]. (And I still have to merge the PR updating to .NET 8.) I'm really only replying here to correct more narrow points.

[1]: https://doc.rust-lang.org/std/arch/index.html

[2]: https://doc.rust-lang.org/std/simd/index.html

[3]: https://github.com/dotnet/runtime/blob/72fae0073b35a404f03c3...

[4]: https://github.com/dotnet/runtime/pull/88394#issuecomment-16...

[5]: https://github.com/BurntSushi/memchr#why-is-the-standard-lib...

[6]: https://github.com/rust-lang/rfcs/pull/3469

[7]: https://github.com/BurntSushi/rebar#summary

Re: Ask HN: What's the fastest programming language with a large standard library?

#30

C#/.NET in my opinion. Extremely extensive and high quality standard library and it keeps getting faster every release. Though it's kind of a difficult question to answer, what do you need the standard library to actually do?

Doesn't it have an ide problem on Linux?

I use Rider on Linux, it's great.
Post reply on HN