Live data from Hacker News

Bored? How about trying a Linux speed run?

rachelbythebay.com

1–10 of 284 posts

Re: Bored? How about trying a Linux speed run?

#3
> Who knows how far down the stack this could go?

Seems to be like the obvious initial way to up the ante would be to get rid of the compiler. How would you go about bootstrapping your way out if all you had was the Linux kernel, glibc, and the Bourne shell?

Re: Bored? How about trying a Linux speed run?

#5
Writting a shell is easy, but it's already done (do'h). You could be restricted to a really basic one, with no cd having to reimplenent that yourself. A simple "cd" command taking ARGV as the path would be around 10 lines in C.

Reimplementing echo would be the obvious second thing to do, and later, a barebones cat a la plan9/OpenBSD. Finally the 3rd basic tool would be an ed(1) clone without regex support.

ed(1) can work as a simple "more" like pager, too. Add add readonly flag to argc/argv so it fopens the file with just read permissions and you have the best setting to start. ed(1) is much easier to write than a visual editor.

Any TCP/IP stack related would be hard, but it the libc/kernel has a basic implementation bundled, I'd write a gopher client and I'd declare the problem solved, as I can fetch everything from here.

Gopher is much easier to implement than banging the FTP ports. Also you can do a barebones IRC client with few lines. Nothing too complex, but usable enough.

Or better: write a netcat clone, https://git.2f30.org/openbsd-nc/ connect to gopher, fetch the specs, write a dumb gopher client, (or fetch sacc(1), you can compile it without ncurses by editing the Makefile), connect to gpoherpedia/gutenberg Gopher proxies to fetch all the documentation.

gopher://1436.ninja/1/Project_Gutenberg_in_Gopherspace

gopher://gopherpedia.com

But the netcat clone combined with the ed editor could serve as a basic IRC client with FIFO files, also as a basic gopher client if you don't want to fetch sacc(1). Once you get connected to an IRC channel in order to seek help, among Gopher, you'll have tons of information.

Also it's the most Unix-y way to solve a problem, by far.

Re: Bored? How about trying a Linux speed run?

#6
I think an important category has to be: no outside servers designed to help with this speedrunning challenge. Without such a rule, one can get an outside computer to do much of the work. One would merely write a small program that connects to the known IP and pulls bootstrap code straight into memory. (Granted, still a fair piece of work, but without such a rule the finish line for the speedrun would become "establish a TCP connection").

EDIT: I wonder if including the Linux kernel + C library is just too much. How minimal could one go with this challenge, yet have it still be fun/doable in a reasonable duration? You start with just MS-DOS on the disk? Or a Forth interpreter? Or maybe you start with a blank disk, but you get to twiddle bits one at a time before you first use it, in the vein of the Altair 8800?

EDIT 2: An even more entertaining idea than some sort of 8800-style toggle switch interface: you start with an actual Altair 8800, then get a few "stepping stone" computers that have just enough hardware compatibility that you can transfer data from one to the next. The final computer is a modern PC with a network connection.

Re: Bored? How about trying a Linux speed run?

#7

You get all this functionality from the kernel for free. http://man7.org/linux/man-pages/man2/syscalls.2.html

Does the kernel provide a TCP stack? Either way, you still need to write an editor with which to write programs that utilize those syscalls.

Re: Bored? How about trying a Linux speed run?

#8
Why would you write a terrible editor in C and what would you use to type that in?

Isn’t cat - > file.txt or echo enough?

AFAIK bash is able to set up tcp connections. Can’t you just download a static compiled editor through this?

Maybe you don’t have bash. So what exactly is the starting point?

Re: Bored? How about trying a Linux speed run?

#10
post #3

> Who knows how far down the stack this could go? Seems to be like the obvious initial way to up the ante would be to get rid of the compiler. How would you go about bootstrapping your way out if all you had was the Linux kernel, glibc, and the Bourne shell?

> How would you go about bootstrapping your way out if all you had was the Linux kernel, glibc, and the Bourne shell?

You're fully aware that you're describing a complete programming environment and then some, correct?

Bourne's shell (assuming you mean the original, not the GNU 'remake', but GNU bash would practically make this effortless as well although for a different reason) is fantastic for almost any purpose. You can do virtually anything you'd like with it.

Post reply on HN