# lost above the scriptorium

November 26, 2017 7:35 AM Subscribe

A dev named Nothke talks about implementing a simple navigable infinitely large library, inspired in part by Borges, Castel del Monte and Jonathan Bosile's earlier Borges project, libraryofbabel.info (of which previously).

... Have you read The Library of Babel? "library of procedurally generated books" is the most literal possible interpretation of the title entity.

posted by PMdixon at 8:27 AM on November 26 [4 favorites]

posted by PMdixon at 8:27 AM on November 26 [4 favorites]

*.. Have you read The Library of Babel? "library of procedurally generated books" is the most literal possible interpretation of the title entity.*

I made a post about this very story last year. Previously.

posted by Fizz at 8:29 AM on November 26 [1 favorite]

I love that Jorges story just keeps on inspiring generations.

posted by Fizz at 8:30 AM on November 26 [2 favorites]

posted by Fizz at 8:30 AM on November 26 [2 favorites]

Because it’s infinite and procedurally generated, it doesn’t need to exist unless someone is looking at it, and even then only the parts they can see need to have a manifestation. It’s the ultimate optimization.

posted by blue_beetle at 11:55 AM on November 26 [1 favorite]

posted by blue_beetle at 11:55 AM on November 26 [1 favorite]

In Borges' actual library design, if each hexagon is only joined horizontally to two others, doesn't that imply that each floor of the Library is one enormously-long path?

I say "enormous" rather than "infinite" because the books are a finite length and have a finite variety of symbols; consequently, if they are unique there can only be a finite number of volumes.

posted by Joe in Australia at 1:51 PM on November 26

I say "enormous" rather than "infinite" because the books are a finite length and have a finite variety of symbols; consequently, if they are unique there can only be a finite number of volumes.

posted by Joe in Australia at 1:51 PM on November 26

Aren't there more books than there are atoms in the universe? Do I remember that right?

posted by Sebmojo at 2:08 PM on November 26

posted by Sebmojo at 2:08 PM on November 26

Way, way more. Google says that there are estimated to be "between 10

This answer surprised me too, but if you think about it it's obvious: there are vastly more ways to arrange things than things themselves, and the whole point of Borges' story is imagining whst it would be like if all possibilities were manifested. Interestingly, this vast library, so much vaster than our entire visible universe, is necessarily still infinite. In fact it's conceptually possible that our universe

posted by Joe in Australia at 6:18 PM on November 26

^{78}to 10^{82}atoms in the known, observable universe". In contrast, a single line of a single book is made of a random selection of around 80 characters chosen from a set of 25, which is approximately 6.84*10^{111}.This answer surprised me too, but if you think about it it's obvious: there are vastly more ways to arrange things than things themselves, and the whole point of Borges' story is imagining whst it would be like if all possibilities were manifested. Interestingly, this vast library, so much vaster than our entire visible universe, is necessarily still infinite. In fact it's conceptually possible that our universe

*isn't*finite. Nonetheless, the Library as described can only have so many books and hence so many shelves and rooms and therefore it must come to an end somewhere.posted by Joe in Australia at 6:18 PM on November 26

*I say "enormous" rather than "infinite" because the books are a finite length and have a finite variety of symbols; consequently, if they are unique there can only be a finite number of volumes.*

Speculation about this is one of the primary topics of the story. The narrator comes do a different conclusion than you do.

posted by straight at 6:20 PM on November 26

Nothke's version is really nifty, but the Library in the story was three-dimensional with (endless?) stairs at regular intervals that went up and down. There were also rooms every so often that provided food and shelter to the librarians.

posted by straight at 6:23 PM on November 26 [2 favorites]

posted by straight at 6:23 PM on November 26 [2 favorites]

You can browse the books in the library here.

EDIT: remove this, it's a link in the FPP

posted by straight at 2:29 PM on November 27

EDIT: remove this, it's a link in the FPP

posted by straight at 2:29 PM on November 27

I found the book that contains the answer about whether the library is finite or infinite.

posted by straight at 2:56 PM on November 27

posted by straight at 2:56 PM on November 27

I still don't get how the online version works. It's obviously not storing an infinite amount of text, so what is it searching, and how?

posted by obiwanwasabi at 8:11 PM on November 28

posted by obiwanwasabi at 8:11 PM on November 28

One general way to handle something like that is to use a seed value to initiate some bit of procedural generation, and generate any given instance you need in the moment.

So you might write a bit of code that generates a random book by, say, shuffling a collection of 1000 alphabetical characters and laying them out in their shuffled order. And that shuffling procedure works by starting from some specific seed value to kick off a series of random number generations. You initialize your random number generator with the seed, and then pick e.g. 1000 numbers out of the resulting hat.

