Why Law Is Law-Shaped

ekns 83 points 67 comments April 29, 2026
lawvm.org · View on Hacker News

Discussion Highlights (16 comments)

eru

I guess this is not meant as a general introduction, but it would have been useful to acknowledge the differences between different legal systems somewhere at the start? (Even if it's only to argue that they aren't all that different in practice.)

keiferski

In an entirely different qualitative sense, this post reminded me of the short story by Kafka, Before the Law. I won’t paste the whole thing here, but it’s a really short read: https://homepage.univie.ac.at/st.mueller/kafka_english.html An article on the story: https://courses.cit.cornell.edu/hd11/BeforeTheLaw.html

dvh

> Parliament cannot restate the entire legal corpus each session. IMHO the biggest mistake. It should be like that. Because right now for mere mortal it's impossible to find out if some law or paragraph is still in effect.

james-bcn

Audrey Tang did a lot of things related to this whilst they were Minister of Digital Affairs of Taiwan. https://en.wikipedia.org/wiki/Audrey_Tang

eqmvii

my favorite quote in this space has always been: the prophecies of what the courts will do in fact, and nothing more profound, are what i mean by the law.

fractallyte

Interesting synchronicity: I've written a patent-drafting DSL which exactly parallels this – and which is now shaping up into an "IDE" for patent drafting... Patent texts read as prose, but are actually precisely structured legal documents. The latest developments in this domain involve LLMs to create and modify patent documents, but even though the legal profession seems to have fallen all in on it, it's essentially rather fragile and error-prone. I've gone the deterministic direction, which has opened up some very cool, previously unexplored, possibilities!

ChaosOp

As a fellow Finn (and a lawyer), super interesting work Elias! And thank you for reporting the inconsistencies you found to Finlex

vessenes

Man, I hated last year’s clanker-tone, and I hate this one’s too by now. I don’t want to read the word load-bearing ever again. The reminder that there’s structure and content and they’re different is a good one. Even a small legal document has this microstructure of references, inside, outside explicitly and outside by inference.

vharuck

>Retroactive amendments change the legal effect of provisions for a past period — an amendment published today can declare that it applies from last year. This retroactively alters the legal state at historical points in time. I don't (personally) agree with this. Laws should be seen as applying in cases where parties and actions have certain qualities. A retroactive law does not state, "This actually applied to past events and entities." It states, "This applies to entities with the quality of having done an action or met some quality in the past." I'm not familiar with the EU law system the article is based on. How would it handle a case where a person was found in violation of a retroactive law, and their past violating action was done along with another action that is considered illegal when done during a crime? For example, if somebody wrote that they never used illegal drugs on a government form, and a drug they had used is later retroactively declared illegal, can they now be prosecuted for having "lied" on the form?

Brendinooo

Interesting to read this a few days after reading Patel's "software brain" piece. ("the overlap between software brain and lawyer brain is very, very deep") https://www.theverge.com/podcast/917029/software-brain-ai-ba... (fwiw I didn't think that piece hit the nail on the head even though it was generally swinging a hammer in the direction of a nail)

CrisMystik

It's not as complete as the compiler proposed by this article, but there is a tool for Italian laws which can, among other things, recognize (parse) and apply amendments: https://igsg-marker.gitlab.io/

dgreisen

This is very cool, and exceptionally well-thought-out. I particularly like how they are working with the existing legal/legislative institutions to fix the issues at their source rather than creating yet another unofficial version. We've built the Open Law Platform that governments can use to do this with their official laws. We just launched with the Maryland Secretary of State last month at regs.maryland.gov. You can see the "source code" at https://github.com/maryland-dsd/law-xml , and the "compiled" code at any point in time since they started using our system at https://github.com/maryland-dsd/law-xml-codified and https://github.com/maryland-dsd/law-html . All cryptographically signed at https://github.com/maryland-dsd/law .

rogerrogerr

