On 01/06/18 13:46, Warren Young wrote: > Your jQuery example later on doesn’t much apply here, for several reasons:
Note that I was showing how the site let you choose whatever features you want, and then gave you a download matching exactly that. > 1. JavaScript is a dynamic language, while C is a statically-compiled > language. Your comments while correct don't actually apply to SQLite. SQLite is not a C file. It is many C source files, many headers, a grammar (not in C), and various tools (typically TCL). For example to exclude virtual tables from SQLite, you can't just add a compile time option and be done. You have to regenerate from the grammar (so it is no longer valid SQL syntax and no longer has calls to virtual table relevant functions). And then you almost certainly want to use the tool to make the amalgamation from the updated grammar. And then you need to make sure your Makefile or equivalent passes in the omit flag too. The web site doing all that work for you, and getting it right every time does have value IMHO. It also makes it easier for SQLite to have bigger or smaller presets to address the varying developer needs. And the team will have some idea of what OMITs are used, where testing should check etc. > That means that all of the symbols needed to link the program ... That was nothing to do with the issue. To be very clear: * SQLite has a way of omiting functionality * Other than a few special cases, you must use the SQLite source (not the amalgamation) to regenerate what you finally use * Doing this is difficult and error prone > Contrast a language like JavaScript, where you can ship a program that has > calls to functions that don’t exist, and as long as you continue to not call > those functions, the JS VM won’t balk. You can do lazy runtime linking in some operating systems so functions to calls that don't exist are ok (until you call them). But in any event JS code is not distributed how you think. Minified source is usually used, and works best if run through dead code elimination first (called "tree shaking" in the JS world). ie the distribution isn't that different to SQLite (amalgamation). > 2. There are ways around this with C, My point is that it isn't. You cannot add / remove defines to the amalgamation to omit most features. Heck if you try it just won't compile. More work has to be done. The mailing list archives have many messages where people tried a few compile flags and it didn't work. > One could write a variant of cpp that would run on the sqlite3.c amalgamation > ... It won't work for anything grammar related. And the project has tools like you describe (eg it is how the amalgamation is produced). Those tools are in TCL and know about the structure and coding patterns of SQLite. Roger
signature.asc
Description: OpenPGP digital signature
_______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users