Revamping and Extending Kotlin's Type System | Ross Tate

Поділитися
Вставка
  • Опубліковано 25 гру 2024

КОМЕНТАРІ •

  • @matjojo1000
    @matjojo1000 4 місяці тому +9

    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.

  • @nO_d3N1AL
    @nO_d3N1AL 3 місяці тому +1

    Fascinating talk, great presentation of technical academic research into an understandable yet detailed format programmers can relate to.

  • @piaIy
    @piaIy 3 місяці тому +1

    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.

  • @mariodanielruizsaavedra1486
    @mariodanielruizsaavedra1486 4 місяці тому +3

    Feels like they're bringing Ceylon back.

  • @stefku76
    @stefku76 2 місяці тому

    the topic is very interesting, thanks for sharing

  • @techaido
    @techaido 3 місяці тому

    28:50 Errors and Exceptions 😱🤯 Golang wants to conquer Kotlin.
    💡You can create your custom exceptions as a value.

  • @techaido
    @techaido 3 місяці тому

    18:44 What’s the different in the algorithms ???

  • @DM-fw5su
    @DM-fw5su 4 місяці тому

    @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.

    • @bagadeshkumarr9502
      @bagadeshkumarr9502 4 місяці тому +4

      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?

  • @AdibCodes
    @AdibCodes 4 місяці тому

    Great talk!

  • @KuroKazeZX
    @KuroKazeZX 3 місяці тому

    i love error as values, please do this

  • @gustavbw
    @gustavbw 4 місяці тому

    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++).

  • @fabianomello9141
    @fabianomello9141 3 місяці тому +6

    Camera should zoom out and stand still, for god's sake.

  • @juneuniversum
    @juneuniversum 4 місяці тому +1

    arrow-kt-raise out of box

  • @gustavbw
    @gustavbw 4 місяці тому

    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.

    • @guai9632
      @guai9632 3 місяці тому +2

      one don't mention golang in a polite society

  • @sakesun
    @sakesun 4 місяці тому +1

    I want to go back to dynamic language after this 🤣

  • @CielMC
    @CielMC 4 місяці тому +2

    JVM folks discovering error-as-value and emulating algebraic datatypes are so funny to me

    • @wollf92
      @wollf92 2 місяці тому

      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

    • @CielMC
      @CielMC 2 місяці тому

      @@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

    • @balen7555
      @balen7555 Місяць тому

      Scala is on the JVM rofl.