If you feed the random number generator the same seed value on two different occasions, you'll get the same series of (pseudo-)random numbers each time.

So you generate your map of your library, where every room has an index number from 1 to a billion, and every shelf in a room has an index number from 1 to 60, and each book has an index number from 1 to 50. So every book in your library has an address that's the combo of those numbers. The 37th book on the 23rd shelf in room 304,456,432 has the address "304456432:23:37".

That's your seed for that book: 3044564322373. Only that book has that seed; that book always has that seed. You feed that seed, that book's address, into your book generator as the initializing value for the procedure that generates the book, and you get the same book every time. So you don't have to generate the book and store it; you don't have to generate billions and billions of books in order to be able to reliably deliver over and over again any given one of the billions of possible books in your notional library.

This is the same sort of idea that makes huge procedurally generated video games work in general. Games that have 400 billion planets in a galaxy that you're free to explore don't store 400 billion pre-generated worlds on your hard drive; they just generate the ones you actually visit, as needed when you visit, based on the code that reliably constructs a given world based on that world's seed/address.

posted by cortex at 8:43 PM on November 28

So you might write a bit of code that generates a random book by, say, shuffling a collection of 1000 alphabetical characters and laying them out in their shuffled order. And that shuffling procedure works by starting from some specific seed value to kick off a series of random number generations. You initialize your random number generator with the seed, and then pick e.g. 1000 numbers out of the resulting hat.

If you feed the random number generator the same seed value on two different occasions, you'll get the same series of (pseudo-)random numbers each time.

So you generate your map of your library, where every room has an index number from 1 to a billion, and every shelf in a room has an index number from 1 to 60, and each book has an index number from 1 to 50. So every book in your library has an address that's the combo of those numbers. The 37th book on the 23rd shelf in room 304,456,432 has the address "304456432:23:37".

That's your seed for that book: 3044564322373. Only that book has that seed; that book always has that seed. You feed that seed, that book's address, into your book generator as the initializing value for the procedure that generates the book, and you get the same book every time. So you don't have to generate the book and store it; you don't have to generate billions and billions of books in order to be able to reliably deliver over and over again any given one of the billions of possible books in your notional library.

This is the same sort of idea that makes huge procedurally generated video games work in general. Games that have 400 billion planets in a galaxy that you're free to explore don't store 400 billion pre-generated worlds on your hard drive; they just generate the ones you actually visit, as needed when you visit, based on the code that reliably constructs a given world based on that world's seed/address.

posted by cortex at 8:43 PM on November 28

*So you generate your map of your library, where every room has an index number from 1 to a billion, and every shelf in a room has an index number from 1 to 60, and each book has an index number from 1 to 50.*

I should state this more clearly, because this is part of the power of the idea: you don't have to generate the map in a literal "crunch the numbers and write this set of addresses out to the hard drive" sense. The map isn't a list of a billion rooms. The map is itself just

*a description of how to find a room*. So you dedicate a kilobyte of code to saying "the room at position x,y has room number z", and then you keep track of two numbers, the player's current x coordinate and their current y coordinate, and when they walk to the next room you update those numbers accordingly.

And then you feed the new x and y into the map procedure, and it says "okay, we're in room z now", and it runs the book generation code for all the books in room z, and the player can start browsing in that room. And the library can throw away everything that was in the previous room and just regenerate it again if the player wanders back that way.

posted by cortex at 8:53 PM on November 28

So this libraryofbabel.info site has long been one of my favorite websites of all time.

I've often wondered — if you slap a copyright notice at the bottom of every page, have you effectively created a copyright for every possible book?

Another question — is it illegal to share the book ID of a copyrighted work? Or since you can access every book by simply browsing the site, is the website itself breaking the law?

posted by rlio at 1:07 AM on November 29

I've often wondered — if you slap a copyright notice at the bottom of every page, have you effectively created a copyright for every possible book?

Another question — is it illegal to share the book ID of a copyrighted work? Or since you can access every book by simply browsing the site, is the website itself breaking the law?

posted by rlio at 1:07 AM on November 29

An ID system powerful enough to identify every possible book would be as long as every possible book.

posted by Joe in Australia at 1:43 AM on November 29

posted by Joe in Australia at 1:43 AM on November 29

« Older A Dress Code For The Mind | The Javelin’s engineering was orthodox pony car... Newer »

library of procedurally generated booksThat's as far as I got, sounds like an amazon scammer wanna be.

posted by sammyo at 8:06 AM on November 26 [2 favorites]