HNHacker News
TopNewBestAskShowJobs

pmahoney

632 karma · joined December 22, 2011

submissionscomments
pmahoney··on Car tires biggest likely source of microplastics in California coastal waters
Think "polymer" or "synthetic polymer" since these will be the things bacteria and other parts of nature have not evolved around.

https://en.wikipedia.org/wiki/Polymer#Common_examples

pmahoney··on A Tarahumara woman won a Mexican ultramarathon in sandals (2017)
I'd love to read citations for this; this is a topic of interest to me. I ran barefoot for several years (on pavement and grass; stopped because occasional thorn or glass became too obnoxious) and read various peer-reviewed running injury studies, and never found anything correlating with higher injury rates other than history of past injuries and doing "too much, too soon".
pmahoney··on It's raining plastic: microscopic fibers fall from the sky in Rocky Mountains
Maybe? Wood is useful even though there are things that will eat it under the right conditions.
pmahoney··on What the Royal Astronomical Society in 1884 Tells Us About Python Today
I love Nix and NixOS personally... but it's been a tough sell at work, unfortunately.

Even with simple shell scripts... it's so easy to invoke programs with GNU extensions and later find they fail on a co-workers macos machine. And I often have a shell.nix sitting right there that defines the complete dependency closure; very frustrating to not be able to use it.

pmahoney··on What the Royal Astronomical Society in 1884 Tells Us About Python Today
> "pip install pendulum" is not complex.

For much of the work I do, there's a _big_ jump in complexity from using python (2 or 3) and its stdlib vs. requiring a library. A script using only the stdlib is easy to distribute and get working on developer, ci, and production machines. Once an external library is required, I need machinery or scripts to manage or ensure presence of those dependencies.

pmahoney··on Go 1.11 got me to stop ignoring Go
> Even better, it lets use very easily drop into those dependencies and add minor changes or debugging lines if you need to.

I've done this quite a bit with typical Ruby+bundler setups. I think the key is that both Go and Ruby start from source code, vs. something like Java where your dependencies are compiled JARs without source (of course, there is infrastructure to enable easy fetching of the source when available).

This is similar to my experience with Nix package manager. It's purely source-based with binary packages seen as something like a compiler cache. It's easy to get the source to a package, make some tweaks, and build (and use) a custom version (at least I personally have found it far easier than Debian, even with apt making it easy to get the source).

pmahoney··on Nike Says Its $250 Running Shoes Will Make You Run Much Faster
It's possible to run at or near an elite level without modern running shoes. For example the 1960 Olympic marathon was won by a barefoot competitor (his winning time of 2:15:16.2 would be considered sub-elite today) [1].

One can speculate why all elite runners use shoes. Worth noting that running shoes designed for racing, as opposed to training, tend to be thinner and lighter and closer to a simple sandal [2]. I personally reverted from bare feet back to shoes after the occasional thorn or bit of glass getting stuck in my foot became too annoying.

[1] https://en.wikipedia.org/wiki/Abebe_Bikila#1960_Rome_Olympic...

[2] https://en.wikipedia.org/wiki/Racing_flat

pmahoney··on World's richest 500 see their wealth increase by $1T this year
The situation is more complex than candidates' election spending. For example, many of the groups in [1] influence various radio and television programs, and through those, elections.

[1] https://en.wikipedia.org/wiki/Political_activities_of_the_Ko...

pmahoney··on Nike’s Two Hour Marathon Attempt
I wouldn't disagree that snobbishness is present in the running community, but there are standards that must hold for a course to be "record-eligible" (by the dominant athletic organizations). In sprints on a track, this includes the wind. I'm not sure if distance events include wind. But marathon courses must start and end "near" the same location (be a loop course, more or less) to avoid being wind-aided the entire time, and to avoid an overall elevation drop.

The course of the Boston marathon is notable in that it is not record-eligible. It is not a loop, and there is a net elevation drop. In 2011, there was a tailwind at Boston, resulting in abnormally quick times, including Ryan Hall's 2:04:58, which would have been an American record, but is not due to the course [1].

