HNHacker News
TopNewBestAskShowJobs

jmillikin

11,783 karma · joined March 23, 2009

https://john-millikin.com/

john@john-millikin.com

Currently semi-retired; formerly at Google (2011-2017) and Stripe (2017-2022)

submissionscomments
jmillikin··on Container Runtimes and WasmEdge benchmarking on Arm
The article is not describing the Cloudflare approach (v8 isolates) -- note the graph of startup times. Their "wasmedge" line takes 20 seconds to start 1500 instances, or about 13 milliseconds per instance.

Cloudflare's blog post at https://blog.cloudflare.com/cloud-computing-without-containe... contains a graph in which requests are handled in 200 microseconds, orders of magnitude faster.

jmillikin··on Container Runtimes and WasmEdge benchmarking on Arm
Ok then. Let's say I write a webserver with WASI, compile it to a `.wasm` file, package it as an OCI container image, and deploy it in Kubernetes via a container runtime that loads the entry point into wasmtime.

If containers and WASM are in fact competing technologies, as you and the article imply, then this shouldn't be possible.

On the other hand, if WASM is a format for executable code as I claim, then packaging WASM as a container image and executing it in a container runtime is fine and should work as well as any other machine-independent bytecode (such as JVM).

jmillikin··on Container Runtimes and WasmEdge benchmarking on Arm
WASM is WebAssembly. Words have meanings.

If someone wants to try to advertise some weird custom platform that uses WASM as an intermediate bytecode for its packaging format then that's fine, but they'll need to pick a different name.

jmillikin··on Container Runtimes and WasmEdge benchmarking on Arm
A comparison between WASM and x86/ARM/etc native binaries is meaningful, because those are different formats for executable code.

A comparison between WASM and "containers" is meaningless, because the binaries being executed by a container runtime could be written in WASM. The executable format and the packaging format are separate concerns.

This might be easier to think about if you imagine the article was written as "native code vs containers" -- what conclusions (if any) could you draw from the benchmarks in an article with that premise?

jmillikin··on Container Runtimes and WasmEdge benchmarking on Arm
Is it possible you don't have direct experience with CGI?

The typical way to deploy CGI during the '90s was to have a compiled program in C/C++, which would be executed once per request. There were entire frameworks built around this "process per request" model, with various optimizations like pre-warming (start the process, connect to db, wait for request on stdin) and variant protocols (SCGI).

Any time you have an execution model based on running a single address space per request, it's fundamentally CGI-ish. It doesn't have anything to do with the implementation language. The limitation of CGI is that state can't be persisted in-process between requests.

---

Going back to the thread, there's multiple aspects when thinking about the structure of a hosted service:

1. Whether state is shared between requests (CGI vs long-lived process).

2. Whether the binary is native code (x86/ARM/) or bytecode (WASM/JVM/).

3. Whether the binary is standalone or comes with additional files.

4. If it needs additional files, whether it's distributed as a package (apt/rpm) or chroot (container image).

Does breaking those different concepts down into a list help? You can see that trying to compare the performance of "WASM deployed as standalone binary with CGI execution model" and "native code deployed in container image" just isn't meaningful. The article is mixing up too many different ideas when trying to benchmark.

jmillikin··on Container Runtimes and WasmEdge benchmarking on Arm

  > Actually there is support for using WASM as a container runtime.
Isn't that what I said?

Some container runtimes (such as `runc`) execute a native binary. There are also container runtimes that execute a WASM+WASI binary.

So trying to compare WASM with "containers" is like asking "should you deploy your code as x86 or as a container", which isn't a useful question.

jmillikin··on Jails on FreeBSD
Namespaces and cgroups provide resource accounting and some limited isolation between trusted workloads. They're not considered a sandbox or security boundary because the processes have full access to the Linux kernel APIs, which are not well-hardened.

To provide a security boundary between Linux processes, it's currently considered best practice to use something like Firecracker or gVisor.

jmillikin··on Jails on FreeBSD
Whenever an article about FreeBSD's jails gets posted here, the comments tend to drift toward an argument about jails vs Docker containers. People call them "Linux containers", but really they're talking about Docker (or its clones like Podman).

