Revo elegantly refines functional error handling into a seamless developer experience, proving that safety doesn't have to come at the cost of syntactic fluidity. It is a sophisticated attempt to bridge the gap between rigorous type systems and intuitive, pipeline-driven logic.
Deep Dive
Voraussetzung
- Keine Daten verfügbar.
Nächste Schritte
- Keine Daten verfügbar.
Deep Dive
Building a language that actually feels good to useHinzugefügt:
This majestic, this is beautiful. I finally made errors in the exact way that I want them to be. So, what is an error? What is a result? So, result type is just is just this. It's a tuple where the first element is either an atom of okay or an atom of error. Right, and the second element is going to be either the value of the okay or the error name like as an atom. And you just want to return all of that as your errors from functions. And then you can handle it at call site. So, we have some things that help massively with this.
So, matches. You can pattern match on them. And you can go off the shape and like for example if it's never you just panic with something cuz that should never happen. For example, but yeah, that that gets a little bit verbose, right?
That gets a little bit verbose cuz what if for example you wanted to number everything, right? To number 34 like three times. That is too much.
That is too much. You don't want to do that. So, I made this little bit of syntax right here.
This equation mark.
Equation mark does the same thing as this but it's more optimized as an actual opcode for this.
Right here on the upper result. And then maybe you propagate errors, maybe not.
So, I'm going to talk about when you don't propagate errors a little bit later on.
But yeah.
It's super simple, super concise, and it's super findable, right? It's super readable. And I'm very careful about choosing where I put the syntax and where I don't put the syntax. So, question mark is only used in two places.
Well, ideally.
Fn is an atom.
Atom is function that returns a boolean.
Any function that returns a boolean should ideally end with a question mark but not like it's not like super you know, it's just convention. But yeah, that's where you use them. And the second place where you use them is the this. So, you can just look for closing paren and then question mark. Which is super important. It's super important.
And the same goes for unwrap. So, unwrap gives you the value of the thing if it's okay. And if it's not, it just it just panics. It just crashes the whole program. It tells you where it happened.
And yeah, that's super convenient. And it's super important that you can actually grep for that. And I'm thinking of actually removing that forever and not having it ever in favor of try. So, try is a function that takes in an a takes in an error tuple a result tuple and then and then it checks like it and then it panics.
It's the same as unwrap, but it's like a function on anything. And we can actually do in this language is pipe stuff. Right? So, this is equivalent to this actually.
And that like replaces unwrap entirely.
And that fits in a little bit better cuz you know, unwrap is just a bit like meta method on any tuple ever. So, maybe you don't want to have that. Maybe not. I don't know. I don't know. And then you just unwrap it like at call site. That's how you handle it.
And what if you don't actually want to return an error if you have if you happen to like encounter it.
What if for example, it has to be zero?
What if for example, you have a default value? We have an or else in fixed operating just like this.
And it's just that, right? And it's super optimized as well. So, it has its own op code. It's fast. It's going to be faster than a match. You want to use that. You always going to use that.
And yeah, well, maybe you know, like 5 years down the line it could be optimized. Matches like this could be optimized into just those.
But not now. Not now. And how actual looks like is it looks like this.
Oh, and also pipes. By the way, about pipes, nobody does it like this. I've never seen anybody do it like this, but inspect inspect just prints the value that you give it to the value that you give it. And then it prints like the line and the debug information. Well, not now. It just prints it. But and then it just does the value back.
So, this is just equivalent to this, but it has one more side effect, which is beautiful. I don't know. know, it's so beautiful that you can just [snorts] do side effects without affecting the actual data. I don't know, man.
It's super cool and the fact that like it's a pipe it's a pipe so you can just like two string, right? And then you can just comment that out. Well, not like like this.
I don't know, it's so cool. It's super cool.
So yeah, that's how you do it. That's how you do it. And real code would look like this. A file open, you check for an error, if not you just return and then you read but if you can't read it cuz like the permissions are not set you do all else and then whatever you want as default value and then you can do stuff or you can build a pipeline just like this. Obviously you can read me dots MD into into let me FS.open into try and you do all of that into file.read cuz I'm trying to do it like in a way where if you have a meta table that should also be available as a normal functions or else because like this.
I want people to build pipelines cuz I want them to. I just like it.
And then you get like then you like string not split it just like this by new line and then you get the length of the lines and then you like inspect it and all of this is just returned. So this can be a function. This can be a function. You have this whole like allocated T flow but it's super it's super readable, super pipelined. It's you know, you can obviously can do FM.C C by 2 let me actually put it somewhere with wax C by 2 and all of that. So you can build your whole program as a pipeline of input and that is like kind of functional but not really. But I don't really like functional programming that much I can't even lie.
So yeah, that's how it works. That's how I feel like that's beautiful. I feel like I hope you all guys you guys like it too. Give me some feedback. Tell me what you think about this Uh I didn't really get any feedback on this uh cuz I don't really have people who are that much into languages. Uh so, yeah.
Uh tell me what you think. Thanks for listening.
Ähnliche Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 views•2026-05-28
How agent o11y differs from traditional o11y — Phil Hetzel, Braintrust
aiDotEngineer
450 views•2026-05-28
Re: 🗣️📍theprophedu📍2026 GST 103 CLASS (E-EXAM REVISION)
theprophedu
636 views•2026-06-04
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanation💯✅
LearnwithSahera
1K views•2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 views•2026-05-29
Search Algorithms Explained in 60 Seconds! 🤖💨
samarthtuliofficial
218 views•2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 views•2026-05-30
Instagram accounts got PWNed
EricParker
13K views•2026-06-03











