The New Massively Parallel Language

  Рет қаралды 176,670

ThePrimeTime

ThePrimeTime

Күн бұрын

Пікірлер: 475
@infernoplayzgames1684
@infernoplayzgames1684 6 ай бұрын
"I'm not gonna use this..." you say that, then six months later we will see a "Learning the Bend Language" video.
@dylancode
@dylancode 6 ай бұрын
How can we take the language seriously when the promotional videos use light mode??!!
@mrs8683
@mrs8683 6 ай бұрын
@@dylancode light mode is better for showcase
@dylancode
@dylancode 6 ай бұрын
@@mrs8683 Maybe in some cases... Depends what you prefer I guess!
@Machine_State
@Machine_State 6 ай бұрын
@@dylancode Light mode is fine actually -Light mode enjoyer
@crimiusXIII
@crimiusXIII 6 ай бұрын
Probably some AoC is my guess
@origamitraveler7425
@origamitraveler7425 6 ай бұрын
This thing is built on top of another of the guy's projects called HVM, which was a massively parallel runtime originally envisioned as a compilation target for Haskell. But it's a whole platform, you can write any language on top of it. It's pretty cool.
@joszuarotschild2270
@joszuarotschild2270 6 ай бұрын
I love that guy as he managed to implement this, enable it to be incoroprated in custom projects via design and finally promote it out (at least enough to be heard by Prime) at the same time.
@zweitekonto9654
@zweitekonto9654 6 ай бұрын
HASKELL MENTIONED
@Adowrath
@Adowrath 6 ай бұрын
When somebody mentioned Bend to me, I got immediatly reminded of the original HVM - was glad to see it's a continuation of that idea in HVM2. Amazing work, wish I was intelligent enough to understand how it works.
@ZeroInDaHouse
@ZeroInDaHouse 3 ай бұрын
There is a massive market out there for parallel computing and the current libraries or '''toolkits" to use them are a joke. I hope there will be support for AMD GPUs.
@Sandromatic
@Sandromatic 2 ай бұрын
If I can run haskell on this I'd love to do that, bend's lack of types really hurts understanding for this kind of code tbh. Or heck, just give me ADT in bend, that's all I need.
@paryonix3d6657
@paryonix3d6657 6 ай бұрын
Mutex: To freely quote Kevlin Henney here: "They should really have called them Bottleneck instead. No one would be like - Oh, I think we just need to add two bottlenecks here in those classes and we are fine" :D.
@alkeryn1700
@alkeryn1700 5 ай бұрын
sure, but there are many cases where not using them is not an option for correctedness.
@dipereira0123
@dipereira0123 6 ай бұрын
This language is so advanced that we dont even have a problem for it to solve (YET)
@ThePrimeTimeagen
@ThePrimeTimeagen 6 ай бұрын
But you can imagine
@irakli2166
@irakli2166 5 ай бұрын
I think the language could be ideal for creating a solver for linear programming, where you need a lot of parallel calculations. This could be a huge business opportunity.
@timmygilbert4102
@timmygilbert4102 5 ай бұрын
The problem exist, it's called video games
@dtracers
@dtracers 5 ай бұрын
hobbyist wanting to get into GPU programming without needing to get into cuda
@colbyboucher6391
@colbyboucher6391 5 ай бұрын
​@@timmygilbert4102There are almost certainly no graphics libraries in Bend.
@EvanEdwards
@EvanEdwards 6 ай бұрын
My late wife could have used this in her daily work. She was obsessed with h bar (Planck's constant over 2π, or Dirac's constant) because she used it all the time in her code. When she died, a military officer came to my door and asked me very politely to let them know if she had any notes or material from her work in DC so they could come and collect it. If you're not doing that kind of work, it is unlikely you'll be using Bend.
@willothy
@willothy 6 ай бұрын
12:59 I usually use `.ok()` to ignore an error instead of assigning it to underscore. This will give you a warning if the type changes from Result to impl Future, etc.
@Kram1032
@Kram1032 6 ай бұрын
interaction combinators are super simple. The basic form is just: "If two of *the same* combinator meet, connect up their input wires" "it two *different* combinators meet, copy them" and somehow that suffices to - be Turing complete - calculate things as efficiently as possible And furthermore, these compute locations can happen completely independently from each other, i.e. in parallel. There ARE limitations on this. Namely, you have to structure your code in a form that properly takes advantage of this. However, I *think* that's where Bend comes in. HVM2 is basically typed interaction combinators. Bend probably is a layer that attempts to minimize your having to think about the specific function form. And the design with folds and recursions rather than loops *also* is all about increasing the chance to write in a style that the interaction combinator parallelism can actually be taken advantage of. I recommend at least trying to skim the mentioned paper. You don't have to understand every last bit of the theory in order to understand at least roughly how these interaction combinator graphs work. It's really clever stuff, and pretty long-known too. What's new here is this effort to make it run seamlessly on a GPU.
@oleonardohn
@oleonardohn 6 ай бұрын
There are no evidences for the second claim. In fact, the author clearly distorted the meaning of optimal evaluation in the context of lambda calculus. Take a look at what Lévy means by optimal evaluation in his 1978 paper, then read what Asperti says in 1998 about the ineficiency of optimal evaluation.
@Hector-bj3ls
@Hector-bj3ls 6 ай бұрын
Super simple he says... proceeds to use words no one with an IQ under 9000 understands.
@Hector-bj3ls
@Hector-bj3ls 6 ай бұрын
Specifically: What is a combinator? Why can they interact? What interactions are we talking about? What does it mean to copy one? What does it mean "to connect up their input wires"? What is a compute location? What is a function form?
@nandans2506
@nandans2506 6 ай бұрын
It's just pure functional programming to be honest
@Kram1032
@Kram1032 6 ай бұрын
​@@Hector-bj3ls all of those things are best explained through pictures I'm afraid. The diagrams in the paper are pretty good though. Here are my best tries: You can think of a combinator as almost like an assembly instruction for computations. I don't think "why" they interact is a good question: They do so "by definition". The questions is really "how". There are different kinds of combinators that interact in various ways. These interaction combinators are among the simplest though. I don't actually know why they are called interaction combinators rather than anything else, but I'd say they interact with each other? Whenever two combinators encounter each other, they annihilate or "pass through each other" in a copy step. - What that means is very easy to show in a diagram and very hard to only put in words. However, you can see that diagram in this video. It's the one where a pair of combinators turns into four. The triangles are the combinators. They have one input and two outputs each, given by the lines. A compute location is whenever two combinators are directly connected along the input. The term "function form" isn't anything rigoros. That was my handwavy term. Basically, a seemingly magical property of these combinators is, that you can compute a lot of things in a *sublinear* number of steps. Sometimes even in O(1) And the programs you write for that often look quite naive. A toy example is to apply "not" to a bit like quadrillions of times. - Obviously, it's quite easy to say whether the outcome is the same or the opposite as you start with simply by looking at your enormous number in the quadrillions and check the least significant bit (check if it's even or odd) However, *naively* you might just go "oh apply not and then not and then not ..." across those quadrillions of steps. It'd take way too long to do that sequentially, even on modern GPUs. But by the magic of Interaction Combinators, defined in certain precise ways, you can take even this really stupid naive program and it'll give you the result in essentially as much time as the parity check would've done. However, whether this works depends on how you define your "not" function. IIRC it was like this: If you have your classic church-encoded bools: True = \t f -> t False = \t f -> f basically just a pair of singletons, where the left pair is considered True, and the right pair is considered False Then there are two seemingly equivalent versions of Not: not_a = \b -> b False True not_b = \b t f -> b f t The first definition explicitly assigns True to False and False to True. The second one simply says "swap what you get". Using the first definition, you will *not* achieve any speedup with repeat application. It will stay linear. The second definition, however, will allow interaction combinators to discover *sub expressions* that are identical. So when you get something like not not not not not not not not True the first definition will just sequentially do: not = not_a not ( not ( not ( not ( not ( not ( not ( not True ))))))) which is linear. But the second will end up doing something like not = not_b (((not . not) . (not . not)) . ((not . not) . (not . not))) True which can be simplified to: a = (not . not) b = (a . a) x = (b . b) True effectively using only three steps. By construction, it is guaranteed that your combinators will *always* find this optimal form with the fewest numbers of steps, so long as your function is defined in a way that can be turned into a tree like that. The algorithm it finds is equivalent to Exponentiation by Squaring where you go a = x * x b = a * a x^8 = b * b It'll do that without you having to cleverly think about how to do this efficiently yourself rather than using an expensive pow(x, 8) So long as your function has a reasonably tree-like form (or whatever), it will find the optimal way. And moreover, every single compute step is completely local, so if you ever have multiple places that can be reduced at the same time, those places can be safely evaluated in parallel without fear of race conditions or anything like that. I think that's also the reason why bend doesn't directly offer loops and wants you to use recursion instead. It makes it so you are kinda forced into a style that's more likely to take advantage of this kind of speedup. Perhaps with time some syntactic sugar will make that more straight forward.
@Flakelolz
@Flakelolz 6 ай бұрын
13:45 Clippy warns you about this things. The specific lint rule is called "let_underscore_future". Clippy should be mandatory when writing Rust imo, it has so many helpful warnings.
@edumorango
@edumorango 6 ай бұрын
Another Brazilian language 🇧🇷
@alexandrecolautoneto7374
@alexandrecolautoneto7374 6 ай бұрын
BR mentioned, carai
@aldi_nh
@aldi_nh 6 ай бұрын
vamos
@josemarques3454
@josemarques3454 6 ай бұрын
Brasil sil sil sil
@zerorusher
@zerorusher 6 ай бұрын
Vai Taelin!
@greidinger-reis
@greidinger-reis 6 ай бұрын
BRAZIL MENTIONED
@novantha1
@novantha1 6 ай бұрын
As someone who is the target audience of this language, that call out at the end felt super weird, lol
@reviraemusic
@reviraemusic 6 ай бұрын
As a brazilian aware of how Ideology works, that also felt weird.
@eNtrozx
@eNtrozx 6 ай бұрын
Out of curiosity, how are you the target audience? what do you do?
@novantha1
@novantha1 6 ай бұрын
@@eNtrozx Distributed linear algebra across a variety of devices with the intent of deploying various MLP and Transformer blocsk in edge and consumer facing applications. This language is really interesting because it's a lot more ergonomic than writing GPU kernels. Even if it was, say, 10% slower, if it saves you 90% of the dev time it's worth it because CUDA engineers and ML engineers are pretty expensive right now.
@SpacialCow
@SpacialCow 6 ай бұрын
Weird in which sense?
@graham8316
@graham8316 6 ай бұрын
Why weird? I thought it was A+ v funny
@victormurphy3511
@victormurphy3511 6 ай бұрын
Adult education in mathematics ... Fast Python ... Loops that don't suck ass ... Check Check Check. I am delighted, as I'm going to use for Weather and Climate analysis... Thank you for the video and your point of view as when I came across this language I thought it was to good to be true. Awesome.
@victormurphy3511
@victormurphy3511 6 ай бұрын
@@bbourbaki Grift ?
@oldtools
@oldtools 5 ай бұрын
You can't use math to make yourself a seer. To predict the weather requires personality.
@victormurphy3511
@victormurphy3511 5 ай бұрын
@oldtools6089 then i said your call is important to us 🤣🤣🤣 yes math is actually a lie because airline companies are a conspiracy as they use flying carpets and magic because we all live on a flat earth... 😉 ... lol 😆 🤣 😂
@drdca8263
@drdca8263 5 ай бұрын
@@oldtoolslol, no
@oserodal2702
@oserodal2702 6 ай бұрын
Lowkey, Bend isn't even that guy's most impressive work (it's HVM).
@KBIZWORLD
@KBIZWORLD 6 ай бұрын
Real
@dowiee2694
@dowiee2694 8 күн бұрын
HVM is actually written really poorly ngl look at the rust interpreter source
@oserodal2702
@oserodal2702 8 күн бұрын
@@dowiee2694 The better interpreter is written in C and CUDA
@meandsee
@meandsee 6 ай бұрын
Literally in December “Advent of Code in bend”
@TecnocraciaLTDA
@TecnocraciaLTDA 5 ай бұрын
The creator is a friend of mine, he is called Victor Taelin, he is from Brazil and he is a very skilled language creator, he made more than 5 programming languages already and he is a workaholic as sh*t
@Jaood_xD
@Jaood_xD 6 ай бұрын
"Mutalisks" sounds like a scary flying creature from star craft 😁
@lmnk
@lmnk 5 ай бұрын
That's just hydralisks but they also mutated from all the radiation and stuff (like ninja turtles, y'know), so now they are mutalisks
@danielandresvasquezprieto9902
@danielandresvasquezprieto9902 6 ай бұрын
Perhaps the most impressive part about this all, and is something that's not mentioned in the video, is that the HVM compiler can in fact compile from other languages (given that touring computation based languages are equivalent to lambda computation ones, and lambda computation ones can be then converted to the interaction combinators) So you can like write javascript or python or whatnot c, and compile ir with the HVM and boom, you haven't changed a single line of code and your program runs on gazillion threads and fucking fast
@SimGunther
@SimGunther 6 ай бұрын
Those interaction combinators look so cool and mind bending
@Ekce
@Ekce 6 ай бұрын
It's really cool but I noticed that while their relative benchmarks compare against CPU they also mention that their "single core performance is still extremely sub-par". So that 57x speedup may not really be accurate. I do have an advanced education in mathematics, but I don't really understand how this language works. I'll have to spend time reading through their paper. My initial expectation was that the paper would describe the language in terms of category theory/type theory (especially after seeing the string diagram looking diagrams) but that's not the case. There are a lot of new domain specific languages (DSLs) being created and studied in research labs all over the world these days (for many applications including concurrency, database updating, parallelism, message passing, etc..). Many of them offer many promising specialized features but most are ultimately just research projects not intended for widespread use. In the future, the hope is that they will lead to good and mature languages for many things. I don't know if that's the case with Bend but it would be good to get an interview with the developers to learn more about it as there is very little information on their website (e.g., who is behind it, is there a future roadplan, is there funding, etc..). Also on a sidenote, I don't think the transpiler/compiler distinction is really that meaningful these days. For instance, the Java compiler is really just a transpiler down to Java bytecode, which is then interpreted by the JVM (unless you're running on ARM in which case the JVM is implemented as a stack machine in microcode and in that case the Java compiler really is a compiler).
@alainzscheile6913
@alainzscheile6913 6 ай бұрын
oh their parallel performance is also still extremely sub-par (compared e.g. to haskell, I haven't seen a comparison with Python single-core or multiprocess perf yet)
@VivekYadav-ds8oz
@VivekYadav-ds8oz 6 ай бұрын
Well the parallel performance is just a multiple of the single-core performance, so that statement stlll makes sense. If they improve their single-core perofrmance, all of the metrics will improve, but (ideally) would stay in the same ratio.
@MartinJaniczek
@MartinJaniczek 6 ай бұрын
Bend compiles Lambda Calculus to Interaction Combinators (see also Interaction Nets), and HVM is a parallel runtime for these.
@isodoubIet
@isodoubIet 6 ай бұрын
Guy Steele spent several years in Sun's labs designing precisely this (it was called Fortress then, suggesting a "secure fortran"). Eventually he got to some problems they couldn't really solve and the whole project was scrapped.
@IsmeGenius
@IsmeGenius 6 ай бұрын
@@VivekYadav-ds8oz Their single-core is in Rust, multi-core in C and massive-core in CUDA, they will have to improve each thing separately.
@PeterFaria
@PeterFaria 6 ай бұрын
Coolest thing I’ve tried yet. Can’t wait to see where it goes
@monolith-zl4qt
@monolith-zl4qt 5 ай бұрын
I am a prophet: it'll go absolutely nowhere!
@reviraemusic
@reviraemusic 6 ай бұрын
Brazilians are really proud of this, Prime.
@Zoragna
@Zoragna 6 ай бұрын
There are programming models that detect dependencies which are "high-level" where you give a sequence of intructions and it becomes a parallel program (OpenMP kinda gets you there, task-based runtimes, ...)
@nicholasfigueiredo3171
@nicholasfigueiredo3171 6 ай бұрын
This will be super-useful to me. I was programming in python for machine learning and a lot of time I had to write C++ code and a wrapper but parallelizing is fucking hard. I only did this when I needed to do some sort of data manipulation that numpy/pandas/matplotlib didn't allow(they covered all data analysis up to date) but when you want to modify the sub-arrays inside an image they sometimes fall short. I would need to fallback into python for the manipulation but not kidding python is AT LEAST 3 orders of magnitude slower then whatever non-parallelized crap I write in C++ to do the same job and any non-parallelized crap I write in C++ is already considered slow to be useful in consumer hardware.
@vitalyl1327
@vitalyl1327 5 ай бұрын
Write in OpenCL then. C++ is not suitable.
@nicholasfigueiredo3171
@nicholasfigueiredo3171 5 ай бұрын
@@vitalyl1327 The problem was the data transfer since I don't know OpenCL very well so when I did that it was slow swapping the data between the openGL part of the code and the numpy part. That's the reason I used C++ together with PyCuda. I believe they refactored my old code to CUDA PYTHON/Cupy some magician did the manipulation in Cupy directly if I am not mistaken. I will prob have to read a lot of code to understand when I get back to the company in october thanks for the suggestion. Also if you know how to that transfer faster or some documentation showing that would be very helpful OpenGL would allow us to use a couple of AMD GPUS we have sitting there idle even if the perfomance isnt as good
@dsdy1205
@dsdy1205 5 ай бұрын
Finally, something to run my teetering tkinter monolith at faster than 5 seconds per frame
@complexity5545
@complexity5545 6 ай бұрын
Bend is basically haskell's design and approach to parallelism. Interesting.
@dmolast-kv8jg
@dmolast-kv8jg 6 ай бұрын
21:46 ah yes, the first phase, denial
@gavinpaull1793
@gavinpaull1793 4 ай бұрын
I’m definitely gonna try using this. I work in data science at a university and I think this could definitely speed up my terribly implemented parallel python scripts for linear algebra and entropy analysis.
@commarchinin
@commarchinin 5 ай бұрын
Oh no, Fireship missed that python threads aren't parallel... The Global Interpreter Lock means it's only ever one thread running at once in python, so python threads only help with IO bound stuff
@BryonLape
@BryonLape 6 ай бұрын
Multi-threading is straight forward when you stay out of the "shared mutable state" quadrant.
@pranavbadrinathan6693
@pranavbadrinathan6693 6 ай бұрын
Ah the `bend` keyword seems to be a sort of generator for recursive datatypes? the HOF `fold` (left and right) consumes recursive data types, and `bend` produces them. The example shown in the video at 20:36 creates a binary tree with depth 3, for example. Really cool! If only these languages were not python like lol. I hate the syntax, as I much prefer curly braces and the flexibility that comes with that than whitespace-scoping in python-like languages. Also, TYPES! I sincerely hope there is a way to enforce strict typing in this language.
@gralha_
@gralha_ 6 ай бұрын
There's also a haskell/ml-like syntax you can use
@agustinpizarro
@agustinpizarro 5 ай бұрын
What do you use braces for? In the end you are indenting your code properly, right?
@pranavbadrinathan6693
@pranavbadrinathan6693 5 ай бұрын
@@agustinpizarro Preference, mostly. I have used a ton of Python and GDScript, but I simply can't get used to the indentation based scoping. It's so hard to tell which block you are in if you have multiple levels of indentation, vs using braces where it's super easy to tell with just a glance. While it's just plain bad to have too many levels of indentation, braces-scopes are so much easier to distinguish with lots of indentation, especially if you are going from an indented line to a non indented one. Also, accidentally indenting something to a different scope than expected is much easier with indentation, and I've done it far too many times. Also, if you really need, you can have an arbitrary scope with braces, which you can't with indentation. Python will just error. And yes, I have used this before.
@agustinpizarro
@agustinpizarro 5 ай бұрын
​@@pranavbadrinathan6693 Unless you have syntax highlighting fir your braces in your IDE and you are looking for the right color of the brace (which not always works), i still wonder how having extra characters added (braces) without any strict indentation rules, helps you find that you are in the right scope.
@pranavbadrinathan6693
@pranavbadrinathan6693 5 ай бұрын
@@agustinpizarro Distinguishing between 3-4 indentation levels on screen at once is easier with braces imo. I can see a closing brace and know the next line is the previous scope. I usually use 4 space indents, and find it harder to figure out scope changes as quickly.
@jimhrelb2135
@jimhrelb2135 6 ай бұрын
So a more structured MapReduce. It's so good because now you get the benefits of a type system among ADT abstraction, with the benefits of how many infrastructure is in place ready for MapReduce-like environment. Big if true
@ansidhe
@ansidhe 6 ай бұрын
Another feeling that I just got: it may be a magic box analogous to Kolmogorov-Arnold Networks that just apply analytical approach to perceptron activation functions to reduce multiple simple ones into a single one that is more complex mathematically. As long as you can keep within the consistent boundaries of mathematical rigor, analytical calculus can work magic for you, like the Fourier transform, convolutions or Taylor series. Or the Karnaugh maps.
@patrickl5290
@patrickl5290 5 ай бұрын
What is analytical calculus in this context?
@ansidhe
@ansidhe 5 ай бұрын
@@patrickl5290 Whenever the term „calculus” comes up, it mosty gets associated with integrals and derivatives - whereas in fact it has a much broader meaning, as in lambda calculus for example. What I had in mind here though was functional analysis as opposed to numerical methods or matrix algebra. To give a more practical example: if there is a known integral of a function or if a compound or convolution of functions can be analytically transformed into a simpler form over the whole number domain - you win without any doubts. The real life problem is that usually the reality very rarely conforms to ideals and the analytical approach has to give way to numerical approximations that are a brute force approach essentially. Replacing bilions of params with hundreds or thousands but which describe more complex analytical building blocks - like b-splines or trig-functions (for potential Fourier transform approach proposed in the comments here) - would be a great reduction in numerical load.
@TheLouisEric
@TheLouisEric 6 ай бұрын
They missed a great opportunity here. The main process exit command should have been over();
@ajmgdaj
@ajmgdaj 6 ай бұрын
In all the outrage the one chatter goin "We STUPID?" somehow ... got me right in the chuckles ... seriously, when you are reading this it is still going on...
@MaxHaydenChiz
@MaxHaydenChiz 6 ай бұрын
Fold is more than just reduce. It's "universal" in that you can have full Turing completeness without imperative for loops using folds. They map well to modern hardware. This is a promising idea that's complex to execute. I hope he succeeds though. This isn't something that should require Haskell or other exotic tooling in order to use.
@tophy9865
@tophy9865 5 ай бұрын
All loops can be implemented using just recursion. The lambda calculus is turning complete. You don't need loops at all. I have no idea what you mean that it's more universal.
@MaxHaydenChiz
@MaxHaydenChiz 5 ай бұрын
@@tophy9865 I didn't mention recursion. I was talking about folds. Folds are a universal construct. So are certain combinators. Typically, in toy languages used to study programming language theory, you may have a language with branches and loops, but no recursion. There are other ways to achieve similar results.
@tophy9865
@tophy9865 5 ай бұрын
@@MaxHaydenChiz I'm still not sure what you mean when you say it's universal. My point is that omitting loops is quite normal for Turing complete languages. All you need is something that can do the same thing. Fold (which can be implemented as a general recursive function) is one way to do this.
@MaxHaydenChiz
@MaxHaydenChiz 5 ай бұрын
@@tophy9865 We are talking past each other. Prime said that fold was "just reduce". Folds are not "just reduce". They are more general. Any loop can be replaced by a fold. (This is more or less how Scala implements loops under the hood IIRC.) Not all loops can be replaced by a reduce. Yes. We could *also* replace all loops with recursion. But that is not relevant to my statement that you can have an imperative language that only understands folds but not loops and not recursion and still be Turing complete. We could also use the combinators in Haskell's G-machine for that matter. Or any of a large number of other primitives. So I don't understand what point you are trying to make. But hopefully I've made mine clear.
@tophy9865
@tophy9865 5 ай бұрын
@@MaxHaydenChiz Can you explain how it's more general? Do you just mean that it works on any stream?
@Oscaragious
@Oscaragious 6 ай бұрын
"Everyone virtually in this chat will never use language" We'll see.
@Hebruwu
@Hebruwu 6 ай бұрын
Do you use CUDA, OpenMP, or MPI? If not, I doubt you’ll need it. Seems like a language targeted at heavily computational fields
@Oscaragious
@Oscaragious 6 ай бұрын
@@Hebruwu Yet, it's not.
@isodoubIet
@isodoubIet 6 ай бұрын
@@Hebruwu I use CUDA regularly; roll my own parallelism on the cpu side. Little bit of tbb here and there. There's basically a 0% chance that something like this would be competitive with our custom solutions.
@tui3264
@tui3264 6 ай бұрын
most people in chat writes javascript, lol they don't need performance not gpu programming 😅
@JohnUrbanic-m3q
@JohnUrbanic-m3q 5 ай бұрын
Don't call it "massively parallel" unless it is at least multi-node, and tens of thousands of cores (with the potential to go to millions). Like MPI, for example. This is just multi-threading.
@MMetalRain
@MMetalRain 6 ай бұрын
I would guess the downside is memory usage, I'd assume Bend needs to build full execution graph (interaction net) in memory and then make at least partial copies when net is reduced. More traditional algorithm can loop over structures and modify them in-place. However not having to think parallelism so hard can produce unexpected speedups in some algorithms.
6 ай бұрын
About the rust underscore issue @13:00 - set the type of the underscore to the type of the returning function and when it changes you get the error as intended. For example let _ : Result = run_fun(); You can also tell clippy to bug you if you forget to do so.
@MorningNapalm
@MorningNapalm 6 ай бұрын
LOL, that async comic is like smoking. There were 99 non-smokers in a room. Then a smoker entered. Then there were 100 smokers.
@nicgeorge6126
@nicgeorge6126 6 ай бұрын
Programming languages are becoming as common as JavaScript frameworks
@dead-claudia
@dead-claudia 5 ай бұрын
inb4 bend compiles to js
@agustinpizarro
@agustinpizarro 5 ай бұрын
FP with thread optimizations has entered the room.
@solagratiasolafide
@solagratiasolafide 6 ай бұрын
Prime: I don't know that lambda calculus terminology. Also Prime: I believe it's called a catamorphic operation. 😂
@marcsh_dev
@marcsh_dev 2 ай бұрын
A similar (sounding at least) language, is Halide. Its built on top of the dreaded C++, but it is really cool. Its a bit more "manual", but provides a straight forward way to test different layouts of the same data.
@darianschnose6177
@darianschnose6177 6 ай бұрын
I'm absolutely going to use it! Not professionally probably, but just because it's neat. I'll probably write a couple applications then go back to JS
@rdubrdub
@rdubrdub 6 ай бұрын
Seems like the peak Advent of Code language
@sentinelav
@sentinelav 6 ай бұрын
I'm slowly reading through the original paper on Interaction Combinators and it's blowing my mind. If you can comprehend it, Bend represents the future of high-performance software. Moore's law has found a stopgap in the domain of groundbreaking theory.
@palmberry5576
@palmberry5576 6 ай бұрын
??? It doesn’t fundamentally speed up anything though, it just seems to represent more things as trees (kinda? Not even though really?)
@sentinelav
@sentinelav 6 ай бұрын
@@palmberry5576 Have you had a chance to check out the original paper? They've essentially created the parallel equivalent of a Turing machine.
@Takyodor2
@Takyodor2 5 ай бұрын
It's not going to get better performance compared to handwritten parallel code. The promise is to make it easier to write fast-ish parallel code.
@sentinelav
@sentinelav 5 ай бұрын
@@Takyodor2 I don't know, the ability to massively parallelise even basic arithmetic across 16k GPU threads is a massive challenge in any coding language.
@Takyodor2
@Takyodor2 5 ай бұрын
@@sentinelav It's really not. If you know C++, and read about the memory model of GPU's for a few hours, you could easily parallelize problems with inherent parallelism in CUDA (or OpenCL). On the other hand, if the problem _doesn't_ trivially translate into massive parallelism, you will either A) not be able to utilize all those GPU threads, and get better performance with fewer CPU threads, or B) perform a whole lot of extra work on the GPU, synchronizing and performing duplicate calculations, and get better performance with fewer CPU threads. Many threads does not mean automatically faster!
@ShrinathBalakrishnan-rs2ko
@ShrinathBalakrishnan-rs2ko 5 ай бұрын
There is a part of my codebase that has a complexity of O(n4) which to some degree has been optimised using Dynamic Programming (i.e, caching) to O(n3), but this calculation has to run many times a minute and with a growing dataset, I was considering moving this to CUDA.... After a lot of research, I hit upon the C++ CUDA wall. I know that if I stepped into it, even for this part of the codebase, it would be a minefield area for the rest of the team including myself if I don't look at it for a while. This sounds interesting to me. Thanks mate!
@Dekharen
@Dekharen 6 ай бұрын
The point about parallelism is SO true. I mean it's true of so many interactive elements of code, or even libraries at time. Like, interacting with the raw output from a speaker in Rust; look at the example and it's the easiest thing in the world, but try to do something with it and you run into race conditions, you are moving data around in closures, and need to keep track of them while they get multithreaded ; you're probably going to end up multithreading both receiving the data and processing it, while needing for it to be in order, and so many other possible issues.
@seedmole
@seedmole 5 ай бұрын
Shaders are sick, I delved into them earlier this year, nothing else ever felt so complicated to get started.. in the end you get multiple layers, mainly one doing all the vertices in parallel and one doing all the pixel colors in parallel, and it uses a notation basically the same as running through a for loop across the x axis with one inside it for running across the y axis (or vice versa, i forget which order they actually use -- and i'm even more lost on how the vertices are all indexed).
@JaredHatesGames
@JaredHatesGames 6 ай бұрын
The start of this video is an extremely concise summary of learning any programming language
@JackDespero
@JackDespero 5 ай бұрын
I want to learn it to call myself a code bender.
@Kiyuja
@Kiyuja 6 ай бұрын
while we probably wont just jump head first into this, maybe it lays the groundwork for something amazing in the future. What I meant to say is: Bend me over 'til I fold.
@dillbourne
@dillbourne 4 ай бұрын
"Check out this new thing! it's easy! just python!" - proceeds to write a hieroglyphic script that makes python look sane.
@sharkinahat
@sharkinahat 6 ай бұрын
Me brain too smooth for this.
@edusandalo
@edusandalo 6 ай бұрын
22:48 the idea of the language is exactly the opposite of what you're saying here! bend's whole existence is to try to make parallelism simpler, so you _don't_ need the adult education in mathematics to use it
@TurtleKwitty
@TurtleKwitty 6 ай бұрын
He meant more in the sense of, if you're not a mathematician you likely don't have a usecase for this no matter how cool it sounds
@kiseitai2
@kiseitai2 6 ай бұрын
It would be nice if this lead to another form of optimization in compilers. Although it looks like the user is expected to prime the program by writing an operation in a specific form, maybe someone can map common patterns into patterns that the hvm can then parallelize. The computation kernels might need a further pass in which you turn the instructions into simd compatible operations so our cpus can cook hooooot. Haha. But yes, I won’t be using it directly. I struggle as it is to convince people to let write a small utility in Rust.
@isodoubIet
@isodoubIet 6 ай бұрын
It's a pure functional language so yes math phds are the only audience.
@edusandalo
@edusandalo 6 ай бұрын
@@isodoubIet we're trying to make the language so you don't need a math phd to use it! for example, the `fold` operation could be defined mathematically as a catamorphism like primagen said in the video, but we're adding plenty of syntax sugar to make it less daunting
@paxdriver
@paxdriver 6 ай бұрын
Parallel is only hard if you're worried about linearly scaling ram and power, otherwise you could just make a hard copy of every process at the time of splitting, respawn on failure.
@shiccup
@shiccup 6 ай бұрын
Doesn't this mean that nontraditional accelerator cards are viable now? Like cards from tenstorrent which are specifically for ai. The main disadvantage was that it didn't have cuda but if you run bend you would actually take full advantage of all the parallel cores so now you get better than 4090 performance for 1/4 the price???
@nilssab
@nilssab 5 ай бұрын
Given the focus on tensors in new hardware, it would be really cool if it bent the code so that anything that could be written as tensor multiplication, is.
@andrewdunbar828
@andrewdunbar828 6 ай бұрын
a transpiler is a compiler. it's a subcategory.
@trickeddev
@trickeddev 6 ай бұрын
w take
@nevelis
@nevelis 6 ай бұрын
Trans piler awareness month coming up
@vitalyl1327
@vitalyl1327 5 ай бұрын
I hate idiots who even use the term "transpiler". Dumb code monkeys invented it, it has nothing to do with any academic CS.
@oldtools
@oldtools 5 ай бұрын
Thank you. Sometimes I feel like everyone just wants there to be compilers and runtimes. Get freaky. Believe in yourself.
@notsojharedtroll23
@notsojharedtroll23 5 ай бұрын
​@@nevelis😂😂😂
@luigi4622
@luigi4622 5 ай бұрын
i loved how wonderful was the conclusion in the end of the video 🤣
@lukeskywalker7029
@lukeskywalker7029 6 ай бұрын
Great final take at the end. Cant wait to put my hands on it and benchmark it against CUDA and Triton!
@newsofthenerd
@newsofthenerd 6 ай бұрын
Glasgow Haskell Compiler mentioned! Bend is just functional programming.
@tomlee7073
@tomlee7073 5 ай бұрын
1 problem: If you're someone that programs in Bend, are you then known as a Bender?
@paladynee
@paladynee 5 ай бұрын
I can't wait for the time where they are done optimizing and the thread creation overhead is the only culprit of performance
@isodoubIet
@isodoubIet 6 ай бұрын
This is a language where easy-to-parallelize things are trivial and hard-to-parallelize things are impossible.
@klex3905
@klex3905 6 ай бұрын
This is actually kind of special. Maybe most people don't target algo's in everyday work, but for those people who do, like game physic engineers, maybe some other who need to work with some evaluations/simulations etc. This makes their lives so much more incredibly quicker, MAYBE less reliable, depends on the actual output of it's compiler. But I'm here for it, physics rendering in general, if this optimizes instead of just 'facilitating' could honestly change a lot quicker than we've ever seen.
@gammalgris2497
@gammalgris2497 6 ай бұрын
The memory footprint would be interesting. More interesting is at which point there is a real benefit, i.e. how to write the code to really benefit from parallelism. The small example (see formulas) would rather cause more overhead than benefit.
@beofonemind
@beofonemind 6 ай бұрын
Been waiting for you to go over this.
@Raziaar
@Raziaar 6 ай бұрын
Even a well known algorithm, name your shit better than single character things, jesus.
@usershilov
@usershilov 5 ай бұрын
With Go I used multithreading for a data extract as a beginner and honestly it was pretty easy. It was only extracting chunks in parellel because of some dependencies but go routines made it pretty simple. I didn't know how lucky I was to be using Go I guess.
@larjasoul
@larjasoul 4 ай бұрын
if the package manager ends up slapping, this language will take over
@xslashsdas
@xslashsdas 6 ай бұрын
Bend Over LMAO
@brain.yogurt.5.56
@brain.yogurt.5.56 6 ай бұрын
One point that not mentioned at all is that python doesn't run in parallel even if you have parallel code, because of the Global Interpreter Lock
@oxyht
@oxyht 5 ай бұрын
Multiprocessing?
@agustinpizarro
@agustinpizarro 5 ай бұрын
Until you use 3.12... or numba
@DrJaneLuciferian
@DrJaneLuciferian 5 ай бұрын
I can see a use for it in trading strategy backtesting. I've been looking better solutions than jumping into the deep end with elixir.
@ansidhe
@ansidhe 6 ай бұрын
I’ll have to read the paper and hope for some >1% grok ratio… 🤯😉 But on the surface this HVM magic feels a bit like BEAM magic - which would be a very promising prognostic 👍🏻
@krilektahn8861
@krilektahn8861 6 ай бұрын
Something to consider would be the substantial power draw increase for 5x faster by spawning 1000x more threads. An M3 doesn't peak anywhere near a 4090.
@ansidhe
@ansidhe 6 ай бұрын
Also, the reduction rules for combinator interactions feel strangely similar to the Conway’s game of life… 😉
@marcosmoreira4277
@marcosmoreira4277 6 ай бұрын
I'm gonna make a lib on it to measure weather conditions, it's gonna be called "Air Bending"
@mpilosov
@mpilosov 6 ай бұрын
spent a day trying to write a matrix dot product in this. absolutely infuriating.
@TecnocraciaLTDA
@TecnocraciaLTDA 5 ай бұрын
And yeah, VIctor Taelin programs in Haskell, C++, TypeScript, Idris, Coq and AGDA.
@cannaroe1213
@cannaroe1213 6 ай бұрын
I came to the chat because im datascientist, this was great, dont assume your audience is all JS kiddies they just talk the loudest :)
@MeriaDuck
@MeriaDuck 6 ай бұрын
In my favorite language, Java, I did a short test LongStream.range(0, Integer.MAX_VALUE). parallel ().sum(). One hundred times in a 3 seconds.AMD 3900X CPU. a) thats 30ms average b) Only specify what I want, not how to do that. Plain old hotspot jvm (openjdk 22) doing actual magic. Give that, I'm eagerly waiting for java to unlock gpu programming.
@oakley6889
@oakley6889 6 ай бұрын
I immediately picked up this language, I have a DNA alignment algorithm I was going to rewrite with threading, but bend could actually be better!
@anarchymatt
@anarchymatt 6 ай бұрын
immutable by default data and controlled side effects makes parallelization easier
@TueChristensenDK
@TueChristensenDK 6 ай бұрын
I tried it today. Didn't further than trying to open my csv-file and I think I should be somewhat of the target audience coming from mathematics and into data science/numerical computations... It seems awesome - hate the typeless python style (love python though), will check back in a few release to see more
@aminzarei1557
@aminzarei1557 6 ай бұрын
Well bad news for you prime. Based on statistics, there are multiple Js frameworks being built on top of this, and also react team planing to use it in react 20 😂
@nathaaaaaa
@nathaaaaaa 6 ай бұрын
This guy's a fucking genious, hes the one behind HVM
@andythedishwasher1117
@andythedishwasher1117 6 ай бұрын
My counterpoint to your conclusion that we won't use it is that someone will probably build a game engine on it with a cute little visual editor for the noobs to play with. Sounds like a cool idea, anyways. They're already touting its shader capabilities, so that's a solid start to attracting the engine development community.
@ansidhe
@ansidhe 6 ай бұрын
I’m really hoping there is an „over” keyword in that bend lang… to make every bend like more powerful or sth 😉🙃
@hesam-init
@hesam-init 6 ай бұрын
dude end of the video got me tho shiiiiet real prime time xDDDD
@blahblahblah118
@blahblahblah118 6 ай бұрын
It's an interesting idea and I'm glad somebody tried it but IMO computers today just aren't designed for a guarantee like anything that can run parallel will. Generally when threading stuff in C++ there is no real fine grained parallelism opportunitites that actually result in perf gains because the overhead is so high. If you were to do something like do a parallel find in a vector, you would need to have 200k+ items per thread to overcome the synchronization costs and then maybe you should be using a hashtable and be near O(1) time.
@seyedhusseinmirzaki8056
@seyedhusseinmirzaki8056 6 ай бұрын
21:44 emotional damage
@airkami
@airkami 6 ай бұрын
I applied for a Data Science position I may use this
@adamhenriksson6007
@adamhenriksson6007 6 ай бұрын
It will also eat up all your memory like it is Chrome if you fuck up. FUN!
@ezbody
@ezbody 26 күн бұрын
How do we solve the theory of everything? -- Just write a TOE funtion.
@dipereira0123
@dipereira0123 6 ай бұрын
Prime shoving some light In FACT that in the end we are just CRUD-makers drowlling over some grown-ups language LOL
@MorningNapalm
@MorningNapalm 6 ай бұрын
Using special languages with hyper-parallelisation without a special need is like premature ej^H^Hoptimisation.
@descendency
@descendency 6 ай бұрын
I can't wait for 100 hours of using bend.
@SuperUtilisateur
@SuperUtilisateur 6 ай бұрын
You are right to think it's a thing made by math people, because it is, the original paper author (the one from 1990) is seemingly only doing theorical stuff. I don't know if that's related to that work, but he also wrote (in French) on his website in some comic form: "Dear Dr. Galileo, your research project has been evaluated by our committee of experts from civil society and the socio-economic world. There is no economic value to it! No industrial partnership!" If that's related, maybe his thesis will finally get some economic value to it? Idk.
@ErazerPT
@ErazerPT 6 ай бұрын
The plural of Mutex is Mootahs... ;) Very efficient, but prone to deadlocks if they face a Ravenous-Thorus conflict condition...
HaskLUL
25:25
ThePrimeTime
Рет қаралды 102 М.
The Most Amazing Software Ever Created
20:02
ThePrimeTime
Рет қаралды 383 М.
Симбу закрыли дома?! 🔒 #симба #симбочка #арти
00:41
Симбочка Пимпочка
Рет қаралды 3,9 МЛН
World’s strongest WOMAN vs regular GIRLS
00:56
A4
Рет қаралды 48 МЛН
how to never write bug
7:20
Fireship
Рет қаралды 902 М.
Building An Ascii Particle System
1:45:39
TheVimeagen
Рет қаралды 134 М.
Java Is Better Than Rust
42:14
ThePrimeTime
Рет қаралды 312 М.
Gitlab DELETING Production Databases | Prime Reacts
17:27
ThePrimeTime
Рет қаралды 348 М.
The Pain Of Frontend Dev | Prime Reacts
21:42
ThePrimeTime
Рет қаралды 292 М.
The Amazing Return of the FORTRAN Programming Language!
10:09
Dr Ganguli
Рет қаралды 123 М.
Why I Quit Copilot | Prime Reacts
35:56
ThePrimeTime
Рет қаралды 324 М.
iTerm2 Adds AI - Internet Explodes
23:10
ThePrimeTime
Рет қаралды 110 М.
Rust and RAII Memory Management - Computerphile
24:22
Computerphile
Рет қаралды 233 М.