←back to thread

Catala – Law to Code

(catala-lang.org)
116 points Grognak | 10 comments | | HN request time: 0.276s | source | bottom
1. alphazard ◴[] No.46178933[source]
Obviously it would be great if this caught on, but it's not even widely understood/agreed on that read-time precision is a desirable quality in a legal system. This is something almost everyone here takes for granted; we want the interpreter or machine to give the same result for the same input. We want that property so we can know the run-time behavior during development.

There are judges and politicians in the US that advocate for various "interpretations" of laws including parts of the constitution, which are different from what the law literally says. In fact they refer to the literal meaning as the "literal interpretation", implying it is one of many valid interpretations, and casting doubt on the idea of language having a precise meaning. The crowd here knows that it is totally possible and often invaluable to work in languages with precise meaning. Anyways, in practice this means: all the steps happened for the law to get passed by the legislature including arguing about the exact text, and instead of enforcing it as written, the judiciary enforces some slightly different but similar law.

A technology like this necessarily concentrates power in the legislature, and takes it away from the judicial system. It concentrates legal power at write time and removes it from run/read time.

replies(6): >>46179013 #>>46179227 #>>46179247 #>>46179427 #>>46179579 #>>46191682 #
2. btown ◴[] No.46179013[source]
It’s also the case that the massive set of constantly evolving case law is akin to the most convoluted and buggy “libc” ever implemented, running on a system where random bit flips occur frequently. Any lawyer who says they know how to definitively encode an assumption is inherently making a probabilistic statement colored by their own experience and definitionally limited exposure to case law - it may be near perfect, but it exists in an imperfect runtime environment.

This doesn’t mean that this isn’t a useful tool as an aid for interpretability. And perhaps we can reach a point where ambiguity in case law can “propagate” through a graph of nodes to give a range of answers to any question about a regulation - perhaps with the aid of LLMs. But until we have such a system, it can be dangerous to draw conclusions from systems like this one.

(Not a lawyer, this is not legal advice.)

3. 6gvONxR4sf7o ◴[] No.46179227[source]
I have a potentially more optimistic (and simultaneously more pessimistic!) view to offer.

Some differing interpretations of the law distinguish between the lawmakers' intention vs the literal meaning (and keep in mind that language itself changes a lot in just a few centuries. The hard problem is that, in PL terms, the law is written in syntax without agreed upon semantics. So a decent step could be just using some agreed upon semantics, like we do in code! Then at least "interpreting" it would be unambiguous.

Maybe a decent analogy would be gcc vs clang might produce different programs for certain undefined behavior, and different combinations of pieces might lead to different behavior too (like race conditions), and somebody (the plaintiff/user) is asking you (the judge/compiler) to decide what's going to happen in this next loop/program/whatever.

Or maybe a decent analogy would be getting a ticket that the API is erroring in some rare user's case and having to look into the code and stacktrace to realize it's some weird unanticipated interaction between two different pieces of legacy code (150 year old law) that now interact due to a recent merge (a new law from last year), and now it's crashing, so we have to figure out how to interpret/compile/resolve this user's case.

If law was usable like code, we'd never have any of those issues, just like we never have those issues with actual literal programs. And when we do, it's just because we're using the wrong language/aren't encoding enough things in the types and semantics/shouldn't have used this niche compiler so now let's get a new interpretation from another Supreme Compiler/etc. Life would be easier \s

So it's maybe more optimistic than you, in that the run/read time power (judicial) doesn't get diminished, but more pessimistic in that I believe it because I believe that changing the language from english law jargon to some formal language doesn't actually eliminate the issues it might be intended to eliminate.

4. undershirt ◴[] No.46179427[source]
> "interpretations"... which are different from what the law literally says.

We have to remember that the letter and spirit of the law can grow apart over time, and loopholes are often gamed before that naturally happens anyway. So obviously we still need judges to keep the "spiritual" aspect of intent alive, so that evil isn't laundered through technicality.

"Literal" should really be a concrete thing, but it does feel strangely connected to a problem that has existed since Sola Scriptura, up to Gödel's theorem. I think about this everytime software and law collide. That article on "what color are your bits"[1] also comes to mind.

[1]: https://ansuz.sooke.bc.ca/entry/23

replies(1): >>46179570 #
5. TZubiri ◴[] No.46179570[source]
Curiously enough, law in the US, which inherits from Common Law, is heavily focused on the interpretation (the case law) in the courts of the written law, as opposed to the written words themselves. This is in contract with civil law, napoleonic law and Japanese law, which places greater importance on the written words themselves.
6. csb6 ◴[] No.46179579[source]
Catala is specifically for tax codes and other laws that involve formulas and calculations, not all laws, so I don’t think most of your concerns apply to it specifically. There are often complicated rules governing how, e.g. benefits or tax credits are calculated that natural language is clumsy at expressing, so having a formal language that encodes that logic seems useful.

I agree government/justice by algorithm would be very dangerous, but Catala does not seem to be that.

7. maratc ◴[] No.46191682[source]
Do you really want, for example, the US constitution's write time understandings to be perpetuated forever? Their understanding of "citizen" did not include neither women nor black slaves, just to take one example. Another example is the famous question of "whether or not the right of a woman to abortion is a consitution-guaranteed federal right?" to which a bunch of very important folks gave an answer in 1973 but another bunch of very important folks gave a different answer in 2022.
replies(1): >>46193630 #
8. alphazard ◴[] No.46193630[source]
Write-time understandings no, write-time language yes. You can always change it, which is what happened in the case of women and slaves. To be clear, changing the text is the correct way to handle that, we shouldn't have just relied on the understandings of people changing over time to fix those issues.

The famous example you give illustrates why a system without precise meaning cannot work. It can seem like it works when lots of people act in good faith, but it quickly breaks down with even a few actors play the actual game instead of some "spirit of the game". In 1973, judges ruled one way, playing the actual game to accomplish a goal, and then everyone acted surprised in 2022, when the same tactics (playing the actual game not the spirit) reverted the decision.

I'm going to take a guess, and assume that you were in favor of the 1973 understanding and not the 2022 understanding. It would have been nice for that to have been captured precisely in some kind of specification, instead of enacted with a volatile read-time mechanism.

replies(2): >>46193845 #>>46195844 #
9. maratc ◴[] No.46193845{3}[source]
I don't live in the US and I'm rather indifferent to either understanding, so it would be correct to say that I'm neither in favour nor in opposition of any one of these. Being personally unaffected, I simply find it an interesting subject to observe.

With that, I still want to point out that even if we both agree that "changing the text is the correct way to handle," it's not a possibility that is even remotely practical or achievable; any meaningful progress that the US have had in the last 100 years or so was achieved solely by the means of "reinventing" the meaning of already written (and unchangeable) words. That seems to be the exact thing you seem to be in opposition of.

10. knollimar ◴[] No.46195844{3}[source]
Wouldn't 1973 be spirit based and 2022 be text based in this instance?