11 ms·
What I would love to see is a SQLite rewrite in Rust. Just enough to support WebSQL and appease Mozilla's concern about the lack of alternative implementations.
by pygy_ 11y ago
What I would love to see is a SQLite rewrite in Rust. Just enough to support WebSQL and appease Mozilla's concern about the lack of alternative implementations.
- greggman 11y agoI thought the issue with SQL as a web standard period was it's under specified. So, rather than put SQL in the browser and then run into all kinds of incompatible edge cases they went with something simpler and easier to define and get right. You can then make your own library (SQL if you prefer) and be more likely to get the exact behavior you want across browsers. https://hacks.mozilla.org/2010/06/beyond-html5-database-apis-and-the-road-to-indexeddb/ https://hacks.mozilla.org/2010/06/beyond-html5-database-apis...
- TazeTSchnitzel 11y agoThe problem is that WebSQL was just SQLite, and SQLite only has a single implementation, it's basically implementation-defined.
- saidajigumi 11y ago"What I would love to see is a $PROJ rewrite in Rust." has kinda become a mantra of mine, particularly for things like SQLite which are core dependencies of so many other things.
- coldtea 11y agoYeah, let's rewrite $PROJ in a language few people use, with a lacking toolchain, and that few people will be bothered to use said rewrite, since it will make their life difficult to connect to it (they'd need a Rust toolchain to compile it for one).
- pcwalton 11y agoHow is the Rust toolchain lacking? "Few people will use a Rust library because they'd need a Rust compiler" doesn't make sense to me, because odds are good that the Rust compiler can target the platform you used to post this comment.
- Sanddancer 11y agoSQLite is rather heavily used in the embedded world, which uses a lot of architectures that llvm hasn't been ported to. Hitachi's SH, NEC's v850, etc are all targets people pay the sqlite maintainers for test suites, porting, etc. A rewrite in rust would eliminate a lot of income the developers of sqlite count on, because the toolchain just doesn't have the breadth of targets that c does.
- pcwalton 11y ago"Nobody should bother developing an alternative to SQLite because 1% of SQLite's users won't be able to run it" isn't a valid argument against developing an alternative any more than "Microsoft shouldn't bother developing Windows 95 because some users still have a 286" would have been in 1993. Nobody is saying that those who need SQLite as it exists today shouldn't continue to fund its development. It's just that writing off the development of alternatives as unrealistic because they'll only be runnable by 99% of SQLite's install base as opposed to 100% of it is silly.
- willhinsa 11y agoIf that 1% of people are the ones paying money for it, why shouldn't the developers focus on their needs?
- willhinsa 11y agoKind of ridiculous that someone downvoted this. Aren't downvotes supposed to suggest that the comment detracted from the conversation? In what way am I detracting from the discussion? Disagreeing isn't a reason to downvote.
- WaxProlix 11y agoThe problem is that it isn't so much about an interface-compatible version of $project in Rust - the value of things like SQLite is in the huge amount of testing and perf work that's been done over the years. You could do a toy reimplementation, but the value wouldn't be there.
- TranquilMarmot 11y agoSure the value would be there! After a huge amount of testing and perf work done over the course of 15 years...
- pygy_ 11y agoMozilla has a license for the full test suite (which AFAIK uses the public interface), and Rust interoperates nicely with C... The perf works would remain to be done, though, after the whole thing is made to work.
- vvanders 11y agoThat's the exact line I was thinking of, It'd be curious to see how reimplementing an existing C-api library looks in Rust. One of the huge benefits is the lifetime analysis which you lose soon as you cross the FFI boundary.
- pygy_ 11y agoAFAIK the SQLite API is rather tight. You mostly pass in and get back strings (SQL and rows of tuples, respectively).
- rcthompson 11y agoLuckily a huge amount of that testing work has been captured in a comprehensive test suite for SQLite that any alternative implementation could easily use to ensure compatibility.
- monocasa 11y ago
- malkia 11y agoThere is a complete sqlite rewrite to C# - https://code.google.com/p/csharp-sqlite/ https://code.google.com/p/csharp-sqlite/
- ivanceras 11y agoWelp, There you go, https://github.com/nukep/llamadb https://github.com/nukep/llamadb