This may be me shouting into the void, but I wish there were an article directly comparing jails with namespaces, which is the Linux functionality that Docker uses. I can totally believe that FreeBSD jails provide a better / more unified / more secure experience than Docker, but to extend that into saying "FreeBSD jails are better than Linux namespaces" feels like a category error.

Questions I would like to see answered in that article:

* Can jails be used to run subprocesses in the normal filesystem, but with a different network environment (for example making a given command run its net traffic through TAP)?

* Can jails be used to limit memory/cpu/IO/network for subprocesses? For threads within a process?

* Can live processes be moved into or out of a jail?

* Can jails be used to make a process think it's running as a different user?

I feel like the answer to these questions is generally "no, that's not what jails are for", which is (1) a fine answer given the apparent goal of being a better chroot(), and (2) reinforces that jails and namespaces are addressing different problem domains.

jmillikin··on Jails on FreeBSD
Most of those are supported by "containers", which are after all just a chroot and a process tree with restricted visibility into certain kernel objects. Assigning individual NICs or running a browser with extra isolation is one of the classic Linux namespace tutorials.

  > You can setup Linux in a jail.
I don't see how this can be possible. Could you explain more how to boot a Linux kernel within a FreeBSD jail?

edit: I'm not talking about running binaries compiled for Linux under FreeBSD. The parent said it's possible to set up Linux within a jail, so I want to see instructions to boot an actual Linux kernel as a FreeBSD process.

jmillikin··on Native AOT Overview
I'm satisfied with Bazel as a build system, and some of its functionality that is important to me (sandboxed remote execution) works best when it's not used to delegate to recursively nested sub-builds. To the extent I wish anything different about Bazel, it's to move even further away from integrated language-specific logic[0].

The idea of trying to learn some new ecosystem-specific build tool (in this case msbuild) is unappealing. Done that too many times, and I'm tired of fighting with tools written for/by people who think projects are written in a single language.

[0] I hear Buck2 is a step in this direction.

jmillikin··on Native AOT Overview

  > Banshee is a pretty long-lived project; we might be talking 10+ years ago.
I looked through my archives and I think most of my contributions were pre-2010, so 13+ years.

Mono was a very different thing back then -- less mature, and Microsoft (mid Ballmer era) seemed to have a love/hate relationship with it.

jmillikin··on Native AOT Overview
Notice how that page describes how to configure the toolchain using XML. That's the thing I don't like -- instead of just building up an args list like cl.exe, I need to write my own intermediate tooling that synthesizes a .csproj and spits it out into the build sandbox before launching their magic do-everything binary.

There's clearly something else underneath, the <LinkerArg> element is exactly what I would want to generate when running link.exe, but most of the configuration options are wrapped in a layer of gunk.

Ideally it would be possible to invoke a command directly to convert a bunch of *.cs files into a .dll (or .a), then I could use existing logic to link it with link.exe (or ld).

jmillikin··on The Windows XP activation algorithm has been cracked
Each version of Windows has had its upsides and downsides.

My favorite in terms of looks and behavior is Windows 2000, and it's still in the top 5 when I think of desktop UIs that don't try to grab the user's attention. It was also much lighter on resources than XP, and didn't have poorly-animated dogs hiding behind the menus.

But oh man, let me tell you, the first time I experienced one of the newer versions restart its graphics driver without losing state was magical. I can't remember how many hours I lost to blue screens with a stack trace deep inside some ATI/nVidia dll, and to this day I can get a kernel panic in Linux if I tickle the GPU the right way, but modern Windows has proper GPU driver isolation and they did it without wrecking performance.

I wish it were somehow possible to run the pre-XP interface on the modern OS.

jmillikin··on Choosing a Name for Your Computer (1990)
That would have been one way to implement it, certainly.

The actual implementation was something like this:

  const char *cluster = "ex";
  uint16_t enc_cluster = (((uint16_t)cluster[0]) << 8) & (uint16_t)cluster[1];
