Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
kentonv
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
14 ms
·
211.
▲
by
kentonv
1y ago
Hey it's super-cool that you've implemented Cap'n Web in Rust! Nice! But would you mind renaming the packages to make it clear they aren't official, before too many people depend on them? Prefix with your name or "c
212.
▲
by
kentonv
1y ago
Does this app make any network requests that might have their own cold start or caching effects? 2.5 seconds seems way too long to be attributed to the Worker cold start alone.
213.
▲
by
kentonv
1y ago
Sure. And Cap'n Proto/Web provides tools for handling that. And they work, as evidenced by one of the largest and highest-traffic distributed systems in the world (Cloudflare Workers / Durable Objects) being built on Cap'
214.
▲
by
kentonv
1y ago
Yes, I'm aware of the fallacies of distributed computing. I literally linked to it in my post. You quoted the place where I linked it in your original comment above. > you can't solve fundamental distsys problems at the languag
215.
▲
by
kentonv
1y ago
There has actually been formal research on the idea (predating MCP, ironically): https://machinelearning.apple.com/research/codeact We actually didn't know about the research when we started working on this but it
216.
▲
by
kentonv
1y ago
MailChannels is a separate company from Cloudflare. At one point they offered a Workers integration, and Cloudflare blogged about it because we like to encourage such things. Unfortunately MailChannels later decided to discontinue their int
217.
▲
by
kentonv
1y ago
MailChannels was a different company that offered an integration with Workers, and then later decided to stop offering that integration. Today's announcement is a feature offered directly by Cloudflare.
218.
▲
by
kentonv
1y ago
It does better. It supports callbacks, including callback objects with multiple methods. So to define a stream, you just send the other side an object with a `write()` and an `end()` method. The other side calls `write()` for each chunk of
219.
▲
by
kentonv
1y ago
I should clarify, lack of proper language-level support for async programming wasn't the only problem CORBA had. Its main problem was that it was just massively overcomplicated and tried to do way too much. It went way beyond just bein
220.
▲
by
kentonv
1y ago
You're simultaneously being pedantic and at the same time anti-pedantic here. Sure, you can kinda-sorta argue that HTTP is an RPC protocol, insofar as it is request/response oriented, and so is RPC. But obviously I was describing
221.
▲
by
kentonv
1y ago
> The WWW would like a quick word with you regarding function calls having won. Nope, HTTP got it wrong. HTTP was designed to fetch files -- GET and PUT. It's fine at that. REST was invented as a way to shoehorn APIs into the model
222.
▲
by
kentonv
1y ago
Neither of these will type check. You can't perform computation on a promise. The only thing you can do is pipeline on it. `user.updatedAt == date` is trying to compare a promise against a date. It won't type check. `new Date(user
223.
▲
by
kentonv
1y ago
Which part of the protocol do you think is actually specific to JavaScript?
224.
▲
by
kentonv
1y ago
The protocol itself is really only language-specific to a similar extent that JSON is language-specific. Which you can totally argue it is, but also people have figured out how to use it in lots of languages other than JavaScript. I think C
225.
▲
by
kentonv
1y ago
For public-facing APIs, I would strongly recommend writing the TypeScript interfaces in a separate file from any implementation, and using JSDoc comments. There are various documentation generators that can turn that into a web page, though
226.
▲
by
kentonv
1y ago
Well, if the server is a Cloudflare Durable Object running sqlite, then the round-trip to the database is free. https://www.sqlite.org/np1queryprob.html But you are right that this won't work great with traditional dat
227.
▲
by
kentonv
1y ago
But the suggestion wasn't to design a simple expression language. The suggestion was to parse _JavaScript_. (That's what `.toString()` on a function does... gives you back the JavaScript.)
228.
▲
by
kentonv
1y ago
Almost all ocap systems seem to use event loops -- and many of the biggest ocap nerds I know are also the biggest event loop nerds I know. I'm not actually sure if this is a coincidence or if there's something inherent that makes
229.
▲
by
kentonv
1y ago
Eh, I think composed function calls have legitimately won _because_ they compose well and are easy to understand, not just because we haven't tried other things.
230.
▲
by
kentonv
1y ago
If you invoke `Date.toLocaleString()` in a map callback, it will consistently always run on the client.
231.
▲
by
kentonv
1y ago
Keep reading, the blog post addresses this.
232.
▲
by
kentonv
1y ago
What does server-side aggregation for optimization have to do with round trips, though?
233.
▲
by
kentonv
1y ago
In HTTP batch mode, they're all sent as a batch. In WebSocket mode, yes, you are sending messages with each call. But you're not waiting for anything before sending the next message. It's not a round trip until you await some
234.
▲
by
kentonv
1y ago
Yeah that's what I mean by DSL-in-JSON. I think it's pretty clunky. It's also (at least in Mongo's formulation, at least when I last used it ~10 years ago) very vulnerable to query injection.
235.
▲
by
kentonv
1y ago
The application should track resource use and implement limits as needed. I know that sounds like a cop-out, but this is really true of any protocol, and the RPC protocol itself has no real knowledge of the cost of each operation or how muc
236.
▲
by
kentonv
1y ago
> Is there a structured concurrency library being used to manage the chained promise calls Cap'n Web has no dependencies at all. All the chaining is implemented internally. Arguably, this is the main thing the library does; without
237.
▲
by
kentonv
1y ago
> So this just won't be used outside of Node servers then? Well... I imagine / hope it will be used a lot on Cloudflare Workers, which is not Node-based, it has its own custom runtime. (I'm the author of Cap'n Web and
238.
▲
by
kentonv
1y ago
That's exactly what Cap'n Web does...
239.
▲
by
kentonv
1y ago
1. Think of it like updating a JavaScript API without breaking existing callers. The rules are essentially the over RPC as they would be for local calls. So, you can add new methods and new optional arguments, etc. 2. After losing the conne
240.
▲
by
kentonv
1y ago
I haven't tested it, but I'd be surprised if it doesn't work. I'd happily accept a PR adding a CI job to make sure it works and we don't break it.
More ›