News for hackers. Stuff that matters.
Re:Go for C++ Programmers by amelius on Friday February 06, 2015 @03:17PM (#9011265)
So, when writing a high-performance, scalable web-server, which language should I pick: Go, C++, Rust, Scala, other?
Re:Go for C++ Programmers by anom9999 on Friday February 06, 2015 @03:31PM (#9011348)
Whichever you're most competent in. Any of those languages (and many others) would be a suitable option, so it boils down to what you are most proficient in.
Re:Go for C++ Programmers by lomnakkus on Friday February 06, 2015 @04:12PM (#9011573)
I would amend that. Start with whichever you're fastest (not necessarily most competent) in. Once you discover whether the whole thing is worth the effort, move towards safe languages. That's basically Rust, Scala, or (functional-language-of-your-choice-or-) Haskell.

EDIT: Personally, I would start in something like Haskell or Scala just to do a proof-of-concept without having to worry too much about undefined behavior (C/C++) or absurd verbosity (Java), but then I am pretty familiar with those two languages. Maybe it would be worth learning one or two very terse languages to start with, just in case you hit upon a great idea? (Btw, I think Python or Perl qualifies.)

EDIT#2: As a sort of second or third order bit of advice, I'd encourage anyone to brush up on programming languages that might make you faster. It's a sort of "propellant" and can increase your speed exponentially.

Re:Go for C++ Programmers by IshKebab on Friday February 06, 2015 @06:19PM (#9012227)
Rust isn't ready yet so I wouldn't pick that.

Scala I'm not familiar with.

C++ is great. Very fast and powerful, and really not as complicated or difficult as people make out. The manual memory management thing isn't really an issue if you do it right. However writing multithreaded C++ code is never fun.

Go is very simple and easy. I think of it like Simple English. It's very easy to write, and everyone will understand what you are saying, but you'll end up being way more verbose and often a bit more clunky than you might be in a more powerful language like C++. Huge limitations are that there is no overloading at all. I.e. you have to implement `minFloat64(a, b float64)`, `minFloat32(a, b float32)`, `minInt(a, b int)` and so on, whereas in C++ function overloading means it is just `min()`, and templates mean you only need to write it ones. The other big issue is lack of templates (AKA generics), so containers (list, map, etc.) are a pain in the arse to use.

However Go does have great concurrency support, and is close enough in speed to C++ that I'd probably always choose it to write servers in.

So I'd say Go, maybe C++. In a year reconsider Rust.

Re:Go for C++ Programmers by tomohawk on Friday February 06, 2015 @06:37PM (#9012301)
Having done web servers in Java, C++, Ruby, and Python, I was pleasantly surprised by the capabilities offered by Go. In these other languages, the first thing you do is usually figure out a framework to use, which usually comes with its opinionated way of doing things. Often, the framework is really there to paper over issues with the language or the available standard libraries.

In go, the std library offers very good support, and if you need more, there are things such as gorilla (a web toolkit that enhances the std lib). There are also frameworks, of course, but many people find there is much less of a need for that.

The goroutine support is really great, and servicing concurrent client requests with them is effortless.

Re:Go for C++ Programmers by cyber1 on Friday February 06, 2015 @04:24PM (#9011640)
If you choose Go, you get simple scalable language with safe memory, superior standard library and performance close to C.

Performance: Go vs Python - http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan... Go vs C++ - http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...

Re:Go for C++ Programmers by eonil on Saturday February 07, 2015 @02:14AM (#9013349)
I believe you're going to learn a new language for future problems, and I strongly recommend Rust.

If your performance (throughput and latency) requirement is not very critical, language really doesn't matter. Even scripting languages like Python, Javascript or Ruby performs very well by spawning servers on each cores.

But if your performance requirements goes serious, I believe you will get unusual bottleneck (e.g. GC, VM, memory usage pattern, specific hardware,... ), then you'll want a kind of "full-control". In this case, the only traditional choice was C/C++, and that's why many large-scale companies like Google and Facebook are using C++ internally.

Anyway C/C++ cannot provide enough level of safety that required to provide good productivity. As a workaround, you can use a sort of dynamic checkers (sanitisers), but the dynamic checkers are very immature, and fundamentally dynamic.

A new, and the only current alternative for this case is Rust. Rust provides far batter safety from first at "compile time". It also provides far better linguistic constructs and semantics. But the language itself is immature.

Anyway, (1) there is huge demand for this kind of features from C++ community and (2) Rust is completely engineer community driven (3) and fully open-sourced. So I expect the maturing speed of the language will be incredible that never been existed in language history. And it's fully open sourced.

Re:Go for C++ Programmers by detrino on Friday February 06, 2015 @04:03PM (#9011530)
Go will never match (in performance) C or C++ (using epoll) for this task.
Re:Go for C++ Programmers by staunch on Friday February 06, 2015 @04:35PM (#9011703)
You're right, but it's got nothing to do with not using epoll.

Still, Go is far faster than what most people use on the web.

https://www.techempower.com/benchmarks/

Re:Go for C++ Programmers by cyber1 on Friday February 06, 2015 @04:52PM (#9011805)
Re:Go for C++ Programmers by jonnybgood on Friday February 06, 2015 @03:29PM (#9011336)
Clojure should also be a consideration.
Re:Go for C++ Programmers by npalli on Friday February 06, 2015 @03:57PM (#9011500)
You would pick Java
Re:Go for C++ Programmers by rjammala on Friday February 06, 2015 @03:25PM (#9011309)
Go is the easiest.
Re:Go for C++ Programmers by Zikes on Friday February 06, 2015 @03:52PM (#9011473)
I'm a Go fan, but ease is a very subjective measure.