HNHacker News
TopNewBestAskShowJobs

pmahoney

632 karma · joined December 22, 2011

submissionscomments
pmahoney··on Boycott systemd
I have not tried runit. s6 is actively maintained; I don't know about runit (on the other hand, runit is in Debian while you must compile s6 yourself). The author of s6 has a (very biased of course) comparison or various supervisors:

http://skarnet.org/software/s6/why.html

The big feature s6 has that runit lacks seems to be the ability to wait without polling on some event (process started). I haven't used this much myself, but even given that some process has started, it doesn't necessarily mean that it's initialized and ready to do what you expect.

pmahoney··on Boycott systemd
> daemontools are nothing more than an init system on top of an init system

What do you mean by that? That it isn't PID 1? Apparently it can be made to run as PID 1. But you can keep the (in my opinion) brilliant design of daemontools and use successors such as s6 are designed to run either as PID 1 or as a plain old daemon (which is nice if you've not got full control of a machine).

http://www.skarnet.org/software/s6/index.html

I've been using s6 to manage a few things, and some features I like are:

- allow a group to manage (stop/restart) certain processes using Unix file permissions

- arrange things in a tree. My toplevel s6-svscan starts a second s6-svscan which starts a handful of related processes. These all inherit the same user and environment vars which makes config easy.

pmahoney··on Build Tools – Make, no more
I think the big difference between redo and make is that make requires knowledge of dependencies up front, and this is sometimes tricky to get right.

"as you can see in default.o.do, you can declare a dependency after building the program. In C, you get your best dependency information by trying to actually build, since that's how you find out which headers you need. redo is based on the following simple insight: you don't actually care what the dependencies are before you build the target; if the target doesn't exist, you obviously need to build it. Then, the build script itself can provide the dependency information however it wants; unlike in make, you don't need a special dependency syntax at all. You can even declare some of your dependencies after building, which makes C-style autodependencies much simpler."

https://github.com/apenwarr/redo

pmahoney··on TLS/SSL implementation in Haskell
So what candidates are there? While C may make it possible to write code that avoids timing attacks, a quick glance at [1] shows one must avoid memcmp and array lookups based on secret data, neither of which would be prevented by the compiler, and both probably similarly easy mistakes as heartbleed.

Can Rust compile to a shared lib the programs can use as easily as a C library? (I think the answer is "not yet", but I'm not sure? At least, I've seen projects for compiling Rust without any runtime library).

Today I learned this is possible with Ada [2], but it seems there is some boilerplate to start/stop the runtime. Does Ada provide the necessary low-level control to implement crypto?

Are there sufficiently strict dialects of C?

NaCl [1] says "There are an increasing number of cases where the C implementations and assembly-language implementations are automatically generated from code that was actually written in another language, such as CAO or qhasm."

CAO is a "a domain specific language for describing cryptographic software" [3], while qhasm [4] is a portable assembly seemingly not focused on safety.

[1] http://nacl.cr.yp.to/internals.html

[2] http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gnat_ugn_unw/Creatin...

[3] [PDF] http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.113...

[4] http://cr.yp.to/qhasm.html

pmahoney··on Programming Languages are the Least Usable, but Most Powerful User Interfaces
I've not heard of slate before. Glancing at the front page, it looks very interesting. I'll definitely take a closer look, thank you.
pmahoney··on Programming Languages are the Least Usable, but Most Powerful User Interfaces
I have dreamed of a similar thing for a long time...

When I worked in a (science research) lab, we had a few Excel files we passed around for performing various calculations. These were great in that my non-computer-fluent boss could use them (and even contribute). There were a few input boxes to fill out which were run through some calculations, and the answer spit out.

Pros:

* Single file

* Everyone has Excel installed on desktop

* Accessible. Even if you're not an Excel wizard, you can see and edit the basic formulas.

Cons:

* Rigid grid (Any documentation, notes, etc. must fit into the grid)

* Formulas are hidden, when you might want to highlight the most critical ones

* If you want to calculate intermediate results (which you do, to prevent very long formulas that are hard to read), you've got to plop them in some cells

* No meaningful variable names, A10:A55 what?

Excel is so entrenched, it'd probably be difficult for a slight improvement to gain any traction, but it would have made my life a heck of a lot easier.

And I'm by no means an Excel wizard, so there's a good chance that some of the Cons above can already be avoided... But I still want some kind of hybrid of LabVIEW and Excel.

pmahoney··on Ted Ts'o: For those who believe systemd developers are reasonable
I've read the front page of systemd a couple times, but have not dug into the documentation much.

Can someone give a tl;dr of what it provides over the (brilliantly designed in my opinion) daemontools, or successors like s6 [1] and runit [2]?

I hear features like "socket activation", but can this not be implemented in a helper program?

I've been using s6 to manage some ruby apps, and I've got a primary s6-svscan to start a few things, one of which is a secondary s6-svscan that manages a bunch of resque workers. This makes it easy to start/stop all the resque workers in one go. And I can also allow non-root users to manage them via plain old Unix file permissions (s6 can be controlled by writing commands to a fifo).

[1] http://skarnet.org/software/s6/ [2] http://smarden.org/runit/

pmahoney··on Nweb: a tiny, safe web server (static pages only)
This is hardly in the category of "lightweight and secure", but for impromptu stuff, this Ruby+Rack one-liner serves directory listings and static files from the current directory:

    ruby -e 'require "rack"; include Rack; \
      Server.start :app => Directory.new(".", \
      Static.new(nil, :urls => ["/"], :root => "."))'
pmahoney··on Kinematics Bodice
It's been a while since I was in that field...

Typical sintering temperatures are around 1000 to 1300 degC. Usually about 2/3 the melting point of the ceramic; enough to promote ionic motion leading to fusing of the powder in a reasonable amount of time (one-two hours for my lab-sized samples).

Various techniques for lowering the sintering temperature are:

- Increase the sintering time. The time required to achieve a given density (say, 95%) increases somewhat rapidly as you decrease the temperature

- Add a glass to the ceramic powder. The glass melts and essentially lubricates things so there is sufficient motion at lower temperature.

- Start with finer ceramic powder. This has higher surface area for a given amount, which is an energetically unfavorable state (the fused state has lower surface energy and is thus more favorable).

- Apply pressure while sintering [3]

- Live with less density. Pottery needn't be 95+% dense. Clay (or playdough) can be useful for some situations (not bullet-proof vest I imagine) if just let to air dry.

- Other clever things I don't know about.

I know there are metallic substances that can survive sintering processes, as in multi-layer ceramic capacitors, where a sandwich of ceramic/electrode/ceramic/electrode is sintered, but these tend to be the expensive metals that don't react with oxygen [1].

The polymer with the highest melting point I know of is Kapton [2], melting around 400 degC, which is quite a way from the 800 or so degC you might see after adding glass to your ceramic powder...

All that said, most ceramics are not that tough in that they shatter when impacted. If you must 3D print bullet-proof armor, and are sure you can't print some kind of Kevlar-reinforced thing, then I'm not really sure what the best option is.

[1] https://en.wikipedia.org/wiki/Ceramic_capacitor#Multi-layer_...

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

[3] https://en.wikipedia.org/wiki/Hot_isostatic_pressing

pmahoney··on What it's like to use Haskell
> We can restart the process without losing any connections

Would you mind expanding on this a bit? I'm not too familiar with Haskell, but I am familiar with various was of blocking new connections while allowing existing connections to complete, either at the load-balancer level or built-in each individual process.

What Haskell stack are you using, and how are graceful restarts accomplished?

Thanks.

pmahoney··on Kinematics Bodice
Ceramics can be 3D-printed [1]. The printed product is a paste of ceramic powder + binder that must be sintered (heated so the organic binder burns away and the ceramic particles fuse together into a strong, dense body). The as-printed part shrinks a bit during sintering, so you've got to account for that as well.

