Sqlite's Use of Tcl (2017)
Posted4 months agoActive4 months ago
tcl-lang.orgTechstory
calmmixed
Debate
40/100
SqliteTclProgramming Languages
Key topics
Sqlite
Tcl
Programming Languages
The article discusses SQLite's use of Tcl, highlighting its benefits and quirks, sparking a discussion on the merits and limitations of Tcl as a programming language.
Snapshot generated from the HN discussion
Discussion Activity
Moderate engagementFirst comment
4h
Peak period
7
6-9h
Avg / period
3.4
Comment distribution27 data points
Loading chart...
Based on 27 loaded comments
Key moments
- 01Story posted
Sep 7, 2025 at 11:03 AM EDT
4 months ago
Step 01 - 02First comment
Sep 7, 2025 at 3:30 PM EDT
4h after posting
Step 02 - 03Peak activity
7 comments in 6-9h
Hottest window of the conversation
Step 03 - 04Latest activity
Sep 9, 2025 at 2:30 AM EDT
4 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 45158814Type: storyLast synced: 11/20/2025, 6:27:41 PM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
Curious if anyone has more details on this. Does it have encryption?
Fossil chat has the advantages that (1) it is fully encrypted and (2) it works from any web-browser, including on mobile phones.
I suppose the encryption is only at the TLS layer?
Correct unless the fossil repository in question uses SQLite's SEE (encryption) extension (which fossil can, but relatively few repositories use that, AFAIK).
That said, to the best of my knowledge git-lfs operates upon stdin and stdout, like much of git, so I'd guess you could actually just commit the tracking file and manually run $(git-lfs scrub) et al. I do hear that "manually run" isn't the same as the way it works in git, but that's why fossil does things the fossil way
"may be aborted if a file contains content that appears to be binary, Unicode text, or text with CR/LF line endings unless the interactive user chooses to proceed. If there is no interactive user or these warnings should be skipped for some other reason, the --no-warnings option may be used."
I use fossil and checking in binaries works beautifully. You _do_ get a warning, but as seen in the documentation, you can use --no-warnings if you don't want that.
Note however, that you can't use diff on binaries, and since the entire history of the repository and the versions is shipped to all developers, storing large binaries quickly becomes cumbersome. I would in that case, store links to binaries, which themselves are stored in an archive, or switch to another scm program.
As for storing binaries, unversioned files have no history, and are not synced automatically.
https://fossil-scm.org/home/doc/trunk/www/unvers.wiki
https://fossil-scm.org/home/doc/trunk/www/unvers.wiki
But then I'm old and still use perl for small stuff, so probably not reading the room....
One of the best ways.
See also, Lua.
No, at least not if you put the SQL inside of {...}, which IIRC the documentation strongly recommends.
The $uid is passed down into SQLite. It is a single token recognized by the SQL parser itself. It does not get expanded by TCL. The $uid token serves the same roll as a "?" or ":abc" token would in some other SQL implementations. It is a placeholder for a value. The tclsqlite3.c interface first parses the SQL, then asks for the names of all of the placeholder tokens. Then it binds the values in TCL variables of the same name to those placeholders.
Indeed, this whole mechanism is specifically designed to make it easy to write SQL-injection-free code. As long as you put your SQL inside of {...}, you are completely safe from SQL injections.
If your TCL script includes SQL text inside of "...", then TCL will do the expansion and SQL injection is possible. But as long as the SQL text is inside of {...}, SQL injection is not possible.
Haha, didn't know that. That's cool.
While most of this looks cool, the stuff about parsing vdbe.c's switch cases and assigning opcodes seems a little too much for my taste.
https://en.wikipedia.org/wiki/Modified_condition/decision_co...
https://shemesh.larc.nasa.gov/fm/papers/Hayhurst-2001-tm2108... (This tutorial provides a practical approach to assessing modified condition/decision coverage (MC/DC) for aviation software products that must comply with regulatory guidance for DO-178B level A software)
12 more comments available on Hacker News