News for hackers. Stuff that matters.
Re:A lot of complex “scalable” systems can be done with a si... by lmm on Sunday December 29, 2019 @09:40PM (#21910348)
The idea that GCed languages in general have Python-like performance is a dangerous myth. Languages that are managed but not interpreted (e.g. Java, OCaml, Haskell, C#, Swift) have performance characteristics that are much closer to C than to Python.
Re:A lot of complex “scalable” systems can be done with a si... by Const-me on Sunday December 29, 2019 @11:42PM (#21910871)
This.

Modern C# in net-core 3 can even match C++ at manually vectorized numeric code: https://github.com/dotnet/coreclr/issues/27909#issuecomment-...

Re:A lot of complex “scalable” systems can be done with a si... by pkolaczk on Monday December 30, 2019 @02:54AM (#21911588)
While I agree they can sometimes compete in numerically heavy tasks, the place where they fall behind is memory management. Systems like databases need very careful memory management and GC is not always your friend there. I'm still hoping some day we'll be allowed both GC and Rust-like manual memory management in a single language, although I'm not sure it is at all possible.
Re:A lot of complex “scalable” systems can be done with a si... by Const-me on Monday December 30, 2019 @04:09AM (#21911960)
> the place where they fall behind is memory management

It's sometimes possible to design C# code in a way that doesn't stress GC too much, so the majority of bandwidth bypasses the GC.

For instance, here's my old .NET project which plays streaming media for hours without interrupts, with a hard limit of 15MB RAM for the whole process: https://github.com/Const-me/SkyFM

Doing so became easier in modern .NET, with these value tuples and spans.

> still hoping some day we'll be allowed both GC and Rust-like manual memory management in a single language

Microsoft tried, managed C++, then C++/CLI. The CLI is still supported if you want to try, but IMO they both were way too complex: 2 types of pointers, two runtimes with weird interaction between them, worst of both sides on safely and ease of use.

AFAIK most people only used these languages for a thin layer of glue to integrate native C++ with C#. And even for that limited use case, COM interop or C interop often worked better. Even MS switched to COM interop in the next iteration, C++/CX.

Re:A lot of complex “scalable” systems can be done with a si... by Too on Monday December 30, 2019 @04:38AM (#21912150)
Rc/shared_ptr comes pretty close to GC from usability point of view?
Re:A lot of complex “scalable” systems can be done with a si... by ospider on Monday December 30, 2019 @03:53AM (#21911853)
Actually, Python is compiled to its bytecode and then interpreted by the Python VM, which is also how Java works. Python is slow because the lack of funds and people's focus, just take look at how fast JavaScript(V8) is nowadays.
Re:A lot of complex “scalable” systems can be done with a si... by Too on Monday December 30, 2019 @04:32AM (#21912118)
No, Python bytecode is still interpreted at runtime. Java, JS and .NET is first compiled into bytecode but then they are also JIT-compiled into machine code which Python is not.

You can JIT Python also using https://www.pypy.org/ but it's not the default and it's not 100% official and compatible.

Re:A lot of complex “scalable” systems can be done with a si... by armitron on Monday December 30, 2019 @11:04AM (#21914227)
It's also nowhere near as fast as other language JITs. I'm talking orders of magnitude slower than JVM, .NET and LuaJIT. End result being a - relatively - dead project, since the incentives for people to use it over stock Python and pay extra compatibility costs are not there.
Re:A lot of complex “scalable” systems can be done with a si... by terminaljunkid on Tuesday December 31, 2019 @08:12AM (#21920757)
I think you entirely ignored the performance cost of dynamism (not having types known, not having value types, dynamic binding of methods etc..) that is handy 1% of the time but imposes type safety & performance cost other 99% of the time..