So browser has got to one of those crossroads: How much do I want to write myself vs using libraries.
(Something that's just occurred to me is that I can always come back later and patch out a library, which helps make the choice on the side of libraries)
For example, libcurl is a fairly comprehensive "get it from the network" library. On the other hand is using something like LibreSSL (I'm not going to write my own TLS stuff) and parsing HTTP myself.
A related question is where in the stack I want to parse HTTP? I can create a thin wrapper around BoringSSL, and then do everything else in Lox:
var con = net.connect(host, port);
var body ="";
while (con.isConnected()) {
var read = con.read();
body += read;
}
(I'd need to sort out the difference between bytes and strings, and add methods to convert between the two, although I'm going to need those anyway for pages that aren't in ASCII)
Or push more of it down to C and have something closer to:
var body = fetch(url);
(except I want more control than that, but that's just replying with a "response" instead of a string).
I think the next step is to rough out what I'd want 'low level' io/network/file access to look like in Lox, and then see how much I'm going to need to add to support it.
(Idle thought, add a "charset" property to strings, and only allow strings with matching charsets to concentrate)