Better HN
topnewbestaskshowjobs
Log inSign up

cbrewster

271 karma · joined Jun 25, 2016 (10y ago) · 49 submissions

platform engineer @ replit.com
Submissions

1.

How to ship a database every day(turbopuffer.com ↗)

15 points · by cbrewster · 3mo ago · discuss

2.

Stripe Just Wants a Number(blog.exe.dev ↗)

4 points · by cbrewster · 3mo ago · discuss

3.

ZeroFS vs. Amazon S3 Files(zerofs.net ↗)

92 points · by cbrewster · 4mo ago · 29 comments

4.

Restate 1.7: End-to-end Flow Control for your Agents and Back ends(restate.dev ↗)

1 points · by cbrewster · 4mo ago · discuss

5.

Chorus: A fast WAL for object storage(rockwotj.com ↗)

5 points · by cbrewster · 4mo ago · 6 comments

6.

Grit: Rewriting Git in Rust with agents(blog.gitbutler.com ↗)

178 points · by cbrewster · 5mo ago · 306 comments

7.

SlateDB – An embedded database built on object storage(slatedb.io ↗)

3 points · by cbrewster · 6mo ago · discuss

8.

We Built a Video Rendering Engine by Lying to the Browser About What Time It Is(blog.replit.com ↗)

1 points · by cbrewster · 9mo ago · discuss

9.

Replit's Snapshot Engine: The Tech Making AI Agents Safe(blog.replit.com ↗)

2 points · by cbrewster · 11mo ago · discuss

10.

Replit Storage: The Next Generation(blog.replit.com ↗)

11 points · by cbrewster · 3y ago · discuss

comment 4y ago · link · parent

Now you need to batch your requests to your intermediate server

comment 4y ago · link · parent

You can talk to support about missing the notification about your reservation and they'll still let you put in an order.

comment 4y ago · link · parent

Fair, but its still a real issue and solved in a similar way: Nix has finer grained reproducibility -- not only at the environment level but also at the derivation level. Being able to pick and choose which dependencies to update while ensuring other packages are left exactly the same is valuable to us.

comment 4y ago · link · parent

For context, I'm referencing our (legacy) base image for projects on Replit: Polygott (https://github.com/replit/polygott/).

The image contains dependencies needed for 50+ languages. This means repls by default are packed with lots of commonly used tools. However, the image is massive, takes a long time to build, and is difficult to deploy.

Unfortunately, slimming the image down is not really an option: people rely on all the tools we provide out of the box.

comment 4y ago · link · parent

What happens when you need to update some dependency within that image? Now you have to do an image rebuild. If you're lucky only the top-most layers will be rebuilt and the base layers stay the same, if you're unlucky nearly the whole image is rebuilt. Usually we just want to update some subset of dependencies, but during the rebuild some other dependencies may get updated unintentionally (eg if they aren't pinned to a particular version). For most, this may not be an issue but at Replit, everyone's projects use this base Docker image. Unintended updates can cause breakage for our users.

comment 4y ago · link · parent

Author here. It's titled this way because Docker seems to come up in a lot of discussions around Nix and is often compared with Nix. Partly because of their overlap in functionality but also because people may not understand the difference between the two. The goal here was to a) highlight the different use-cases between the two tools b) compare the tools in the areas that they overlap and c) show how both tools can be used together.

comment 4y ago · link · parent

Author here. In our case, we had a large base Docker image called Polygott (https://github.com/replit/polygott) it pulls in dependencies for 50+ different languages from various repositories. We would pin things where possible, but its still very difficult to ensure reproducible builds.

Additionally, docker builds have free access to the network to do anything it would like. Nix goes to great lengths to sandbox builds and limit network access. Anything accessed from a network requires a pinned sha 256 hash to ensure the remote data hasn't changed. (https://nixos.wiki/wiki/Nix#Sandboxing)

comment 4y ago · link · parent

Author here. As with most things, its all about the trade-offs. Docker has certainly proved itself and that approach has worked on a massive scale. However, its not a silver bullet. For us at Replit, our Docker approach was causing issues: our base image was large and unmaintainable and we had almost no way of knowing what changed between subsequent builds of the base image.

We've been able to utilize Nix to address both of those issues, and others who may be in a similar scenario might also find Nix to be valuable.

Of course Nix comes with its own set of opinions and complexities but it has been a worthwhile trade-off for us.

comment 4y ago · link · parent

While you can copy files from different stages, I wouldn't consider this to be the same thing as composing two base images together. Like the example in the post, you can't take the Rust and NodeJS images and tell Docker to magically merge them. You can copy binaries & libraries from one to the other but that seems extremely tedious and error prone.

Whereas Nix makes it rather trivial to compose together the packages you need (eg Rust, NodeJS) in your environment.

comment 5y ago · link · parent

It was more of a silly demonstration showing what's possible and less about being practical. :)

comment 5y ago · link · parent

Yeah, we are really excited about the future Nix will bring for us at Replit. Soon, language version incompatibility will be a thing of the past on Replit.

comment 5y ago · link · parent

Yup, you can setup Haskell with Nix. I'm not too familiar with Haskell, but it looks like Nix even has a collection of Haskell packages (including lens). This looks like it is a good resource for getting started with Nix + Haskell https://notes.srid.ca/haskell-nix, you should be able to follow along in a Nix repl. I recommend forking on of the example repls from the blog post.

comment 5y ago · link · parent

Sorry, building nix environments from scratch is still rough around the edges and we are working to improve that at the moment.

When hosting a web server, your app must listen on 0.0.0.0, adding that to your repl seems to make that work. I will make sure that is in our docs for web hosting.

Working Racket web app: https://replit.com/@ConnorBrewster/racket-server

comment 5y ago · link · parent

This is coming soon!

comment 5y ago · link · parent

The config files should be visible again, sorry for the delay!

comment 5y ago · link · parent

Here's a template for Racket: https://replit.com/@ConnorBrewster/racket

comment 5y ago · link · parent

Here's a template for nasm: https://replit.com/@ConnorBrewster/nasm

comment 5y ago · link · parent

If they are in Nixpkgs they will likely work in a repl. Nixpkgs search: https://search.nixos.org/packages

Piet: https://search.nixos.org/packages?channel=unstable&show=hask...

comment 5y ago · link · parent

Hi, one of the authors here. The Nix environment on Replit is under development right now, we hid the configuration files to clean up the filetree as most users shouldn't need to know about the config files unless they are customizing the repl environment.

However, we are reverting that change for now since we don't offer a good way to access those files yet. I'll reply here once they are visible again.

12