Re:Making a Statically-Linked, Single-File Web App with Reac...
by kowdermeister on Thursday April 05, 2018 @10:30AM
(#16765203)
The tutorial stops where it starts to get interesting, actually implementing any logic with the backend other than serving static files. It would have been interesting to follow through a database transaction or see some data / image manipulation.
[ Parent
| on HN ]
Re:Making a Statically-Linked, Single-File Web App with Reac...
by anderspitman on Thursday April 05, 2018 @10:38AM
(#16765290)
I actually agree. I extracted this tutorial from a project I'm working on developing an RTS game for school. I'm experimenting with having the game loop run in Rust and seeing if I can send render updates fast enough to smoothly run the UI in JS. It's working pretty well so far. I'm using Protobuf 3. I'd love to get capnproto or flatbuffers working eventually, but neither of them seem to have both JS and Rust support mature yet. I think the next obvious evolution from this tutorial would be to connect a sqlite db. Not sure how easy statically linking with it is though.
Re:Making a Statically-Linked, Single-File Web App with Reac...
by NiceGuy_Ty on Thursday April 05, 2018 @11:18AM
(#16765678)
Are you talking about statically linking the database itself? Seems like it'd be better to keep the database separate from the binary, unless you're working with a read-only database.
For static-linking the sqlite3 library, if you're using rusqlite you can just specify the bundled feature in Cargo.toml.
``` [dependencies.rusqlite] version = "your-version-number" features = ["bundled"] ```
Re:Making a Statically-Linked, Single-File Web App with Reac...
by anderspitman on Thursday April 05, 2018 @11:47PM
(#16770738)
Yeah I meant statically linking the sqlite library. Thanks for the tip on how to do it
Re:Making a Statically-Linked, Single-File Web App with Reac...
by shae on Thursday April 05, 2018 @10:35AM
(#16765247)
I have such a thing in Haskell: https://github.com/shapr/sporkle/blob/master/app/Main.hs
It's not Rust, but it is a really crappy exercise tracking app I wrote for teaching a class.
Thing different about my code: I build the HTML in the source itself, and I don't use React