DEV Community

Priyal Kumar
Priyal Kumar

Posted on

<<Learning by creating is fun>>

I just love learning by creating projects. Here are some of the things which I'd love to make but I was unable to find any online tutorials, courses,... for any of them:

  • a Web Browser
  • File system
  • Programming language interpreter

Also suggest me anything.(book, GitHub repo, course, tutorial, blogpost, ...) I just love creating.

So far I've only created a few websites by using HTML, CSS and some frameworks. Did few things in AWS. Few small programs in hackathons. Some command-line games and simple animations. Once made a detailed model of International Space Station in openSCAD(lost the code, so sad about it).

Top comments (2)

Collapse
 
curtisfenner profile image
Curtis Fenner • Edited

Web Browser

This would be an incredibly ambitious project. Web browsers are made up of lots of things, including these, each of which is a huge project on its own:

  • An HTTP stack. Reasonably, you could just use a library for this, but some features of web browsers (connection pooling, getting information on HTTPS certificates) might be hard to get right without opening up the HTTP library. Building a functional but slow HTTP 1.0 / much of HTTP 1.1 library yourself actually wouldn't be too difficult, but it would still be a massive project

  • An HTML parser. HTML is not a simple specification. (Actually, to browse the full web, you also need to be able to parse XHTML and other standards, which are slightly different!) You could probably use a library for this, but I'm not sure of one off the top of my head

  • A CSS parser. Parsing CSS is comparatively straightforward.

  • A layout engine. This would take in HTML and CSS, and turn it into things that need to be drawn on the screen. This is much more complicated than you might think because of the way that HTML describes layout.

  • A JavaScript parser and engine. JavaScript is by no means a simple language! You might possibly be able to leverage something like Node.JS to avoid doing this yourself, but you would have to be careful about sandboxing it.

  • All of the browser's UI and state (cookies, history, back/forward, tabs, ...)

File System

This is something I've wanted to do too, and I haven't found any good guides.

I think the most straightforward way to accomplish this would be to build an NFS server. This doesn't work exactly the same way that the file-system built into your computer does (which is generally a part of the OS itself) but the OS will generally have a way to make an NFS mount look just like a regular drive. There isn't really a safe way to make a "real" OS-level file system, but a networked drive will teach you all about how file system APIs work. (NFS will work better on Linux/Mac than Windows, but Windows also has support for NFS drives).

I'm guessing there are some guides produced for this by some university course, but I haven't come across them yet. The NFS protocol is not too complicated, so you could theoretically read the specs and implement it yourself (assuming you have some understanding of how servers and networking works), but it would be a long project before you get something functional.

Interpreter

This is actually not too bad, and there are lots of great resources!

The online book Crafting Interpreters is a highly recommended one! It walks through from the beginning to the end. I think they show everything in Java, but you could do it in any language you wanted.

Collapse
 
pryl profile image
Priyal Kumar

extreme thanks bro, this gave me some clarity :-)
love u 3000