4 ms·
Is Slack still written in Hack/PHP?
by alberth 3y ago
Is Slack still written in Hack/PHP?
- aftbit 3y agofrom the article: >Slack does not share a common codebase or even runtime; services in the user-facing request path are written in Hack, Go, Java, and C++.
- skullone 3y agoMan what a mess. Meanwhile, everyone else can extend a library used by their common services in a common language trivially.
- rs_rs_rs_rs_rs 3y agoLet me guess, they should rewrite everything in Javascript?
- skullone 3y agoWoe is us if they actually did.
- tomrod 3y agoNah, Excel. /s
- HumanOstrich 3y ago[flagged]
- wmf 3y agoAlmost everyone embraced polyglotism and microservices together.
- hotnfresh 3y agoMeh. As long as you’ve got a good, typed interface for passing messages between them and for having a common understanding of (and versioning system for) key data structures, that’s fine for this sort of thing where it’s largely processing steams of small messages and events. … but it’s probably JSON and some JSON-Schema-based “now you have two problems” junk instead of what I described. In which case, yeah, ew, gross. Unless they’ve made some unusually good choices.
- nostrebored 3y agoThere are tons of approaches to align on service contracts for JSON based API calls. There’s also libraries like gRPC which help make contacts explicit. Neither are really uncommon
- xwowsersx 3y agoWhat are some of those approaches? Are there formal methods and/or tools for doing this?
- muglug 3y agoYes — see my recent article https://slack.engineering/hakana-taking-hack-seriously/ https://slack.engineering/hakana-taking-hack-seriously/ We use a few languages to serve client requests, but by far the biggest codebase is written in Hack, which runs inside an interpreter called HHVM that’s also used at Facebook.
- koolba 3y agoI really like the writing style in that article: > PHP makes it really easy to make a dynamically-rendered website. PHP also makes it really easy to create an utterly insecure dynamically-rendered website.
- alberth 3y agoHi Matt Thanks for Psalm! Curious, if Slack was built today from ground up - what tech stack do you think should/would be used?
- muglug 3y agoThat’s a simple question that’s hard to answer. A slightly different question that’s a bit easier to answer: “if I could wave a magic wand and X million lines of code were instantly rewritten and all developers were instantly trained on that language”. There the choice would be limited to languages that have similar or faster perf characteristics to Hack, without sacrificing developer productivity. Rust is out of the question (compile times for hundreds of devs would instantly sap productivity). PHP, Ruby, Node and Python are too slow — for the moment at least. So it would be either Hack or Go. I don’t know enough about JVM languages to know whether they would be a good fit.
- alberth 3y agoI like your question way better than mine :) Some follow-up … A. isn’t PHP on par perf wise to Hack these days? Re: “PHP is too slow” comment. B. have you ever looked into PHP-NGX? It’s perf looks impressive, though you lose the benefit of stateless https://github.com/rryqszq4/ngx-php https://github.com/rryqszq4/ngx-php https://www.techempower.com/benchmarks/#section=data-r21 https://www.techempower.com/benchmarks/#section=data-r21