SQLite compiled into JavaScript via Emscripten
github.com
github.com
I've no doubt it will be a hit, thank you very much for taking the time to create this.
http://www.brianbondy.com/blog/168/sql-on-khan-academy-enabl...
https://www.khanacademy.org/computing/computer-programming/s...
1. Not API compatible with node-sqlite3, so you can't just drop it in and use it with knex or other wrappers.
2. Doesn't support in-place editing of a db. You have to load the entire DB into memory, modify it, and then save it back, making it unsuitable for any concurrent application.
I love the idea of the project though, and it would be awesome not to have to deal with compiling sqlite or using node-pregyp to build embedded chromium apps.
I wonder why that is. Is it just a fuction they simply didn't create a binding for? Or is it some performance concern?
The perf works would remain to be done, though, after the whole thing is made to work.
One of the huge benefits is the lifetime analysis which you lose soon as you cross the FFI boundary.
"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.
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.
Why not? There's no rule on HN against it, and the founder of HN thinks it's ok, since upvotes are used to indicate agreement.
Downvote for disagreement has a bit of history on HN.
PG has said gently conflicting things:
Downvoting to disagree is a problem that needs action: https://news.ycombinator.com/item?id=1057347
Downvoting to disagree is fine if people are also upvoting to agree: http://news.ycombinator.com/item?id=117171
Worry about excessive downvotes is a long term problem on HN. Here's a post from seven years ago: https://news.ycombinator.com/item?id=214398
...and a 80% or more of the rest 99% wont bother to run it, because all it buys them is hassle, as SQLite is present everywhere, well maintained by the guy who wrote it, with lots of books on it, interfaces for all their favorites languages and environments, tested thoroughly by its dev, and battle proven.
Of course somebody can write it in Rust, and do whatever they like. It might even catch on eventually.
But merely "it will be more secure because of advanced compiler technology" is not that enticing an argument -- especially if people don't have many security issues with it in the first place.
Now if it was a Rust-based Sendmail...
Yeah, didn't say you said those.
But since I started this subthread, I'm merely expanding and explaining further the thigs I said initially.
>The point is simply that, if you want to write a SQLite alternative, Rust is a reasonable language to write it in.
Oh, on that I agree.
I was mainly questioning the need to rewrite in the first place (and especially for this particular software, being an embedded db et al), not whether Rust as a language is a good choice to do so.
That said, the less mature ecosystem/toolchain etc, is still an issue for some projects that would still benefit from Rust -- e.g. for somebody used to work with VS C++, etc.
SQLite is used in tons of software. Why add a Rust compiler dependency on its build stage, if SQLite already serves them well and they already work in C/C++ land for the rest of the code of their project?
> SQLite is used in tons of software. Why add a Rust compiler dependency on its build stage, if SQLite already serves them well and they already work in C/C++ land for the rest of the code of their project?
Because a replacement might have more features/better performance/improved security? These are the same reasons you might look for alternatives for any piece of software!
That's good to know. In the language OK, not even in the standard lib?
>Because a replacement might have more features/better performance/improved security? These are the same reasons you might look for alternatives for any piece of software!
Most of that (more features, better performance) are orthogonal to Rust. Features obviously (if anything a port will probably have even LESS features initially, as Sqlite got most of its features piecemeal too).
And how is better speed assured with the Rust rewrite considering that Sqlite is pretty fast C already?
At best it might be the same speed (and if it's an algorithmic issue that slows down Sqlite, then of course they can also fix their C code and overcome that).
Which leaves us with "better security". Is it compelling enough to change software? Depends, I say.
https://hacks.mozilla.org/2010/06/beyond-html5-database-apis...
---
Now this is really, completely OT, but since you seem to be an expert with Lightroom catalogs, I wonder if you would know the answer to the following problem.
I had been using Lightroom 3 for a very long time, with newer cameras the RAWs of which it couldn't read, so I converted the RAW files to DNG using the Adobe utility. This was fine but used double disk space.
Now I finally upgraded Lightroom; I still have the original RAW files and was wondering if I could somehow replace the pointers to the DNGs with the original RAWs in the .lrcat catalog file; would that work, or completely break everything? (The point being, to get rid of the DNG files on disk).
If you just want a single file, you can bundle all the assets into one and emit some metadata so you know where each file starts and ends. Emscripten's file packager does this, for example.