Live data from Hacker News

Programming languages endorsed for server-side use at Meta

engineering.fb.com

181–190 of 302 posts

Re: Programming languages endorsed for server-side use at Meta

#181

I'm very surprised that C++ is one of the recommended languages for backend services. I occasionally am interested in learning C++ but with my context as a web developer I find it doesn't really fit any of my use cases. How would one go about building a rest service in C++? Do you have to write everything yourself or are there libraries and frameworks. I did some light looking into it after reading the article but I…

I’d bet they use e.g. Python to receive the HTTP calls and do basic logic at that level, but use C++ libs to chew through lots of multimedia, ML/AI, etc.

Re: Programming languages endorsed for server-side use at Meta

#182

Earlier quoted context omitted.

If I can have a XAML/WinForms like UI dev experience with Rust on Linux, I am sold. Even just a usable rich UI framework on Linux. Cross-platform is a bonus, but since I believe Linux is the future I can live without other platform targets. We all hate the resource hogging desktop apps that are just browsers (which in turn are just OS'es). That is a niche as wide and as open as the ocean. Cryptography and web framewo…

UI is a poor fit for Rust, IMO, because the natural way to model UI widget hierarchies is rather painful with ownership tracking in the picture. But I don't see why that precludes Rust from being a good choice in other applications, CLI in particular.

Well, isn´t that a bit damning though? I am not an expert on Rust, so please enlighten me. If it is meant to replace C++, I would expect it to dethrone on the areas where it is king. I am looking at a crap ton of programs with an UI. Your IDE, your text editor, your spreadsheet program, your graphics editor, etc. Most of the modern programs just give up and ship as a full blown bloated memory eating web browser.

There is a gap between the nineties and now, and it is still void.

If you have to constrain it to CLI apps the average developer here on HN needs to write, I don´t see a reason to use such a complex beast as Rust. If you mean operating systems, I can see a spot for Rust. Also database systems or a web server implementation. But that is fairly niche.

For userland cli-apps I am not sure if the added complexity pays of in terms of sufficient performance gains in practice. If you want to write a new implementation of grep, sure. But how niche is that?

So in those cases where you need both type strictness (which I agree should be the default requirement) and cannot have an automatic garbage collector, I can see the value of Rust.

But for what audience is an automatic GC really a problem? Personally I would use Haskell, Java, F# for CLI-apps, but I know there are tons of other options there.

Re: Programming languages endorsed for server-side use at Meta

#183

> Meta’s primary supported server-side languages are Hack, C++, Rust, and Python. > For specific use cases, we support other languages, including Java, Erlang, Haskell, and Go Makes sense. Python because ML. Rust because of performance. C++ and Java because all-the-things. Go because 75% of all cncf.io projects are Go. Haskell because elitism. Erlang because stability. /s I think the real story is that migrating off…

> Erlang because stability.

Maybe because of WhatsApp acquisition ? Some services might still be running in Erlang. Last I heard, Erlang was being replaced by C++.

> Haskell because elitism.

Haxl used to be a project at FaceBook, not sure what Haskell is used for now there.

Thoughts as an outsider. I dont work [neither have worked] at Meta.

Re: Programming languages endorsed for server-side use at Meta

#184

I’m surprised they said Rust is their new language of choice for CLI tools. I’m no expert but always saw Go as the better choice for CLI tooling where performance is important, Rust more of a low level language for highly performant libraries and tools, and Python a good choice for scripting or plumbing that needs to work and be easily maintainable, without special performance concerns (Python is my primary language,…

> I’m no expert but always saw Go as the better choice for CLI tooling where performance is important

I'm no expert in golang, so golang may in fact be better(?) by some metric of better, but as the author of a Rust CLI tool[0], I will say that Rust is extremely performant, and pretty fantastic at this very use case. It seems like a sweet spot to me.

[0]: https://github.com/kimono-koans/httm

Re: Programming languages endorsed for server-side use at Meta

#185
post #51

What's always been interesting about the languages Meta uses is the story of the rise and fall of the D programming language at Meta. I wasn't around at the time when Andrei was working there and advocating for its adoption, but it seemed like he hit a wall at some point. By the time I joined all D services were being deprecated or rewritten. Rust seems to be doing far better. Though it's also worth noting that Go ne…

There wasn’t that many D services at Facebook. There may have been more outside buzz about its usage than reality.

Re: Programming languages endorsed for server-side use at Meta

#187
post #157

Earlier quoted context omitted.

The borrow checker and lifetime annotations. It's always the borrow checker and lifetime annotations - otherwise Rust is, IMHO, as readable as (the excellent) Golang.

I've often wondered what it would be like having a variant of Rust that was essentially the same underlying language, but with a garbage collector of some kind instead of a borrow checker and lifetime annotations.

You can approximate this already: forget Rust references (borrow checking + lifetimes; in other words, raw pointers) and start hacking with Rust using its shared ownership (reference-counted) smart pointers, immutable Rc[1], mutable RefCell[2] and the combination of the two[3]. The syntax will, overall, get considerably more dense than Go, but otherwise analogous to Go. Instead of GC cycles, memory will be freed incrementally, immediately when no longer in use.

[1] - https://doc.rust-lang.org/book/ch15-04-rc.html

[2] - https://doc.rust-lang.org/book/ch15-05-interior-mutability.h...

[3] - https://doc.rust-lang.org/book/ch15-05-interior-mutability.h...

Re: Programming languages endorsed for server-side use at Meta

#188
post #130

Earlier quoted context omitted.

Yeah sorry I should have been more specific that I meant used in the operating system. That was my bad.

Nothing prevents Google to eventually change their mind in regards to its support on userspace, however given how the NDK has been managed all these years (as a kind of side project at least from the outside), I pretty much doubt it.

Right the future could be anything, so we might as well just talk about the present.

Re: Programming languages endorsed for server-side use at Meta

#189
post #142

Earlier quoted context omitted.

Yeah. They are both writing code in Rust and also dabbling in creating a language of their own to see how that goes, not necessarily with the intent of releasing it, but at least exploring the space from first principles instead of being incumbered by Rust's decisions. I think the name started with V but I cannot find it right now with quick Googling.

I believe you're thinking of Project Verona. https://www.microsoft.com/en-us/research/project/project-ver...

This is it, thank you for digging it up!

Re: Programming languages endorsed for server-side use at Meta

#190

> Meta’s primary supported server-side languages are Hack, C++, Rust, and Python. > For specific use cases, we support other languages, including Java, Erlang, Haskell, and Go Makes sense. Python because ML. Rust because of performance. C++ and Java because all-the-things. Go because 75% of all cncf.io projects are Go. Haskell because elitism. Erlang because stability. /s I think the real story is that migrating off…

> Erlang because stability. Maybe because of WhatsApp acquisition ? Some services might still be running in Erlang. Last I heard, Erlang was being replaced by C++. > Haskell because elitism. Haxl used to be a project at FaceBook, not sure what Haskell is used for now there. Thoughts as an outsider. I dont work [neither have worked] at Meta.

Iirc the story was fb messenger was written in Erlang, then they rewrote in c++ because of no trust in erlang (I think that was around when fb messenger started sucking with everyone complaining about bugs -- it was better last I used it 4 yrs ago) then ironically they re-acquired Erlang via WhatsApp.

I wonder if they will make that mistake twice

Post reply on HN