[1] http://robocasting.net/index.html

pmahoney··on Announcing the new Rust package manager, Cargo
One issue I've run into (which may simply be ignorance) is the time consuming 'bundle install'. For example, I've updated some gems and run 'bundle update' on my development machine. I push that to the CI server, which must run 'bundle install' to install any new gems. But this seems to trigger the (NP-complete, last I checked [1]) dependency resolver yet again, even though I've already run it locally and my Gemfile.lock is newer than my Gemfile. Is there a way to skip it? Perhaps bundle just-blindly-install-the-gems-listed-in-Gemfile.lock?

Bundler in general is a nice tool, and Bundler + shared pile of gems is a nicer workflow than gemsets (though I am not a fan of "remembered options"; I'd rather make my own config file than forget that Bundler "remembered" my experimenting).

The more I think about Bundler, the more I wish that general purpose tools like Nix Package Manager [2] got more love. I've been playing around with using Bundler for the dependency resolution step, then Nix for the packaging and deployment steps (each app might have a separate Nix profile where it could install its particular set of gem versions), but there are missing pieces.

[1] http://www.youtube.com/watch?v=3soqhbnh0jY#t=35m22s [2] http://nixos.org/nix/

pmahoney··on Why Puppet, Chef, Ansible aren't good enough
A fair definition. If they're anything like mine, the hosts probably have unique hostnames but share the remaining 99% of the nginx config. Is that identical portion a "package" or "configuration"?

I think there are a few more steps in there. Assuming identical OS and arch, you've probably got:

* software packages that should be identical on all nodes in the cluster

* a set of software packages that should be installed on all nodes

* configuration that should be identical (e.g. 99% of an nginx config)

* configuration that is unique to the host (e.g. a hostname)

Or perhaps:

* packages limited to a single OS (traditional software packages for Linux)

* packages limited to a single organization (identical portions of configs)

* packages limited to a single node (hostname)

Anyway, I'm playing around with using Nix for all but the unique-per-host stuff. I see potential, but it may or may not pan out. I seem to always need a custom version of nginx, or ruby, and I find making custom Debian packages rather cumbersome, even with a fair amount of experience.

pmahoney··on Why Puppet, Chef, Ansible aren't good enough
> The thing about HashDist is that you can actually install it in userspace over any UNIXy system (for now, Cygwin, OS X, and Linux)

I've been looking into Nix (the package manager) recently, and it also can be installed on OS X and various Linux distros (I've seen Cygwin mentioned, but I don't think this is well supported).

If you're familiar with both, what does HashDist provide over Nix?

pmahoney··on Why Puppet, Chef, Ansible aren't good enough
What's the difference between a "package" and a "configuration"? At some level, they are both sets of files, so I can imagine a tool handling both, providing the benefit of a common interface. On the other hand, why might one want separate tools for packages and configuration?
pmahoney··on A brief introduction to Haskell, and why it matters
Here's a list compiled by someone else:

http://haskell-news.blogspot.com/2008/01/top-10-most-popular...

Here's a GitHub search. Mostly libraries, but a few end-user programs:

https://github.com/search?p=1&q=language%3Ahaskell+stars%3A%...

I didn't realize Pandoc was written in Haskell. Darcs of course, and xmonad window manager are the ones that come to my mind.

pmahoney··on Circuit Breaker
Your typical synchronous servlet container (Tomcat, Jetty, etc.) all maintain a thread pool and dedicate a single thread to each request for that request's lifetime. These threadpools can easily hold hundreds of threads on every-day hardware (vs. something like forking unicorn where 8 Ruby processes consumes quite a bit of memory).

This works well for many workloads. It allows a straightforward blocking-IO model, but you don't typically worry about a few slow requests bogging everything down (which you do if you only have 4-8 unicorn processes). I'd say in many apps, the database becomes a bottleneck before the pool runs out of threads.

pmahoney··on The perovskite lightbulb moment for solar power
"Perovskite" refers to the common mineral as well as any number of materials exhibiting the particular crystal structure.
pmahoney··on The subtle brilliance of Apple's product names
My problem with Lenovo is that something like your one-paragraph summary is not on their website. I occasionally window shop for laptops, but I find it very confusing. If I drill down into one of the laptop series, what am I missing from the others? What's the price/feature difference between a top-of-the-line L series and the bottom-of-the-line T series?

(After a quick look, I see the (base price) cheapest T is more expensive than all the L, but the L allow up to 16GB RAM, while the T's cap at 8GB. ...and I've spent too much time window shopping yet again.)

pmahoney··on How Do You Teach Kids the Value of Money? (2006)
Anyone ever tried giving monthly allowance of something like (allowance + $500) and then charging your kids $500/month in rent? In some sense it's silly to give them money that they'll give right back, but on the other hand going from rent-free with the parents to suddenly having to manage rent, utilities, etc. is a big jump.
pmahoney··on New algorithm can dramatically streamline solutions to the ‘max flow’ problem
The Soap Film: An Analogue Computer

http://www.americanscientist.org/issues/feature/the-soap-fil...

pmahoney··on Ruby’s GIL and transactional memory
> Why would you need hundreds of worker threads?

Shrug why not? You get a different (easier?) programming model where you can use blocking IO rather than an event loop.

> on the order of 2x-8x, not 100x

Yeah, but that 2x might be the difference between one virtual machine flavor and the next price up.

pmahoney··on Ruby’s GIL and transactional memory
> Most people who complain about the GIL have not even profiled multithreading versus multiprocessing.

This is a fair point, but the issue might be about memory usage, not speed. A unicorn setup might have two to eight worker processes to service HTTP requests. Even with copy-on-write-friendly garbage collection, the memory usage of each additional process is significant. On the other hand, a thread-based solution (using JRuby, for example) can maintain a threadpool with hundreds of worker threads because the cost of an additional thread is nearly negligible.

pmahoney··on Data looks better naked
This has nothing to do with putting labels in bold or not, unless I misunderstood?
pmahoney··on Data looks better naked
The idea is to keep focus on the data. The labels are reference when exact numbers are needed, but the data trend is king.
pmahoney··on How Class-based Programming Sucks (2011)
Most events humans care about happen in plain old classical physics, and no computer is moving at some large fraction of light-speed relative to any other computer. If you maintain synchronized clocks, everyone can agree on the exact same order of events (which would not be true in a relativistic situation).

Now it turns out to be difficult to maintain synchronized clocks, and Lamport timestamps and vector clocks are alternatives. The end result looks similar to a relativistic situation, but (and I'm not a physicist), it seems wrong to claim this situation is because of Special Relativity.

Thoughts?

pmahoney··on Diet Drugs Work: Why Won’t Doctors Prescribe Them?
Boil some water, throw the green beans in for just a couple minutes. Remove the beans and put them in a colander to dry. Mince and fry a shallot (or onion) in oil or butter. Throw in the beans, chopped walnuts, and a little bit of feta cheese. Salt to taste (salt is often the difference between bland and tasty).
pmahoney··on Functional data structures in JavaScript with Mori
Is is possible to construct a persistent data structure that is not referentially transparent? I suspect the answer is yes, depending on how you define side effects (example: a persistent array that logs operations).

Which would mean "functional" is a more general adjective than "persistent" since it includes both persistence and referential transparency.

Wikipedia[1] claims "There also exist persistent data structures which use destructible operations, making them impossible to implement efficiently in purely functional languages"

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

pmahoney··on Open-Sourcing PEPS: A modern webmail server
To clarify, the default copyright rules apply (which means, more or less, no copying allowed).

Copyright very much applies to MIT/BSD/GPL licensed code as well. In fact, the mechanism of the GPL requiring changed+released versions to include an offer for the (modified) source code depends on copyright.

pmahoney··on Seven-Planet System Detected
So, what gets to be "mg"?

I'm not against the idea, but please don't have the new base also start with "g".

← PreviousPage 5 of 7Next →