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

I’ve always wondered if contracts themselves couldn’t be expressed in a parsable domain-specific language.

IANAL, but it seems to me that source code and contracts/legislation/policies are similar in many ways: logic, rules, special words with reserved meaning.

The right DSL might go a long way to automating the boring stuff out of law, and serve to highlight the contentious stuff for human judgement.


Spoken language is as close as we currently get to expressing our thoughts in a standardized way.

It’s not a great standard, lots of variation and duplication, and above all undefined. But it’s what we have.

Agreements are but one use case of spoken language. Therefore you’re looking at reinventing language itself.

Not a bad idea at all. I do think we eventually get there. But it may take years and may need more advanced technology like AI. Until then spoken language it is.


This is very seductive, but what happens when I need to refactor the database? Do all my API consumers just have to deal with a new interface?


Yes, A popular convention when using such tools is to use views for any tables that may change, and then treat those views as public interface.

So, when you refactor the underlying, you can also update your view definition so that the interface remains the same.


We use currying at work to inject dependencies. E.g.

`sendEmail(mockEmailService)(to, subject, body) `

I find it helps to differentiate between side-effecting dependencies and parameters, making code purer, easier to test, more scalable etc.


And the is-odd package.json requires is-number! Jesus...


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

Search: