{"id":14151352,"url":"https://github.com/gosub-io/gosub-engine","last_synced_at":"2025-05-14T03:03:26.925Z","repository":{"id":187521346,"uuid":"676211990","full_name":"gosub-io/gosub-engine","owner":"gosub-io","description":"The Gosub browser engine","archived":false,"fork":false,"pushed_at":"2025-05-12T00:45:41.000Z","size":5535,"stargazers_count":3558,"open_issues_count":37,"forks_count":177,"subscribers_count":37,"default_branch":"main","last_synced_at":"2025-05-12T05:18:28.192Z","etag":null,"topics":["browser","html5","rust"],"latest_commit_sha":null,"homepage":"https://gosub.io","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gosub-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"gosub-io"}},"created_at":"2023-08-08T17:20:38.000Z","updated_at":"2025-05-12T02:49:42.000Z","dependencies_parsed_at":"2023-09-27T00:21:37.528Z","dependency_job_id":"928bf313-1ace-4da5-a09c-4353e79c9c70","html_url":"https://github.com/gosub-io/gosub-engine","commit_stats":null,"previous_names":["jaytaph/gosub-browser","gosub-browser/gosub-engine","gosub-io/gosub-engine"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gosub-io%2Fgosub-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gosub-io%2Fgosub-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gosub-io%2Fgosub-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gosub-io%2Fgosub-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gosub-io","download_url":"https://codeload.github.com/gosub-io/gosub-engine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254059474,"owners_count":22007767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","html5","rust"],"created_at":"2024-08-17T04:01:01.878Z","updated_at":"2025-05-14T03:03:26.876Z","avatar_url":"https://github.com/gosub-io.png","language":"Rust","funding_links":["https://github.com/sponsors/gosub-io"],"categories":["Rust","browser"],"sub_categories":[],"readme":"# Gosub: Gateway to Optimized Searching and Unlimited Browsing\r\n\r\nThis repository holds the Gosub browser engine. It will become a standalone library that can be used by other projects\r\nbut will ultimately be used by the Gosub browser user-agent. See the [About](#about) section for more information.\r\n\r\nJoin us at our development [Zulip chat](https://chat.developer.gosub.io)!\r\n\r\nFor more general information you can also join our [Discord server](https://chat.gosub.io).\r\n\r\nIf you are interested in contributing to Gosub, please check out the [contribution guide](CONTRIBUTING.md)!\r\n\r\n\r\n## About\r\n\r\nThis repository is part of the Gosub browser engine project. This is the main engine that holds the following components:\r\n\r\n- HTML5 tokenizer / parser\r\n- CSS3 tokenizer / parser\r\n- Document tree\r\n- Several APIs for connecting to javascript\r\n- Configuration store\r\n- Networking stack\r\n- Rendering engine\r\n- JS bridge\r\n\r\nMore will follow as the engine grows. The idea is that this engine will receive some kind of stream of bytes (most likely \r\nfrom a socket or file) and parse this into a valid HTML5 document tree and CSS stylesheets.\r\nFrom that point, it can be fed to a renderer engine that will render the document tree into a window, or it can be fed\r\nto a more simplistic engine that will render it in a terminal. JS can be executed on the document tree and the document \r\ntree can be modified by JS.\r\n\r\n\r\n## Status\r\n\r\n\u003e This project is in its infancy. There is no usable browser yet. However, you can look at simple html pages and parse\r\n\u003e them into a document tree and do some initial rendering.\r\n\r\nWe can parse HTML5 and CSS3 files into a document tree or the respective css tree. This tree can be shown in the terminal \r\nor be rendered in a very unfinished renderer. Our renderer cannot render everything yet, but it can render simple html \r\npages, sort of.\r\n\r\nWe already implemented other parts of the engine, for a JS engine, networking stack, a configuration store and other\r\nthings however these aren't integrated yet. You can try these out by running the respective binary.\r\n\r\nWe can render a part for our own [site](https://gosub.io):\r\n\r\n![Gosub.io](resources/images/current_progress.png)\r\n\r\n\r\n## How to run\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e Installing dependencies \u003c/summary\u003e\r\n\r\n\r\nThis project uses [cargo](https://doc.rust-lang.org/cargo/) and [rustup](https://www.rust-lang.org/tools/install). First\r\nyou must install `rustup` at the link provided. After installing `rustup`, run:\r\n\r\n```bash\r\n$ rustup toolchain install 1.73\r\n$ rustc --version\r\nrustc 1.73.0 (cc66ad468 2023-10-03)\r\n```\r\n\r\nOnce Rust is installed, run this command to pre-build the dependencies:\r\n\r\n```bash\r\n$ cargo build --release\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n\r\nYou can run the following binaries:\r\n\r\n| Command                                | Type | Description                                                                                                                                                     |\r\n|----------------------------------------|------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\r\n| `cargo run -r --bin config-store`      | bin  | A simple test application of the config store for testing purposes                                                                                              |\r\n| `cargo run -r --bin css3-parser`       | bin  | Show the parsed css tree                                                                                                                                        |\r\n| `cargo run -r --bin display-text-tree` | bin  | A simple parser that will try and return a textual presentation of the website                                                                                  |\r\n| `cargo run -r --bin gosub-parser`      | bin  | The actual html5 parser/tokenizer that allows you to convert html5 into a document tree.                                                                        |\r\n| `cargo run -r --bin html5-parser-test` | test | A test suite that tests all html5lib tests for the treebuilding                                                                                                 |\r\n| `cargo run -r --bin parser-test`       | test | A test suite for the parser that tests specific tests. This will be removed as soon as the parser is completely finished as this tool is for developement only. |\r\n| `cargo run -r --bin run-js`            | bin  | Run a JS file (Note: console and event loop are not yet implemented)                                                                                            |\r\n\r\nFor running the binaries, take a look at a quick introduction at [/docs/binaries.md](/docs/binaries.md)\r\n\r\nThere are also a bit more advanced examples that can be run:\r\n\r\n\r\n| Command                                    | Description                                                  |\r\n|--------------------------------------------|--------------------------------------------------------------|\r\n| `cargo run --example gtk-renderer \u003curl\u003e`   | A GUI based on GTK4 / Cairo that displays a webpage          |\r\n| `cargo run --example vello-renderer \u003curl\u003e` | A GUI based on Winit / Vello that displays a webpage         |\r\n| `cargo run --example html5-parser`         | A simple example that displays a dom tree from a html source |\r\n\r\n\r\n## Benchmark and test suites\r\n\r\nTo run the tests and benchmark suite, do:\r\n\r\n```bash\r\nmake test\r\ncargo bench\r\nls target/criterion/report\r\nindex.html\r\n```\r\n\r\n## Wasm\r\n\r\nOur engine can also be compiled to WebAssembly. You need to use WasmPack for this. To build the Wasm version, run:\r\n\r\n```bash\r\nwasm-pack build --target web\r\n```\r\n\r\nAfterwards you need to serve the small useragent around the wasm version in the `wasm/` directory. You can do this by\r\n\r\n```bash\r\ncd wasm\r\nnpm run dev  # you can also use `bun run dev`\r\n ```\r\n\r\nTo use this demo, you need to enable webgpu in chromium and disable the same origin policy.\r\n\r\n```bash\r\nchromium --disable-web-security --enable-features=Vulkan --enable-unsafe-webgpu --user-data-dir=/tmp/chromium-temp-profile \r\n``` \r\n\r\nThis command works on Linux only, if someone uses Windows or macOS, please open an PR!\r\n\r\nAnd then you have it! A browser in a browser:\r\n\r\n![Browser in browser](resources/images/browser-wasm-hackernews.png)\r\n\r\n\r\n## Contributing to the project\r\n\r\nWe welcome contributions to this project but the current status makes that we are spending a lot of time researching,\r\nbuilding small proof-of-concepts and figuring out what needs to be done next. Much time of a contributor at this stage\r\nof the project will be non-coding.\r\n\r\nWe do like to hear from you if you are interested in contributing to the project and you can join us currently at\r\nour [Zulip chat](https://chat.developer.gosub.io)!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgosub-io%2Fgosub-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgosub-io%2Fgosub-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgosub-io%2Fgosub-engine/lists"}