Martin Odersky DIRECT STYLE SCALA Scalar Conference 2023

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 พ.ย. 2024

ความคิดเห็น • 35

  • @julianavar3836
    @julianavar3836 ปีที่แล้ว +8

    The man just proclaimed the end of the monad era

  • @tepan
    @tepan ปีที่แล้ว +4

    "My new Scala is much more user-friendly than Haskell. I don't like that." ~ Sheldon

  • @ShotterManable
    @ShotterManable ปีที่แล้ว +2

    Thanks a lot for sharing it!!

  • @akemegbebu7807
    @akemegbebu7807 ปีที่แล้ว +5

    Game changer.

  • @jaypandya1154
    @jaypandya1154 ปีที่แล้ว

    That was so cool

  • @lucianojoublanc4484
    @lucianojoublanc4484 ปีที่แล้ว +2

    Could you provide a reference for the papers? Is the first one "monads and composable continuations"?

  • @shilangyu
    @shilangyu ปีที่แล้ว +9

    Effect systems are the future of programming

  • @jausmann
    @jausmann ปีที่แล้ว

    Storing the stack frame between break and boundary on the heap and then returning to it, is conceptually very similar to how an actor stores state and can pipe a future to itself. Perhaps delimited continuations are a special case of actor behavior being embedded in the language.

  • @Tvaroh
    @Tvaroh ปีที่แล้ว +6

    I don't know, all that "syntax" feels a bit weird, and I like "monads" much more. I'd rather write traverse instead of that stuff at 11:23 backed by exceptions. Not a fan of Rust error handling either, I think it's not very FP approach, I felt downgraded in a sense when writing code in Rust (but it's a revolutionary language considering its capability with borrowing checking, etc).

    • @simonwaddington1866
      @simonwaddington1866 ปีที่แล้ว +2

      I'm inclined to agree. Sometimes more code that's simpler and more self explanatory is good - at some point the syntax feels like there's some magic going on. But ultimately 90% of the code we write is hiding some magic so its down to. your comfort level with the paradigm. Seeing this for the first time my head was hurting quite a bit 🙂

  • @unorsk
    @unorsk ปีที่แล้ว +13

    [...] I refuse to use Either for errors, I think Either is terrible. And I want a Future that gives me as a result either a list of T or the error. [...]

    • @nilskp
      @nilskp ปีที่แล้ว

      What's wrong with Try?

    • @thomasjarvstrand1511
      @thomasjarvstrand1511 8 หลายเดือนก่อน +1

      Doesn't Try only support Throwables as errors?

  • @mrsozekaiser9299
    @mrsozekaiser9299 ปีที่แล้ว

    taticu, el padre, BO$$

  • @MorgenPeschke
    @MorgenPeschke ปีที่แล้ว +3

    This looks like it will quickly become a massive headache to debug.

    • @markhathaway9456
      @markhathaway9456 ปีที่แล้ว +4

      The people who first approach Scala say it's too complicated, so what do they do, they add more. Their rational is that they're "completing" the picture as is necessary, not on a whim. But most of those newbies leave. So, there's a trade-off. Now, if any new things make it harder (as with perhaps debugging) on current Scala users, will that chase them away or will they seek some other way of working around difficult features? Time will tell.

    • @MorgenPeschke
      @MorgenPeschke ปีที่แล้ว

      @@markhathaway9456 It'll be interesting to see how this gets used in non-trivial examples, but multiple exit points for loops/functions rarely increases the ability to mentally trace code when reading it (and help when debugging even less). I'm also really curious to see how `Break` will (or won't) avoid the issues with abstractions leaking that have lead non-local returns to be considered a code smell. When any try block can potentially break your abstraction, corner cases proliferate.

    • @jasonpickens9839
      @jasonpickens9839 ปีที่แล้ว +5

      @@MorgenPeschke Why would it be a headache? Current effect libraries are already a headache. The stack is incomprensible without some serious tricks. AFAICT continuations will restore the stack to how it was so it looks as you would expect.

    • @MorgenPeschke
      @MorgenPeschke ปีที่แล้ว +4

      @@jasonpickens9839 Yes, current effect libraries can be a headache, however this will likely be worse.
      The first (and least important) is that, depending on what you do with it, the stack is going to be mangled by patterns like the one at 16:52 or 19:00 so there isn't necessarily going to be an improvement there. This is without taking into account that effect libraries aren't obliged to ignore things like project Loom, so it's more likely than not that they'll be able to leverage it's capabilities to improve their stack traces, shrinking the gap even further.
      The bigger issue is that effect libraries (particularly monadic ones) are easier to mentally model and debug than imperative/mutable code because they actively limit the space of possible states the programmer has to keep track of. This is such a benefit that we put up with the mangled/unusable stack traces because we can mostly get along without them.
      Yes, the ability to break across effects is powerful, but the cost of that power is the loss of the predictability and composability that monadic effects offer. Even worse, it means you can exit a block in as many places as you could possibly imagine (including inside of function calls of arbitrary depths), which explodes the search space of possible states you have to keep track of when debugging.
      It's kind of like the difference between writing a tail recursive function and using foldLeft to accumulate a calculation over a collection. The tail recursive function is inarguably more powerful, however it's also much harder to debug, so it's a bad choice when you don't need that power. This is fine because the foldLeft is usually also easier to use.
      In this case, the ability to break across things like foreach instead of using something like traverse makes it look like this is the simpler approach. However, this is only the case when everything works correctly, and when in our industry has assuming things will always work correctly ever ended up in anything other than a massive headache?

  • @web3tel
    @web3tel ปีที่แล้ว +1

    nice, but I like Unison approach better

  • @DAB009
    @DAB009 ปีที่แล้ว

    Need actor model locally

  • @TheSunscratch
    @TheSunscratch ปีที่แล้ว +4

    It looks like Scala is on its way to becoming the C++ of functional programming.

    • @jasonpickens9839
      @jasonpickens9839 ปีที่แล้ว +2

      Haha there is some truth to this but I do think that the Scala team do a good job of finding the most powerful abstractions that give us the greatest capabilities (can't wait for capture checking 😉). So yes the language does grow but I want a language that grows rather than one that grows stale. So long as redundant/obsolete features also get removed (there is evidence in this talk that they do).

    • @fredoverflow
      @fredoverflow ปีที่แล้ว +3

      On its way? Always has been!

    • @encapsulatio
      @encapsulatio ปีที่แล้ว

      @@fredoverflow And Clojure is in what way better?

    • @fredoverflow
      @fredoverflow ปีที่แล้ว +2

      @@encapsulatio Clojure and Scala/C++ are on complete opposites of the complexity spectrum (imho)

  • @abhijit-sarkar
    @abhijit-sarkar 2 หลายเดือนก่อน

    11:14 - Why mention Rust, Rust is horrible. "I shall makest thy life unbearable by promising to solve the problems that thou dost not hast".

    • @user-uf4lf2bp8t
      @user-uf4lf2bp8t 28 วันที่ผ่านมา

      Rust is amazing. It is just not for everything. Obviously, a garbage collector is preferred for most of the use cases of functional languages, but when you NEED a manually managed language, it doesn't get better than rust.

  • @MaksimVolkau
    @MaksimVolkau ปีที่แล้ว

    what scala is going to?... ah wait, it is the same direction :)

    • @encapsulatio
      @encapsulatio ปีที่แล้ว

      And what is your alternative, simpler solution?

  • @klasus2344
    @klasus2344 ปีที่แล้ว +2

    I don't like it 😬

  • @FirstLast-zs6dq
    @FirstLast-zs6dq ปีที่แล้ว +2

    Too raw talk. The main thought is tough to be tracked.

    • @markhathaway9456
      @markhathaway9456 ปีที่แล้ว

      Are you saying it's hard to debug or just hard to understand the overall ideal final product?

  • @pr0master
    @pr0master ปีที่แล้ว +1

    Way too complicated. I will stick to Kotlin.