4 ms·
> Part of the beauty of SQLite is the single .c/.h thing. Noting that it's not _developed_ that way. Its many files are compounded together by the build proces
by sgbeal 4y ago
> Part of the beauty of SQLite is the single .c/.h thing.
Noting that it's not _developed_ that way. Its many files are compounded together by the build process to produce the amalgamation build. In a mixed-language project (Rust for some, C for others) a single-file distribution literally won't be possible and it will require as many toolchains to build as there are languages involved.
- bpye 4y agoI wonder if mrustc [0] would be sufficient to retain the amalgamated build even if Rust were adopted. The regular Rust tool chain would be needed for development still, but if simply depending on the library the Rust components could be transpiled to C… [0] - https://github.com/thepowersgang/mrustc https://github.com/thepowersgang/mrustc
- chasil 4y agoTH3 requires the components to be separate for testing. But that is not how it is meant to be used.
- ReactiveJelly 4y ago> a single-file distribution literally won't be possible Actually. You could compile the Rust into Wasm, then the Wasm into C. Firefox did this last year [1], so the tools exist and it's neither totally impossible nor totally stupid. The penalty is less than JITting or interpreting Wasm. wasm2c is the tool they apparently used in 2021. [2] [1] https://hacks.mozilla.org/2021/12/webassembly-and-back-again-fine-grained-sandboxing-in-firefox-95/ https://hacks.mozilla.org/2021/12/webassembly-and-back-again... [2] https://github.com/WebAssembly/wabt/tree/main/wasm2c https://github.com/WebAssembly/wabt/tree/main/wasm2c > wasm2c takes a WebAssembly module and produces an equivalent C source and header.