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

Cloudflare Workers is a big on capabilities.

The recently released Dynamic Workers directly provides an API for capability-based sandboxing: https://developers.cloudflare.com/dynamic-workers/usage/bind...

But the platform has used caps internally all along. Cloudflare makes heavy use of Cap'n Proto (https://capnproto.org/), a capability-based RPC protocol, and recently released Cap'n Web (https://capnweb.dev/), a JavaScript-oriented version of the same idea. The "Cap'n" in both is short for "Capabilities and". (Dynamic Workers sandboxing is based around Cap'n Web capabilities.)

Most successful sandboxes use capabilities, though it's not often something you hear about. Android's IPC system, Binder, is a capability system. And Chrome has a capability-based IPC system called "Mojo".

Capabilities really shine when used for sandboxing, but here's a blog post I wrote that tries to explain the benefits beyond sandboxing: https://blog.cloudflare.com/workers-environment-live-object-...

(I am the lead developer of Cloudflare Workers, and the creator of Cap'n Proto and Cap'n Web.)


When using Dynamic Workers, you generally don't run the AI harness inside the Dynamic Worker itself, but rather as a regular worker. But your harness would have a tool call that's like "executeCode" which runs code in the dynamic worker.

You could certainly set it up to allow the AI to import arbitrary npm modules if you want. We even offer a library to help with that:

https://www.npmjs.com/package/@cloudflare/worker-bundler


Dynamic Workers don't have a built-in filesystem, but you can give them access to one.

What you would do is give the Worker a TypeScript RPC interface that lets it read the files -- which you implement in your own Worker. To give it fast access, you might consider using a Durable Object. Download the data into the Durable Object's local SQLite database, then create an RPC interface to that, and pass it off to the Dynamic Worker running on the same machine.

See also this experimental package from Sunil that's exploring what the Dynamic Worker equivalent of a shell and a filesystem might be:

https://www.npmjs.com/package/@cloudflare/shell


Cloudflare Workers was actually pushing for web standards on the server side several months before Deno was announced. :)

Though Ryan of course had a lot more clout from day 1 than I did.


(I love cloudflare workers and thanks for that), but I do think that credit is where its due and Deno's push for server side web standards also helped the general ecosystem.

Since a lot of people here aren't familiar with the private credit situation, here's my understanding, which comes almost entirely from reading Money Stuff, a daily column by Matt Levine. If you are a tech person who wants to learn about finance, I recommend it! It's a lot more entertaining than most finance industry reporting.

"Private credit" is an idea that has been hot in finance for the last several years, originating from the great financial crisis (GFC). After the GFC, regulations made it very hard for banks to make business loans with any kind of risk anymore. So instead, new non-bank institutions stepped in to make loans to businesses. These "private credit" institutions raise money from investors, and lend it to businesses.

The investors are usually institutions who are OK with locking up their money long-term, like insurance companies and pension funds. This all seems a lot safer than having banks making loans: banks get their funding from depositors, who are allowed to withdraw their deposit any time they want. So a bank really needs to hold liquid assets so they are prepared for a run on the bank, and corporate borrowing is not very liquid. Insurance companies and pension funds have much more predictability as to when they actually will need their money back, so can safely put it in private credit with long horizons.

It's not quite so clean, though.

It's actually common for banks to lend money directly to private credit lenders, who then lend it out to companies. But when this happens, typically the bank is only lending a fraction of the total and arranges that they get paid back first, so it's significantly less risky than if they were loaning directly to the companies. Of course, the non-bank investors get higher returns on their riskier investment.

And the returns have been pretty good. Or were. With the banks suddenly retreating from this space, there was a lot of money to be made filling the gap, and so private credit got a reputation for paying back really good returns while being more predictable than the stock market.

But this meant it got hot. Really hot.

It got so hot that there were more people wanting to lend money than there were qualified borrowers. When that happens, naturally standards start to degrade.

And then interest rates went up, after having been near-zero for a very long time.

