Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
QuineDB – A quine that is also a key-value store (github.com/gfredericks)
185 points by panic on Sept 13, 2016 | hide | past | favorite | 23 comments


This is one of those glorious "because I can" projects that I love to see on HN. It shows that in a world full of big data, VC, and startups, where tech is a big buisiness, we can still do something for the fun of it, without having a reason, or trying to provide value. In short, it shows that the hacker spirit isn't dead.

I wonder if we can create a sort of Y combinator for quines: A function called YQ, that, when called with any function X as an argument will pass X a value that, when printed, generates reproduces both X and YQ, and calls X with YQ. I suppose the problem is that it would be hard to reproduce all of the values X depends on. You could just hedge on this, but that's not really the Right Thing.

Also, I think this is the Most Functional database: it rebuilds the entire program every time state changes.


It's also the Most Object-Oriented database: it combines the data and the procedures to access that data into a single encapsulated object. An exemplary design in all respects!


See? I know OO and FP weren't mutually exclusive.


I wonder if we'll see the MongoDB investors throwing money at this next? I heard that they started the due diligence process into /dev/null, but somehow the process always came back as good without any actual content. /s


Well, I've heard that the Mongo investors in investing in some really revolutionary database technology next. Instead of having a document store, you have many "tables" each containing "rows" of objects of the same type. And the best part is that these objects can have relationships to other objects, allowing you to separate complex data into its components, and describe all kinds of systems. It has a strong mathematical background, and the creators have even developed an english like structured language for queries. It's already in use at Google and Facebook, so it's totally web scale.

Crazy, right?

/s


This is totally awesome, and fun. Also it makes me remember a work I participated in when I was still an undergrad:

Can Code Polymorphism Limit Information Leakage? https://pablo.rauzy.name/research.html#amarilli2011polymorph...

The idea is that based on a Quine with payload (similar to what QuineDB does) we are able to produce a different but equivalent version of the code, and replace it with this new version, so that each time it executes, the execution trace (e.g. power leakage) is different.


Amazing. If you like this, you may also like Quine Relay, a quine program that cycles through 100 different languages:

https://github.com/mame/quine-relay


Love it!

quinedb can even store an 'extra' snapshot copy of quinedb, with "quinedb" as the key, inside quinedb:

  quinedb set quinedb `cat quinedb` | sponge quinedb
sponge, which is part of the moreutils package, soaks up standard input and then writes it to a file.


Why not cat > quinedb ?


Sponge delays the overwriting of the input file, so its not trying to read and write quinedb at the same time.


Really clever. I am working through EOPL, and this seems pretty familiar; it's the procedural representation of a database!

Can't wait to deploy this with my next web app.


Whats EOPL?


Essentials of Programming Languages; an introduction to functional programming, as well as other concepts.


EPL isn't really about FP... it's more about programming languages.


This is the perfect storage solution for my beowulf cluster


My favorite part of README.md:

Can I run a QuineDB cluster?

Well I mean, um.


What's a Quine


http://research.swtch.com/zip is a neat article about quines, worth reading if you haven't heard of them before.


It is a program that produces its own source code as output.

See https://en.wikipedia.org/wiki/Quine_%28computing%29


Now that's what I call continuous deployment!


In the company I'm working for I'm using a bash script that keeps track of my development builds, because I need to store multiple pieces of information for each one that are not readily available.

For this reason I am storing stuff in a small sqlite database. If I was ever to do this again, I would strongly consider using QuineDB instead.


Love it, the Readme is hilarious. Looks like you could avoid some code duplication though with a little awk script run by the script on its own source.


Will be a perfect backend for QuineWebFramework...




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

Search: