Hacker Newsnew | past | comments | ask | show | jobs | submit | remywang's commentslogin

Is this site Hacker Tabloid now?

Sigh, I recently got into stereo photography and saw there's a shortage of transparency film. I suppose the stock's not coming back up any time soon. We can't even take photos thanks to the clankers can we.

I added the quote after seeing the parent comment-thanks for the feedback.

I actually am studying German so I actually found it a cool application of my newfound German knowledge.

But then I thought about everyone else and offered the translation, then edited after I realized you covered it later.

It's an overall interesting blog post but just a minor quibble from me all else considered. Keep up the good writing.


I agree there is a spectrum, but we at least have to be honest with ourselves: are we really sure AI generated code is following the spec? On the other hand, with progress in proof automation, it is now feasible to formally verify AI generated code, and that allows us to specify program behavior formally, and a formal specification is again a program in itself.

I think with the AI it's not only question about following the spec, but about the completness of the spec. Before the AI, if specification wasn't complete, then program would lack of a feature, won't start correctly or crash. Nowadays, agents will happily fill any missing specification parts with random stuff, often looking reasonable at the first glance. This random content can be different with every iteration of the LLM work.

To find the right position in this spectrum, I think we need to find a level of specification that we care about.


Then don't grade the homework! I have in-person quizzes in my class, and the students are motivated to do the homework anyways because it prepares them for the quiz.


So I spent some time poking at the released 0.4-beta code. Controversy aside, it is interesting to see an open source system that beats ClickHouse on ClickBench - 4 out of the 5 systems ahead of CH (Umbra, elosdb, Hyper, CedarDB) are all closed-source, while the only open one is pivotlake.

What makes pgrust fast? There's no one single reason, but a combination of techniques like dictionary encoding [1], zone maps [2], late materialization [3], vectorization [4], and a gazillion others. It's not unlike all the countless optimization passes in a compiler.

None of the optimizations are groundbreaking - in fact, I could find a counterpart of every optimization I checked in ClickHouse as well! So why is CH still slower?

I believe the difference is in when they decide to apply each optimization. Unlike compiler optimizations which are usually beneficial, DB optimizations are highly data-dependent, and the query planner needs to turn them on an off based on data statistics. For example, CH is more conservative in applying dictionary encoding, and it basically doesn't get used at all for ClickBench.

Turning off dictionary-related optimizations in pgrust immediately made it 5x slower (from 3.8s to 20.4s on my machine), while ClickHouse takes a total of 15.0s.

This points to one important nuance in benchmarking - when all you target is one single benchmark, you can be more aggressive during query planning, as plans that work well for one query probably also work well for others, due to characteristics shared among queries/datasets. But when you build a system that needs to support millions of users, you have to be conservative with optimizations.

[1]: https://motherduck.com/glossary/dictionary-encoding/

[2]: https://motherduck.com/glossary/zone-map/

[3]: https://arrow.apache.org/blog/2025/12/11/parquet-late-materi...

[4]: https://clickhouse.com/resources/engineering/vectorized-quer...

To turn off dictionary-related optimizations in pgrust, I used the following setting:

  SET pgrust.gravity_road_off = 'dict.entries,percode.table,percode.length,verdict.coderange,
    code.carry,code.render,code.front_part,code.front_dense,code.front_light,code.sparse,
    code.cut,code.heads,key.codeif,prefetch.fp,text.frame';


Thanks for the explanation, can you release the source of 0.4-preview so that people can understand what was going on?


I'll see what I can do. I'll need to go through and make sure there isn't anything sensitive in the source


I would recommend releasing the full history so the broader community can verify and you regain trust with those you lost it with.


Such as?


Agreed. Though we still don't have a reason why they rushed a custom preview to a rigorous benchmark competition. Feels like too much hype, and now damage control.


Hang in there! What you can build knowing how to code is drastically different from what promptards can build. Imagine trying to build a car without knowing anything about car building - you’d just get the most generic boring clunker anyone can design.


But anyone can decompile it, now, too.


Every verification needs a spec, and in this case the spec is the Postgres implementation. I think we can and should do a lot better than taking 2.6 million lines of C code as the spec.

In general, the spec must be human readable, and I believe to achieve that we must do away with SQL. Putting aside the thousands of pages of SQL standard, even the core subset has a gnarly semantics due to issues like nulls.

A simpler semantics is one of the main motivations behind Prela [1], and despite its simplicity, we now know it’s powerful enough to express thousands of queries in the wild [2], as well as run doom [3].

[1]: https://prela-lang.org/

[2]: https://github.com/remysucre/prela/tree/sqlstorm

[3]: https://github.com/remysucre/prela/tree/doom/


Sometimes it's good to have bug-for-bug compatibility, where the code is the best spec.


I always wondered about this. Software engineers always want a spec, and either complain about it being insufficiently specific or find some ambiguity and make it a reason to write their own text editor instead of shipping the fucking product. But if you hand them running code and say "make it do exactly this", they frown and don't wanna.

Like, what the literal fuck?


> In general, the spec must be human readable, and I believe to achieve that we must do away with SQL

Eh. Carthago delenda est? Why?


Yeah, that's the most impractical part of the original post.

Like, SQL was around before I was born, and barring the immanence of the Machine God (and potentially even then), will be around long after I die (unless civilisation collapses, I guess).


SQL is a lot more intellectually coherent than its syntax belies. It's easy to be attracted to things like SPARQL, which has a well-written simple public spec, or Datalog, which doesn't really have a spec but does CTE in a way that doesn't look so painfully half-baked, or to feel really queasy looking at triggers and other features... but SQL isn't that bad. Dialects like postgres actually have pretty good support for JSON.


SPARQL is cool, but fairly limited. For example, one cannot implement common graph operations like a BFS or a DFS in SPARQL, and SQL of course can (even though I wouldn't necessarily recommend it). I was fairly puzzled when I figured this out. This means SQL is strictly more expressive than SPARQL!


The semweb badly needs a SPARQL 2.0 but we won’t get it, not least because the community was burnt out by the standards process. Myself I am keen on facilities common in document databases to represent ordered collections because the culmination of my work on the semantic web was figuring out how to use (mostly) OWL to represent complex document schemas such as the ISO 20022 financial messaging standard. And order matters for that!


> the spec must be human readable

Usually I would agree with you but when porting code the source code is the spec.


Ideally an executable specification, not as hard as it sounds for many things.


> I wrote a compiler that can translate both Rust and C code into Lean

How do you verify this compiler is correct? To do that, I think you at least need a formal semantics for both C and Rust in Lean, both sound like Herculean efforts


> How do you verify this compiler is correct?

I haven't yet. My main goal has been to find as many bugs as possible. While bugs could still slip through because my compiler is incorrect, I'm still finding a good number, so I think it's worth it.


Did you consider using an established Rust verification toolchain like Aeneas?

Edit: I don't do this often, but why is my question being downvoted? Is this question not allowed?


AFAICT, Aeneas only supports a safe subset of Rust. I needed something that could support all of Rust


https://github.com/AeneasVerif/aeneas says

"Aeneas currently functionalizes a subset of safe Rust, and we are in the process of extending the functional model with reasoning based on separation logic to support unsafe code and concurrent code."


A Rust verification toolchain won't tell the GP whether his code does the same as the C code or not.


> I think you at least need a formal semantics for both C

https://en.wikipedia.org/wiki/CompCert


> formal semantics for both C and Rust in Lean, both sound like Herculean efforts

If we're doing Ancient Athens, then Platonic Methexis probably fits better.


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

Search: