HNHacker News
TopNewBestAskShowJobs

1337p337

924 karma · joined September 19, 2010

Personal site is debu.gs.

Activity stream (mostly code) is at stream.debu.gs.

submissionscomments
1337p337··on The Inferno Shell, an Introduction with Examples
I'm planning a couple of more articles on this topic, so your point is of interest to me. Since it's all content I have absorbed by using the shell, some things that seem obvious to me might have slipped through the cracks when I wrote the post. It seems from your comment like #1 was answered (how it differs from existing shells). The problems with existing shells (byzantine quoting rules, general opacity in terms of being able to use them from the outside, and crufty, non-uniform syntax, lack of simple FD manipulation, lack of modern facilities like blocks, scoping, etc.) were sort of taken as a given, and the examples should have shown how they are obviated. What is it you'd like to see explained?
1337p337··on The Inferno Shell, an Introduction with Examples
No Execute is one of my favorite (semi-) blogs!

I couldn't agree more about the Atlast writeup. I'm glad for the vast proliferation of Lua, if for no other reason than it has made scriptability a library. I can certainly believe you've never heard of my fork. I actually feel bad because it's still "in beta", being a work in progress. I've been meaning to send a patch to Mr. Walker for the 64-bit issues, but there's always another bug or feature in the way, and I've held off on a "real" (tarballs on a server, documentation) release until I ping him and fix some bugs.

Regarding 9atom, I don't recall any difficulties booting from USB, but it was a while back, and I didn't quite get it installed. I've been running 9front for the most part when I run Plan 9.

1337p337··on The Inferno Shell, an Introduction with Examples
Well, spawn() and pctl() are actually more like a finer-grained fork(), without the necessity of, for example, O_CLOEXEC, or anything in fcntl. Between pctl() and Limbo's channels (on which Go's are patterned), a lot of what is required for security in "vanilla" Unix is unnecessary.

What I was trying to convey in the article (sorry if it was a bit vague) was that using functions available to the shell was the nice part, the actual advantage over regular Unix. That is to say, if a user passes '*[0-9]?.gz', you can call functions within the shell to handle the glob rather than having to implement them yourself, for example. The shell is also designed as a library, in other words. This includes things such as parsing sh's syntax, even.

1337p337··on The Inferno Shell, an Introduction with Examples
Plan 9 does have a POSIX-like shell, psh.

A command loaded into your process can do things to you if you run it directly without calling spawn() or pctl(), but you'll usually use those to seperate the process, although it's rare to do it that way.

As far as other shells in the family, mash influenced Inferno's sh, but I think it's a relatively sparse branch compared to bourne-compatible shells.

1337p337··on The Inferno Shell, an Introduction with Examples
Inferno seems to do fine on BSD, OSX, Windows. It had a little trouble coping with CLang but a makefile tweak to make it use gcc fixes it.

If you want to try runnong Plan 9 on an EeePC, 9atom is tuned for that. I have one of the older ones (701 is the model, I think) and it does boot Plan 9.

1337p337··on Old People Icons That Don't Make Sense Anymore
Not only that, but the author also seems annoyed by older terminology taking new meanings, as with "radio buttons", "bookmarks", and "folders".

The irony here is that he has no problem calling the device he uses a "computer", despite the older definition no longer holding true, or especially referring to "files", which is certainly not a term used in the old sense.

Dijkstra's "On the Cruelty of Really Teaching Computer Science" rails against analogies (the source of these terms) at length, but I'm not certain that there's much validity to the argument when the new meaning of the term eclipses the old one.

