Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Compiles atmosim to WASM via emscripten, tied with a html/js WebUI
Current state is functional, but probably a few things that I still want to tweak
Uploading just so it doesn't die untouched in a folder on my computer for years
Backend
All web code & configuration lies within the "web" folder, and no further modifications to the base atmosim.cpp are required, meaning that the web ui is effectively standalone to the actual atmosim calculator.
The only required dependency for building is emscripten, with python being optional for the dev webserver (run
make serve
, and visit http://127.0.0.1:8000/dist/ to view). Building compiles atmosim.cpp and puts the result in/dist
, and then copies all the files from/src
to/dist
as wellFunctionally emscripten compiles
atmosim.cpp
intoatmosim.wasm
andatmosim.js
(the JS interaction endpoint). The Web UI JS then calls atmosim as a web worker so that the main thread remains responsive and doesn't make the browser feel "laggy". Input is provided via args, and output is parsed from the stdout of the atmosim binary.Bad things
The current output format isn't very nice to parse as a computer, it follows a pattern but there are a lot of outliers in the output which means that the JS parsing the atmosim output has to be relatively hardcoded, meaning that changes to the output in future will require modifications to main.js in order to not break the output.
TODO
pls look through and point out things that are bad
Sample dist.zip if you just want to look through without installing emscripten and whatnot:
dist.zip
note that you'll probably have to self host it locally as a lot of javascript fetch stuff doesn't work locally for security reasons