4 ms·
If you think that file system is a viable approach to web site, how would implement Hacker News? Hacker News is one of the old-school static-rendered sites. It
by ianburrell 2y ago
If you think that file system is a viable approach to web site, how would implement Hacker News? Hacker News is one of the old-school static-rendered sites. It may not even use a database.
But it needs to be dynamic. The ordering on the front page is dynamic. The vote counts are dynamic. What does the voting? These are all easier to have a database with values that query and then render the page.
The other issue adding new content. How would someone post a comment? How and where does it get written? How do you make sure they write to right place? How do you make it easy to use as typing in box and hitting button?
Dynamic responses are the special sauce of the web, they are why it is a success. Without it, it would be good-looking Gopher.
- pilgrim0 2y ago> If you think that file system is a viable approach to web site, how would implement Hacker News? Hacker news is a web application, with a client-server architecture. Indeed would be impractical to replicate with the file system model. Still, I think it would be useful to have standardized hypermedia documents. It would allow for content that's naturally multimedia to be much more easily handled and distributed. I find it super weird that we need to create a 'website' just to have a multimedia, responsive document. It practically must be hosted on a server because nobody sends HTML around. Mind you that I used the file system just as a metaphor for what an offline-first hypermedia document model could look like.
- ianburrell 2y agoOne of the huge advantages of the web is that there is no distinction between static web sites and web application. The backend implementation can change per page based on what is needed. The remote filesystem needs a server. HTTP is a much better protocol for serving multimedia documents. The remote file system protocols are slow because they are based on RPC and make lots of requests. It is dangerous to use filesystem for sharing cause have to carefully limit write access. None of the current filesystem protocols do that well. If you were designing something new, it would probably end up like WebDAV or S3, an object store that can be used like a file system. There is a place for distributed storage, like IPFS but better, but that wouldn't be a file system. There is a standard for hypermedia documents, HTML. There were attempts to make it more semantic, like XHTML 2.0 or using RDF, and they failed. There were attempt to transform XML, XSL, and that failed. People send HTML around, they upload it to servers like I did a few days ago. But HTML is usually generated, for me because Markdown is easier to edit and can use templates.
- pilgrim0 2y agoI’m not at all suggesting replacing HTML; it's a treasure we have. I think you're failing to see the point. Having hypermedia documents follow a file system model does not imply that you would need to basically give up hypertext protocols. I'm sure you’ve at least once visited an Apache directory index on the web. Heck, just type file:///Users/ianburrell in your browser, and you'll have a hypermedia document modeled after the file system. Take that concept to its ultimate conclusion, and you'll see that a dead-simple hypermedia document can be built without resorting to any new technology or infrastructure.
- robertlagrant 2y agoIt can be built that way, but only locally. If you want it over a network you need something to serve it.
- pilgrim0 2y agoLet me give a use case where an offline-first hypermedia document model would be useful. I used to work as an instructional designer, making art and photography courses. This sort of material requires a lot of media, practically of all kinds. You either have to know how to code or use some platform to build that kind of thing. In either case, there'll be friction between reconciling the data source and the final document/volume. If you use a managed solution like a platform, you'll be locking away the content on their servers. Exporting the raw data does nothing because it'll lose all structure—that's basically what happens when you try to export from Notion, from instance. Yes, you can export, but it's lossy, because available offline formats, even markdown, cannot express the structure and ergonomics available within the authoring environment. There's a disconnect between source and presentation. You'll be left with a scattered set of files. The other option is not much better: coding it yourself. You'll need a CMS, and your data will be either JSON, MD, XML, or worse, tabular within an SQL database. Then you'll have to develop a build system or make some sort of SPA. And you'll need to setup a webserver and configure it to distribute the content. This is absurdly complex. It makes producing such materials very expensive. You just can't distribute your course offline. You can't back it up easily, either. Compare that with print media. Want to make a memo? Fire whatever word processor, write it down, export to PDF, share anywhere. Done. If hypermedia was easy like this, do you have any doubt that people would put it to good use? Do you realize how PDF might be overused simply because of the durability, simplicity and fidelity traits it has? It's not a law of nature that hypermedia should exist only in the context of browsers. Neither that it has to use HTML, CSS and JS.
- ianburrell 2y agoYou are going to need code anyway. Something needs to render the structured data into the format that the browser can understand. People tried to do that with structured markup and languages like XSL. But now we do it with JavaScript and JSON. Your example could be done with directory of media files and metadata in JSON. JavaScript generates pages from the JSON file. Browsers can serve from the filesystem. It would need to be static since updating the JSON safely is hard since filesystem don't provide atomic guarantees. If you wanted it writable or larger, you would need web server running API for accessing something like SQLite for database. Running a web server is super easy these days, single command. Instead of thinking about how would remake hypermedia, come up with a JSON metadata schema that can be dropped in directory of multimedia. Then have JavaScript to render it. There are lots of people, me included, that would like that for our music and image libraries.
- 6510 2y agoWith torrents the number of seeds and leaches do something similar. It actually tells you more as crap is deleted rather than seeded. Most of HN is frozen archives. That you can still vote on things you may not comment on isn't all that useful. HN (while huge) is a collection of things that are easy to do on centralized platform. It could be much more complicated but simplicity is valuable. I would have to think a bit to come up with something that could reasonably match the mature centralized architecture. First thought would be that if I like your comment I could chose to seed your most recent GB of comments. They would load faster for everyone for each who seeds them.
- pilgrim0 2y agoYou provided a great example of using the conscious choice to seed as a way to signal an upvote. What better way to promote something other than the commitment to redistribute the content? In the context of P2P, it occurred to me that it's also possible to design a fully decentralized comment system using a naming convention. Each comment would be a torrent named after a given scheme, making it possible to track and discover comments related to another torrent. Since seeding means upvoting, then the best comments would be the most seeded ones.
- 6510 2y agoI have a lot of ideas. Each would have to be examined, debunked, improved etc they would have to be considered in combination as many would overlap, contradict or compliment. On a higher level it's fun to notice that HN isn't suitable for developing anything. People are just talking for talking sake, small nuggets of information are tossed around that may be useful to the reader any place but here. It is quite preposterous actually that this kind of architecture is even a thing. I have higher expectations from scribblings on a napkin among drunks in a loud bar. When I first got on irc I had the audacity to ask people to do things for me. I even used private messages for this. Everyone got really angry but I disagreed, I still do. irl if I need a drill ill go ring the door 5 houses down the street and expect them to lend it to me. If some stranger asks me to dig a swimming pool for them ill show up with 10 friends and go do it. People who don't normally function that way should be offered assistance until they've so abundantly made use of it that they too will lend a hand. Online the opposite is happening. People have culturally rendered themselves to be quite useless. Imagine for laughs trying to architect and build a house on Twitter. Even GIT is pretty useless. If it cant get an 8 year old to contribute in 5 minutes a tool has failed. Sure, all parts of a project might be extremely complicated or dangerous but that is just looking for excuses. Therefore, I would argue, everything that doesn't directly contribute towards setting or accomplishing real world goals should live behind some imaginary line in the sand and be treated like useless content. Educative or inspiring does count as useful but only barely.