Show HN: I wrote a RDBMS (SQLite clone) from scratch in pure Python
51–60 of 82 posts
Re: Show HN: I wrote a RDBMS (SQLite clone) from scratch in pure Python
#52Kudos, i bet that was a fun and rewarding experience. I know this was never meant to be fast, but could you produce some benchmarks for shits and giggles?
Re: Show HN: I wrote a RDBMS (SQLite clone) from scratch in pure Python
#53Earlier quoted context omitted.
Yes. It's an interesting area, irrespective of implementation language. I had tried out one or two Java-based RDBMSes back in the day, via programs written in Java, for fun. I think one was HSQLDB. https://en.m.wikipedia.org/wiki/HSQLDB There was also another interesting one called PointBase, which was developed by Bruce Scott, an Oracle founder, and others. https://en.m.wikipedia.org/wiki/PointBase
H2 is pretty great and fully supports JSONB and the like [1]. Full java-only RDBMS. [1]: https://www.h2database.com/html/main.html
Re: Show HN: I wrote a RDBMS (SQLite clone) from scratch in pure Python
#54Re: Show HN: I wrote a RDBMS (SQLite clone) from scratch in pure Python
#55long time ago the Python2 stdlib shipped a ton of DB libs like BerkelyDB. https://wiki.python.org/moin/BerkeleyDB
Re: Show HN: I wrote a RDBMS (SQLite clone) from scratch in pure Python
#56Earlier quoted context omitted.
That's pretty standard for parsing libraries - have you seen any good ones (for Python or other languages) that don't use a DSL like this? The only one I've seen is this one: https://parsy.readthedocs.io/en/latest/tutorial.html
Parse, comparse, parsec and PEGs come to mind. 1: https://github.com/massung/parse 2: https://wiki.call-cc.org/eggref/5/comparse 3: https://hackage.haskell.org/package/parsec 4: https://janet-lang.org/docs/peg.html
5: https://www.gnu.org/software/guile/manual/html_node/PEG-Pars...
Re: Show HN: I wrote a RDBMS (SQLite clone) from scratch in pure Python
#57Re: Show HN: I wrote a RDBMS (SQLite clone) from scratch in pure Python
#58Thank you for sharing My perspective is that writing this kind of system in a language such as Python is actually a great thing because for myself Python is more widely readable and approachable compared to C++ or C which is what databases are often programmed in. If someone wants to be serious they can port it to a low level language . As it stands it's educational and useful for studying. I wrote a distributed pseu…
Both C and Python are very "approachable" if you ignore the bad language design, inconsistencies and other "gotchas" and only take the "easy" parts, disregarding edge cases. However, with C you could at least have a fighting chance to learn how to do things right, but with Python you'll never even know what the real thing is like.
Re: Show HN: I wrote a RDBMS (SQLite clone) from scratch in pure Python
#59Nice OP. How would you say this compares to the inbuilt 'sqlite3' module in Python? Is it more or less portable? Different features?
OP rewrote the actual database in Python, so (if it's a 1:1 equivalence), you would still use the python `sqlite3` module to connect to OP's project.
As mentioned, it's an educational project, not really meant to be used as a replacement for sqlite in projects etc though.
Re: Show HN: I wrote a RDBMS (SQLite clone) from scratch in pure Python
#60Thanks to this post I learned about Lark, which looks like a really nice parser library for Python. The JSON tutorial on their site is excellent - shows how to build a basic parser for JSON, then goes into some great detail about how to improve its performance: https://lark-parser.readthedocs.io/en/latest/json_tutorial.h... Here's the grammar used for the RDBMS project: https://github.com/spandanb/learndb-py/blob/mas…
Would a logical next step be Generate an optimal query plan from the AST(somehow..)?