What is Concurrency? And how can Structured Concurrency make it easier?

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

КОМЕНТАРІ •

  • @ethanniser
    @ethanniser  5 місяців тому +3

    Corrections:
    Effect.die('todo')

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

      11:31: Queue has element type number, but is given strings: offer("hi")

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

    Great video, Ethan! You do acknowledge Erlang, but I think the framing could give it more credit. The concurrency challenges you describe-like race conditions, structured concurrency, and managing parallelism-are definitely contemporary issues for many languages, but Erlang and the BEAM VM solved these decades ago. Concepts like message passing, preemptive scheduling, and supervision trees have been foundational in BEAM-based languages since the '80s. What’s being positioned as cutting-edge today has been core to Erlang for over 30 years, so while these are still challenges for many, for BEAM languages, they’re old news!

  • @capability-snob
    @capability-snob 5 місяців тому +1

    Ooh! Well done. I don't think I like it, but it's a really interesting approach.
    So, the important thing about promises is that you can tell clearly when a transaction will run to completion, without an interleaving task, and when you are enqueing a new task to be run later. Blurring this line is a great way to start a bug farm.
    Building off of this approach, I think it would be cleaner not to conflate tasks and contexts. Allow a function to return to the caller but still leave work to do, and use a separate context object to track ownership of the run queue and donate time to it.
    This is how the scheduling interface in my own system works. I think in practice I'd rather just use promises directly, but there are absolutely scenarios where resource management is more important than pure expression.

  • @DivjotSingh
    @DivjotSingh 5 місяців тому +3

    I wish you could spend some time explaining the code snippets, but thanks for the effort (I can always pause and pay close attention).

    • @ethanniser
      @ethanniser  5 місяців тому +1

      Yea it’s always a bit hard trying to balance maintaining the narrative while stopping to explain the examples- always more to improve
      But I would say I lean towards the mindset of like “if you are really curious pause and ponder for a second”

    • @DivjotSingh
      @DivjotSingh 5 місяців тому

      @@ethanniser Yup you're right. The concepts are hard to summarize in a short video. I'll explore further, thanks for the advice.

  • @md2perpe
    @md2perpe 5 місяців тому +2

    Using 'goto' isn't necessarily bad. It is used quite a lot in C code, for example in the Linux kernel, primarily for error handling and cleaning up. Correctly used, it does not result in spaghetti code but in very clear code.

    • @ethanniser
      @ethanniser  5 місяців тому +2

      Agreed it has uses for places as low level as kernel code
      Disagree it does not result in spaghetti code- it creates control flow that coolaid man smashes all of the “walls” of your program by jumping between functions
      Again, it has its uses but it’s just not a sustainable way to program

    • @md2perpe
      @md2perpe 5 місяців тому +2

      @@ethanniser To me, "goto spaghetti code" means jumping back and forth, a flow that is difficult to follow. It was common in early BASIC code where there was no WHILE statement and perhaps not even subroutines.
      The way 'goto' is used in the Linux kernel one usually only has jumps forwards, from a failing call into a cleanup section. In my opinion that's not spaghetti code since the flow is easy to follow.

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

    Underrated video

  • @teej_dv
    @teej_dv 5 місяців тому +6

    WHERE ARE THE OCAML FIVE EFFECT AND DATA RACE FREE PARALLELISM MENTIONS!?!?!
    Nice video tho :)

  • @bobDotJS
    @bobDotJS 5 місяців тому +5

    Are you an educational channel or are you advertising your NPM package? I just want to know if I should be subscribed with notifications on or if your videos will all be about the Effect library.

    • @ethanniser
      @ethanniser  5 місяців тому +17

      the first 3/4ths of this video don't mention effect at all
      I am quite passionate about effect, and it is a great example of an implementation of many really interesting programming concepts
      I would expect some more videos approximately similar to this:
      talk about general concept that applies to any language, then look at how effect makes it really easy
      but I have plans on making many videos completely independent of effect as well
      feel free to turn notifications off and just click on the videos if they seem interesting to you
      and if you click away the second I mention effect that is perfectly reasonable too
      (lastly, it is not my package)

    • @recursion.
      @recursion. 5 місяців тому

      @@ethanniserNice try Diddy

    • @Danielo515
      @Danielo515 5 місяців тому +1

      I would prefer if you can keep yourself and your toxicity away. Some of us value the free and informative content people invest hours on, and I don't want people like you pissing the creators

    • @dawid_dahl
      @dawid_dahl 5 місяців тому +2

      Ethan I love the quality content you put up, regardless of whether it’s about Effect or not. Thanks a lot! 🤩🙏🏻

  • @Alivezombie16
    @Alivezombie16 5 місяців тому +1

    Kotlin has coroutines as their solution for their structured concurrency. I'd love to see what your thoughts on the strengths and weaknesses of it versus Effect

  • @amebaaa7412
    @amebaaa7412 5 місяців тому +1

    great video erhan

  • @profnmom
    @profnmom 5 місяців тому

    Cool!

  • @inversebrah
    @inversebrah 5 місяців тому +2

    first