How we program multicores - Joe Armstrong

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

КОМЕНТАРІ • 94

  • @RFC3514
    @RFC3514 5 років тому +127

    22:49 - This is the bit where he told us the real secret of parallel programming.

    • @birrextio6544
      @birrextio6544 5 років тому +5

      I think he said that google does it wrong :-)

    • @vladirimus2689
      @vladirimus2689 4 роки тому +3

      Any way to find out what he said during that time interval? Is there a transcript?

    • @vladirimus2689
      @vladirimus2689 4 роки тому +15

      No transcript found if you search on Google. I sense foul play.

    • @0x44Monad
      @0x44Monad 3 роки тому +1

      Very odd...

    • @rickacton7540
      @rickacton7540 Рік тому

      HAHAHA

  • @fosres
    @fosres 3 роки тому +41

    I am truly sorry this legend of a human being passed away. It would be awesome if he was around. A benevolent speaker. An amazing writer. And the inventor of one of the best programming languages to conquer the problems real-time systems face everyday.

    • @DuTuben32
      @DuTuben32 2 роки тому +3

      He held a course in Erlang at my university. The man had a galaxy sized brain.

    • @fosres
      @fosres 2 роки тому +2

      @@DuTuben32 It must have been amazing having him as a professor. Thanks for sharing.

    • @llothar68
      @llothar68 Рік тому +1

      Only 68 years old. I now start to worry about myself. We are all mortals even if youtube helps to extend our recognized life a few more years.

  • @nathanlewis42
    @nathanlewis42 5 років тому +44

    RIP Joe Armstrong

  • @senthilramalingam9500
    @senthilramalingam9500 8 років тому +24

    Awesome. Joe, the man who nullifies my current thought process and makes me think in a different perspective and define a problem correctly before choosing a solution path.

    • @rgw5991
      @rgw5991 7 місяців тому +1

      and you are still a humunculous

    • @rgw5991
      @rgw5991 7 місяців тому

      how fat???

  • @amenostalgique
    @amenostalgique 8 років тому +63

    Erlang is my new religion

  • @ximalas
    @ximalas 5 років тому +6

    Joe mentioning Alan Kay's thoughts about throwing everything away and beginning anew and Facebook's lack of reply on what to do with what we leave behind, this all reminds me of a Star Trek episode or two where parts of our history was simply lost. So maybe we should start over again before it's too late.

    • @laurelsporter
      @laurelsporter 3 роки тому

      Star Trek? What about China and Russia, that actively destroyed history? What about the Dark Ages, where the Church's expansion, combined with difficult daily lives, made people not care of their old history, and often probably reuse items it was recorded with? What about the height of and fall of Egypt? Despite their attempts at extensive record-keeping, there are huge gaps. What of the Native American mound cultures? It's like one day they went from high stone age empires to scavenging tribal scavenging warlords, and none have any - public, at least - stories to tell about that collapse.
      It's abnormal for us to keep good records.

  • @MrDigitsu
    @MrDigitsu 2 роки тому +2

    A bow to the legend. These are the real heroes of the world.

  • @MCLooyverse
    @MCLooyverse 4 роки тому +1

    The way I think about multi-threaded, parallel, distributed, or whatever-you-like programming (which I've done practically none of) is that you have some problem to solve, so you say to your buddy "Hey, get me the solution to A." then you get the answer to B, then when you're both done, you combine your answers into the solution to your original problem. Of course, some problems can't be "factored" like that (maybe you could call them "prime"?), which I'd imagine is where he's going with this talk (which I obviously haven't finished yet).

  • @danielsmith5626
    @danielsmith5626 6 місяців тому

    22:48 The one true computer scientist. He knew the way.

  • @vaishakm6
    @vaishakm6 5 років тому +10

    Hello Joe,
    Hello Mike,
    Hello Mike,
    Hello Robert

    • @nero1375
      @nero1375 3 роки тому

      ohhh I see what you did here! ahahahaha

  • @shamzfk
    @shamzfk 7 років тому +9

    Just as a side note, why Go is on a Shared Memory side of things? at 5:00
    It does allow it, thats true, but it also discourages it while providing goroutines and channels as the means to implement ideas of CSP which both Go and Erlang are based on.

    • @neuronist
      @neuronist 5 років тому +1

      exactly, Go does allow you to pass messages and the scheduling is comparable to erlang, but its still very viable, easy and normal to use shared memory models in go, which would also - for me - put it generally more on the shared memory model places, even though you can opt for a different way. I am still not sure if that is a good thing necessarily and go should have some opinion on that part.

    • @aimp4598
      @aimp4598 4 роки тому +5

      Goroutines and channels do nothing to discourage shared memory. Rather, its lack of constraints facilitates the sharing of memory.
      To suggest it shouldn't fit on the shared memory side would be like suggesting that Go shouldn't be considered an imperative language because it has higher order functions. Yes, you could write in a purely functional style, but it's not a fundamental characteristic of the language.

    • @GertVeltink
      @GertVeltink 7 місяців тому

      @shamzfk I know I am late to the party, but I agree with you on the position of Go in the diagram. One of the Go mantras is: “Don't communicate by sharing memory, share memory by communicating.”. Yes memory is shared, but it is done in such a way, that if the message memory is with the receiver it is logically no longer with the sender.
      However, I have to put a side note on the CSP remark. CSP uses synchronous communication, the Actor model only supports asynchronous communication, which makes a large difference! The beauty of Go channels is that they support both synchronous (= unbuffered) and asynchronous (= buffered) communication.
      One final remark on the diagram. I’m amazed that Scala isn’t mentioned on the right side, because it clearly supports the actor model.

  • @BryonLape
    @BryonLape 3 роки тому

    Why is it that in so many of these tech conference videos the audio is horrible?

  • @vimalk78
    @vimalk78 7 років тому +6

    where is sound at 22:50 ?

    • @zacharylarson1245
      @zacharylarson1245 7 років тому +17

      That's where Joe slips up and accidentally reveals to the world that we are being visited by beings from another (concurrent? parallel?) Earth, where humanity took a twist in the history of programming languages and has hence found a way to bring harmony to their universe. The Ministry of Information of the Global Illuminati had to censure this most guarded secret.

    • @DanGK
      @DanGK 7 років тому +6

      "...beautiful diagram, the way we program that... *hand waving* ...destroy the JVM... *broad handwaving* ...death, a side-affect of mutable human state... *outward, inward handwaving* ...writing a small program..."

    • @weneedtogoback8553
      @weneedtogoback8553 5 років тому

      @@zacharylarson1245 O_o das woke

  • @mohamedfouad2304
    @mohamedfouad2304 5 років тому +4

    its videos like this that makes me keep the youtube app

  • @MultiNnn999
    @MultiNnn999 8 років тому +5

    Awesome talk! More programmers need to know this information.

  • @morthim
    @morthim 5 років тому +3

    audio cuts out

  • @vadityag
    @vadityag 4 роки тому +1

    What does he mean by No FP hardware(more CPUs instead)?

    • @0x44Monad
      @0x44Monad 3 роки тому +1

      no useless floating point units

  • @oberguga
    @oberguga 4 роки тому

    Maybe a stupid question... If we declare equality between pure function and processes can it works? Just put output of function to atomic buffer and work with futures by default.

    • @dennydravis8758
      @dennydravis8758 3 роки тому

      That's an interesting thought... Hmmm
      You'd have a bit of an issue with tiny functions - I mean after all a lot of functions are recursive in one way or another

    • @oberguga
      @oberguga 3 роки тому

      @@dennydravis8758 recursive function is kinda special case that detected by most compillers, so it can work in one process.
      Other tiny functions like add(a,b) also kinda special case and can be inlined, just because it's size or because of some tag...

  • @JohnBat26
    @JohnBat26 8 років тому +1

    Amazing presentation !

  • @bwfrieds
    @bwfrieds 7 років тому +4

    The wisdom at 17:00 stuck me hard. Not sure why. Should have been obvious to me.

    • @dlwatib
      @dlwatib 5 років тому +2

      The problem is that computations are not grains of sand. They have data dependencies between them. They're more like spiders sitting in the middle of spider webs connected to other spider webs with other spiders sitting in the middle of their webs. And some spiders are bigger than others and have much longer lives, but most spiders have very short lives so it's hard to fit them neatly into barrels because they keep disappearing.

    • @zomgdude1
      @zomgdude1 4 роки тому +1

      @@dlwatib This proves Joe's point exactly. Programs are only like spiders in spider webs if they are modeled like this, it's not intrinsic. This sort of model (which is the most common one as evidenced by the graph of message passing model vs shared memory model), ends up making parallelism even more difficult than it already is. Erlang is specifically designed so that computations are, in fact, like grains of sand as he described, purposefully avoiding spider webs.

  • @venkatrajanala6841
    @venkatrajanala6841 5 років тому +8

    Rip Joe !

  • @AndersJackson
    @AndersJackson 4 роки тому +1

    At 47:30 he was talking about the future. About Corona, apparently. At least as most people thing it is.

  • @sanderd17
    @sanderd17 5 років тому +1

    Does JS fit into the "Shared memory" group of concurrency? If you consider traditional JS, it's not paralel, and programming style usually forces you to keep memory in a closure, so not shared. When you add workers, those communicate with messages instead of memory.

    • @maximmatyunin9934
      @maximmatyunin9934 Рік тому

      Well, JS (Node.JS) is (mostly) single threaded. And you can pass references to objects around and change anything anywhere. Yes, it has workers, but those are usually used for some kind of big work, you don't usually spin thousands of workers in JS, you don't have something like OTP to manage them

  • @ken-kost
    @ken-kost 5 місяців тому

    absolute legend

  • @whossname4399
    @whossname4399 7 років тому

    How is the sending the program to the data done in practice?

    • @MatthewHolevinski
      @MatthewHolevinski 6 років тому +2

      (disclaimer: I'm an idiot.) But I think a somewhat similar real world example of that might be Joyent's Manta offering.? It appears to be somewhere within that realm (from a cloud based perspective).

    • @skepticmoderate5790
      @skepticmoderate5790 5 років тому +3

      Javascript programs are sent to the browser to be evaluated all the time.
      Also, there was a time when we used to download programs to solve problems.

  • @AlinNemet
    @AlinNemet 7 років тому +1

    great stuff

  • @victoreijkhout7115
    @victoreijkhout7115 5 років тому +1

    I agree that shared memory should be avoided at all costs. But then he mentions briefly that Erlang has "xtables" because you don't want to reproduce large databases. Ok, but now you need locks &c again to prevent conflicting accesses again to these big tables. And so you have all the problems of shared memory. Not?

    • @lucf8476
      @lucf8476 3 роки тому

      No - ETS tables use memory of course, but you interact with them in one of the same ways you'd interact with external storage, ie, you send messages to a process, they're just fast (though not strictly as fast as just munging memory directly). One of the problems in using shared memory is, for instance, a shared references to data that's been changed 'out from under you' and unexpected/undefined behavior, and the various ways you need to complicate your code to detect or prevent that, and that's a problem that doesn't happen with data that's copied out of an ets table and returned to you in a message. It's pretty fast, basically like Redis, but like Redis (unless you've embedded it), there'll be copying overhead so it's not a magic bullet -- but also like Redis, it's in the right order of magnitude to speed up a whole lot of things.

  • @rodjacksonx
    @rodjacksonx 4 роки тому +4

    They were angry it only went 33x faster rather than 64x faster on 64 cores? Yeah, that sounds like typical, pointy-haired management.

  • @chenzhixiang3116
    @chenzhixiang3116 7 місяців тому

    I would prefer a new approach: To program in a distributed promise style use language native async/await syntax, which then could be transformed(lower down) by a smart compiler into message passing style... MQ is still imperative, Declarative is better.

  • @LordZordid
    @LordZordid 5 років тому

    Why exactly
    does quantum mechanical entanglement not allow the transmission of information faster than the speed of light if you could manipulate the particles?

  • @nolan412
    @nolan412 3 роки тому

    "C is like airline." Thanks UA-cam captions.

    • @nolan412
      @nolan412 3 роки тому

      I will assume that was a couple minutes of swearing at programming an Earth to Moon and back system.

    • @nolan412
      @nolan412 3 роки тому

      OMG. Prescient at the end.

  • @derekfrost8991
    @derekfrost8991 5 років тому

    If your language does not have a strategy for parallelism, then it's days are numbered. Even prolog can do this, albeit with libraries.. :)

  • @neuronist
    @neuronist 5 років тому +1

    It's funny how he says that the notion of things happening at the same time doesn't exist in Physics and has an amazing example...Yet...isn't it the same in your computer, the cloud, anywhere? The fallacy of thinking something could be simultaneous when in fact nothing is but is only the observable part and we come up with solutions to agree on simultaneity (is that a word?) like consensus protocols and name it blockchain, but are in fact just a way to agree on something that does inherently not exist in reality.

    • @GeorgeTsiros
      @GeorgeTsiros 2 роки тому +1

      that example was quite weak. Of course there exists the concept of simultaneity in physics. He literally _based_ the example *on the two stars exploding simultaneously*
      once again: the basis of the example is that the two stars indeed exploded *simultaneously*

  • @monetize_this8330
    @monetize_this8330 5 років тому

    What I don't get is, if BEAM OTP is a runtime system executing on an OS that is basically multi-threaded, how does it wrangle control away from the kernel scheduler?
    When my application gets scheduled by the OS, I have no idea how many cores, I might or might not, have given to me. Not constant either.
    I'd rather not even think about parallelism at all. It's a job for the language syntax and cpu/gpu features. Like matching parallel constructs to GPU features automagically.

  • @tobiasfuchs7016
    @tobiasfuchs7016 7 років тому

    I like and support Erlang in general, but this sounds ... off.
    The claim in the description is dubious. So, Amdahl's Law does not exist for Erlang? A general claim of linear speedup is implausible - no matter the programming model, just because of basic math.
    Or I'm mistaken and all algorithms can be formulated in Erlang without synchronization and sequential sections.
    34:43 ... oh, I see, they refer to "massively parallel" (also known as "embarassingly parallel") problems and aim at 0.75 x N speedup. That's underwhelming.
    And to look down on shared memory parallelism is en vogue because oh my, the complexity, but presumably Erlang is subject to the same memory hierarchy as any other application, so how is data locality maintained or exploited in Erlang? If the answer is "we don't care" then all statements on robust performance are bogus. Or restricted to some problem domains, or anecdotic. "36 computers" is, to keep it in the message passing domain, a debugging setup for MPI applications at best.

    • @llothar68
      @llothar68 7 років тому

      Amdahls Law is in practice the least of the problems. And often can be worked around when looking at the real world and rewriting the process instead of scaling a bad requirement. Like youtube view counters which do not need to update in sync (just sync some day) or all the NoSQL used now after they found out that a single SQL database is stupid for the real usecases.
      The very few places where Amdahls Law is relevant like adding number on your bank account or zipping a file for ONE user can be handled with fast hardware. And it's just one bankacount or one user.

    • @tobiasfuchs7016
      @tobiasfuchs7016 7 років тому

      That's true, but not about my point, I was just using Amdahl as an example from the top of my head.
      Also, you sometimes just can't cheese it by relaxing the requirements, like in system programming. There is no "eventual consistency" in laser control loops.

    • @MatthewHolevinski
      @MatthewHolevinski 6 років тому

      agreed, dragon wrestling requires adequate amounts of wrestling.

    • @juansanchezgonzales3934
      @juansanchezgonzales3934 5 років тому

      @@llothar68 r

    • @skepticmoderate5790
      @skepticmoderate5790 5 років тому +1

      0.75 * N is underwhelming? What are you smoking?

  • @bocckoka
    @bocckoka 5 років тому

    I don't understand the question. - Jon Gjengset (see evmap crate). RIP Joe!

  • @garyda6605
    @garyda6605 2 роки тому

    Genius

  • @moshedimawalaadormeo
    @moshedimawalaadormeo 3 роки тому

    Sad that he passed away sometime ago

  • @NormanZhou
    @NormanZhou 8 років тому +14

    Elixir all the way

  • @goverdhank
    @goverdhank 7 років тому +3

    the talk (though good) was a glorified advertisement of Erlang - and, should have been titled on those lines !

    • @MatthewHolevinski
      @MatthewHolevinski 6 років тому

      I feel like he answered the title at 17:42, and as for an advertisement it to me sounded like he was bluntly honest about it not being the end all be all to all the worlds problems, but expressed it was a helpful tool.

    • @dlwatib
      @dlwatib 5 років тому +1

      All Joe's talks are ads for Erlang.

  • @hidragerrum
    @hidragerrum 7 років тому

    God, he even considering the death of his spouse. LOL

    • @MatthewHolevinski
      @MatthewHolevinski 6 років тому +1

      That's when you know you have a great speaker :)

  • @camilojazzfernandes
    @camilojazzfernandes 5 років тому

    hahaha ... 3d args could seem silly in xd p ... hahaha ...

  • @yorik2588
    @yorik2588 6 років тому +1

    Unfortunately, or fortunately, the problem that Erlang address is nothing which can't be handled by c++ and the like, provided you throw enough money and time at it. Facebook chat was written in Erlang but has now been rewritten in c++. Reason: engineers were not quite comfortable in Erlang and they had a lot of existing threading libraries in c++. So I think, what he says is very right, but big companies would not likely adopt Erlang. So as an engineer, is it worth learning Erlang ? Yes: If you are into programming for the love of it, and are not merely learning Erlang for career progression. But practically speaking, to go corporate, learning Erlang would not add a lot of value. Try convincing the business division that they should switch to Erlang.

    • @pietroviske
      @pietroviske 6 років тому +8

      Nowadays programmers are turning into Elixir, which is being highly successful by packaging all the power of Erlang with a better syntax, and the community is just awesome. A lot of new companies are adopting it and I believe we'll see much more in the future.

    • @RsZ789
      @RsZ789 4 роки тому

      @Sergio Díaz Nila Do you think Elixir can ever be used as a replacement for C++? The fact that it runs on BEAM means it will never have direct access to the low level of the system like C++ can.But, is that really necessary?

    • @newsgroupsusenet5486
      @newsgroupsusenet5486 3 роки тому +2

      @@RsZ789 You've never heard of Native Implemented Functions (NIFs) in Erlang. With NIFs you can call C/C++/Rust from Erlang/Elixir

  • @Luix
    @Luix 5 років тому

    golang maybe the solution...?

    • @nolan412
      @nolan412 3 роки тому

      Looks like Erlang is still winning benchmarks.

  • @jessethompson2950
    @jessethompson2950 7 років тому +1

    "blah blah blah simultaneous, doesn't mean anything in Physics, we don't have the language for this (drones on for five minutes about exploding stars).."
    Look. Dude. Just say "Spacelike" and keep on walking. Okay? If they ask "What's spacelike mean?" Just say "Oh, that's just 'simultaneous'" for smart people, *and it's equally applicable to this topic*. ;P

    • @petertomov5728
      @petertomov5728 5 років тому +1

      No. This is a lecture.
      The explanation is structured, fairly self-contained precisely because of how he declares a term that he's going to use, explains it and then uses it.
      It's precise and correct, how an explanation for a large audience of people with mixed backgrounds should be.
      If your approach to programming is the same as your outlook on this lecture, you should listen carefully once more to this lecture and others, similar in nature.
      Simultaneous means "happening at the same time"
      Parallel means "happening at the same time as but not being affected nor affecting other instances"
      Concurrent means "happening at the same time, running separately from other instances while accessing one or more shared resources"

    • @pearz420
      @pearz420 3 роки тому

      Yes, let's make something less clear and more nonsensical for the sake of *your* attention span.

  • @frankfahrenheit9537
    @frankfahrenheit9537 5 років тому

    43:22 don't watch if you are interested in doing numerical stuff.
    It's called here "nitty gritty in-memory stuff", thanks for wasting my time.
    I think everybody with an IQ>120 can "invent" a system which is described
    here, able to do some clint-server stuff.
    Many cores, every core has local memory. Trivial.

  • @llothar68
    @llothar68 5 років тому

    The problem of Erlang is that the language and the language implementation totally suck. They should move at least away from interpreter to full compiled language making it 10times faster in each thread.

    • @laurelsporter
      @laurelsporter 3 роки тому +1

      HiPE been included with the standard runtime since 2001. It's just not a big concern to most users, as practical slowdowns usually occur elsewhere.

    • @MultipleObjectSelector
      @MultipleObjectSelector 2 роки тому

      It's interpreted *byte code* with a very efficient decoder and a JIT. These days most ventures needn't be concerned with performance juicing: the law of diminishing returns applies here, and presently the merits of the current design (code server in particular comes to mind) broadly outnumber and outweigh the demerits.