1337p337··on Notes on Programming in C - Rob Pike, February 21, 1989
You don't actually lose the metadata by commenting the code, thanks to git/svn/hg's blame feature, named identically in each. (I've not used darcs in a very long time, but it had something similar called "annotate".) If the code doesn't look like the comments say it is, you can check the timestamps and if that doesn't help, then you can crawl through old commits to see what's going on. It's useful enough that I've bound a key in my editor to display the blame'd code.
1337p337··on Why is “Everything is a File” unique to Unix operating systems?
If you have a look at, e.g., Plan 9 and Inferno, I think you might be surprised at how expressive a file-based API can be.

For a trivial example, webfs supports REST quite handily without a loss of expressive power (and REST itself is a simple but powerful abstraction), and because things need not be piped through curl, you can, for example, point your image editor at what it believes to just be another file on the filesystem, rather than requiring the image editor to support HTTP.

The other half of this is that abstractions can and are built atop this. The Limbo programming language, for example, provides typed channels (which, as I understand it, also made it into Go) and its standard library provides functions for treating arbitrary files as typed channels. So, the OS need only concern itself with "files" (really, in Plan 9 and Inferno, these are less like files and more like names in the processes' respective namespaces), and whatever complex objects the language concerns itself with are easy to ship around between a process and the outside world without hacks (unless marshalling objects is considered a hack).

1337p337··on What's the one Linux command you wish you knew years ago?
Or, for another alternative, w3mman, which is bundled with the w3m browser. Tabbed manpage browsing in the terminal with URLs converted into links and "foo(1)" converted into a link to the man page for "foo". Don't leave home without it.
1337p337··on What's the one Linux command you wish you knew years ago?
I'm still a die-hard (and vertical-split-patched) screen user, but it seems tmux is the only suggested alternative. The combination of the more orthogonal dvtm[1] (for window management) and dtach[2] (for screen's killer feature: detaching) is flexible and compelling and sadly doesn't seem to have been mentioned here.

I currently use dvtm to split terminals and connect to multiple screen sessions in a single window. The downside of dvtm is it takes the dwm[3] approach of using #defines rather than configuration files.

1. http://www.brain-dump.org/projects/dvtm/ 2. http://dtach.sourceforge.net/ 3. http://dwm.suckless.org/

1337p337··on Rob Pike: Dennis Ritchie has died
The |s, the |s are calling.
1337p337··on How to Force Facebook into Handing Over their Secret Tracking Data
It's at least six months, and they don't do a very good job of anonymizing: they scrub the last two digits of the IP, but not tracking cookie logs. DataLiberation further contains no information they keep when you are not logged in, and only a fraction of what they have (and keep) when you are logged in. The "privacy dashboard" points to several chunks of data that are retained but not accessible, and there is far more that actually is kept.

A simple but perhaps inconvenient way to verify this is to be criminally prosecuted for something where your Google account is relevant. Google will hand over what they have to the prosecution, and as the defendant, you'll be entitled to see the evidence. (I've not tried this and don't recommend it, but do know someone that this happened to, and have examined the contents of the provided CD.)

DataLiberation is mostly a PR site, and it's main use is migrating what data Google feels is useful to you, not finding out what Google knows.

1337p337··on Unix V5, OpenBSD, Plan 9, FreeBSD, and GNU implementations of echo.c
It's just good practice, in general, to keep individual programs simple. If you have a look at DMR's description of why the pipe was invented, it suddenly clicks.

All of these tools are intended to be composable, analogous to functions. 'cat -v' is like a function with too many arguments, one that does too much. If you need, for example, to allocate a block of zero'd memory, you don't add new flags to malloc(); you use memset() after allocation, you write a for loop, or you use calloc().

Likewise, the basic tools available on Unix can and should be thought of as functions, which take some number of arguments, and the implicit argument of an input channel. They produce as their output an integer as a return value and two output channels, stdout and stderr. Making a function that does too much (and this is as subjective for functions as it is for command-line tools) is known to be bad practice, but for the shell, it is often misunderstood. To misunderstand this is to misunderstand the core principals of the Unix environment.

It has nothing to do with the typical non-programmer user. On, say, Linux or OSX, the user doesn't write functions or talk to the shell very often. They click buttons in a GUI that doesn't in a meaningful sense offer composable programs, and it's an inefficient but simple way to interact with the machine, a way that matches their habits and understanding. cat, echo, sed, and awk aren't for these users; they're for programmers, and the typical user does not know or care whether cat can show non-printing characters, but as a programmer, I certainly care about a clean design for my environment.

1337p337··on Plan9 has been forked: 9front
The IRC channel (#cat-v on freenode) has been extra helpful and responsive. I've now got 9front mostly up and running on qemu and my T60, thanks to devs fixing drivers on the fly while I passed along screenshots of error messages. I've been interested in hacking on Plan 9 for a while but have had little luck getting it to boot before 9front (even 9atom).

A couple of years down the road, it would be delightfully perverse to end up with Plan 9 running in the server room and Linux/OSX on the devs' desktops. Maybe unlikely, but fun to consider.

1337p337··on Plan9 has been forked: 9front
Even if Plan 9 and 9front go nowhere, the ideas have already crept into other operating systems and userland tools. Linux has had 'mount --bind' for a while, and has last year introduced in-kernel support for 9P2000 (for mounting Plan 9 resources). bash and gawk have some weak support for interacting with the network via the filesystem. wmii actually speaks 9P2000 and uses it for scripting.
1337p337··on Bored People Quit
He was a friend before, which is why I spent as much time as I did trying to convince him to join the company, and trying to convince everyone that he'd be a good hire for VP of Engineering. We'd hang out on occasion, talk shop on the phone, etc. He's a pretty cool guy, but I don't especially care to see him again. (I was not the only or first one fired; I didn't make any efforts to conceal what I thought about our sysadmin getting fired.)
1337p337··on Bored People Quit
It sort of was. At one point, he said to me, "What are you complaining for? I haven't even started the death-march yet."
1337p337··on Bored People Quit
I had a boss that took the opposite approach. Whenever I started to lose productivity, he'd put me on work he knew I'd hate, telling me I'd get to do more interesting things when I showed him I could be productive. So I started working on side projects at the office just to keep my mind from going and became less and less productive until I quit.

He was a talented engineer himself and a good friend. We ended up working together again at another company. A few months after he arrived, I had a slump and the cycle repeated itself. This time we had long meetings where he accused me of being cynical and questioned my dedication; I defended it ("I'm here making much less than I was before, aren't I?"), which was exhausting in itself. I thought the problem was all on my side, so I didn't put up much of a fight when he told me I'd be writing integration tests full-time--no more "real" coding--until I proved whatever he thought needed proving. I forced myself to ignore any side projects I had going. He called me in again later to complain that the tests weren't coming along quickly enough and that they "read like sketch comedy routines". (They did, actually. I was bored, and the tests were full of things like, e.g., Eve getting unfriended by Alice but not Bob and, wounded, trying to spy on Alice. It did tehnically test our access controls!)

Because I was convinced it was my problem, I stuck around long enough to get fired this time. I'm lucky enough right now to have very interesting work (at a big company, of all places), but this article has given me an opportunity to reconsider what happened at the old job in a different light.

1337p337··on Nokia Cnxn 2011 livestreaming right now. They'll reveal N9, the new MeeGo phone.
I certainly hope the N950 is keyboard-equipped and Meego-powered as rumored; thanks for providing the link. I can't cope with touch-only devices, despite the many times I have been told by friends/coworkers/HN/Twitter/etc. that I can. (It's surprising how often I have to defend a personal preference.)
1337p337··on What’s Up With All These Changes in Rails?
Even before 1.x, Rails has been pretty easy to figure out, and looking at the old documentation, apparently well-documented. There were countless tutorial-style blog posts if the API docs weren't enough. The Ruby mailing list was inundated for a long time with talk about Rails, to the point that I had to make a filter.

I'm not by any means a Rails fan, and think that even now, it feels like a PHP framework. (I have a "competing" web framework that I wrote and use whenever I have the flexibility, if you can call it a competitor; it's not actively promoted and the users number in the low single digits). But they do deserve credit for making sure that it's easy to figure out how to get things done.

1337p337··on What’s Up With All These Changes in Rails?
I agree that it's much nicer than ERB for HTML, but I still use ERB for, e.g., config file generation.

HAML, though, shares the same fundamental problem with ERB: it's straddling the code/template fence. I wrote the Hoshi ( http://github.com/pete/hoshi ) gem to address this, and used it in the last Rails application I wrote (still in production), and still use it for HTML when I need that. (It's still in the "personal itch" phase, so it's only maintained when I notice that W3C doesn't like something or when I'm missing a feature. For example, I haven't done any HTML5, so I haven't put any in.)

For anything requiring a wall of text (in HAML, ERB, Hoshi, whatever), I think it's a mistake to put it into your view code. Make a place where copy goes, decide on a markdown format, and write a helper that pulls in and processes that text. Even if the coders are writing the copy, it's helpful to have the text seperate, and easier to edit besides. And if it turns out that you need the text editable via a web UI or something, it makes the change easier: modify the helper to fetch text by name from the database rather than the filesystem, and import all of the text into the database. Everything is easier all around; I'm at the point where it looks like a code smell when I see walls of text (or frequently edited text) in a template.

1337p337··on Ask HN: Why is Optomizely on the frontpage with no voting and no discussion?
I follow, but how can one tell from looking? There is a convenient "[pdf]" tag when a link is a PDF, but no indicator besides missing controls that there is some special arrangement for job postings. I had to check the web to find out that Optimizely is YC-funded, and I had no idea YC jobs had special promotion on HN until I found this post. It's a slightly shady thing to do without any obvious indicator of what's going on.
1337p337··on Ask HN: Why is Optomizely on the frontpage with no voting and no discussion?
"Obama uses Optimizely. Help him get re-elected by joining Optimizely". It doesn't look very clear to me that this is a YC-sponsored link.
1337p337··on Intel significantly speeds up graphics under Linux (X.org)
This is great. Now if only the newer Intel drivers didn't make X segfault!

This seems to be a common problem. I had to downgrade to 2.14.0; some bug introduced in 2.14.903 and still present in 2.15.0 break it thoroughly. Fast is nice, but stable is better.

1337p337··on The brain's 5-million core, 9 Hz computer
This reminds me of Chuck Moore's 144-core, unclocked (!) colorForth CPU: http://greenarraychips.com/home/documents/greg/GA144.htm

I wonder when he'll catch up to 5 million.

1337p337··on Rosetta Code: solutions to the same task in many languages
I love Rosetta Code. For common problems, the solutions cover a very long list of languages, sometimes with multiple solutions. It's a great tool when you're learning a language and want to see why the code you've written doesn't feel natural.

For me, it's also been useful for finding new languages. Scrolling around, you occasionally see a language with a particularly clever or readable (or just quirky) solution, and you can bounce around the wiki to see what other examples in the language look like.

http://99-bottles-of-beer.net/ is also a great page for browsing languages. Of course, it's a bit more whimsical and the focus is on a single problem (a good one, though: it covers conditionals, looping and I/O), but it covers a large number of languages and is easy to browse.

1337p337··on BlackBerry Dead by 2012
I have a work-issued iPhone, but use my personal phone anyway. Not to say that the iPhone is useless, but it irks me if I have to look at my phone to do things with it, like staring at the keyboard (and missing its autocomplete mis-fires) or looking at it to change songs while driving. So, not to speak for the person you're replying to, but the iPhone does happen to be useless for people like me.
1337p337··on BlackBerry Dead by 2012
It's just two pictures, and it ignores the rest of the Blackberry line-up, which includes touch-only devices and slide-outs. I was expecting some announcement from RIM based on the title, and was disappointed to find this content-free article by an iPhone platform-bigot. (Disclaimer: I'm not using or a fan of either device.)
1337p337··on Gmail Contacts size increased to 25000
Google has lots and lots of storage. The TL;DR version: Contacts are more about bandwidth and processing power. Follow my reasoning for a minute if that seems like a leap.

