The best Hacker News stories from Show from the past day
Latest posts:
Show HN: PQCrypta Proxy: Rust proxy with HTTP/3, QUIC, hybrid post-quantum TLS
Show HN: PQCrypta Proxy: Rust proxy with HTTP/3, QUIC, hybrid post-quantum TLS
Show HN: PQCrypta Proxy: Rust proxy with HTTP/3, QUIC, hybrid post-quantum TLS
Show HN: Mason – A lightweight Postgres read-replica, built on columnar storage
Hi HN! TLDR: we’ve built an open-source drop-in replacement for a postgres read-replica, powered by duckdb’s columnar compute engine. It’s very fast. And it looks like postgres.<p>So, this started out as: let’s just connect Clickhouse to our postgres dbs and throw our analytics queries at it instead. That will speed everything up. But we quickly found that 1) Clickhouse comes with quite the learning curve (engine optimisation) to make it fast (we needed something we could easily drop in to any customer’s postgres scenario), and 2) we had underestimated how different clickhouse’s SQL syntax was to postgres. Don’t get me wrong: we love Clickhouse (it’s ridiculously fast if you know what queries to expect), it just didn’t work for our ad-hoc postgres workloads.<p>So we went searching for alternatives that were 1) more plug-and-play and 2) looked a lot more like postgres.<p>We dismissed a bunch based on desk research alone:<p>- pg_mooncake (seems to have stalled since data bricks bought them)<p>- pg_duckdb (seems to offer fast queries, or fresh data, but not both - we needed both)<p>- materialize/risingwave/readyset (like Clickhouse, they require knowing the query shapes upfront - not ideal for ad-hoc workloads)<p>- firebolt (license makes it challenging to offer to our customers)<p>- redshift / alloydb / etc (we wanted something cloud-provider agnostic)<p>And we shortlisted 3:<p>- pg_clickhouse (Postgres extension that parses SQL in Postgres and pushes the work down to ClickHouse)<p>- cedarDB (closed-source, Postgres-compatible analytical database)<p>- duckdb (open-source, embedded columnar analytics engine with a Postgres-like SQL dialect)<p>We needed to know how they would perform on real postgres queries, so we took a backlog of 5,410 (hand-written) queries (chosen because they had been slow to execute against postgres) from 159 real postgres databases. We then generated synthetic data (dynamically using the schemas from those 159 databases) to fill 159 local databases so we could run the experiment.<p>We then spun up the 3 short-listed tools locally, and ran each of the 5,410 queries against both postgres and the 3 tools, and compared the results:<p>- pg_clickhouse (matched postgres 59.4% of the time, refused 39.9% of the queries and was “wrong” 0.8% of the time).<p>- cedarDB (matched postgres 88.1% of the time, refused 8% of the queries and was “wrong” 3.9% of the time).<p>- duckdb (matched postgres 84.1% of the time, refused 14.3% of the queries and was “wrong” 1.6% of the time).<p>Matched meant they returned exactly the same result as postgres. Refused meant they returned an error message (usually telling you some syntax isn’t recognised). And “wrong” meant they didn’t return the same results as postgres. I appreciate that arguably postgres may be the one that is wrong in some cases - but for our use case, we considered postgres the golden source of truth.<p>So, both duckdb and cedardb performed pretty well (correctly handled more than 80% of the postgres queries we threw at it), out-of-the box. But we really still wanted to try and cover that long-tail.<p>We chose duckdb as its open-source license would allow us to easily work on the long tail to get the postgres SQL parity we wanted.<p>So, Mason (linked above), is what we built, powered by duckdb, which now matches postgres on 96% of our 5,410 queries, plus hundreds of other queries that we added, testing it with Metabase, Grafana, Superset, DBeaver and Trevor.io. For the remaining 4%, it errors with a nice clear message telling you how to rewrite your SQL.<p>We’d love your feedback on what we’ve built. Useful? How can we make it better?
Show HN: Mason – A lightweight Postgres read-replica, built on columnar storage
Hi HN! TLDR: we’ve built an open-source drop-in replacement for a postgres read-replica, powered by duckdb’s columnar compute engine. It’s very fast. And it looks like postgres.<p>So, this started out as: let’s just connect Clickhouse to our postgres dbs and throw our analytics queries at it instead. That will speed everything up. But we quickly found that 1) Clickhouse comes with quite the learning curve (engine optimisation) to make it fast (we needed something we could easily drop in to any customer’s postgres scenario), and 2) we had underestimated how different clickhouse’s SQL syntax was to postgres. Don’t get me wrong: we love Clickhouse (it’s ridiculously fast if you know what queries to expect), it just didn’t work for our ad-hoc postgres workloads.<p>So we went searching for alternatives that were 1) more plug-and-play and 2) looked a lot more like postgres.<p>We dismissed a bunch based on desk research alone:<p>- pg_mooncake (seems to have stalled since data bricks bought them)<p>- pg_duckdb (seems to offer fast queries, or fresh data, but not both - we needed both)<p>- materialize/risingwave/readyset (like Clickhouse, they require knowing the query shapes upfront - not ideal for ad-hoc workloads)<p>- firebolt (license makes it challenging to offer to our customers)<p>- redshift / alloydb / etc (we wanted something cloud-provider agnostic)<p>And we shortlisted 3:<p>- pg_clickhouse (Postgres extension that parses SQL in Postgres and pushes the work down to ClickHouse)<p>- cedarDB (closed-source, Postgres-compatible analytical database)<p>- duckdb (open-source, embedded columnar analytics engine with a Postgres-like SQL dialect)<p>We needed to know how they would perform on real postgres queries, so we took a backlog of 5,410 (hand-written) queries (chosen because they had been slow to execute against postgres) from 159 real postgres databases. We then generated synthetic data (dynamically using the schemas from those 159 databases) to fill 159 local databases so we could run the experiment.<p>We then spun up the 3 short-listed tools locally, and ran each of the 5,410 queries against both postgres and the 3 tools, and compared the results:<p>- pg_clickhouse (matched postgres 59.4% of the time, refused 39.9% of the queries and was “wrong” 0.8% of the time).<p>- cedarDB (matched postgres 88.1% of the time, refused 8% of the queries and was “wrong” 3.9% of the time).<p>- duckdb (matched postgres 84.1% of the time, refused 14.3% of the queries and was “wrong” 1.6% of the time).<p>Matched meant they returned exactly the same result as postgres. Refused meant they returned an error message (usually telling you some syntax isn’t recognised). And “wrong” meant they didn’t return the same results as postgres. I appreciate that arguably postgres may be the one that is wrong in some cases - but for our use case, we considered postgres the golden source of truth.<p>So, both duckdb and cedardb performed pretty well (correctly handled more than 80% of the postgres queries we threw at it), out-of-the box. But we really still wanted to try and cover that long-tail.<p>We chose duckdb as its open-source license would allow us to easily work on the long tail to get the postgres SQL parity we wanted.<p>So, Mason (linked above), is what we built, powered by duckdb, which now matches postgres on 96% of our 5,410 queries, plus hundreds of other queries that we added, testing it with Metabase, Grafana, Superset, DBeaver and Trevor.io. For the remaining 4%, it errors with a nice clear message telling you how to rewrite your SQL.<p>We’d love your feedback on what we’ve built. Useful? How can we make it better?
Show HN: Mason – A lightweight Postgres read-replica, built on columnar storage
Hi HN! TLDR: we’ve built an open-source drop-in replacement for a postgres read-replica, powered by duckdb’s columnar compute engine. It’s very fast. And it looks like postgres.<p>So, this started out as: let’s just connect Clickhouse to our postgres dbs and throw our analytics queries at it instead. That will speed everything up. But we quickly found that 1) Clickhouse comes with quite the learning curve (engine optimisation) to make it fast (we needed something we could easily drop in to any customer’s postgres scenario), and 2) we had underestimated how different clickhouse’s SQL syntax was to postgres. Don’t get me wrong: we love Clickhouse (it’s ridiculously fast if you know what queries to expect), it just didn’t work for our ad-hoc postgres workloads.<p>So we went searching for alternatives that were 1) more plug-and-play and 2) looked a lot more like postgres.<p>We dismissed a bunch based on desk research alone:<p>- pg_mooncake (seems to have stalled since data bricks bought them)<p>- pg_duckdb (seems to offer fast queries, or fresh data, but not both - we needed both)<p>- materialize/risingwave/readyset (like Clickhouse, they require knowing the query shapes upfront - not ideal for ad-hoc workloads)<p>- firebolt (license makes it challenging to offer to our customers)<p>- redshift / alloydb / etc (we wanted something cloud-provider agnostic)<p>And we shortlisted 3:<p>- pg_clickhouse (Postgres extension that parses SQL in Postgres and pushes the work down to ClickHouse)<p>- cedarDB (closed-source, Postgres-compatible analytical database)<p>- duckdb (open-source, embedded columnar analytics engine with a Postgres-like SQL dialect)<p>We needed to know how they would perform on real postgres queries, so we took a backlog of 5,410 (hand-written) queries (chosen because they had been slow to execute against postgres) from 159 real postgres databases. We then generated synthetic data (dynamically using the schemas from those 159 databases) to fill 159 local databases so we could run the experiment.<p>We then spun up the 3 short-listed tools locally, and ran each of the 5,410 queries against both postgres and the 3 tools, and compared the results:<p>- pg_clickhouse (matched postgres 59.4% of the time, refused 39.9% of the queries and was “wrong” 0.8% of the time).<p>- cedarDB (matched postgres 88.1% of the time, refused 8% of the queries and was “wrong” 3.9% of the time).<p>- duckdb (matched postgres 84.1% of the time, refused 14.3% of the queries and was “wrong” 1.6% of the time).<p>Matched meant they returned exactly the same result as postgres. Refused meant they returned an error message (usually telling you some syntax isn’t recognised). And “wrong” meant they didn’t return the same results as postgres. I appreciate that arguably postgres may be the one that is wrong in some cases - but for our use case, we considered postgres the golden source of truth.<p>So, both duckdb and cedardb performed pretty well (correctly handled more than 80% of the postgres queries we threw at it), out-of-the box. But we really still wanted to try and cover that long-tail.<p>We chose duckdb as its open-source license would allow us to easily work on the long tail to get the postgres SQL parity we wanted.<p>So, Mason (linked above), is what we built, powered by duckdb, which now matches postgres on 96% of our 5,410 queries, plus hundreds of other queries that we added, testing it with Metabase, Grafana, Superset, DBeaver and Trevor.io. For the remaining 4%, it errors with a nice clear message telling you how to rewrite your SQL.<p>We’d love your feedback on what we’ve built. Useful? How can we make it better?
Show HN: I used Fable to make an open source 80s-style Skyrim browser game
Inspired by both Skyrim and the old Sierra games like King's Quest<p>Features:<p>- Playable in the browser on desktop and mobile<p>- Play by clicking, tapping, number keys, or typing<p>- Original code-drawn pixel art and synthesised music<p>- Day and night, snow, and a thaw<p>- Real-time combat with timed parries<p>- Six skills that rise by use, with perks<p>- Five spells and four runewords<p>- Trading, a forge, and repeatable paid work<p>- Weight limit for what you carry, and a storage chest<p>- Map, journal, character sheet, and deeds list<p>- Two-part main story with two endings<p>- Eleven side stories<p>- Valley with eight fable-made places and interiors<p>- Endlessly generated open country beyond the valley<p>- Eighteen fable-written scenes to find in the wild<p>- Three far landmarks<p>- Walls of rock with passes guarded by enemies<p>- Vaults under ruined towers<p>- Autosave plus three manual slots<p>- No runtime dependencies<p>Limitations:<p>- Story inconsistencies<p>- Mismatches between story/description and visual state<p>- I'm sure plenty more
Show HN: Hearth 64 – A cozy fireplace screensaver ROM for real N64 hardware
Show HN: Type-C – variants, options, generics and pattern matching for C
I love C, but often using it for parsing, tree walking or complex error handling leads to spaghetti code.<p>Of course there is Swift, Ocaml or Rust for situations like that, but then you are either forced to convert the entire codebase, or add a runtime library or go through the pain of bridging C to the new language. Sometimes there are no compilers for the target architecture too when you are working on embedded stuff.<p>This is where Type-C comes in. It works as a preprocessor like TypeScript and calls the original C driver behind the scenes. Your code stays normal C for the most part, so you can predict how the code will be laid out. TypeC is a full superset of C11, so any C11 code compiles as is.<p>Want to use TypeC just for one file? Rename to .tc and use the features you want, the rest of the codebase stays the same. This works for kernel or baremetal code too as there is no runtime or extra libararies.<p>There are examples of TypeC code as well as real-world tests of converting existing code to TypeC on the GitHub page.<p>This is how the code looks like for an expression evaluator:
type expr =
| Num(int value)
| Add(const expr <i>l, const expr </i>r)
| Mul(const expr <i>l, const expr </i>r)
| Div(const expr <i>l, const expr </i>r);<p><pre><code> static result(int, eval_error)
eval(const expr *e)
{
int d;
match (*e) {
case Num(value):
return (Ok(value));
case Add(l, r):
return (fit((long long)try eval(l) + try eval(r)));
case Mul(l, r):
return (fit((long long)try eval(l) * try eval(r)));
case Div(l, r):
d = try eval(r);
if (d == 0)
return (Err(DivByZero));
return (fit((long long)try eval(l) / d));
}
}
% typec -std=c11 -Wall -Wextra eval.tc
$ ./a.out
14
division by zero
</code></pre>
Would love to hear your thoughts and feedback!
Show HN: Type-C – variants, options, generics and pattern matching for C
I love C, but often using it for parsing, tree walking or complex error handling leads to spaghetti code.<p>Of course there is Swift, Ocaml or Rust for situations like that, but then you are either forced to convert the entire codebase, or add a runtime library or go through the pain of bridging C to the new language. Sometimes there are no compilers for the target architecture too when you are working on embedded stuff.<p>This is where Type-C comes in. It works as a preprocessor like TypeScript and calls the original C driver behind the scenes. Your code stays normal C for the most part, so you can predict how the code will be laid out. TypeC is a full superset of C11, so any C11 code compiles as is.<p>Want to use TypeC just for one file? Rename to .tc and use the features you want, the rest of the codebase stays the same. This works for kernel or baremetal code too as there is no runtime or extra libararies.<p>There are examples of TypeC code as well as real-world tests of converting existing code to TypeC on the GitHub page.<p>This is how the code looks like for an expression evaluator:
type expr =
| Num(int value)
| Add(const expr <i>l, const expr </i>r)
| Mul(const expr <i>l, const expr </i>r)
| Div(const expr <i>l, const expr </i>r);<p><pre><code> static result(int, eval_error)
eval(const expr *e)
{
int d;
match (*e) {
case Num(value):
return (Ok(value));
case Add(l, r):
return (fit((long long)try eval(l) + try eval(r)));
case Mul(l, r):
return (fit((long long)try eval(l) * try eval(r)));
case Div(l, r):
d = try eval(r);
if (d == 0)
return (Err(DivByZero));
return (fit((long long)try eval(l) / d));
}
}
% typec -std=c11 -Wall -Wextra eval.tc
$ ./a.out
14
division by zero
</code></pre>
Would love to hear your thoughts and feedback!
Show HN: News Blocklist – a DNS blocklist of 14k news and current-affairs sites
A little while ago I built (vibed) a tiny Mac app to block websites via the hosts file. By default it imported some fairly popular adult filtering lists as well as social media etc.<p>It has been very effective; it would only take a few moments to switch off but it is enough of an interruption to often make me re-evaluate and proceed on.<p>I have a particular distain for current affairs and have found "the news" addictive for years, clearly at the detriment to my own mental health and sanity.<p>So, in a similar vein to the other lists I found, I have created a fairly comprehensive list of news sites that can be imported/used as you see fit.<p>To state the obvious, the absolute vast majority of the work was done via Claude and a small army of sub-agents.
Show HN: Hermit CRM – Free open-source CRM for solopreneurs
I was about to keep track of my clients and prospecting in Google Sheets for my solopreneur business, when I remembered that's exactly what I advise my clients not to do.<p>Created Hermit CRM, an open source CRM for 1 person. Hermit helps to keep track of deals and prospecting. The platform is built for AI by storing the data in Markdown files in git, stored locally and can be accessed with a web app, CLI or MCP. No telemetry on the app. Building in public, even the website stats are public as well.<p>It’s macOS first. Linux is less tested, and Windows isn’t supported.<p>Features I'm proud of:
- import somebody from LinkedIn into to the CRM with 1 click
- adding a LinkedIn convo to the CRM with 1 click.
Both work without LinkedIn or CRM subs.<p>Don't like what you see? Fork the Hermit with your AI.<p>Would love to learn how you're using Hermit and where it doesn't fit your workflows.
Show HN: Hermit CRM – Free open-source CRM for solopreneurs
I was about to keep track of my clients and prospecting in Google Sheets for my solopreneur business, when I remembered that's exactly what I advise my clients not to do.<p>Created Hermit CRM, an open source CRM for 1 person. Hermit helps to keep track of deals and prospecting. The platform is built for AI by storing the data in Markdown files in git, stored locally and can be accessed with a web app, CLI or MCP. No telemetry on the app. Building in public, even the website stats are public as well.<p>It’s macOS first. Linux is less tested, and Windows isn’t supported.<p>Features I'm proud of:
- import somebody from LinkedIn into to the CRM with 1 click
- adding a LinkedIn convo to the CRM with 1 click.
Both work without LinkedIn or CRM subs.<p>Don't like what you see? Fork the Hermit with your AI.<p>Would love to learn how you're using Hermit and where it doesn't fit your workflows.
Show HN: Drive around my village in 3D
So this started out just over a week ago, could I drive around my village in my old car on the web, and its expanded into a massive map, with races, events, different cars and multiplayer.<p>I'm a web/app guy, backend guy, and yes I build it with Claude.<p>I know I shouldn't be astounded by what these Ai agents can do as of today, but here I am still amazed.<p>I've even got support from a Sim racing guy and built a web driver so he gets full force feedback for his rig, and it works.<p>Anyway, just a bit of fun!<p>Uses LIDAR data from the UK Gov + OpenStreetMap data to build the world. Technically, I could do the whole of England/Wales...but the data storage would be huge!
Show HN: Drive around my village in 3D
So this started out just over a week ago, could I drive around my village in my old car on the web, and its expanded into a massive map, with races, events, different cars and multiplayer.<p>I'm a web/app guy, backend guy, and yes I build it with Claude.<p>I know I shouldn't be astounded by what these Ai agents can do as of today, but here I am still amazed.<p>I've even got support from a Sim racing guy and built a web driver so he gets full force feedback for his rig, and it works.<p>Anyway, just a bit of fun!<p>Uses LIDAR data from the UK Gov + OpenStreetMap data to build the world. Technically, I could do the whole of England/Wales...but the data storage would be huge!
Show HN: Drive around my village in 3D
So this started out just over a week ago, could I drive around my village in my old car on the web, and its expanded into a massive map, with races, events, different cars and multiplayer.<p>I'm a web/app guy, backend guy, and yes I build it with Claude.<p>I know I shouldn't be astounded by what these Ai agents can do as of today, but here I am still amazed.<p>I've even got support from a Sim racing guy and built a web driver so he gets full force feedback for his rig, and it works.<p>Anyway, just a bit of fun!<p>Uses LIDAR data from the UK Gov + OpenStreetMap data to build the world. Technically, I could do the whole of England/Wales...but the data storage would be huge!
Show HN: Compile the same source for GPUs and CPUs
I'm writing a language called xc and its compiler, xcc for the last 6 months or so (full disclosure: with a lot of help from Claude). I've finally got version 1 (actually v1.0.1) out, for Linux (x86-64 and arm64, including the Pi 5), macOS and Windows.<p>The idea: you write an ordinary loop, the compiler works out whether it can run in parallel, and it emits both a multi-core CPU version and GPU kernels (MSL, PTX, SPIR-V or WGSL, all generated by xcc itself without needing an SDK installed).<p>At run time the program measures each block on that machine and keeps the faster placement.<p>Examples:<p>- On an M3 Max a Mandelbrot block takes 13.7 ms on all 16 cores and 1.3 ms on the GPU<p>- On a Ryzen 9955HX's 2-CU integrated Radeon the GPU loses to the 32 CPU threads, so it stays on the CPU.<p>The compiler also reads plain old C via clang's front end and does the same thing to C loops, with no pragmas. Comparing xcc to OpenMP for both gcc and clang (with the helping hand of "#pragma omp parallel for" gives (times in ms):<p><pre><code> xcc gcc+omp clang+omp
mandel_deep 371 2170 2231
mandelbrot 2.45 12.2 12.8
md5 9.39 16.1 13.4
md5_mask 8.17 12.1 13.4
nbody 0.45 1.29 9.92
perlin 5.87 4.38 7.05
saxpy 2.26 2.18 2.32
</code></pre>
Geometric mean: xcc is 2.1x faster than GCC+OpenMP and 3.0x faster than clang+OpenMP.<p>All the builds are checked to make sure they give the same result - no point having a benchmark that doesn't produce the same result! xcc has a notable win for nbody, because its vectorisation is better (across bodies) but perlin has been a bit of a bugbear throughout the leading-up-to-v1 timespan.<p>Platform-specific binary tarballs, the sources, OpenMP versions and method are on the site (linked from github), and there are Phoronix Test Suite profiles if you'd like to run them yourself.<p>It's only just made v1 so there's a few rough edges: C++ through clang is in-progress (but not official yet), and the Pi 5's GPU is slow. Not sure if that's the Pi or the code yet...<p>There's more to the language but I don't want this to be an essay! The real, honest-to-$deity cool thing is the <i>automatic</i> parallelising of standard C/xc loops and being able to run that code on the GPU with <i>no boilerplate</i> - "ARC for Algorithms" (what Objective-C's ARC did for memory management), it "just works".<p>Very keen to get feedback and fix any gaps. I think it's generally useful right now, but it is "v1" - Bug reports welcome as GitHub issues...
Show HN: The Riemann Proof Handbook
Show HN: I built a game where you are an LLM's subagent
Show HN: I built a game where you are an LLM's subagent