The New Massively Parallel Language

  Рет қаралды 157,712

ThePrimeTime

ThePrimeTime

Ай бұрын

Recorded live on twitch, GET IN
Links
/ 1791213162525524076
By: / victortaelin
• Mind-bending new progr...
By: / @fireship
My Stream
/ theprimeagen
Best Way To Support Me
Become a backend engineer. Its my favorite site
boot.dev/?promo=PRIMEYT
This is also the best way to support me is to support yourself becoming a better backend engineer.
MY MAIN YT CHANNEL: Has well edited engineering videos
/ theprimeagen
Discord
/ discord
Have something for me to read or react to?: / theprimeagenreact
Kinesis Advantage 360: bit.ly/Prime-Kinesis
Hey I am sponsored by Turso, an edge database. I think they are pretty neet. Give them a try for free and if you want you can get a decent amount off (the free tier is the best (better than planetscale or any other))
turso.tech/deeznuts

Пікірлер: 486
@infernoplayzgames1684
@infernoplayzgames1684 Ай бұрын
"I'm not gonna use this..." you say that, then six months later we will see a "Learning the Bend Language" video.
@dylancode
@dylancode Ай бұрын
How can we take the language seriously when the promotional videos use light mode??!!
@mrs8683
@mrs8683 Ай бұрын
@@dylancode light mode is better for showcase
@dylancode
@dylancode Ай бұрын
@@mrs8683 Maybe in some cases... Depends what you prefer I guess!
@Machine_State
@Machine_State Ай бұрын
@@dylancode Light mode is fine actually -Light mode enjoyer
@crimiusXIII
@crimiusXIII Ай бұрын
Probably some AoC is my guess
@origamitraveler7425
@origamitraveler7425 Ай бұрын
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 Ай бұрын
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 Ай бұрын
HASKELL MENTIONED
@Adowrath
@Adowrath Ай бұрын
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.
@user-fc8xw4fi5v
@user-fc8xw4fi5v Ай бұрын
>compilation target for Haskell UM.... BASED!!!!
@derschnarz6657
@derschnarz6657 Ай бұрын
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 19 күн бұрын
sure, but there are many cases where not using them is not an option for correctedness.
@dipereira0123
@dipereira0123 Ай бұрын
This language is so advanced that we dont even have a problem for it to solve (YET)
@ThePrimeTimeagen
@ThePrimeTimeagen Ай бұрын
But you can imagine
@henriquemarques6196
@henriquemarques6196 Ай бұрын
You're not supposed to create the right tool for the problem, you're supposed to create the problem for the right tool
@iraklidarchiashvili2166
@iraklidarchiashvili2166 Ай бұрын
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 25 күн бұрын
The problem exist, it's called video games
@dtracers
@dtracers 24 күн бұрын
hobbyist wanting to get into GPU programming without needing to get into cuda
@stephanreiken9912
@stephanreiken9912 Ай бұрын
Multithreading is simple. Take two threads, put them into two different needles, sew two different sweaters simultaneoulsy, save the sweaters to your deskop, done.
@user-jo8dw8mg2w
@user-jo8dw8mg2w Ай бұрын
Now do it with 16000 CUDA whatever threads to feel really multi-sweatering :)
@braineaterzombie3981
@braineaterzombie3981 Ай бұрын
Just ​Get an industrial grade thread with heavy machinery@@user-jo8dw8mg2w
@daweed695
@daweed695 Ай бұрын
@@user-jo8dw8mg2w thats what i do to get 100 average fps in my games, just they all seem to come in batches of 16000 for some reason
@baxstart9008
@baxstart9008 Ай бұрын
@@user-jo8dw8mg2w i'd be multi-swearing
@darekmistrz4364
@darekmistrz4364 Ай бұрын
@@baxstart9008 Faster then ever
@edumorangobolcombr
@edumorangobolcombr Ай бұрын
Another Brazilian language 🇧🇷
@alexandrecolautoneto7374
@alexandrecolautoneto7374 Ай бұрын
BR mentioned, carai
@aldi_nh
@aldi_nh Ай бұрын
vamos
@josemarques3454
@josemarques3454 Ай бұрын
Brasil sil sil sil
@zerorusher
@zerorusher Ай бұрын
Vai Taelin!
@greidinger-reis
@greidinger-reis Ай бұрын
BRAZIL MENTIONED
@Flakelolz
@Flakelolz Ай бұрын
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.
@Kram1032
@Kram1032 Ай бұрын
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 Ай бұрын
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 Ай бұрын
Super simple he says... proceeds to use words no one with an IQ under 9000 understands.
@Hector-bj3ls
@Hector-bj3ls Ай бұрын
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 Ай бұрын
It's just pure functional programming to be honest
@Kram1032
@Kram1032 Ай бұрын
​@@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.
@willothy
@willothy Ай бұрын
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.
@meandsee
@meandsee Ай бұрын
Literally in December “Advent of Code in bend”
@novantha1
@novantha1 Ай бұрын
As someone who is the target audience of this language, that call out at the end felt super weird, lol
@reviraemusic
@reviraemusic Ай бұрын
As a brazilian aware of how Ideology works, that also felt weird.
@eNtrozx
@eNtrozx Ай бұрын
Out of curiosity, how are you the target audience? what do you do?
@novantha1
@novantha1 Ай бұрын
@@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 Ай бұрын
Weird in which sense?
@graham8316
@graham8316 Ай бұрын
Why weird? I thought it was A+ v funny
@victormurphy3511
@victormurphy3511 Ай бұрын
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 Ай бұрын
@@bbourbaki Grift ?
@oldtools6089
@oldtools6089 28 күн бұрын
You can't use math to make yourself a seer. To predict the weather requires personality.
@victormurphy3511
@victormurphy3511 28 күн бұрын
@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 18 күн бұрын
@@oldtools6089lol, no
@Jaood_xD
@Jaood_xD Ай бұрын
"Mutalisks" sounds like a scary flying creature from star craft 😁
@lmnk
@lmnk Ай бұрын
That's just hydralisks but they also mutated from all the radiation and stuff (like ninja turtles, y'know), so now they are mutalisks
@PeterFaria
@PeterFaria Ай бұрын
Coolest thing I’ve tried yet. Can’t wait to see where it goes
@monolith-zl4qt
@monolith-zl4qt Ай бұрын
I am a prophet: it'll go absolutely nowhere!
@SimGunther
@SimGunther Ай бұрын
Those interaction combinators look so cool and mind bending
@samuraijosh1595
@samuraijosh1595 Ай бұрын
When you take the aesthetic sexiness of Haskell and inject it into python:
@furkankaraslan9040
@furkankaraslan9040 Ай бұрын
so python is mother?
@oldtools6089
@oldtools6089 28 күн бұрын
Nothing doing pal. Just give it a pocket protector and put a propeller-beanie on it.
@oserodal2702
@oserodal2702 Ай бұрын
Lowkey, Bend isn't even that guy's most impressive work (it's HVM).
@KBIZWORLD
@KBIZWORLD Ай бұрын
Real
@dmolast-kv8jg
@dmolast-kv8jg Ай бұрын
21:46 ah yes, the first phase, denial
@reviraemusic
@reviraemusic Ай бұрын
Brazilians are really proud of this, Prime.
@beofonemind
@beofonemind Ай бұрын
Been waiting for you to go over this.
@TecnocraciaLTDA
@TecnocraciaLTDA Ай бұрын
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
@danielandresvasquezprieto9902
@danielandresvasquezprieto9902 Ай бұрын
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
@Mia-mf
@Mia-mf Ай бұрын
Fucking nightmare without types.
@d.lauzon
@d.lauzon Ай бұрын
so what's the deal with your account? ai nudes?
@henriquemarques6196
@henriquemarques6196 Ай бұрын
Maybe not for what they are trying to achieve. For me it looks like a domain-specific language, maybe they don't need types for the use case they're trying to achieve
@steinerkelvin
@steinerkelvin Ай бұрын
​@@henriquemarques6196Bend is intended to be simple and flexible, as well as a compilation/translation target. The statically typed language, with all the goodies like dependent types, will be built on top of Bend.
@vitalyl1327
@vitalyl1327 Ай бұрын
You need strictly typed compilation targets for performance.
@henriquemarques6196
@henriquemarques6196 Ай бұрын
@@steinerkelvin okay, that sounds very interesting. Can't wait to make a new "neofetch" using Bend.
@user-go5oe6td3k
@user-go5oe6td3k 16 күн бұрын
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.
@Ekce
@Ekce Ай бұрын
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 Ай бұрын
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 Ай бұрын
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 Ай бұрын
Bend compiles Lambda Calculus to Interaction Combinators (see also Interaction Nets), and HVM is a parallel runtime for these.
@isodoubIet
@isodoubIet Ай бұрын
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 Ай бұрын
@@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.
@Zoragna
@Zoragna Ай бұрын
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, ...)
@joelimbergamo639
@joelimbergamo639 Ай бұрын
The language is based on a French paper form the 90s which is really sould. But the syntax needs to be really restricted in order to apply the algorithm. So the challenge is to make a useful language with those constraints, a bit like rust (which might actually be porrible to add to the language with some macros)
@complexity5545
@complexity5545 Ай бұрын
Bend is basically haskell's design and approach to parallelism. Interesting.
@agustinpizarro
@agustinpizarro 24 күн бұрын
FP with thread optimizations has entered the room.
@solagratiasolafide
@solagratiasolafide Ай бұрын
Prime: I don't know that lambda calculus terminology. Also Prime: I believe it's called a catamorphic operation. 😂
@sharkinahat
@sharkinahat Ай бұрын
Me brain too smooth for this.
@nicgeorge6126
@nicgeorge6126 Ай бұрын
Programming languages are becoming as common as JavaScript frameworks
@dead-claudia
@dead-claudia 24 күн бұрын
inb4 bend compiles to js
@xslashsdas
@xslashsdas Ай бұрын
Bend Over LMAO
@TheLouisEric
@TheLouisEric Ай бұрын
They missed a great opportunity here. The main process exit command should have been over();
@lukeskywalker7029
@lukeskywalker7029 Ай бұрын
Great final take at the end. Cant wait to put my hands on it and benchmark it against CUDA and Triton!
@Oscaragious
@Oscaragious Ай бұрын
"Everyone virtually in this chat will never use language" We'll see.
@Hebruwu
@Hebruwu Ай бұрын
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 Ай бұрын
@@Hebruwu Yet, it's not.
@isodoubIet
@isodoubIet Ай бұрын
@@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 Ай бұрын
most people in chat writes javascript, lol they don't need performance not gpu programming 😅
@JaredHatesGames
@JaredHatesGames Ай бұрын
The start of this video is an extremely concise summary of learning any programming language
@JackDespero
@JackDespero 27 күн бұрын
I want to learn it to call myself a code bender.
@nicholasfigueiredo3171
@nicholasfigueiredo3171 Ай бұрын
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 Ай бұрын
Write in OpenCL then. C++ is not suitable.
@nicholasfigueiredo3171
@nicholasfigueiredo3171 Ай бұрын
@@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
@rdubrdub
@rdubrdub Ай бұрын
Seems like the peak Advent of Code language
@jimhrelb2135
@jimhrelb2135 Ай бұрын
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
@isodoubIet
@isodoubIet Ай бұрын
This is a language where easy-to-parallelize things are trivial and hard-to-parallelize things are impossible.
@dsdy1205
@dsdy1205 21 күн бұрын
Finally, something to run my teetering tkinter monolith at faster than 5 seconds per frame
@ansidhe
@ansidhe Ай бұрын
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 29 күн бұрын
What is analytical calculus in this context?
@ansidhe
@ansidhe 28 күн бұрын
@@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.
@osiristeam6959
@osiristeam6959 Ай бұрын
If you can replace loops with "folds", then you can replace "folds" with loops and achieve a more developer friendly experience, instead of needing to wrap my head around recursion for every loop I want to write. I guess there is a reason why they don't do this, feel free to tell me.
@theshadower5565
@theshadower5565 29 күн бұрын
Because when talking about consuming recursive values, imperative loop is a specialized version of Bend's fold, that only handles one branch at a time. On the other hand, fold consumes all branches of a recursive structure (like a tree) in parallel, which can't be achieved like a good old loop which runs linearly.
@ShrinathBalakrishnan-rs2ko
@ShrinathBalakrishnan-rs2ko 14 күн бұрын
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!
@commarchinin
@commarchinin 28 күн бұрын
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
@seedmole
@seedmole 22 күн бұрын
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).
@paxdriver
@paxdriver Ай бұрын
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.
@MaxHaydenChiz
@MaxHaydenChiz Ай бұрын
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 13 күн бұрын
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 13 күн бұрын
@@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 13 күн бұрын
@@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 13 күн бұрын
@@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 13 күн бұрын
@@MaxHaydenChiz Can you explain how it's more general? Do you just mean that it works on any stream?
@darianschnose6177
@darianschnose6177 Ай бұрын
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
@ajmgdaj
@ajmgdaj Ай бұрын
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...
@nilssab
@nilssab 13 күн бұрын
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.
@luigi4622
@luigi4622 26 күн бұрын
i loved how wonderful was the conclusion in the end of the video 🤣
@andrewdunbar828
@andrewdunbar828 Ай бұрын
a transpiler is a compiler. it's a subcategory.
@trickeddev
@trickeddev Ай бұрын
w take
@nevelis
@nevelis Ай бұрын
Trans piler awareness month coming up
@anonymousalexander6005
@anonymousalexander6005 Ай бұрын
Everything uses a transpiler besides I guess microcode, your assembly ain’t raw assembly-ing on most dogs 🐕
@henriquemarques6196
@henriquemarques6196 Ай бұрын
@@nevelis non-binary computation awareness month when?
@vitalyl1327
@vitalyl1327 Ай бұрын
I hate idiots who even use the term "transpiler". Dumb code monkeys invented it, it has nothing to do with any academic CS.
@tomlee7073
@tomlee7073 29 күн бұрын
1 problem: If you're someone that programs in Bend, are you then known as a Bender?
@Dekharen
@Dekharen Ай бұрын
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.
Ай бұрын
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.
@BryonLape
@BryonLape Ай бұрын
Multi-threading is straight forward when you stay out of the "shared mutable state" quadrant.
@natebennett8663
@natebennett8663 Ай бұрын
You had me at Tip to Tip
@MorningNapalm
@MorningNapalm Ай бұрын
LOL, that async comic is like smoking. There were 99 non-smokers in a room. Then a smoker entered. Then there were 100 smokers.
@kira.herself
@kira.herself Ай бұрын
yippie I waited for prime to look at this lang
@gammalgris2497
@gammalgris2497 Ай бұрын
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.
@user-shilov-
@user-shilov- 22 күн бұрын
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.
@pranavbadrinathan6693
@pranavbadrinathan6693 Ай бұрын
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_ Ай бұрын
There's also a haskell/ml-like syntax you can use
@agustinpizarro
@agustinpizarro 24 күн бұрын
What do you use braces for? In the end you are indenting your code properly, right?
@pranavbadrinathan6693
@pranavbadrinathan6693 24 күн бұрын
@@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 24 күн бұрын
​@@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 24 күн бұрын
@@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.
@TueChristensenDK
@TueChristensenDK Ай бұрын
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
@brain.yogurt.5.56
@brain.yogurt.5.56 Ай бұрын
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 Ай бұрын
Multiprocessing?
@agustinpizarro
@agustinpizarro 24 күн бұрын
Until you use 3.12... or numba
@DrJaneLuciferian
@DrJaneLuciferian 21 күн бұрын
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.
@newsofthenerd
@newsofthenerd Ай бұрын
Glasgow Haskell Compiler mentioned! Bend is just functional programming.
@hesam-init
@hesam-init Ай бұрын
dude end of the video got me tho shiiiiet real prime time xDDDD
@MMetalRain
@MMetalRain Ай бұрын
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.
@sentinelav
@sentinelav Ай бұрын
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 Ай бұрын
??? It doesn’t fundamentally speed up anything though, it just seems to represent more things as trees (kinda? Not even though really?)
@sentinelav
@sentinelav Ай бұрын
@@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 Ай бұрын
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 Ай бұрын
@@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 Ай бұрын
@@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!
@paladynee
@paladynee 28 күн бұрын
I can't wait for the time where they are done optimizing and the thread creation overhead is the only culprit of performance
@cheezedoodles3447
@cheezedoodles3447 Ай бұрын
he saw that tweet 🎉🎉🎉
@klex3905
@klex3905 Ай бұрын
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.
@airkami
@airkami Ай бұрын
I applied for a Data Science position I may use this
@ansidhe
@ansidhe Ай бұрын
Also, the reduction rules for combinator interactions feel strangely similar to the Conway’s game of life… 😉
@JonathanPlasse
@JonathanPlasse Ай бұрын
I will totally spend time to learn it
@ansidhe
@ansidhe Ай бұрын
I’m really hoping there is an „over” keyword in that bend lang… to make every bend like more powerful or sth 😉🙃
@Kiyuja
@Kiyuja Ай бұрын
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.
@Ginto_O
@Ginto_O Ай бұрын
how am i already seen this
@shiccup
@shiccup Ай бұрын
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???
@worgenzwithm14z
@worgenzwithm14z Ай бұрын
immutable by default data and controlled side effects makes parallelization easier
@rays3761
@rays3761 17 күн бұрын
Now I'm wondering if I used multi threading in my dash python web interface emulator where I simulate a day going by (causing many calculations) for each item so I have a thread calculate for each item. I believe if I remember my code. Works great but now I'm questioning it, did speed up the processing.
@mpilosov
@mpilosov Ай бұрын
spent a day trying to write a matrix dot product in this. absolutely infuriating.
@seyedhusseinmirzaki8056
@seyedhusseinmirzaki8056 Ай бұрын
21:44 emotional damage
@edusandalo
@edusandalo Ай бұрын
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 Ай бұрын
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 Ай бұрын
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 Ай бұрын
It's a pure functional language so yes math phds are the only audience.
@edusandalo
@edusandalo Ай бұрын
@@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
@descendency
@descendency Ай бұрын
I can't wait for 100 hours of using bend.
@santiagoale6232
@santiagoale6232 Ай бұрын
Why not using it for backend with c compiler? I think it could be usable for micro services
@krilektahn8861
@krilektahn8861 Ай бұрын
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.
@figloalds
@figloalds Ай бұрын
This blue/red function thing is so easy to solve just make every function async under the hood, if it returns a future type then it can be awaited, if not then just move on, how hard can this really be?
@TecnocraciaLTDA
@TecnocraciaLTDA Ай бұрын
And yeah, VIctor Taelin programs in Haskell, C++, TypeScript, Idris, Coq and AGDA.
@philn.4692
@philn.4692 Ай бұрын
mutalisks mentioned
@arcadus
@arcadus Ай бұрын
11:30 these are my exact thoughts re: c build systems
@logicalspaghetti
@logicalspaghetti Ай бұрын
Starcraft mentioned ❤
@102728
@102728 Ай бұрын
1:25 Microplastics Found in Human Testicles
@ds-1111
@ds-1111 29 күн бұрын
"Just run this code without any modifications and it can run on Cuda" - Yeah, but the code is using special data type and is written in case statement when it would normally be a loop in any other language. So you have to use the entire new language and rethink everything in terms of case statements. :/
@timmygilbert4102
@timmygilbert4102 25 күн бұрын
Half press moment
@guyblack9729
@guyblack9729 Ай бұрын
HASKELL MENTIONED LET'S GOOOOOO
@Raziaar
@Raziaar Ай бұрын
Even a well known algorithm, name your shit better than single character things, jesus.
Should You Still Learn To Code? | Prime Reacts
1:00:21
ThePrimeTime
Рет қаралды 228 М.
You dont know OOP
50:48
ThePrimeTime
Рет қаралды 287 М.
Каха ограбил банк
01:00
К-Media
Рет қаралды 10 МЛН
ROCK PAPER SCISSOR! (55 MLN SUBS!) feat @PANDAGIRLOFFICIAL #shorts
00:31
Popular Technologies that Won't be Around Much Longer...
14:36
Sideprojects
Рет қаралды 109 М.
The Perfect Programming Language
23:50
ThePrimeTime
Рет қаралды 353 М.
I Interviewed Uncle Bob
1:11:07
ThePrimeTime
Рет қаралды 309 М.
Migrating 3.7 Million Lines Of Code
23:06
ThePrimeTime
Рет қаралды 141 М.
How Figma Hacked Postgres Into Scalability
36:56
Theo - t3․gg
Рет қаралды 63 М.
They got away with this??
1:21:04
ThePrimeTime
Рет қаралды 1,2 МЛН
Why Does Diffusion Work Better than Auto-Regression?
20:18
Algorithmic Simplicity
Рет қаралды 203 М.
Quake In 13kb Of Javascript
57:13
ThePrimeTime
Рет қаралды 174 М.
Did Theo Recommend Go?? | Prime Reacts
1:25:45
ThePrimeTime
Рет қаралды 212 М.
How Many ERRORS Can You Fit in a Video?!
20:40
ElectroBOOM
Рет қаралды 2,2 МЛН
iOS 18 vs Samsung, Xiaomi,Tecno, Android
0:54
AndroHack
Рет қаралды 85 М.
cute mini iphone
0:34
승비니 Seungbini
Рет қаралды 4,8 МЛН
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 881 М.
🔥Идеальный чехол для iPhone! 📱 #apple #iphone
0:36
Не шарю!
Рет қаралды 1,3 МЛН