logoalt Hacker News

Catala – Law to Code

80 pointsby Grognakyesterday at 10:11 PM46 commentsview on HN

Comments

alphazardtoday at 3:35 AM

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.

show 5 replies
mklyesterday at 11:55 PM

How strange to give it the same name as an unrelated natural language spoken by millions of people: https://en.wikipedia.org/wiki/Catala

show 2 replies
abhashanand1501today at 3:20 AM

We really need this in India. There are 53 million cases which are pending in courts, with over 180k cases open for more than 30 years (see https://en.wikipedia.org/wiki/Pendency_of_court_cases_in_Ind...). It is estimated that more than 300 years will be taken to dispose of all cases.

If law code is a repository: 1. Each trial should be encoded into a law. 2. If the trial is already covered sufficiently in the codebase, and both parties agree to it result. Then case is solved. 3. If not, the new judgement leads to a "pull request" into the codebase.

akabalanzatoday at 4:06 AM

Can't wait for lawmakers to get a red CI before merging ;)

Jokes aside, I'm trying to imagine what a pull request workflow would be for law making.

For example, there might be a test that checks that a law has adequate budget before applying it; or to get an error if it conflicts with another law.

Also (Italian here), I would be very happy to do "git blame" and discover who actually introduced a modification.

wcp0112today at 3:31 AM

Catala is a fantastic project and a real attempt to bring computer science and law together. Which is not easy! That said, for practical projects in legaltech a modern pure Prolog system has a lot of useful properties. A project that attempts to use Scryer Prolog for this is VATmiral.

ajax33today at 1:29 AM

Past discussions:

1. (https://news.ycombinator.com/item?id=27059899) - May 2021 (126 comments) 2. (https://news.ycombinator.com/item?id=28633122) - Sept 2021 (40 comments) 3. (https://news.ycombinator.com/item?id=37546874) - Sept 2023 (277 comments)

EdwardDiegotoday at 5:11 AM

I suspect this works better outside of common law legislation.

Garleftoday at 7:21 AM

Serious question:

Is there any money to be made with this yet? (Jobs, Contracting, Projects, etc)

If not: What's the plan to get this to be used?

show 1 reply
kimfctoday at 12:23 AM

Huh I just finished a book by Jaron Lanier that described a hypothetical system literally just like this. Always fun to get a coincidence like this

ascoldtoday at 7:06 AM

I wonder what people who speak the actual Catala have to say about this semantic appropriation. It would be very easy for creators just to google it first.

sublineartoday at 12:32 AM

> The aim is not to formalise or put into code all the law, because that would make no sense, but we are interested in the law that is already executed automatically, such as the calculation of social benefits, tax or unemployment.

Can anyone explain why it's believed this "would make no sense"?

show 8 replies
side_up_downyesterday at 11:50 PM

How does this incorporate case law?

show 1 reply
vjay1510today at 8:15 AM

Reminds me of smart contracts

TZubiritoday at 6:15 AM

  scope QualifiedEmployeeDiscount :

    definition qualified_employee_discount

      under condition is_property consequence

    equals

      if employee_discount >=

        customer_price \* gross_profit_percentage

      then customer_price \* gross_profit_percentage

      else employee_discount

It feels like the best of both worlds, a syntax that is new and strange to use while basically being the same old abc If Else programming language.

Not sure I'm seeing any law-specific features either. Maybe if there were some tokens like 'jurisdiction' or 'jurisprudence', but it seems like yet another programming language.