Live data from Hacker News

A lot of complex “scalable” systems can be done with a simple, single C++ server

twitter.com

11–20 of 376 posts

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#11
post #4
post #3

Has Carmack looked at Rust? I'd be very curious for someone like him to look at it in light of his experience with C/C++ and high performance systems.

Pretty sure he's aware of it. And honestly I see the logic, Rust has been top of Tech Empower Benchmarks for a while. That said, I think the benchmarks could use some tweaking. I'm not sure they are representative.

Those benchmarks matter little. If by server this topic is a webserver the backend scripts do little. Its your database, caching, and disk manipulation that slows down performance. Most people write bad queries or have a shallow caching strategy.

A router redirecting to a controller and parsing a template is hardly different across languages that use the same queries.

If you truly need speed for post processong the off load on a c script like queries are off loaded.

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#12
not how i read his tweet. he was lamenting that python is too slow for some server side development use cases. and he gave cpp as an alternative that would be simpler and faster. he even followed up citing java and csharp.

totally agree. if all your backend server is mostly complex serialization & de-serialization, and pushing bytes to other sub-systems, i think many other languages have advantages over python.

wondering why no mention of go or rust though...

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#13
> ...My bias is that a lot (not all!) of complex “scalable” systems can be done with a simple, single C++ server.

The second tweet of the discussion:

> JAVA or C# would also be close, and there are good reasons to prefer those over C++ for servers. Many other languages would also be up there, the contrast is with Really Slow (but often productive and fun) languages.

I'm afraid that Carmack has sided with his own anecdotal experiences of the 1990s to justify the use of C++ for server-side development for the 21st Century. This probably made sense at the time due to the availability of more C++ devs and less language choices, but today in the 2020s? I remain totally unconvinced by his argument.

He goes on to suggest Java or C# which still makes sense for many companies for generic server-side development if you are after a more secure backend. Kotlin is pretty much the most sensible for this. But for the sake of Carmack's engineering background however, it is unsurprising why Java/C#/Kotlin are technically unsuitable for high-performance gaming platforms if one was to create one. So what credible languages could be used to compete with C++? I hear Discord is having a great time with using Elixir (Erlang could also be used) and another gaming platform called 'Hadean' is using Rust for their platform.

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#14
post #3

Has Carmack looked at Rust? I'd be very curious for someone like him to look at it in light of his experience with C/C++ and high performance systems.

Good question, not sure why you were voted down. And I’m not even a Rust fan.

[deleted]

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#15
post #5
post #3

Has Carmack looked at Rust? I'd be very curious for someone like him to look at it in light of his experience with C/C++ and high performance systems.

He's had a look: https://www.reddit.com/r/rust/comments/ap2047/john_carmack_w...

Yeah but I didn’t see anything about perf there.

I think it’s a valid point that the reasons why C++ is good for perf - compiled, statically typed, low-level, manual memory management, high degree of control over memory layout - would also apply to Rust. If they don’t then that would really call into question positive claims being made about Rust.

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#16
post #13

> ...My bias is that a lot (not all!) of complex “scalable” systems can be done with a simple, single C++ server. The second tweet of the discussion: > JAVA or C# would also be close, and there are good reasons to prefer those over C++ for servers. Many other languages would also be up there, the contrast is with Really Slow (but often productive and fun) languages. I'm afraid that Carmack has sided with his own anec…

"But for the sake of Carmack's engineering background however, it is unsurprising why Java/C#/Kotlin are technically unsuitable for high-performance gaming platforms if one was to create one."

This really is just not true.

Financial, real-time style High Frequency Trading apps are often written in Java - not C++.

Much of the JVM is not a VM, it compiles to machine code - in an optimised manner. For starters.

Given how difficult it is to develop safely in C++ I can hardly think of a reason to ever use it on the backend.

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#17

Many people don't know about Python's GIL https://wiki.python.org/moin/GlobalInterpreterLock That's the reason why you need to go multi-process if you want to reach a similar level of concurrency in Python as multi-thread in C++. And that surely adds a lot of complexity. As a very practical example of this, TensorFlow has a dedicated page with advice on how to make the Python part that reads the files from disk less…

Not really IO is always going to be slow compared to the CPU. The Python interpreter will be blocked 90% of that time waiting for IO anyway.

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#18
post #16
post #13

> ...My bias is that a lot (not all!) of complex “scalable” systems can be done with a simple, single C++ server. The second tweet of the discussion: > JAVA or C# would also be close, and there are good reasons to prefer those over C++ for servers. Many other languages would also be up there, the contrast is with Really Slow (but often productive and fun) languages. I'm afraid that Carmack has sided with his own anec…

"But for the sake of Carmack's engineering background however, it is unsurprising why Java/C#/Kotlin are technically unsuitable for high-performance gaming platforms if one was to create one." This really is just not true. Financial, real-time style High Frequency Trading apps are often written in Java - not C++. Much of the JVM is not a VM, it compiles to machine code - in an optimised manner. For starters. Given ho…

This and more opinions from the oracle certified java guru.

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#19

Many people don't know about Python's GIL https://wiki.python.org/moin/GlobalInterpreterLock That's the reason why you need to go multi-process if you want to reach a similar level of concurrency in Python as multi-thread in C++. And that surely adds a lot of complexity. As a very practical example of this, TensorFlow has a dedicated page with advice on how to make the Python part that reads the files from disk less…

Not really IO is always going to be slow compared to the CPU. The Python interpreter will be blocked 90% of that time waiting for IO anyway.

Percentages are misleading, what matters is the actual time it takes. Even small gains will have an effect as you increase the traffic and add additional stages to the system. Small delays accumulate and can have a surprising effect on queue sizes and latency.

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#20
post #6

the title is misleading. sure, it advocates for C++, or Java, or C#, or others above Python, but clarifying the context: "a lot (not all!) of complex “scalable” systems can be done with a simple, single C++ server.", which I take as: "sometimes it's better to write a simple server in a low level language, than a complex server in a higher level language".

Submitted title was "John Carmack advocates C++ for server development". We've replaced it with a shortened version of what he said.
Post reply on HN