Leebra is an experimental browser engine written (mostly) in Go. To get it running you'll need to have at least Go 1.17.1 installed. Then you need to run the following:
cd leebra
go build .If everything went well, you should get a binary called leebra.
./leebra -h
Usage of ./leebra:
-run string
Runs a JavaScript file
-url string
The URL to load (default "about:blank")To just run a JavaScript file, all you need to do is run the following:
./leebra -run path/to/js/file.jsThere are plenty of JavaScript examples in the js folder.
Also, you can supply a url with the -url command line argument. For now, this doesn't do much; it will only download the page and attempt to - at some level - parse the HTML and create DOM objects from it.
http://lexbor.com/docs/lexbor/ https://github.com/lexbor/lexbor
https://blog.gopheracademy.com/advent-2014/parsers-lexers/ https://about.sourcegraph.com/go/gophercon-2018-how-to-write-a-parser-in-go/ https://adampresley.github.io/2015/04/12/writing-a-lexer-and-parser-in-go-part-1.html https://adampresley.github.io/2015/05/12/writing-a-lexer-and-parser-in-go-part-2.html https://adampresley.github.io/2015/06/01/writing-a-lexer-and-parser-in-go-part-3.html
The browser is built mostly from scratch.
These will be built from scratch or I will use Go's built-in HTML parser.
Leebra is using V8 as its JavaScript engine due to the ease of using it.
This part is documented in a separate README.
I've always wanted to learn more about browsers and thought I should write one from scratch (ish).