And now a lot of borrowers are struggling to pay back their loans on time. And the lenders need to pay back investors, so sometimes they are compromising by getting new investors to pay back the old ones, and stuff. It's getting precarious.

Meanwhile a lot of private credit institutions are hoping to start accepting retail investors. Not because retail investors have a lot of money and are gullible, no no no. 401(k) plans are by definition locked up for many years, so obviously should be perfect for making private credit investments! Also those 401(k)s today are all being dumped into index funds which have almost zero fees, whereas private credit funds have high fees. Wait, that's not the reason though!

But just as they are getting to the point of finding ways to accept retail investors, it's looking like the returns might not be so great anymore. Could be a crisis brewing. Even if the banks are pretty safe, it's not great if pensions and insurance companies lose a lot of money...


TBH "private credit" (meaning exactly what this article is talking about) is such a big thing in the finance industry that probably most finance industry people can't even fathom that the title is misleading to non-finance-industry people.

I'm not saying they are right. But it's like if you posted an article called "Python Is Eating the World" on a non-tech side and people got mad because they thought the article was about a wildlife emergency. Fair for them to be confused, but maybe not fair to accuse the title of being misleading (at least not intentionally).


Ha, yes I didn't even consider it meant anything other than corporate private credit. Otherwise we'd be talking about presumably mortgages or "consumer debt". Right?


It's some sort of Gell-Mann-Amnesia-like effect. I am accustomed to seeing thoughtful, informed discussion about technical topics on HN, so then it's jarring when something like this hits the front page and nobody seems to have any idea what they're talking about.


It's opposite Gell-Mann-Amnesia: I am a SWE and I come here because I find it one of the best places to keep abreast of the broader software world, not just the little corner of it that I'm currently working in. So in the things that I know well, I trust it. My wife is a medical professional, and so I know just enough to see that most medical conversations here are complete and utter nonsense.

So the mental model I have of the average HN contributor is basically that they are all SWE's- they know software engineering extremely well, and the farther you get from that the less valuable the conversation will be, and the more likely it will be someone trying to reason from first principles for 30 seconds about something that intelligent hard working people devote their careers to.


Probably mostly accurate. Though a few of us do know lots of topics. Can outscore med students on USMLE prep, know what private credit is, etc., etc.


You can trivially block Cloudflare crawl via robots.txt. You don't need to buy Cloudflare's bot protection -- this is not a malicious bot.

https://x.com/CloudflareDev/status/2031745285517455615

(Disclosure: I work for Cloudflare but not on this product. I get pretty tired of the conspiracy theories TBH.)


No, it does not take any action to work around other bot protections.

https://x.com/CloudflareDev/status/2031745285517455615

(Disclosure: I work for Cloudflare but not on this product.)


Cloudflare crawl respects robots.txt. It does not attempt to bypass any anti-crawling measures. If the site doesn't want to be crawled -- whether it uses Cloudflare or not -- this product will not help you crawl it.

Some sites actually want crawlers -- e.g. sites that are selling a product, documentation, etc. That's what this product is meant for.

https://x.com/CloudflareDev/status/2031745285517455615

(Disclosure: I work for Cloudflare but not on this product.)


> flatbuffers and capnproto are in the game of trying to make serialization to binary format as efficient as possible.

Little-understood fact about Cap'n Proto: Serialization is not the game at all. The RPC system is the whole game, the serialization was just done as a sort of stunt. Indeed, unless you are mmap()ing huge files, the serialization speed doesn't really matter. Though I would say the implementation of Cap'n Proto is quite a bit simpler than Protobuf due to the serialization format just being simpler, and that in itself is a nice benefit.

The recently-released Cap'n Web jettisons the whole serialization side and focuses just on the RPC system: https://blog.cloudflare.com/capnweb-javascript-rpc-library/

(I'm the author of Cap'n Proto and Cap'n Web.)


I stand corrected.


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

Search: