Remix.run Logo
thesz 6 days ago

Why do you invent a new language for your work?

Why did you not embed your language into another one, with type system that is superset of what you need?

For example, there's capabilities expressed in Haskell: https://github.com/tweag/capability

Capabilities there are tracked at type level and are subject to type erasure, if possible.

ch4s3 5 days ago | parent | next [-]

There are a few reasons for this. I really can't seem to wrap my head around Haskell in the wild as written by real people. I also wanted to tie capabilities into the build system tooling so that the build tool could verify caps and launch executables into an OS sandbox. Bolting on capabilities doesn't offer the same ability to enforce them, for example the March package manager ForgePM will reject packages that falsify their cap manifest. Moreover I was reading some papers that inspired the language, and wanted to try it. Cap(X) is also erased b the type checker during compilation in March.

tome 5 days ago | parent | prev [-]

I'll blow my own trumpet and promote my own Haskell capabilities library, Bluefin: https://hackage.haskell.org/package/bluefin

Bluefin is used in production, and as far as I know capability is not.

ch4s3 5 days ago | parent [-]

That looks really cool. Can you narrow Bluefin.IO to reads/writes separately? One of the things I've worked on is the ability to allow code to read files, even specific files, but deny writes.

tome 5 days ago | parent [-]

Yeah you can write a capability that encapsulates exactly whatever effects that you like!

ch4s3 5 days ago | parent [-]

Did this start as an effect system and then capabilities shook out naturally?

tome 5 days ago | parent [-]

Yes! It started as an implementation of the effect system I always wanted: effects passed on the value level, rather than implicitly on the type level. Once I'd done that I realise that it was actually a capability system (and that was the better way of describing it, because more people already know what a "capability system" is).

ch4s3 4 days ago | parent [-]

That’s not surprising there’s a lot of mechanical overlap between the two. It’s a really interesting relationship.

tome 3 days ago | parent [-]

Yeah, I think they're basically identical concepts. I'm writing an article on that topic right now.

ch4s3 3 days ago | parent [-]

I’d love to read it!

tome 3 days ago | parent [-]

Here you go! It's a complete document, but I'll continue to edit it over the next few days before I announce it. I'd love to hear any thoughts you have.

https://h2.jaguarpaw.co.uk/posts/bluefin-capability-system/

ch4s3 a day ago | parent [-]

Awesome, I'll take a look and shoot you an email if I have anything interesting to say about it.

tome 12 hours ago | parent [-]

Cool, my contact details are on the front page of that site.