Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It’s always good for this kind of articles, to refer to source code. Provide links to the source code responsible of some of the implementation details


Here's a header file that basically mirrors some of what the article is talking about, the layout of pages and the btree and so on (~lines 100-200)

https://github.com/sqlite/sqlite/blob/master/src/btreeInt.h

The code for the btree functions is here and is a bit over my head TBH with all the locks and permissions and so on but it's a nice example of how to comment code I think:

https://github.com/sqlite/sqlite/blob/master/src/btree.c


Yeah that would be awesome! I'd rephrase your comment as a suggestion rather than a demand though personally. :)


GP's account page says From Morocco With Love, and I'm sure their Arabic and French are far beyond mine.

This reads to me like an accidental slip into the imperative, breaking a sentence in two parts, and not adding a phrase such, "For example,".

In fact, changing the period to a colon would defuse the imperative. It's subtle!


That's a good idea. There's a careful balance though since once you start talking about specific functions in SQLite then the post becomes very low-level and starts to become less accessible. I'll try to integrate that more in the future though.


Yeah maybe it would force you to get too close to the code, I don't know SQLite well enough.

When I do surveys of software I try to provide links to source (mostly just the relevant file or directory) so folks can verify for themselves. For example when looking into the parsers behind Postgres-compatible DBs [0] and parser techniques in a few major language implementations [1]. But both those posts are at a higher-level than what you're doing here.

I'm sure you'll have good reason either way for this series.

[0] https://datastation.multiprocess.io/blog/2022-02-08-the-worl...

[1] https://notes.eatonphil.com/parser-generators-vs-handwritten...


> https://github.com/sqlite/sqlite/blob/master/src/btreeInt.h

Woah, Ben! I'm so glad the above link was shared above; thanks to the poster as well. There's a very good amount of in-depth knowledge shared via comments and a reference to Donald knuth's book


There's a lot of goodies in the comments. I like this one about how POSIX locks are broken: https://github.com/sqlite/sqlite/blob/master/src/os_unix.c#L...


Thanks! Enough catalyst for me to read through all of SQLite source files


The SQLite documentation is pretty good as well: https://sqlite.org/fileformat.html


I'll second that. I was able to use that documentation to write javascript code that reads and queries a sqlite database. (Just as a learning exercise, I don't have a practical use for this.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: