HNHacker News
TopNewBestAskShowJobs

nelhage

1,489 karma · joined February 17, 2008

submissionscomments
nelhage··on Writing Eloquent JavaScript Without CoffeeScript
This is satire, right? ... right? Please?
nelhage··on Quixey Challenge - 1 Bug, 1 Minute, $100
Be warned, if you want to sign up for the real challenge, you need a Skype account and a computer with a working mic. I don't have one at work, so guess I don't get to try.
nelhage··on Faster pathfinding using Jump Point Search
Suppose there was a wall or other obstacle between you and the destination. Then you might have to go "back" to find a way around. Vanilla A* can't "know" whether this is the case, so it searches outwards in all directions, using the heuristic to weight the search towards paths that are getting us closer to the destination.
nelhage··on Why SourceForge Lost
One key point that I think this article missed is the activation energy required to create a new project. On SourceForge, at least when I last used it, it was a very involved, explicit process, where you created a new project and went through several screens of populating license, status, etc., and then you finally had a place where you could stick code.

Whereas github lets you get a repo up and running with just about a single click and a 'git push', and then add on features and information as you grow. So it became the place to stick all of your one-off, throwaway, or experimental code, which got developers in the habit of using it, and it also had the room to grow if once of those things grew into a "real" project.

nelhage··on Stealth Payment Startup Stripe Backed By PayPal Founders
I'm pretty sure TC just made up that logo because they couldn't find one on the Stripe website. These guys are too canny to come up with a logo that shitty.
nelhage··on Ship Firefox 4, 5, 6 and 7 in the 2011 calendar year
Gentlemen, we cannot allow a version number gap!
nelhage··on How Lisp macros differ from static code-generation and metaprogramming
> Except, of course, that doesn’t work. The preprocessor only makes one pass > through the file, meaning a macro can’t call another macro.

Huh? That's just blatantly wrong, and I (and many others) have used the C preprocessor to create multi-level macros in quite powerful ways. See for example http://blog.nelhage.com/2010/07/implementing-an-edsl-in-cpp/ or the insanity Linux's tracing macros have implemented: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6...

His article has a point, but he's not doing C macros justice -- they are quite powerful and can be used in really cool ways, even if people tend to look at you funny when you do :)

nelhage··on Reptyr: move an already-running process into screen (better than screenify)
Most of this. It uses ptrace() to connect to the target and then make the target make specific system calls and ioctl()s on various fd's. I bet it could be ported to other unixes (assuming they have equivalent tty syscalls and ioctl's), but you'd have to change a lot of the details.

If someone wants to try a port to, say, a BSD that abstracts the syscalls and ioctls into a platform-specific way, I'd be happy to take a look.

nelhage··on Reptyr: move an already-running process into screen (better than screenify)
Hm. It currently has a bunch of known limitations, and the debug output probably isn't helpful to anyone other than me at the moment, but that test case works on my Maverick (Ubuntu 10.10) and Lucid (10.04) systems, so I'm not sure why it's failing for you. If you'd like me to take a look, the most helpful thing you could get me would be to install strace, and then run

  strace -o /tmp/reptyr.strace ~/src/reptyr/reptyr PID
and then send me the contents of /tmp/reptyr.strace

Thanks!

nelhage··on How secure is my password?
I was really hoping for something like "It would take N years to crack your password ... but now I know it, so why bother?"
nelhage··on A port of the original 1979 Unix to modern hardware
See also "xv6" (http://pdos.csail.mit.edu/6.828/2010/xv6-book/index.html), (roughly) a reimplementation of v6 UNIX for SMP x86 used by MIT's operating systems class.

They're even writing their own version of Lions' Commentary for it.

nelhage··on Amd64 and va_arg
The Linux kernel, for example, uses the following definitions for page-table entries in different levels of amd64's four-level page tables:

    typedef struct { unsigned long pte; } pte_t;
    typedef struct { unsigned long pmd; } pmd_t;
    typedef struct { unsigned long pud; } pud_t;
    typedef struct { unsigned long pgd; } pgd_t;
That way, even though they're all represented as 64-bit values, the compiler will catch you if you try to mix-and-match different types without doing appropriate work.

Passing small structs in registers means that Linux can do that, and pass around `pte_t`s as parameters, without having to worry about paying a runtime cost for their typechecking.

nelhage··on Dear Twitter: Stop screwing over your developers
If someone spoofed my user-agent and was spamming with it, and they blocked it, I would be annoyed, but I hope I would be understanding that they were doing what they need to maintain their service, and I was unfortunate collateral.

When they pre-emptively ban my user-agent because someone might steal it and spam with it, but don't apply the same rules to themselves and their partners, then I get annoyed.

nelhage··on Dear Twitter: Stop screwing over your developers
> So what Twitter is asking for is that in order to authenticate a user (with additional credentials) you give them a valid "user agent" that was assigned by Twitter.

No. What Twitter is asking for is that you keep that "user agent" secret, even though you have to distribute it to everyone who uses your app. And they have demonstrated that they will happily block that user agent value if you don't do so.

I would be perfectly happy identifying my app to Twitter, and I'm more than happy using OAuth -- it's technically a much better choice than plain passwords. I'm not happy that I have to fulfill an impossible requirement or have my app disabled, and more so that that requirement isn't applied to Twitter themselves or to the other large players they have partnerships with.

nelhage··on How to write a filesystem in 50 lines of code
Have you tried `fusermount -u` on the mountpoint? That's the fuse-specific command to force an unmount, which might clean up the FUSE mount even if the OS's VFS layer doesn't think there's a mountpoint there.
← PreviousPage 2 of 2