One of Google's features is that it attempts to build a social graph based on your contacts from its various services. Have a look at the Dashboard ( http://google.com/dashboard ), which tells you what Google is willing to tell you about what it knows. You may notice a lot of data that you didn't give Google. Scroll down to the "Social Circle and Content" section. This is the interesting bit: http://www.google.com/s2/search/social . These are the people you email using GMail, the people you speak to on Google Chat, people you interact with on Reader, Latitude, Picasa, etc. No big deal so far, until you get to the "connected accounts" section.

Google will let you connect your Facebook, Twitter, Flickr, etc., accounts to your Google Account. If you don't connect these accounts, though, it will use what it knows about your social graph to try to find your account. I discovered this when I logged into my GMail account and made a stop at the Dashboard, to find that it had guessed my Twitter account, and this despite the fact that I had used a different email address and a name totally unrelated to the one I used for GMail. It did this, apparently, by comparing my social graph to the people I followed on Twitter. Per Google's help page about this ( http://www.google.com/support/websearch/bin/answer.py?answer... ), Google finds this out using "[s]imilarities between your connections. For example, Bob's Google Contacts have names that are very similar to the names of people he follows publicly on Twitter." (You'll need to click "Learn how Google matches an account to you" to get that text to appear on the page.)

Google also does this if you have multiple Google accounts, apparently. Via http://gawker.com/#!5637234 , "with a friend's consent, he pulled up the person's email account, contact list, chat transcripts, Google Voice call logs—even a list of other Gmail addresses that the friend had registered but didn't think were linked to their main account".

So, Google's paying Twitter and Facebook (among others) to scrape accounts, which was big news for both of the social networking sites, especially Twitter, which lacked much solid revenue at the time. Google keeps a social graph for all of these other sites' users, and compares them to the social graphs of its own users and, if the above quote from Gawker is true, also against its own users to see which Google accounts belong to the same person. Facebook alone has 600 million users, quite a few accounts to try to match against each of Google's users, and there are a number of services that Google scrapes. The number of contacts you have (which are shared between GMail and Chat, as well as the partial overlap with contacts in Buzz, Reader, Youtube, and others), 500, 25k, or whatever arbitrary number, take up a negligible amount of storage compared to the amount of processing power and bandwidth required to scrape, build, and compare hundreds of millions (if not billions) of social graphs for accounts across dozens of services.

1337p337··on LSD: The Geek's Wonder Drug
Per the Wikipedia page it looks interesting, although I've been almost successful with the patch in the past, and know essentially what to expect. I had used the gum (the gratification wasn't quite instant enough) and the "e-cigarettes" (nicotine vaporizers) before with neither working for very long. I had also tried (ill-advisedly) Adderall, which is supposed to calm nicotine cravings for some. (It really only made me giddy and scatter-brained. A very fun drug that made me almost entirely useless.) Should my next attempt work out the same as my previous ones, I'll definitely look into Chantix.
← PreviousPage 3 of 7Next →