Top
Best
New

Posted by alansaber 7 hours ago

Git for the US Code(lexifina.com)
232 points | 116 commentspage 3
7kago_yomi 6 hours ago|
Unlike code, natural language laws have many exceptions and context dependencies, so trying to manage them cleanly with Git seems like it would be tough as data structuring costs and exception handling (hardcode-style responses) increase.
deathanatos 5 hours ago||
> Unlike code, natural language laws have many exceptions and context dependencies,

In the interpretation of the law, yes, but that doesn't matter for version controlling the text of the law, and in that sense, you can absolutely manage the text pretty cleanly in git. Most laws are just text. Many bills are literal git-diffs, except in prose, which can make it hard to understand a bill.

> exception handling (hardcode-style responses)

This is basically non-sequitur (there no such thing as a "hardcode-style response" in git…), and again, I think you're misunderstanding the idea here.

JumpCrisscross 6 hours ago|||
> natural language laws have many exceptions and context dependencies

The complexity is in common law, not natural-language laws.

The U.S. Code and Code of Federal Regulations can be completely presented through a Git-like system. The complexity comes in when attaching court cases.

jcranmer 5 hours ago|||
Nah, it's pretty damn common in any legal system.

If you've got a statute like "no vehicles in the park," the fundamental issue is that you have to interpret "what is meant by 'vehicle'?" and no legal drafting is going to be good enough to actually cover all the possible cases well enough. The main difference between a common law and a civil law system here is that in a common law system, you have to cite the previous similar cases (because precedent is binding) whereas in a civil law system, you're merely using those previous similar cases as persuasive evidence. At the end of the day, it boils down to arguing for your interpretation.

And in my experience working on language standardization (which is closer to a civil law system than a common law system), it's fairly often that I have to resort to looking up not just when a change in the text occurred, but dive deep into the discussions of the paper proposing the change to understand what the committee thought it was doing with the change. The complexity of law is fairly similar--the changes to the law themselves often require understanding the legislative and interpretative history of the law to understand what the intent of the drafter was to be able to rule on how the law is extended to an unanticipated scenario.

thenewnewguy 5 hours ago||
Yeah but none of this matters for the "git for legislation" idea right? The point here is to record the history of the text of the laws, not their meaning.
tpmoney 4 hours ago||
It depends on the question you're trying to answer. The text of the US law which Citizen's United struck down remains on the books today (though has changed since it was moved to a different part of the code, so references have been updated), but the actual effective law has most certainly changed from when it was written to now. Since courts can't write or modify the law, the literal text remains, even if some of that text is effectively stricken as if the text had been removed.

If you want to know the literal text (that may or may not be enforceable), then sure a plain text diff is sufficient to know that nothing at all has changed about federal communication laws since this section was last amended in 2002. But if you want to know what the actual law is, you definitely need more than just a text diff.

beau_g 3 hours ago||
See my response to the parent, but git blame solves the issue of "what did they mean" because the person (if alive) can just be asked. The same way git blame is used all the time to ask why a programmer did something some certain way, there's more to code too than just how exactly does it compile/execute. The higher level idea should be to stop legislation seemingly written by nobody, that nobody wants to answer for, but is used to make important decision about lives and livelihoods. Having courts needed to interpret verbiage that was written by living people is completely preposterous. If it's written by dead people, sure, that's a harder problem.
7kago_yomi 6 hours ago|||
I see. The laws are completely different from my country, so this is very educational. My country uses civil law, but I see that is how it is under common law. Thank you very much.
beau_g 4 hours ago||
This brings us to my even more unlikely idea - when whoever wrote that line in the legislation dies or retires, the line enters a short review period where it's either renewed with a new author on the line to speak to it or is deprecated. This way someone would always be there to just answer for the intent. Also would help garbage collect legislation that is no longer useful.
autoexec 3 hours ago||
> when whoever wrote that line in the legislation dies or retires, the line enters a short review period where it's either renewed with a new author on the line to speak to it or is deprecated.

That seems like a great way to turn functional legislation into swiss cheese as one line at a time things are either kept or removed based on chance/circumstance and the whims of the current people in power.

Laws are collectively voted for as a complete package, and a law that worked and was passed as being acceptable can become useless, dangerous, and undesirable with a very small number of lines removed from them. I want lawmakers to spend their time focused on the entirety of a bill. Your idea would result in them fighting over who should or shouldn't be recorded as the official author of each and every line. We don't need nonsense like "Senator X will retire soon so Senator Y should author it!", or "I'll agree to author line 405 if you agree to author line 30!"

Your idea, like so many ideas where laws just fade away unless something happens to keep them, also sounds like a great way for you to lose longstanding freedoms and protections that should never be at risk of simply deprecating just because some one gets voted out or dies or retires.

The intent of a law should be clear from the text. It isn't always, but at least now it's possible. To have the intent of a law, or even worse the intent of specific lines within a law, subject to change at any time would make interrupting that law and establishing precedent a nightmare for the courts.

We really should have a system in place to help clear out old and unnecessary laws on the books, but this would be a terrible way to accomplish that.

bad_username 2 hours ago||
Law is programs running on humans.
alanwreath 4 hours ago||
I wonder if there are any public sources for any of this data at a federal level? And do any of them still hold the older now versions?
omoikane 4 hours ago||
See also:

https://news.ycombinator.com/item?id=47625366 - United States Code (federal laws) in Git (2026-04-03, 15 comments)

https://news.ycombinator.com/item?id=47621591 - Every Law a Commit – US Law in GitHub (2026-04-02, 32 comments)

I think it's parsing this data:

https://uscode.house.gov/download.html

Which was discussed here:

https://news.ycombinator.com/item?id=6135504 - The entire US Code is now online in XML (2013-07-31, 237 comments)

adamdennis 5 hours ago||
Wasn’t this one of the original pitches for blockchain?
bowmessage 5 hours ago|
Not that I've ever heard.

Why would one need a trustless distributed system to store document deltas published by an inherently trusted entity (federal government)?

jcranmer 5 hours ago||
I think it's useful to link to a lawyer's take on the utility of a similar tool that was built by somebody else here: https://bsky.app/profile/questauthority.bsky.social/post/3mj...

The tl;dr is that doing git-style change-tracking of the legislation isn't as helpful in practice as you'd think (especially because a lot of the very basic change-tracking is already available in the existing tools that lawyers use!).

layla5alive 5 hours ago||
Being able to git blame politicians and such would be very useful indeed (at first..) :-)
zaik 4 hours ago|
Why only at first?
AustinDev 4 hours ago||
AI explainer videos are actually pretty good. Good usage.
counters 6 hours ago||
Major party foul for not calling this "legitslate"
noja 4 hours ago|
It’s a nice idea, but isn’t it a bit pointless if the law is not being applied?
More comments...