A proposal to reserve the high bit to signal a "long name" was unfortunately(?) not accepted.

This was nearly a decade ago, so things may be different now. You'd have to ask someone who currently works there to tell you what their cluster names look like.

jmillikin··on Native AOT Overview
I used to contribute to a C# project aimed at Linux users[0], and one of the personally annoying aspects was requiring the .NET runtime. It's a lot like how Java programs require a JVM, except worse because OpenJDK is a blessed implementation in a way that Mono never was.

When I saw that .NET 7 included AOT, I immediately downloaded it to play around. It's clearly not fully baked (missing macOS support), but what is there is great. AOT makes C# a direct competitor to Go for projects that don't need to wring every last cycle out of the CPU, and it doesn't have the same squeamishness about language complexity that characterizes Go.

The only part of .NET 7 that really bothers me is the compilation process. I couldn't find any compile-to-obj command with flags and such, instead there's a `dotnet` command that takes its input via a monolithic `.csproj` XML file and spits out a fully-formed binary. Trying to integrate C# into a Unix-style build pipeline (make/Bazel) doesn't seem straightforward in the current SDK.

[0] https://www.banshee-project.org/

jmillikin··on Choosing a Name for Your Computer (1990)
Pick the nearest airport? Or a nearby airport? Airport in the location's capital city? There's always an airport[0].

The purpose is to have a Schelling point that bypasses any tedious weeks-long arguments. Otherwise your Frankfurt datacenter gets named "ceurope" because the London datacenter got "europe" first, or you named the Ohio datacenter "east" and there's a fight about whether to call the new Virginia datacenter "easter".

[0] If you're building a submerged datacenter in the middle of the Atlantic then ... well, do your best.

jmillikin··on Choosing a Name for Your Computer (1990)
If you're going to be naming a lot of computers, it's surprisingly important to pick a naming format that is (1) expandable and (2) trivially parseable. The naming scheme that seems simple when you're in a garage can be constraining when there's too many to track in a spreadsheet.

