Live data from Hacker News

Programming languages endorsed for server-side use at Meta

engineering.fb.com

131–140 of 302 posts

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

#131
post #107

While this is cool to see "how the big guys do it", this article is worthless. Specifically, it lacks one fundamental thing: why. Why isn't Go in this list? It is very surprising since it feels like all off tech jumped on the Go bandwagon, though I won't complain. I can only guess at why, but it would be very interesting to see why. Why is Rust in the list, other than "so many people started to use it internally that…

The article does a good job of explaining why the list is small - and in my opinion quite useful in that regard. Agree that it would be interesting to know what perceived costs/benefits of various options considered were. I suspect accidents of history, before the need for a list like this was recognized, play a large part.

When I started there in 2013 the philosophy was that they'd help you build your service in any language. Funny the difference a decade makes, I suppose.

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

#132

> 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…

Hack because?

Basically, all the front-end code on the server side is written in Hack, because it was originally written in PHP. My understanding is that general application logic, like permissions, is handled by libraries written in Hack. Also stuff like templates (for HTML or other UIs, including CSS), etc.

Hack is recognizable as a PHP derivative but the experience of writing Hack is very different from the experience of writing PHP.

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

#133

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…

Clearly one can write web services in C++. Meta does not really, though. It is Hack code that talks to most web clients (and python for Instagram). The C++ code sits behind that. All of the databases, the caches, the indexing services, the ads ranking and selection are written in C++ and talk Thrift to each other and to the Hack code.

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

#134

Earlier quoted context omitted.

> I’ve been holding off learning Rust. Rust is quite an easy language to learn and a pleasurable language to use, due to its modern ergonomics and internal consistency. Give it a try. The only trick is that Rust newcomers actually need to read up on Rust borrow checker and lifetime annotations first, as opposed to learning Rust only through hacking with it. Those two concepts are unique to Rust and need to be well un…

Rust is not an easy language to learn. Among languages in common use, it is almost certainly the most difficult language to learn.

Disagree. C++ is the most difficult - the compiler accepts programs which Rust would reject and then they segfault or worse.

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

#135
The primary use case for Rust being CLI is somewhat strange and speaks to non-technical considerations. Does anyone really think there is an advantage Rust brings here over everything else -- Golang, Python etc. Rust community seems to go after "hot" areas in hopes of getting traction, fully understandable. Writing web services is another area Rust people jumped into looking at the popularity of Golang. Most recent "hot" area being crypto. The reality is none of these areas is a sweet spot for Rust and will remain niche (in comparison to other languages). The sweet spot is low level systems programming and displacing C++ (of which there is a real and desperate need). If the community can focus on interoperability with C++ (at the gnarly level), would be make a big difference to adoption.

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

#136

While this is cool to see "how the big guys do it", this article is worthless. Specifically, it lacks one fundamental thing: why. Why isn't Go in this list? It is very surprising since it feels like all off tech jumped on the Go bandwagon, though I won't complain. I can only guess at why, but it would be very interesting to see why. Why is Rust in the list, other than "so many people started to use it internally that…

I can't say Go had the adoption I was hoping for.

It did well in the infra community (probably starting with docker) but, among my clients in services, I can think only of one failed startup who bet on Go (and actually failed because they decided to rewrite from node to go).

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

#137
post #88

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…

There are libraries and frameworks. Note that before Java adoption push we had stuff like ATLServer, and the first version of ASP were basically COM libraries being called from VBscript/JScript. On our case, we were calling C code from TCL scripts, using plugins like mod_tcl. Nowadays you have stuff like Boost ASIO and Wt. However I wouldn't plug C or C++ directly into the Internet, rather call them from managed lang…

This is what I had considered to be the state of things. The phrasing on initial read suggested to me that C++ & Rust were the default now for performance critical services (with Rust being a new add) and Hack was used where it made sense but not necessarily by default anymore. I think I may have discounted Hack's role too much.

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

#138
post #86

I used to work there, and I'm personally sad that JavaScript wasn't mentioned: I was the architect of https://dl.acm.org/doi/10.1145/3477132.3483572

Probably because most of the backend developers are former frontend developers that are sick of JS.

node is generally pretty popular, despite JS's shortcomings (and various drama, eg. require vs import, transpilation nightmare)!

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

#139
post #71

Earlier quoted context omitted.

> Probably the data size is so high that the only way to survive there is to write everything in low level C++ or Rust. Except they say: “For data science, ML applications, and Instagram, Python continues to be the language of choice, and we continue to invest in the experience with this ecosystem.”

For research you use Python or whatever. For production you compile your models to whatever their proprietary equivalent to TorchScript and ONNX is, which is surely executed by hyperoptimized C++/Rust/Cuda code.

PyTorch came out of Meta AI and I'm pretty sure they are still the primary contributors, so I assume they use TorchScript.

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

#140
post #135

The primary use case for Rust being CLI is somewhat strange and speaks to non-technical considerations. Does anyone really think there is an advantage Rust brings here over everything else -- Golang, Python etc. Rust community seems to go after "hot" areas in hopes of getting traction, fully understandable. Writing web services is another area Rust people jumped into looking at the popularity of Golang. Most recent "…

Chasing popularity seems to be a necessary evil these days.

I am disappointed when zig calls itself a general purpose language, and 10 years ago Go called itself a system language.

Post reply on HN