3 ms·
A Web Interface for Cosmopolitan Apps would be a great bridge for an UI.
by DrNosferatu 2y ago
A Web Interface for Cosmopolitan Apps would be a great bridge for an UI.
- auggierose 2y agoI am looking for an Electron replacement for writing my apps. Could cosmopolitan be the basis of something like that, or is that not really its purpose?
- brabel 2y agoLua is perfect for Redbean because it's tiny and made for embedding, which is this exactly use case. Something like TypeScript would require a transpiler to JS and a JS runtime, which as far as I know, even the smallest one would be much bigger than Lua. And Lua has well defined semantics to call C and be called by C, which may be hard to do with JS/TS.
- DrNosferatu 2y agoAny examples and good tutorials on how to best go about it?
- brabel 2y agoBest go about using Redbean? The project is well documented: https://redbean.dev/ https://redbean.dev/ Just go through it, it answers all questions you may come up with IMO. Or you mean about embedding Lua? The official docs are great too: https://www.lua.org/pil/24.html https://www.lua.org/pil/24.html If you prefer a tutorial, there's plenty as Lua has been around for a long time. Search on Youtube for example and there's lots of videos. The top hit on DDG for me was https://lucasklassmann.com/blog/2019-02-02-embedding-lua-in-c/ https://lucasklassmann.com/blog/2019-02-02-embedding-lua-in-... which seems pretty straightforward to follow.
- stutonk 2y agoquickjs [1] has native support for Cosmopolitan, is meant to be easily embeddable, and is included as part of the standard Cosmopolitan distribution. It looks like qjs also has patches for recent-ish versions of the Typescript compiler as well. Someone has made a nodejs-style project called txiki.js [2] using vanilla qjs. Maybe it would build with Cosmopolitan with some tweaking. But if you're thinking of packaging a whole browser engine like Electron that might be a Sisyphian effort. [1] https://bellard.org/quickjs/ https://bellard.org/quickjs/ [2] https://github.com/saghul/txiki.js/ https://github.com/saghul/txiki.js/
- airstrike 2y agoI would suggest iced if you're ok with Rust https://github.com/iced-rs/iced https://github.com/iced-rs/iced It's amazing, but I should warn documentation right now is not quite thorough
- lxgr 2y agoLlamafile does that (i.e. it hosts a local web server that presents a GUI).