My favored format is somewhat complex in terms of layout, but is compact and easy to read once you get used to it:

  IATA code (https://en.wikipedia.org/wiki/IATA_airport_code)
  Cluster number (digits)
  'r' (for "rack") \______ if meaningful for you
  Rack number      /       (ignore for EC2/GCP)
  'm' (for "machine")
  Machine number
An example hostname might be `dls1r56m10.mycompany-prod.com`.

Alternatives that don't work as well:

* Don't use a fixed-width field anywhere. Google used two-letter cluster names, and when those ran out they discovered that the two-letter assumption had worked its way into every layer of the stack. One of the important core services had `uint16_t cluster` in its wire protocol.

* Don't make up your own cluster names. Don't use names like "northwest" or "east". IATA codes are your friend and you will love them because someone else already decided what they should be and wrote them down.

* Don't use fields without delimiters. Being able to say "read digits until the next non-digit" is incredibly useful when writing ad-hoc parsers in shell scripts, because those parsers won't break when you bring up the first datacenter with more than 99 racks. If you tell people not to write hacky ad-hoc parsers in shell scripts, they will (1) do so anyway and (2) not tell you.

* Don't leave off the cluster number. Yes, you only have one cluster in us-west-2 right now, but maybe in five years you'll need to have more than one because you want to run 30,000 EC2 instances there but all your per-cluster infrastructure software falls over at 20,000 instances. Then you can just turn up "pdx2" instead of trying to explain to Hashicorp engineers why you want to run the world's biggest Consul cluster.

* Do not put the production hostnames under a subdomain of your corporate website. If you are ACME LLC then your hostnames should end with `.acme-prod.com` instead of `.prod.acme.com`. The same is true of corporate IT assets like laptops or workstations (`acme-corp.com` -- NEVER `.corp.acme.com`). Why? Browser cookies.

jmillikin··on Almost 200k Job Cuts in Tech Pushes New Grads to Wall Street

  > most abandon programming proper rapidly - I'd hazard within 3 years - and
  > go on to other tertiary fields (PM, DevOps, SRE, etc)
SRE is a specialized subfield of programming. Someone has to write and debug all those low-level tools (runc, systemd, etcd) that sit "below" what most people consider to be the backend stack.

If someone becomes an SRE because they don't like programming, they're going to be in for a big surprise when they discover how much quality time they're about to share with the unshare(2) manpage.

jmillikin··on The Absurdity Of Stacks
The default stack size in most OSes is tiny, and when programming in a low-level language (including Rust) it's important to keep large allocations off of the stack. That's why Rust has Box/Vec and the various APIs in `alloc`, and why the cross-thread primitives take ownership of their values.

You can "transfer" a 1 GiB `Vec` between threads without having to actually copy it, which is not true of stack-allocated values.

The relative scarcity/cost of the stack vs heap only gets more extreme as the machines get bigger. My desktop has 128 GiB of RAM, and `ulimit -s` reports a default thread size of 8 MiB. A typical rack-mounted server is going to have 1 TiB or more of RAM, and almost certainly the same stack size.

Could I make the stack size bigger on my machine? Sure, yes, but what would that get me when the entire world writes software with the assumption that any allocation over a few dozen MiB needs to be on the heap?

jmillikin··on Lojban: Constructed language to eliminate ambiguity from communication
The goal of Lojban is to eliminate syntactic/grammatical ambiguity:

  Time flies like an arrow, fruit flies like a banana.
In this example, "flies" could be either a noun or verb depending on context. That sort of construct isn't possible in Lojban.

Of course, it's still possible to use Lojban to express statements that have an ambiguous or unclear meaning.

jmillikin··on Literate Programming: Articles
Haskell does not natively support literate programming -- it only allows the comment/code default to be swapped. The format named "literate Haskell" is basically just syntactic sugar for {- comment blocks -}. Literate programming requires the ability to decouple the ordering of code relative to the commentary.

I wrote more about this at <https://news.ycombinator.com/item?id=35985835> and <https://john-millikin.com/software/anansi#history>.

jmillikin··on Literate Programming: Articles
That's an IDE configuration problem. Most of them support mixed-mode syntax highlighting nowadays, so you just need to configure your theme to treat block comments as Markdown (or LaTeX, HTML, whatever).

You could probably even do it with Markdown directly, using fenced code blocks as part of your begin/end lines.

I think you'll find that this approach offers very little benefit over either traditional commentary or linear notebook-style inline code blocks.

jmillikin··on Literate Programming: Articles
Every language with block comments supports this, by starting the file with a comment and wrapping code in end-comment/start-comment pairs.

It's not especially useful. For literate programming you really need the ability to move blocks of code around without the ceremony of function signatures.

jmillikin··on Literate Programming: Articles
I wrote a literate programming preprocessor in Haskell[0], and used it to weave/tangle a D-Bus implementation (also in Haskell). The woven PDF[1] weighs in around 90 pages.

I'll quote from the linked page regarding my conclusions:

------------>8----------

But in the end, I was never able to realize the promised benefits of Literate Programming. The typeset PDF was not easier to read than hypertext documentation generated by Haddock, and both were obviously worse than the very nice docs being created by the Python community with Sphinx.

So in mid 2012 (~3 years after starting the project) I removed all the literate annotations and styles, dropped the fancy build scripts, and released haskell-dbus 0.10 as standard Haskell.

------------>8----------

I'm sure an expert in LaTeX could do a better job with the formatting, and with the benefit of 10 additional years of experience there are some design decisions I would do differently in the code, but even so I think it was a reasonably effortful attempt.

I've never felt any urge to try Literate Programming again.

[0] https://john-millikin.com/software/anansi#history

[1] https://github.com/jmillikin/haskell-dbus/releases/download/...

jmillikin··on Why Do American Diners Have Such a Limited Palate for Textures?
I endured reading this entire 2500-word article hoping it might eventually meander its way toward answering the question in its own headline, only to be left disappointed, like a diner who orders a bowl of ramen and discovers not a single noodle beneath the beansprouts.
jmillikin··on Sorry Purism, I’m not investing. It’s (possibly) not even legal

  > it would be much more reasonable for OP to note that they don't
  > have a clue if anybody would be breaking the law
If someone who does not qualify as an Accredited Investor has invested into a security that is only allowed to be sold to people who qualify as Accredited Investors, then the law has clearly been broken by someone. You don't need to graduate from Yale to understand this.

  > Your teenaged kid takes your car without you knowing and kills somebody in
  > a car accident. Drunk. On your alcohol. Did they steal it? What's your
  > liability? Do you need to talk to a lawyer, or is it reasonable for OP to
  > give you his opinion?
The OP's opinion would likely be like mine, or like any reasonable person's, which is that (1) an illegal thing has clearly happened, (2) your kid has clearly done at least one illegal thing, (3) you may also have done something illegal.

What kind of person would look at the facts of that situation and think "hmm, I dunno, this law stuff is difficult, no way for me to know if I have any legal risk"?

jmillikin··on Sorry Purism, I’m not investing. It’s (possibly) not even legal
You're focused on some extremely narrow view that's right on the legal/illegal boundary and thinking that's the whole world.

The easiest way to not go to jail for assault with a deadly weapon is to not assault people. It is very easy to follow this guideline, and the success rate is quite high (most people in the world are not currently in jail).

If you absolutely must assault someone, and you decide to use a weapon, then yes, you will likely want to hire a lawyer to write a bunch of carefully-argued pages about why you shouldn't go to jail.

But it's not like you would just be walking down the street, knocking people out with a tire-iron as one does, and then get ambushed by the complexities of the law.

jmillikin··on When you lose the ability to write, you also lose some of your ability to think
ChatGPT can't replace writing intended to convey information, but that's only a small fraction of the writing that's getting created. There's a whole industry where people are given prompts like "five paragraphs about the history of spaghetti" and get paid $0.01 per word, then that text gets put into an Italy-themed travel blog full of ads.

You and I wouldn't notice if that entire industry was replaced by ChatGPT because nobody reads that text, it doesn't exist to be read, it exists to tickle some ranking model deep in the bowels of Google. But you can be sure that the people selling coherent text for $0.01/word will notice when ChatGPT can generate the same thing for $0.000001/word.

jmillikin··on Sorry Purism, I’m not investing. It’s (possibly) not even legal
I think you're reinforcing my point, not disagreeing with it.

You cite examples where the law forbids something, but a judicial opinion allows it. So one easy way to avoid doing something illegal in all of your examples is to simply follow the law as written.

Sure, maybe with legal counsel you could push things a little further, get your nunchuck possession charge dismissed because you were pulled over two hundred yards past the Yuba county line or whatever, but that's different from someone who wants to avoid getting in trouble in the first place.

jmillikin··on Sorry Purism, I’m not investing. It’s (possibly) not even legal
Many people posting on the internet have this strange idea that American law is opaque and difficult to understand, but in general it's actually pretty accessible. If you can read software, you can read American legal documents.

The reason lawyers get paid so much is that if you're doing something that is right on the boundary[0] then the difference between legal and illegal might be extremely fuzzy, and also worth a lot of money, so it's worth paying someone $1000 an hour to write a long brief in your local judge's preferred WordPerfect template about why what you're doing is OK.

On the other hand, the SEC website linked by OP just has a checklist of Accredited Investor qualifications, and it's possible to read them. Do you have a salary of $300,000? You qualify. Did you make $195,000? Well, that's less than $200,000 so unless one of the other checkboxes matches, you're out of luck[1].

[0] Maybe it's illegal by the letter of the law but you think it shouldn't be, like ride-sharing in locations with taxi regulations. Or maybe it's not illegal but might be viewed with extreme skepticism by regulators, like offering a non-fraudy Bitcoin exchange. In both of those cases, there's an easy solution (just don't do the maybe-illegal thing) that is accessible to the layman.

[1] Maybe you can hire a lawyer and/or CPA to get your $6000 of undeclared dog-walking income counted for the purposes of Accredited Investor qualification, but is it really worth the hassle?

← PreviousPage 4 of 34Next →