This seems very exciting. Now that it has been a while since this was originally presented, do you have any papers released on this flow-based type-checking algorithm? Your claim of polynomial time is very promising.
@24:35 why is the return type T|NoSuchValue and not T?|NoSuchValue I presume this is an oversight also the function args need to use T? If the intention (as per the verbal commentary) was to distinguish between a null value in the Sequence and the soft error condition. Other than this a great presentation and I look forward to seeing it ready some time soon and I'm sure project Arrow users will issue a new major release.
There are two types of nullability interfered. One from caller side or from return type side. One the first lastOrNull return type has to T? because we are sure there is a possibility it will be null irrespective of caller T. One the second lastOrNull(supporting union), return type is T|NoSuchValue because we are sure either we return T or NoSuchValue. Now when you call Something like this val list1 = list(1, null, 2) val list2 = list(1, 2) val value1 : T? | NoSuchType = list1.lastOrNull() val value2 : T | NoSuchType = list2.lastOrNull() Based on the callers generic ( T or T?) it will confirm whether it is T or T?
Now, I don't know much about Kotlin, but I have been using Java for quite a while - and run into almost every single bug that type system has. Anyhow. Why arent more people talking about functional concepts like a pure function? It seems to me, that being able to know that a function has no side effects, would be extremely useful for type checking. And just generally useful programmatically, although OOP bros seem pretty against it universally because its nearly impossible to prove theoretically (although in practice it very much is - which is also a great distinction you made). I believe java has the @pure annotation for functions - but I might be mixing up languages right now, but again. Thats a separate, annotation pre-processing pass, and not actually a part of the language which IMO is a shame. What Kotlin I have done, have been great although it was a little syntactially ambiguous and messy, but I also started with probably the most boilerplate heavy language outside of the C's (C & C++).
25:00, y no Golang mention? Seems like you guys went with the best of both worlds from Golang, JS/TS and previous Kotlin versions (maybe a hint of Zig too). No shame in that.
Kotlin already works wonders with algebraic data types using sealed interfaces and classes. It's just that you need to define them separately outside of the function scope. This union type between data or error just makes writing it easier and allows you to return error values without defining them per function
@@wollf92 Ye I know about the sealed type + object/class pattern but it is extra verbose, one more indirection, amongst other things, proper support for them would be nice. As I said, this is more or less just an emulation of true ADT
This seems very exciting. Now that it has been a while since this was originally presented, do you have any papers released on this flow-based type-checking algorithm? Your claim of polynomial time is very promising.
Fascinating talk, great presentation of technical academic research into an understandable yet detailed format programmers can relate to.
25:51 last(...) wouldn't throw if the result is null (e.g. in case of a String? sequence) while lastOrError(...)!! would, so they are not the same.
Feels like they're bringing Ceylon back.
the topic is very interesting, thanks for sharing
28:50 Errors and Exceptions 😱🤯 Golang wants to conquer Kotlin.
💡You can create your custom exceptions as a value.
18:44 What’s the different in the algorithms ???
@24:35 why is the return type T|NoSuchValue and not T?|NoSuchValue
I presume this is an oversight also the function args need to use T? If the intention (as per the verbal commentary) was to distinguish between a null value in the Sequence and the soft error condition.
Other than this a great presentation and I look forward to seeing it ready some time soon and I'm sure project Arrow users will issue a new major release.
There are two types of nullability interfered. One from caller side or from return type side.
One the first lastOrNull return type has to T? because we are sure there is a possibility it will be null irrespective of caller T.
One the second lastOrNull(supporting union), return type is T|NoSuchValue because we are sure either we return T or NoSuchValue.
Now when you call Something like this
val list1 = list(1, null, 2)
val list2 = list(1, 2)
val value1 : T? | NoSuchType = list1.lastOrNull()
val value2 : T | NoSuchType = list2.lastOrNull()
Based on the callers generic ( T or T?) it will confirm whether it is T or T?
Great talk!
i love error as values, please do this
Now, I don't know much about Kotlin, but I have been using Java for quite a while - and run into almost every single bug that type system has.
Anyhow. Why arent more people talking about functional concepts like a pure function? It seems to me, that being able to know that a function has no side effects, would be extremely useful for type checking. And just generally useful programmatically, although OOP bros seem pretty against it universally because its nearly impossible to prove theoretically (although in practice it very much is - which is also a great distinction you made). I believe java has the @pure annotation for functions - but I might be mixing up languages right now, but again. Thats a separate, annotation pre-processing pass, and not actually a part of the language which IMO is a shame.
What Kotlin I have done, have been great although it was a little syntactially ambiguous and messy, but I also started with probably the most boilerplate heavy language outside of the C's (C & C++).
Camera should zoom out and stand still, for god's sake.
I was thinking the same thing.
arrow-kt-raise out of box
25:00, y no Golang mention? Seems like you guys went with the best of both worlds from Golang, JS/TS and previous Kotlin versions (maybe a hint of Zig too). No shame in that.
one don't mention golang in a polite society
I want to go back to dynamic language after this 🤣
JVM folks discovering error-as-value and emulating algebraic datatypes are so funny to me
Kotlin already works wonders with algebraic data types using sealed interfaces and classes. It's just that you need to define them separately outside of the function scope. This union type between data or error just makes writing it easier and allows you to return error values without defining them per function
@@wollf92 Ye I know about the sealed type + object/class pattern but it is extra verbose, one more indirection, amongst other things, proper support for them would be nice. As I said, this is more or less just an emulation of true ADT
Scala is on the JVM rofl.