15 ms·
How Uber Uses Zig
- motiejus 4y agoAuthor here. Took a while to get thumbs-up to publish the talk. Happy to answer questions, if any.
- CoastalCoder 4y agoI agree with a sibling comment: when I read "Zig" I assumed the language. You might consider adding "toolchain" to the title.
- motiejus 4y agoGood suggestion, though the title of my original talk (in the linked video) was even less assuming: "How Zig is used at Uber". Will not change it now though, as this blog post is the last piece of this talk+announcement effort.
- Ysraes 4y agoI'm actually somewhat glad I got "baited" into watching it. I don't think I would have been as likely to watch it had it included toolchain.
- deleted 4y ago[deleted]
- seg_lol 4y agopip install ziglang https://github.com/ziglang/zig-pypi https://github.com/ziglang/zig-pypi
- thebiglebrewski 4y agoThanks for publishing this, it was an interesting look into the topic! Can you explain at a higher level why Uber has the need to go to such a lower level with its programming? What services need the kind of speed that Go, Zig, and the like provide in particular? I guess I was kind of surprised to see a conversation about low-level compilation of programs being super related to Uber's core mission(s)?
- motiejus 4y agoSome services span many many hosts (not sure I can say how many though). Not because they are inefficient; that's because it takes many cpus to do to support our trips/eaters/etc. Most of the services benefit from speed/efficiency of Go: the more effective the language (runtime) is, the less we pay for hosting it, the cheaper the service to the customers. Given that, the GC costs are still significant. Depends what you compare against.
- thebiglebrewski 4y agoAppreciate the answer. In hindsight do you think any solutions could have been purchased that the company "rolled" itself? Was it necessary to create such a huge engineering organization and deep level of technology for what's essentially a ride hailing and food delivery company, or was it more needed to burnish the company's image to investors as a "technology company"? I don't mean to offend with this question, I'm just honestly curious.
- r-w 4y agoTwo words: vertical integration.
- colesantiago 4y ago> Uber does not have any plans to use zig-the-language yet. I would say that Uber uses the Zig toolchain, title is a bit misleading as I thought that Uber uses Zig (the language)
- kristoff_it 4y agoThe title is as misleading as you want it to be, Zig (the language) is famous for not being yet stable, did you really expect Uber to use it in production? edit: I just realized that maybe you were referring to the HN title. The real title is "How Uber Uses Zig" but HN cut the "How", making the title seem a stronger statement that what it's intended to be.
- Kiro 4y agoI hate HN's automatic title parsing. I get offended every time I post something and the title is automatically converted to something unintended.
- ntoskrnl 4y agoSomeone should write a blog post called "How changing titles makes Hacker News worse"
- gibolt 4y agoIt's quite comical how the auto formatter would make that factual, by removing the 'How' :)
- lmm 4y agoIt's worse than that, it's a manual process but done by people acting like robots.
- Kiro 4y agoNo, it happens immediately so there's some algorithm in the works. Mods also change titles manually but that's a different issue.
- throwaway2037 4y agoThis is cool. I don't know why the author wrote <<Uber signed a support agreement with Zig Software Foundation (ZSF) to prioritize bug fixes. The contract value is disclosed in the ZSF financial reports.>> ... but did not provide the amount. Here is what I could find: * https://ziglang.org/news/financials-update/ * https://docs.google.com/spreadsheets/d/14_ljFHGFXY5NhBhlfjgkO0RZHqeVv04fAmCxw3ZusYc/edit#gid=1409515513 2022-01-21 Deposit Uber UBER USA,LLC EDI PAYMNT JAN 20 1454320 REF*TN*0001454320*1\ Support Contract 52,800.00 Great work! Keep it up Zig community. (edit for formatting only)
- spaniard89277 4y agoI don't know about such deals, but isn't 52k like nothing for such agreement? It's close to free support.
- throwaway2037 4y agoHonestly, I'm not sure, but it is a worthy question. I quickly searched that doc: It is the only "Support Contract" entry. I sincerely hope they get more.
- johanj 4y agoThe contract details are outlined in the blog post. Depending on the number of hours worked to fix some issues, it is likely fair. > Contract terms were roughly as follows: > * Uber reports issues to github.com/ziglang/zig and pings Loris. > * Loris assigns it to someone in ZSF. > * Hack hack hack hack hack. > * When done, Loris enters the number of hours worked on the issue. > > Uber has a right to ZSF members’ time. We have no decision or voting power whatsoever with regards to Zig. We have right to offer suggestions, but they have been and will be treated just like from any other third-party bystander. We did not ask for special rights, it’s explicit in the contract, and we don’t want that.
- 2c2c2c 4y agoDoes this mean 52k upfront + (hour rate) * hours? If not, how much "time" of ZSF does Uber own?
- traceroute66 4y agoI have beef with people who boast $big_corp uses X/Y/Z. This beef applies to both commercial vendors using corporate logos on their "customers" pages, as well as open source projects wanting to hype up their community. Why ? Simple. $big_corp is BIG. I'm sure if you look hard enough you'll find all sorts of commercial and open-source technologies being used at $big_corp. It doesn't mean they use it for critical functions or even any production functions. And then when we start talking about "tech-savvy" $big_corp such as Uber, then its almost guaranteed they've got some devs sitting somewhere playing around with bleeding-edge tech .... but it still doesn't mean they are using it in production, or will be using it "soon" ... that tech might well get bored of X/Y/Z move on to the "next big thing". Or they might deploy it to production but only in Beta test to select customers, or A/B testing to larger groups.
- motiejus 4y agoWe are though. Look for "Timeline of 2022 so far" for the current status, and what our production rollout plans for 2022 are.
- giancarlostoro 4y ago> I have beef with people who boast $big_corp uses X/Y/Z. I do not, it is how you gauge if something has been tried and tested in production for example Go. It doesn't hurt whatsoever knowing that Go is used in production by Google in various high demand systems. The more companies I see using a product in production, the more I can determine feasibility. I just wish more companies would have technical blogs to describe their experiences.
- LosWochosWeek 4y ago> doesn't hurt whatsoever knowing that Go is used in productio by Google in various high demand systems. (emphasis mine) Bit odd how you could miss the only point OP was trying to make. Yes, if you know that TECH_X is used in production at BIG_CORP_Y, it's very helpful. I can tell you that in the BIG_CORP I work for, we quite possibly use or have used any- and everything for something. The point OP was trying to make is: What is that something?
- dom96 4y agoThis really shows the genius of `zig cc`: companies adopting the toolchain will have a much easier time adopting the language too in the years to come.
- liftm 4y agoMaybe. Or the language will fall into obscurity and everyone will just use the C compiler. I'm ignorant to the history here, but GCC includes Fortran, Ada, and D compilers, right? I don't see widespread adoption of those…
- cxcorp 4y agoObscurity depends on how closely you're looking. In fluid dynamics (meteorology, atmospheric sciences) and other scientific fields, Fortran definitely sees widespread adoption.
- jacobr1 4y agoAnd Ada is widely used in aerospace. Less these days for new projects, but often enough that one needs to be familiar with it.
- devmunchies 4y agoI was getting a 404. taken down? here is archive: https://web.archive.org/web/20220523131231/https://jakstys.lt/2022/how-uber-uses-zig/ https://web.archive.org/web/20220523131231/https://jakstys.l...
- motiejus 4y agoDNS. Looking. Edit: not DNS. Starting a restart-in-a-loop for now. Thanks for flagging. Will not take this down.
- mrtweetyhack 4y ago
- anoy8888 4y agoI still find it hard to comprehend how a one of the tools of a taxi calling app has this much complexity and have thousands of engineers working on it . It surely must solve a difficult technical problem but I suspect the business impact is minimal as these apps were able to become widely successful initially without this level of complexity
- hu3 4y agohttps://www.uber.com/global/en/cities https://www.uber.com/global/en/cities Any kind of business operating at these many places, having to deal with local laws, tax and payment processing in each one of them would require a huge and constant engineering effort.
- hansworst 4y agoI guess it is just a taxi calling app, but I have to say that for me personally, Uber has become a very useful tool because I can just instantly get wherever I need to go whenever I travel to a new place I've never been before. I hardly ever use Uber in my home city, but when I travel I use it all the time. That kind of stuff used to involve a bunch of planning, now I just open an app and I immediately get a decent estimation of time needed and price to get to my destination, all over the world. I don't find it so surprising that there is a bunch of complexity involved there.
- speedgoose 4y ago> Our Go Monorepo is larger than Linux kernel, and worked on by a couple of thousand engineers. In short, it’s big. I was very surprised too. So much complexity must slow them down a lot.
- latchkey 4y agoHaving worked briefly for Grab, I can comprehend it.
- dangoor 4y ago> I still find it hard to comprehend how a one of the tools of a taxi calling app has this much complexity and have thousands of engineers working on it You can really say this about almost anything once it's established. A startup can seemingly get really far with just a handful of people, but that startup is undoubtedly also dealing with only a handful of the use cases and edge cases. They also don't have legacy to maintain and upgrade. They also don't have all of the issues of scale. Couple that with the fact that as outsiders we likely only see a tiny fraction of what the system ultimately needs to deal with. I'd get this sort of feedback here whenever talking about Khan Academy's work, so I ended up blogging about it to give a sense of how much more there is than what people think about: https://www.kevindangoor.com/posts/why-khan-academy-has-so-much-code/ https://www.kevindangoor.com/posts/why-khan-academy-has-so-m...
- wiremine 4y agoTitle is a bit misleading, since they're not actually using Zig the language.
- jb3689 4y agoYeah, it seems odd to me that the title is "How Uber Uses Zig" but the first line of the page literally says "this blog post is not affiliated with Uber"...
- kristoff_it 4y agoThe author works at Uber, that line means that its just his personal blog and that his opinions are not necessarily the same as Uber's.
- throwawaymaths 4y agohttps://ziglang.org/ https://ziglang.org/ Zig is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software. Emphasis mine
- deleted 4y ago[deleted]
- tomatowurst 4y ago
- scrubs 4y ago> ...immediately.... Really? You might want breath a little bit and then relook at Zig. If you've got C code and you're stuck with it, Zig might be the "C" girl that got way!
- LAC-Tech 4y agoIn classic HN fashion, I will sidestep the content of the article and just say... Zig is the most productive I've ever been with a systems programming language. I've never been less frustrated dealing pointers and allocation in my life.
- jefftime 4y agoI strongly agree. I thought I would have this same feeling with Rust way back when I first learned about it, but the more I use Zig and Rust, the more I prefer the former for systems programming
- Jensson 4y agoSounds great, maybe I should take a look at zig. Rust feels too much like a data processing language instead of a systems language. Quick glance at Zig, it supports the kind of metaprogramming I always wanted in C++! Looks like regular code but guarantees to not typecheck the paths that can't be taken. Also has reflection! And since generic types are created like any other struct, you can write that metaprogramming like normal code as well! If it works as advertised then you could implement your own type constraints and type checking as regular code for those types, I always wanted to do that. Then I can implement compile time type constraints and type checking to see what the type supports and pick implementation based on that, or throw an error if the interface is passed some invalid type etc. This should make the code ultimately safer than even rust if you master this style of coding as you can move so much checking to compile time. What are the main problems with the language? This sounds great, just wanna hear what the drawbacks are.
- kristoff_it 4y agoThe worst part is that it's not done yet :^) This means that you will not find super complete introductory materials about every aspect of programming with Zig. The language reference is very good but for example the standard library doesn't have docs yet as we're still working on the autodoc tool. On the other hand reading the stdlib source code is very easy in good part thanks to the reasons you already mentioned in your post. https://github.com/ziglang/zig/wiki/How-to-read-the-standard-library-source-code https://github.com/ziglang/zig/wiki/How-to-read-the-standard... You might also be interested in reading about the project to see if you like where we're going (aside from technical details of the language). https://kristoff.it/blog/zig-new-relationship-llvm/ https://kristoff.it/blog/zig-new-relationship-llvm/ https://kristoff.it/blog/maintain-it-with-zig/ https://kristoff.it/blog/maintain-it-with-zig/ https://kristoff.it/blog/interfacing-with-zig/ https://kristoff.it/blog/interfacing-with-zig/ https://www.youtube.com/watch?v=AqDdWEiSwMM https://www.youtube.com/watch?v=AqDdWEiSwMM You can find links to learning materials in the "learn" section of the official website: https://ziglang.org/learn/ https://ziglang.org/learn/ Last but not least, at the moment we compensate the lack of learning materials by having a community that it's very good at helping newcomers, so make sure you join one of the communities.
- goodguyamerikan 4y ago
- nobleach 4y agoThis is why I tend to follow the project's Twitter account and NOT the authors. Authors are humans with human opinions. Some folks seem more hellbent on USING their project's popularity to spread their views... but, I don't think I've ever seen a project's Twitter retweet the author (it's usually the other way around).
- deleted 4y ago[deleted]
- benreesman 4y agoI will have to look at “zig cc”. Right now I’m using NixOS for this, but more options never hurts. I can recommend Bazel for C/C++. If you’re doing Rust or something you’ve already got a pretty good build story and maybe Bazel isn’t worth the trouble. But CMake is a nightmare, and it goes downhill from there. If you’re stuck learning a tricky build system with spotty docs, Bazel at least makes it worth your while.
- pcj-github 4y agoI recall reading https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html https://andrewkelley.me/post/zig-cc-powerful-drop-in-replace... as well and thinking this would be great to integrate with Bazel for hermetic cross-compile of go/cgo. Great to see they actually went and did it! Will definitely be trying this.
- olifante 4y agoGreat post. It's shocking to discover that the lead developer of Zig only earns 1500$ a month, and still manages to donate 10% to the musl project: https://andrewkelley.me/post/why-donating-to-musl-libc-project.html https://andrewkelley.me/post/why-donating-to-musl-libc-proje...
- lr1970 4y agoA word of caution: Uber uses `zig cc` toolchain to compile C/C++ code, not Zig language. Moreover, from the article itself: > "Uber does not have any plans to use zig-the-language yet."