Live data from Hacker News

Make any TypeScript function durable

useworkflow.dev

71–80 of 89 posts

Re: Make any TypeScript function durable

#71
post #61

Earlier quoted context omitted.

Please, bundling React with Next is completely foolish. React is open, battle-hardened, type safe, and well-documented, while Next is... a vendor lock-in trojan horse targeting low-knowledge developers with concepts that seem beginner-friendly. I can understand making legit criticisms of React, no doubt the hooks transition had some issues and the library has a high level of complexity without a clear winner in the s…

Just shows you how absolutely little people know about the web ecosystem - most people heard something once or twice from someone else and just assume its true - to make matters worse, you have the typical HN "vanilla html and js only!!!" bandwagon which, if you try to use for any serious web application will only lead you down a path of much pain and suffering. I've commented many times in many other threads that I…

Mate, don't get mad at us just because you can't code without a framework.

React was created to make low skilled people capable of shipping low quality code. If that is the only thing you can do, I'd be careful about calling yourself fullstackchris

Re: Make any TypeScript function durable

#72

So this seems similar to https://temporal.io/ , am I reading this right? I used that briefly a few years ago and it was pretty nice at the time. It did make some features much easier to model like their welcome email example. Would love to hear from someone with extensive temporal experience, iirc the only drawback was on the infra side of things.

It's also similar to https://www.restate.dev/.

Re: Make any TypeScript function durable

#74
Skipping the part that defines what a "durable" function means is typical Vercel.

It's probably a common async functional programming term that I don't know.

But when "algebraic effects" were all the rage, the people evangelizing them at least cared to explain first in their blog posts.

This one instead straight jumps via AI agents (what does this have to do with TypeScript syntax extensions?) to "installation".

No thanks.

Edit:

I've read the examples after commenting and it's understandable, still explained in a post-hoc way that I really dislike, especially when it comes to a proprietary syntax extension.

Also the examples for their async "steps" look like they are only one step away from assuming that any async function is some special Next.js thing with assumptions about clients and servers, not "just" async functions with some annotation to allow the "use workflow" to do its magic.

Re: Make any TypeScript function durable

#76
post #69

Earlier quoted context omitted.

I don't believe you can. I believe what they're trying to do is rewrite the underlying function into separate functions that can be called in any order and combination. That's not possible with generators. With a generator, I can pause between steps, but I can't, say, retry the third step four times until it succeeds, suspend the entire process, and then jump straight to the fourth step. Or I can't run different step…

You are partly correct, if each step is another generator function you can retry the steps until success or fail, and even create a small framework around it.

That still requires the process running the outer generator to stay active the entire time. If that fails, you can't retry from step three. You need some way of starting the outer function part way through.

You can do that manually by defining a bunch of explicit steps, their outputs and inputs, and how to transform the data around. And you could use generators to create a little DSL around that. But I think the idea here is to transform arbitrary functions into durable pipelines.

Personally, I'd prefer the more explicit DSL-based approach, but I can see why alternatives like this would appeal to some people.

Re: Make any TypeScript function durable

#77
post #76

Earlier quoted context omitted.

You are partly correct, if each step is another generator function you can retry the steps until success or fail, and even create a small framework around it.

That still requires the process running the outer generator to stay active the entire time. If that fails, you can't retry from step three. You need some way of starting the outer function part way through. You can do that manually by defining a bunch of explicit steps, their outputs and inputs, and how to transform the data around. And you could use generators to create a little DSL around that. But I think the idea…

yeah, that’s what I meant with a tiny framework, you can add features to it and have it implement à la dsl.

These alternatives just hide the implementation and make debugging and debugging expanding/configuring unavailable

Re: Make any TypeScript function durable

#78

Earlier quoted context omitted.

Just shows you how absolutely little people know about the web ecosystem - most people heard something once or twice from someone else and just assume its true - to make matters worse, you have the typical HN "vanilla html and js only!!!" bandwagon which, if you try to use for any serious web application will only lead you down a path of much pain and suffering. I've commented many times in many other threads that I…

Mate, don't get mad at us just because you can't code without a framework. React was created to make low skilled people capable of shipping low quality code. If that is the only thing you can do, I'd be careful about calling yourself fullstackchris

Mate, real programmers use assembly.

Re: Make any TypeScript function durable

#79
post #46

can anyone point to the "Durable" part? looking at the docs and examples, I see Workflows and Steps and Retries, but I don't see any Durable yet. none of the examples really make it clear how or where anything gets stored

That depends on the “world”. We built an adapter interface so you could store the data (and other things) anywhere you want. There are some docs which are wip regarding that: https://useworkflow.dev/docs/deploying/world

thanks, helpful read!

Re: Make any TypeScript function durable

#80
post #76

Earlier quoted context omitted.

That still requires the process running the outer generator to stay active the entire time. If that fails, you can't retry from step three. You need some way of starting the outer function part way through. You can do that manually by defining a bunch of explicit steps, their outputs and inputs, and how to transform the data around. And you could use generators to create a little DSL around that. But I think the idea…

yeah, that’s what I meant with a tiny framework, you can add features to it and have it implement à la dsl. These alternatives just hide the implementation and make debugging and debugging expanding/configuring unavailable

Yeah, I completely agree that the implementation hiding makes me very uncomfortable with this sort of approach. It's the same with a lot of Vercel's work - it's very easy to do simple things on the happy path, but the more you stray from that path, the more complex things become.
Post reply on HN