> Parliament cannot restate the entire legal corpus each session. This is probably bad for some reasons, but I have wondered about a system where the legislature does have to restate the entire legal corpus every session. Like, everything resets at the end of the year and whatever didn’t get passed in the last 12 months is no longer law. Paired with some kind of rule that says you can’t just vote to pass “everything that already exists”. In my fantasy, there would be less weird cruft in the law, and less bikeshedding about stuff that really should be done.

yxhuvud

This is a good start even if the list of actions is not complete - we have seen sections move around unchanged between totally different laws, as well as edit conflicts where a place in a text gets changed into different results multiple times at the same date. The way amendment happens is also wildly different between different jurisdictions - some replace on singular word level (like Denmark) while other replace whole sections (like Sweden). Now add targeted annotations and other commentary done by specialists into the picture and the real fun begins.

colinhb

I have a lot of sympathy and affection for this project. When I started working in the US Congress in 2009, I was shocked there wasn't a more concerted effort to put US code in some kind of version control system. Over time (~15 years in law and public policy in US and EU) I've come to view that kind of project as something worthwhile, and interesting, but not something that will meaningfully change how laws are created and understood. In the US, as a mixed but substantially common law system, the text of the US Code, which in the LawVM model is the tree, can remain fixed, but the interpretation of that text will still vary over time. (Same syntax, different semantics, which feels like an AI-ism as I write it.) A couple examples: I have worked in competition policy. Section 2 of the Sherman Antitrust Act has read the same since 1890 but it's operated across structuralist and consumer-welfare regimes, and the outcomes in Standard Oil, AT&T, MSFT, and more recent cases have all been shaped by those regimes. US constitutional law may be an even better example of the issue: Article I, sec. 8, cl. 3 (the commerce clause) has not been amended since 1789, but it has expanded and contracted and been reinterpreted over time (most recently with NFIB v Sebelius). Another example of the problem with a LawVM like system making "the law in force [...] knowable" is US overturning of Chevron deference on 28 June 2024. Basically, the day before, courts were expected to defer to expert agencies, constrained by the Administrative Procedures Act, in their interpretation of legislation. The day after, courts were expected to make an independent assessment. All sorts of legislative texts were unchanged, but their meaning shifted dramatically: Clean Air Act, Communications Act, etc. There are a bunch of other issues in figuring out "what the law is", like agency rulemakings in the CFR, and then instruments which sit below those, including sub-regulatory guidance, prosecutorial discretion, etc. Things which fall into this bucket: - DOJ pot enforcement - SEC no-action letters (letters which say in effect "we won't try to enforce if you do X") Altogether, my thinking of this shifted to believing that the real thing that needs to be modeled is not the US Code as a tree serialization format, but the interpretative algorithm (the things lawyers and courts do) that translates that serialized tree into decisions. That interpretive algorithm has a lot of inputs, one which is the serialized tree, but also a bunch of other stuff. As a final note, I will add that the ambiguity in legislative text is often a feature, not a bug. I have worked on legislative text that was intentionally crafted to provide different plausible interpretations to different coalition members both in the immediate context and in the long term. In summary: projects like this are good and admirable; they're likely to have more direct utility in jurisdictions on one extreme of the civil law spectrum (i.e. not the US); and in all jurisdictions there likely needs to be an interpretive mechanism that sits above the representation of legal text which has more inputs if the goal is to model what the law is at any given time.

arjie

Ha, I really enjoy this description of the law. Very neat. Tickled my mind. It struck me a while ago that almost no present law systems have a regularization or refactoring process. It is an entirely grown object that adds epicycles and it reminds me of the way our household personal agent would record memory until we gave it a self-reflection activity. It seems like a large number of states enacted sunset legislation in the 70s and 80s and many of them got rid of it shortly thereafter. I wonder what troubles they encountered. One amusing (to me) observation using the model of edits in the OP is that if you say "Section 171 Part 3 is amended to now add the text 'never' at this location" and then later have "Section 171 Part 3 is amended to now add the text 'almost' right before 'never'" you need to have each such edit also be followed by a revalidation of the age of the entire section or you get amusing results due to the text changes. A fun read for a later afternoon, perhaps.

Semantic search powered by Rivestack pgvector
8,303 stories · 78,303 chunks indexed