[1] https://en.wikipedia.org/wiki/Ryan_Hall_(runner)#Sub-2:05:00...

pmahoney··on Breaking up the Container Monolith
Broken link to Buildah https://github.com/projectatomic/buildah
pmahoney··on Learn Ethereum smart contract programming
There are two distinct features: immutability and single-assignment. Erlang is famous for single-assignment, and also happens to have largely immutable values, but they are not the same thing.

Immutability prevents things like in-place appending to an array, or in-place modification of a string.

Single-assigment means that the value bound to "someVariable" cannot be changed. E.g. `someVariable = new String("hello"); someVariable = new String("goodbye");` is illegal. But it still may be possible to mutate the value `someVariable.substitute("hello", "goodbye")` if the language allows mutation.

pmahoney··on Typing Nix
I may be in the minority, but I like the Nix language.

I don't have extensive ML or Haskell experience, coming from Ruby/Java background.

I think the Nix language works great as a configuration language, and I greatly prefer it to JSON, YAML, or Ruby, which are often used for similar purposes. The way arguments are passed in, merging of attribute sets, the library from Nixpkgs with various list and set operators and other utilities, and great multiline string support make it far superior to those other config languages in my opinion.

My biggest gripe is that the Emacs mode isn't very strong, so I'm often applying indentation manually.

I recently learned about Jsonnet[1] which has some similarity with Nix.

[1] http://jsonnet.org/

pmahoney··on Cloudflare Reverse Proxies Are Dumping Uninitialized Memory
Thanks. Wish they had explicitly stated that all SSL modes were affected (unless I missed it...)
pmahoney··on Cloudflare Reverse Proxies Are Dumping Uninitialized Memory
I haven't found a clear answer to this:

CloudFlare has multiple SSL configurations:

> Flexible SSL: There is an encrypted connection between your website visitors and Cloudflare, but not from Cloudflare to your server.

> Full SSL: Encrypts the connection between your website visitors and Cloudflare, and from Cloudflare to your server

(I'll add Full SSL mode still involves CloudFlare terminating SSL (decrypting) before re-encrypting to communicate to your server)

If I am running in Full SSL mode, is (or was) my data vulnerable to being leaked?

pmahoney··on Systemd Sucks, Long Live Systemd
Many comments seem to only compare systemd with SysV init. But there is a whole world of process supervisors out there, particularly in the daemontools[1] family.

systemd is a process supervisor plus additional features; sysv init is not a process supervisor (though the "init" program as configured in /etc/inittab is a supervisor). At a minimum, a process supervisor starts processes and restarts them should they exit.

Some modern daemontools-family systems with additional features beyond basic supervision that put them in the same category as systemd are nosh[2] and s6-rc[3]. These two systems (and all the daemontools family), in contrast to systemd, are not monolithic, but composed of multiple smaller programs.

Notably, they depend on the shell (any script or executable, but traditionally small shell scripts) to perform actions like setting up environment variables, switching to a less privileged user, redirecting output, etc. while systemd has created a large and growing set of directives[4] to accomplish these. This set of directives is one of my annoyances with systemd. As someone familiar with the shell, I find it annoying to learn yet another language (systemd directives) for expressing the same thing, though I recognize not everyone is familiar with shell.

[1] http://cr.yp.to/daemontools.html

[2] http://jdebp.info./Softwares/nosh/

[3] http://skarnet.org/software/s6-rc/

[4] https://www.freedesktop.org/software/systemd/man/systemd.dir...

pmahoney··on Introducing rkt’s ability to detect privilege escalation attacks on containers
See also s6-sudo [1]. It uses Unix domain sockets to pass the users stdin, stdout to a service that runs a program as root. Still has the problem catern points out.

[1] http://skarnet.org/software/s6/s6-sudo.html

pmahoney··on Poor people pay for parking even when they can’t afford a car
Just guessing, but maybe a reference to Neal Stephenson's novel, _The Diamond Age_. If I recall, "vicky" is a slightly derogatory term used to describe (wealthy) residents of New Victoria, who are shown to buy things like handmade furniture (where mass-produced machine-made furniture is cheaper if not also higher quality).

https://en.wikipedia.org/wiki/The_Diamond_Age

pmahoney··on Purely Functional Linux with NixOS [video]
"I can add, remove, test, screw up, change my mind, whatever without stress"

I love Nix and completely agree with that, and I do have lots of experience with several package managers (deb, rpm, rubygems, ...)

pmahoney··on Urbit Is Building a 'Virtual Galaxy' for Bitcoin Nodes
For unix processes, exit status zero is conventionally considered success and non-zero is failure.
pmahoney··on Sad news today: systemd-resolved to be deployed in Ubuntu 16.10
As a daemontools fan, I'm frustrated that something in the daemontools family never became popular (process supervision, be it daemontools, upstart, systemd, etc. makes managing services so much nicer). But I do recognize the utility of using cgroups as part of this. Is there, or could there be, a "do one thing" utility that can launch a process in its own cgroup, such that it would fit in nicely in a daemontools-style run script?
pmahoney··on Nix as OS X Package Manager
I appreciate your presentation of an alternate viewpoint.

The "build from source" camp provides solutions to a couple problems that at first glance seem to be difficult in a "principled mutation of binary image" model:

- Moving to a different architecture, e.g. x86 to ARM or ppcle. In build from source, I essentially change some parameters and components in the lowest level and rebuild.

- Other big changes to base components, e.g. compiling for Linux/libc vs. building atop a unikernel (obviously heavily dependent on what the upper layers are doing, but I can imagine wanting to run similar code atop multiple bases).

- Sharing common components. This is not really a "from source" thing, but is an important part of Nix. If two images include components in different orders, in Nix the common components will be shared (at the arguably coarse granularity of a Nix package), while the linear structure of Docker layers means once two images diverge, everything further down the chain will be its own copy, even if the same bits.

pmahoney··on Nix as OS X Package Manager
> Either we can build everything from source, so that we have reproducibility (see e.g. emerge for a practical system, although it is still not bit-for-bit reproducible) or else we can ship everything as a blob so we have total consistency (e.g. Docker, Go).

Nix is really both of these combined, and is not like apt/dpkg in how it separates source and binary packages.

A Nix package is really instructions (including all compiler flags) of how to build something from source [1] and nothing more. Due to being pure functions, given the binary inputs (e.g. a zlib dependency previously built) and the instructions, any two people will always get the same binary output upon executing those instructions [2].

Furthermore, without executing the instructions, I can generate the unique identifier of the resulting binary package by hashing the inputs and the instructions. This unique identifier can be used to determine if the package already exists locally in /nix/store, and optionally be used to check if some trusted binary cache (such as Nix's binary cache) already has the binary package.

There is no binary package in the sense that apt/dpkg have source packages and many derived binary packages which are installed without need of the source package.

For example (contrived and simplified):

  gcc-uniqueGccHash = bootstrappingProblem()
  libc-uniqueLibcHash = buildLibc(gcc-uniqueGccHash)
  zlib-uniqueZlibHash = buildZlib(gcc..., libc...)
  myprog-uniqueMyProgHash = buildMyProg(gcc..., libc..., zlib...)
To download "myprog" from a binary cache, I can't calculate uniqueMyProgHash using any old versions of libc and zlib; I must have exactly the same hashes that were used by the system that built "myprog", all the way up the dependency chain. And I'll only ever have that if the builds are reproducible and/or I downloaded them all from the same binary cache.

[1] In practice, there's nothing stopping the instructions from saying "download this binary blob" instead of "download this source tarball".

[2] The problem of build reproduciblity is not solved, but many outside of Nix also see this as important, see https://wiki.debian.org/ReproducibleBuilds

pmahoney··on Nix as OS X Package Manager
The pre-built binary packages available from the Nix project are all compiled for /nix; this choice is baked in to the binaries, which refer to shared libs via absolute paths for example.

I understand this path is configurable, but you'll be compiling everything yourself, unable to use Nix's binary cache. You also risk running into unique problems since everyone else is using /nix

pmahoney··on A Fast Lightweight Time-Series Store for IoT Data
> short/medium-term data

This in particular, but your entire post, would be a great addition to the Prometheus front page, or top of the documentation section. This wasn't clear to me initially, speaking as someone who evaluated prometheus a few months ago.

pmahoney··on Shrink Go binaries 7x with this one weird trick
The amd64 Linux version of Terraform [1] unzipped uses 739 Megabytes on disk (`du -hc`). It is a collection of CLI tools, or one CLI tool that wraps many provider-specific tools (providers such as aws, azure, etc.).

I noticed this recently when trying to upload a container image that happened to include Terraform.

[1] https://releases.hashicorp.com/terraform/0.6.14/

pmahoney··on On the Impending Crypto Monoculture
Just a guess, but maybe wtbob is getting at the fact that odd licenses are generally GPL-incompatible or otherwise awkward or ambiguous. See for example, the JSLint license https://en.wikipedia.org/wiki/JSLint#License
pmahoney··on So you want to write a package manager
> they’re all tied to specific versions and you’d need a new package file to support a new version

I haven't looked at Spack, but as a Nix user, it's often the case that different versions of some software package require different packages in order to build them. For example, particularly on a less-used platform like darwin, I've submitted numerous patches to the Nix package of MariaDB due to minor breakages in newer versions. It's not always simple to parameterize the upstream version.

That said, there are many cases where it is that simple. Overriding a package in Nix to change the version is possible [1], but could be easier from a UX perspective.

> The user can install the version combination that you packaged, but can they easily try their own

As an example, I needed an older Ruby version that required an older libxml2 than available in nixpkgs. I did need to create my own Ruby package, but was able to simply override the version in the existing libxml2 package, and I configured nix to use that version across all other predefined nixpkgs that required libxml2 and were needed by my project. This meant a lot of compiling on my part (since nixpkgs of course can't publish binaries for my customized builds), but it was fairly straightforward.

[1] http://nixos.org/nixos/manual/index.html#sec-customising-pac...

pmahoney··on The result would be a catastrophe (1985)
Can you summarize one or two of Boisjoly's main points?

Tufte's pictures of the (superfluous) rocket graphics showing the temperature vs. his redrawing, placing temperature on the x-axis are very convincing.

pmahoney··on Stack and Nix = portable reproducible builds
I'm curious how this handles changes within nixpkgs itself. For example, if developer A has nixpkgs version 111, and developer B has nixpkgs version 222, and they both attempt to build a Haskell project depending on "libxml", they may compile against different versions of libxml (or worse, an older version of libxml might be incompatible with the Haskell code).

Nixpkgs solves this itself by "owning" the entire dependency tree. That is, if there's a definition in nixpkgs that requires libxml, you can bet it works with the libxml derivation defined in that same nixpkgs. If not, there might be libxml1, libxml2 derivations defined.

In practice, using the ~latest version of everything, or whatever nixpkgs happens to have, usually works well. I started moving toward building my own nixpkgs distribution, which included a vendored copy of nixpkgs at a specific version (rather than whatever version was available at the time you downloaded it), combined with a few customizations for specific (older) versions of, say, libxml. This ensured multiple developers could download things months apart and still expect everything to work. (nixpkgs changes somewhat rapidly.)

pmahoney··on The problem with packaging in Python
I don't know the state of Python packaging in Nix [1], but it can almost do what you ask. I've used it to create a tarball of, for example, a customized Postgres (built with MySQL foreign data wrapper in this case), and all its dependencies down to libc (there's an implicit dependency on a Linux kernel), and unpack and run it on a Linux system where Nix package manager is not installed.

I've done similar for Ruby projects using many gems with various C library dependencies, though I used a fair bit of custom Nix definitions for this (i.e. at the time, the state of Ruby packaging in Nix was poor; I'm not sure of the current status).

A signifiant requirement is that it must live in /nix (it's theoretically possible to build everything for another path, but I don't think many people do this so there may be surprises).

And this is all easier if the target system has a Nix package manager, rather than dealing with (somewhat bulky, since includes everything) tarballs.

[1] http://nixos.org/nix/

← PreviousPage 2 of 7Next →