Live data from Hacker News

Writing a SQLite clone from scratch in C (2017)

cstack.github.io

1–10 of 47 posts

Re: Writing a SQLite clone from scratch in C (2017)

#2
SQLite is already open source in the public domain.

https://sqlite.org/src/doc/trunk/README.md

Wouldn’t this be more worthwhile to write in [insert favorite modern language]?

I get it is to learn. C is a much more difficult language in which to work. A higher level language would allow one to better abstract the concepts and iterate faster

Re: Writing a SQLite clone from scratch in C (2017)

#3
post #2

SQLite is already open source in the public domain. https://sqlite.org/src/doc/trunk/README.md Wouldn’t this be more worthwhile to write in [insert favorite modern language]? I get it is to learn. C is a much more difficult language in which to work. A higher level language would allow one to better abstract the concepts and iterate faster

> Wouldn’t this be more worthwhile to write in [insert favorite modern language]?

sqlite isn’t your average C development, it’s got more lines of code written for tests than it does for actual code. Given the extensive tests written against sqlite, rewriting it from scratch in any language, even a more modern/safer one, would ultimately end up with a buggier program.

The only practical reason for rewriting sqlite is as a learning exercise. Which is what I believe the point behind this submitted project.

Re: Writing a SQLite clone from scratch in C (2017)

#4
post #2

SQLite is already open source in the public domain. https://sqlite.org/src/doc/trunk/README.md Wouldn’t this be more worthwhile to write in [insert favorite modern language]? I get it is to learn. C is a much more difficult language in which to work. A higher level language would allow one to better abstract the concepts and iterate faster

The author states on the page that they are building a new implementation in order to understand how to build it

Re: Writing a SQLite clone from scratch in C (2017)

#5
post #2

SQLite is already open source in the public domain. https://sqlite.org/src/doc/trunk/README.md Wouldn’t this be more worthwhile to write in [insert favorite modern language]? I get it is to learn. C is a much more difficult language in which to work. A higher level language would allow one to better abstract the concepts and iterate faster

Rewrite in your favorite modern language if you want to make something "better" (or "safer", or some other "-er")... but usually you end up with something worse because usually you don't have the years of trial-and-error, iteration, and refinement that most big name projects have.

Rewrite in C if you want to learn the underlying data structures, algorithms, and real-world computer science of the field. Database design is field with exceptional depth and many lessons to be learned.

Re: Writing a SQLite clone from scratch in C (2017)

#6
post #2

SQLite is already open source in the public domain. https://sqlite.org/src/doc/trunk/README.md Wouldn’t this be more worthwhile to write in [insert favorite modern language]? I get it is to learn. C is a much more difficult language in which to work. A higher level language would allow one to better abstract the concepts and iterate faster

You may be interested in https://github.com/joaoh82/rust_sqlite

Re: Writing a SQLite clone from scratch in C (2017)

#8
post #2

SQLite is already open source in the public domain. https://sqlite.org/src/doc/trunk/README.md Wouldn’t this be more worthwhile to write in [insert favorite modern language]? I get it is to learn. C is a much more difficult language in which to work. A higher level language would allow one to better abstract the concepts and iterate faster

If you actually read before posting, you would know that the author is doing this as a pedagogical exercise.

Re: Writing a SQLite clone from scratch in C (2017)

#10
post #3
post #2

SQLite is already open source in the public domain. https://sqlite.org/src/doc/trunk/README.md Wouldn’t this be more worthwhile to write in [insert favorite modern language]? I get it is to learn. C is a much more difficult language in which to work. A higher level language would allow one to better abstract the concepts and iterate faster

> Wouldn’t this be more worthwhile to write in [insert favorite modern language]? sqlite isn’t your average C development, it’s got more lines of code written for tests than it does for actual code. Given the extensive tests written against sqlite, rewriting it from scratch in any language, even a more modern/safer one, would ultimately end up with a buggier program. The only practical reason for rewriting sqlite is…

Parent commenter didn't mean rewrite SQLite in X but rather the project author write the articles utilizing another (probably an easier to work with) language as they're showing the algorithms behind SQLite rather documenting codebase.
Post reply on HN