LLVM in 100 Seconds

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

ความคิดเห็น • 1.1K

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

    this was the most intense 100 second video yet, loved it

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

      Dude I was sweating all along, hahaha. Building your own language is definitely a bit more complicated than HTML, let’s say 😅

    • @ev.c6
      @ev.c6 2 ปีที่แล้ว +11

      Not if you did computer construction and program analysis during your university. 🙂

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

      I was high while watching it, 10/10 experience, would recommend

    • @ernestechie
      @ernestechie 2 ปีที่แล้ว

      Does anyone knows the file icon theme fireship uses??

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

      Yeah even when I had no audio for some reason

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

    One of the biggest upsides to LLVM that rarely gets talked about is simply the fact that it added competition to GCC. GCC as a compiler has simply gotten much better, much faster thanks to the competition of LLVM and it's compelling licensing.

    • @oxelfer7898
      @oxelfer7898 ปีที่แล้ว +7

      @@PefectPiePlace2 yeah also you might wanna email the author to add "rarely gets talked about except for PerfectPiePlace2, who is the first thing he mentions when talking about the subject".

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

    Been reading and hearing LLVM for years without knowing what it was. Thankyou Fireship for this, now I know ✨

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

      Dude, I just googled it and found tons of results right away
      (but of course: fireship rocks, I agree)

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

      We all have something like that. After sometime we find a missing fundamental piece and everything connects.

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

      @@TheRealChiults You usually don't google everything you hear about

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

      @@Coyannn I do

    • @bilalkureshi7437
      @bilalkureshi7437 2 ปีที่แล้ว

      @@Coyannn point

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

    The majority of compilers output an intermediate language. The advantage LLVM had over GCC is that, which GCC has an intermediate, it is kept entirely in memory between compiler phases. This means that adapting it to other languages was difficult, and thus GCC makes a poor module in a set of compiler tools. LLVM has an intermediate file format.

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

      GCC could be made more modular internally, for example by adding a plugin API. However, this was resisted for a long time by Richard Stallman because he was afraid it would be (mis)used to hook proprietary code into GCC and thereby evade the GPL.
      This allowed LLVM to get an edge in areas where GCC could not compete.

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

      @@lawrencedoliveiro9104 Yes, it would have been used as a back stage for a commercial compiler. I don't really see that as much of a "danger" these days, since there aren't that many commercial compiler operations. Most of the ones I know of are compiler groups within organizations, that use them for special projects and optimizations (like my company does).
      LLVM is BSD (open license). So the point is basically moot now. LLVM is a more modern project, so I am sure some would say better, although I have heard different opinions on this matter. I personally don't use anyone else's back or front ends, I have always preferred to write my own.

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

      @@lawrencedoliveiro9104 I thought GCC already had plugins ? Isn't the ODB compiler a GCC plugin ?

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

      Yet another compiler compiler( yacc )?

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

      @@mnoxman yacc does not really determine any formats (like intermediate). Its a tool.

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

    Creating my own compile in college actually help me visualize how programming works and I believe it made me a better programmer.

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

      Sounds like a job interview sentence

    • @1ycx
      @1ycx 2 ปีที่แล้ว +14

      @@mathisd who knows, he might be interviewing

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

      @@1ycx every programer is constantly being interviewed 0_0

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

      im doing it in highschool on my own and im suffering
      Its done

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

      Always true

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

    We definitely need a full tutorial on making our own language.

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

      1 ) Parse the text to an internal IR
      2 ) Transform that to LLVM IR
      3) Enjoy ;)
      Perhaps you could help me build Nemesis and learn together! Let me know if you are interested!

  • @danfg7215
    @danfg7215 ปีที่แล้ว +261

    In college a few years before LLVM was invented I thought how cool it would be to have a universal language that could represent any other language since they're all so similar. I remember jokingly telling my logic teacher I'd come up with it. It's not the same as LLVM but it took me way too long to find out about its existence, and it's way better than I expected (not that I'd have the technical know-how to pull that off anyway).

    • @TBadalov
      @TBadalov ปีที่แล้ว +47

      The question is how do we become that guy who would have the technical know-how to pull that off anyway?

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

      @@TBadalov tell me when you find out

    • @utkua
      @utkua ปีที่แล้ว +47

      ideas are cheap especially in CS, it's the implementation that counts.

    • @danfg7215
      @danfg7215 ปีที่แล้ว +43

      @@utkua agreed. It's just reassuring to know it wasn't a bad idea.

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

      @@mandemlistening6373 read the docs

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

    Language maker: "Wait, It's all written in C++?"
    LLVM developer: "Always has been"

  • @PhuongNguyen-zb2en
    @PhuongNguyen-zb2en 2 ปีที่แล้ว +448

    I once have to write a programming language in a course in my university. That's pretty interesting and funny. The process is exactly thru 4 parts like the video!

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

      I think you are lying to show yourself

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

      @@Abdurrahman98XX Dude, In some Vietnamese Top University for Computer Science we actually have `Principle of Programming Language` course to write a compiler via 4 main steps as the video demonstrated.

    • @haras-unicorn
      @haras-unicorn 2 ปีที่แล้ว +60

      @@Abdurrahman98XX i had to write a compiler as well and idk whats a lie about this - heres how we did it (we reduced step 2 and 3 in the video into a single step though):
      1.) lexer (source code => list of tokens)
      2.) parser (list of tokens => ast)
      3.) optimization (optional) (ast => ast)
      4.) generator (ast => machine code)
      5.) optimization (optional) (machine code => machine code)

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

      We also did something similar, but we were in teams by 4 people. We had to make simplified copy of Golang (without goroutines and without most of standart API missing).
      It was very nice project assignment, and I think every programmer should try it at least once in lifetime (doesn't matter if compiler or interpret).

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

      @@mabed6692 which language did you use

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

    Always insane to see how one single guy invented some really important piece of technology we all use but no one has heard of

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

      More insane that billion dollar companies ride on the back of this software and he's not driving a Lamborghini and drinking Mei Tai's by his Olympic size swimming pool at his Malibu summer house

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

      Chris Lattner workee at Apple for a spell (maybe he still is)
      he was on the Lex Fridman podcast iirc

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

      Same with Lua language.

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

      He is not alone. there are thousands of people contributing on LLVM.

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

      He also created the Swift language while at Apple. Then he went to Tesla, then Google, then SiFive, and now he has started his own company Modular AI. Most of the developer community has definitely heard of him.

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

    Love how you're breaking the comfort zone from web-related stuff!!!!

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

      As Wasm becomes more mainstream, all this will become "web-related stuff."

    • @tavusion
      @tavusion 2 ปีที่แล้ว

      @@PefectPiePlace2 I hope that changes with the next generation of web devs

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

      @@swattalks7624 mechanics can't just know how to drive cars, they have to know how to fix it too, just using and not knowing what or why, you're just being a simple user, you're a programmer, not a user, you have to have control over the machine, not the other way around, you don't become a chef knowing how to cook cup noodles, you don't become a mechanic knowing how to change oil (English is not my mother tongue, sorry for any spelling mistakes)

    • @heraclitoqsaldanha6133
      @heraclitoqsaldanha6133 2 ปีที่แล้ว

      @@swattalks7624 mechanics just fix cars, programmers make and fix programs

    • @lalathealter6513
      @lalathealter6513 2 ปีที่แล้ว

      @@heraclitoqsaldanha6133 it were you who made such a stupid comparison in the first place. How many Logic classes have you slept through?

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

    It is mind blowing that a person can create a tool that is used in like almost all languages.

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

    Took a course this year at UBC diving deep into LLVM and writing LLVM compiler passes to perform static analysis to find bugs and errors in programs. Definitely one of those undergrad courses that I felt privileged to take since it is rarely taught at most universities. This prof was at UIUC when work was being done on LLVM and is a real OG. This was the first time he delivered this course. Not sure if any course materials are available online but the course is CPEN400P.

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

    Dude you just explained a semester's worth of my compile construction course content with actual practical examples/implementation in 2 minutes

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

      100 seconds* xD

    • @aurelia8028
      @aurelia8028 11 หลายเดือนก่อน +4

      these comments are so dumb. You will never get the same from a youtube video as you will from an actual university course

    • @tanko.reactions176
      @tanko.reactions176 9 หลายเดือนก่อน

      @@aurelia8028 you will never get the same from an university course as you will from just sitting down with pure passion and curiosity, forgetting time.
      that is only true way of learning. this video may spark that. a uni course is mandatory and will have the opposite effect.
      check yourself.

    • @lucascamelo3079
      @lucascamelo3079 5 หลายเดือนก่อน

      ​​@@aurelia8028That's true, but the point is: What you get from university in 6 months isn't that a lot better. Actually if you what to deeply learn something, you better be implementing that thing for yourself, rather than in a university class.

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

    Great subject! Perhaps one of the most important recent software inventions. You could focus more on tools and less in libraries or programming languages, perhaps. They are great but there are so many cool tools out there

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

      > GNU Make has entered the chat.
      Possibly the single most versatile tool in my programming arsenal, purely because of its simplicity.

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

      Recent.

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

      @@ToadalChaos 'most versatile.., purely because of its simplicity' doesn't make sense. I'm sure there are more simple tools in your programming arsenal that are less versatile.

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

      @@frydac GNU Make can automate tasks in almost any context. Agnostic of other tools, build systems, pipelines, languages, or frameworks. It has no complex dependencies or installation process (on linux, that is). Its simplicity is what allows it to be used for anything, hence its versatility. It is the only tool I've used in every project (almost) I've worked on since learning about it. I can't think of a simpler tool that approaches that level of versatility.

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

      @@ToadalChaosthe web it is. http, html, css, js. i think there is more versatility than in GNU

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

    This is one of those few videos of Fireship, where you don't understand anything about the code he is writing, but you still watch it till the end because this is FIRESHIP 🔥

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

      You don't understand anything because you're a web developer 😂. Web developers just use a bunch of libraries and isn't real programming, software engineers💪are the smart ones. That's why you don't understand you webdev, you're not an engineer.
      Average webdev: College is USELESS
      Average software engineer: got a degree in a 4-year university

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

      Gatekeeping so hard!

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

      @@steve4718 You gotta be a Jew to have that much pride.

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

      Yet your name is @@steve4718 and you have a Clash of Clans profile picture. Starting to believe you invent a life for yourself?

    • @Ahmad-lc1ln
      @Ahmad-lc1ln 2 ปีที่แล้ว +21

      @@steve4718 Tell me you are trolling

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

    Literally my entire compiler capstone course in 100 seconds. Love it!

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

    This steam of content is just insane fair play man

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

    Chris's wife Tanya is the head of the LLVM Foundation. She's also really fucking talented, like building compilers from scratch. Suppose they're actually 'soulmates'. Chris worked at Apple for a long time and created Swift. He's just bindbogglingly talented.

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

      And he is trying to replace Python with his new programming language Mojo.

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

    Last week i did the final examen for the subject Programming Language Development in my degree. We used ANTLR for the Lexer and Parser, i recommend it to anyone that do not really want to spend time implementing a Lexer and Parser by hand.

    • @AlexanderSuraphel
      @AlexanderSuraphel 2 ปีที่แล้ว

      Interesting I used GNU Flex and Bison while at college. Does ANTLR do both lexing and parsing?

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

      @@AlexanderSuraphel yes, you just have to define a grammar and ANTLR generates a Lexer and Parser

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

      @@martinbeltrandiaz Thanks I'll try it out

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

    Thanks, just created my first language and compiler while watching this video. Quality tutorial

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

      lol

    • @gavinderulo12
      @gavinderulo12 2 ปีที่แล้ว

      Bruh

    • @vaisakh_km
      @vaisakh_km 2 ปีที่แล้ว

      I just made a compliler for js and pythoh that can handle that can even compile all sorts of frameworks and libs..
      thanks for great tut
      🤠 only took 100 sec

    • @OzzyTheGiant
      @OzzyTheGiant 2 ปีที่แล้ว

      Now let's port TypeScript to LLVM

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

    Could you make a video about caches?
    Like the L1 - L3 caches and how it affects speed and how it differs from main ram?

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

      L1, L2, L2 cache is located in the cpu albeit in much smaller sizes than the main ram. Expect much higher speeds though

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

      smaller level cache -> closer to cpu -> faster access

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

      Probably better to make a video about the memory hierachy

    • @cw3dv
      @cw3dv 2 ปีที่แล้ว

      @Nicholas Needham ooh yeah

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

      @Nicholas Needham Recommend any specific ones?

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

    0:16 This is the perfect representation of my source code

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

    1:08 JeffScript looks very promising

    • @lazaraleksandrov2808
      @lazaraleksandrov2808 2 ปีที่แล้ว

      nice original function keyword you got there, mr. "fu {...} ck"

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

      Haha missed the part that it's called JeffScript 😂😂

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

      i asked an ai to make a programming language it came up with "simpscript"

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

    Oh hey, the Blue-Eyes White Dragon toolkit made it's debut on "in 100 seconds"!
    I know, very dead meme x) Still, it is an absolutely essential piece of software nowadays. The only thing that I have always wondered is, if it was possible to build libllvm and libclang as shared libs and link the implementations for Rust, Go, Swift, etc. to it to basically build a do-it-all toolchain. That'd be kinda epic and would make for a lovely modern build-essentials!
    Also, fun fact! LLVM is used in the PS3 emulator RPCS3 as a JIT method. It is effectively used to "re-compile" parts of the emulated game. If I am not mistaken, it takes care of the PPU code, whilst SPU shaders and alike are comverted beforehand so they can be just loaded in.

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

      why do weird things show up when I google your username

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

      what the fuck is furryfinity

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

      @@paulmccartney2327 ur so strange

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

    That’s amazing that I was able to build a whole compiler and less than 100 seconds. What an amazing video.

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

    this is like a 5 minute crafts tutorial: extremly complicated and time intensive stuff done in seconds, made to look easy, cheers!

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

      Minus the fake "crafts" that rarely work, and when they do, they are useless

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

      What Arjix said --> 100%
      Here, we end up with knowledge instead of garbage.

    • @nateo7045
      @nateo7045 2 ปีที่แล้ว

      @@DevranUenal lol no one's becoming knowledgeable about anything in 100 seconds, sorry.

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

      @@nateo7045 maybe you have different definitions. When I don’t know something, then look it up and get an answer/obtain knowledge, what do you call that?

    • @nateo7045
      @nateo7045 2 ปีที่แล้ว

      @@DevranUenal I looked up the definition before I commented just in case, and it means "well-informed'. 100 seconds might introduce you to a concept, but you're going to be far from knowledgeable about it. Anyway, I'm just nitpicking.

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

    I think I requested this under another video, but I'd love to see a "Laravel in 100 Seconds". Love your Content :)

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

      +1 for Laravel. It's the nicest framework ever

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

      @@frfrankie23 Laravel isn't PHP kek.
      The built-in tools provide abstractions over almost all of the disgusting PHP parts. It's very pleasant to work with an the ORM is the best I've seen.

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

      @@frfrankie23 Raw PHP is garbage but working with Laravel is a breeze. I mostly prefer Laravel over JS frameworks on my project.

    • @notanenglishperson9865
      @notanenglishperson9865 2 ปีที่แล้ว

      @@frfrankie23 your mom

    • @spicynoodle7419
      @spicynoodle7419 2 ปีที่แล้ว

      @@frfrankie23 yikes, at my job we always use the latest and greatest.

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

    Great! I'll put this on my resume! Thanks!

    • @perpetualsystems
      @perpetualsystems 2 ปีที่แล้ว

      You're basically an expert In LLVM now! I should do the same.

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

    One way that LLVM C++ Improves on all previous compilers is that it gives much better diagnostics when there is a syntax error. It will actually give you something like a stack trace when you have a function with a series of macro expansions and it will show you exactly at what stage the macro produced an error. No previous compiler comes anywhere close to this.

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

      I don't get it. Are you talking about errors when you create LLVM IR or what?

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

    I had presentation once about LLVM and Crystal lang. I always asked myself how is Crystal compiled and why isn't Ruby compiled when they are almost same language. And once I figured it out, I was mind blown.

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

      Why?

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

      Dude what you exactly did you figure out ? Just curious

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

      @@Supergecko8 Not the original author, here's what I think he was getting at:
      Ruby allows for rich runtime reflection, making it difficult* to compile Ruby to efficient machine code ahead of time. Crystal imposes additional constraints on values through its type system that reduce the runtime flexibility of the language in exchange for knowing the types of all values ahead of time, meaning efficient machine code can be generated. This flexible-rigid dynamic-static tradeoff is why Crystal is compiled while Ruby generally isn't.
      *Just-in-time (JIT) compilers for Ruby, like YJIT, compile Ruby to native code at runtime. JIT compilers run alongside your program, keep track of the types of values, and emit snippets of native code once types are fully known at a point (based on other heuristics too, mainly centered around whether the compilation overhead is worth it).

    • @DK-ox7ze
      @DK-ox7ze 2 ปีที่แล้ว +19

      Damn. I should have studied computer science in college to understand all of this.

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

      @@DK-ox7ze don't worry I did, some curriculums might teach you about compilers but I still don't know much about them. You can still learn this stuff online if it really interests you tho

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

    Video suggestion:
    Glob patterns in 100 seconds
    Thank you very much

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

    Interesting side note. LLVM is embedded into every android and ios device so it can be used to compile graphics shaders on the fly.

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

      Perhaps also ships with all modern browsers for WebGL?

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

    Nice to see some youtube coding content that isn't super casual.
    LLVM is something I should play with at least one.

  • @mr.stache
    @mr.stache 2 ปีที่แล้ว +27

    I was interested and thought I might use this to make my own language. I only understood approximately 1 in 5 words in the "create the programming language" section. 😅

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

    If you are reading this: God bless you man. Was looking for this exactly.
    Also Merry Christmas.

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

    The "IR" reminds me of the "IL" that JIT languages produce when compiled

    • @paulob.d.1210
      @paulob.d.1210 2 ปีที่แล้ว +6

      I would say it is closer to an unviersal assembly language

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

      Yes, however IR is in SSA form and contain PHI nodes (which is not executable as-is)

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

    Great topic. Cover more lower level topics like this 🔥.

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

    Your 100 Second videos are awesome.

  • @KevinHenke
    @KevinHenke 2 ปีที่แล้ว

    Love the casual "middle-end" drop.

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

    A video on Vulkan would be pretty dope. I love your content, cheers.

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

    I love the idea to start the function with FU and end it with CK :D

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

    As someone who has already built one low-quality scripting language and who is planning on hopefully building more programming languages, I saw this video and knew I had to watch it. Great content, keep it up!

  • @dromedda6810
    @dromedda6810 2 ปีที่แล้ว

    As soon as he started making the cpp file i got ptsd from when i worked as a developer for an inhouse game engine.
    Love these in 100 seconds videos!

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

    Probably a good idea to use flex and yacc (or similar) to generate your lexer and parser from simple grammar rules.

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

    You broke down llvm in 100 seconds. Absolute madness! 👏🏻

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

    Great content, easy to understand, you are the best 💪🏻

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

      this sheesh is not easy to understand lmao

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

      @@jardondiego Agree. I bet he didn't understand other than installing it.

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

      @@jardondiego if u already know compiler design or about compilers, the steps he mentioned are not hard to understand. For newbies, yes . It will be hard.

  • @arcaster9444
    @arcaster9444 2 ปีที่แล้ว

    If FIreship ever released a pro lesson on building your own language, I would absolutely pay for that without hesitation.

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

    2003? Wow it feels way older, like 20 years.
    Wait a minute...

  • @Y-anon
    @Y-anon 2 ปีที่แล้ว

    Finally a fireship video that doesn't make me want to throw away half of the tech I'm using in my project for some new shinies.
    At least I know that I can't be bothered to write a new programming language - yet

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

    This tool is harmful to productivity because of the cute dragon logo. I mean look at it!!! It's so adorable!!! You can barely take your eyes off it!

  • @theperson624
    @theperson624 2 ปีที่แล้ว

    I was literally watching one of your old 100 seconds video and I instantly got notification you dropped a new video 👍

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

    Hey Jeff, could you please do a video on the Nim programming language?

  • @johnsoukas2292
    @johnsoukas2292 2 ปีที่แล้ว

    You brought so many sleepless nights memories from computer engineering compilers course in 100seconds

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

    This is so interesting, makes me wonder, if they all compile to the same IR, what is then the advantage of one over the other? The syntax sugar? Or is the lexical analysis bit producing better IR in the case of one language? Anyway thanks for the video! I love this channel!

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

      I think there is no real difference outside human readability preference and the language's ecosystem. Most differences in high-level structuring are whittled down to the same dust in the IR optimization phase nowadays. Of course, the less junk you write in your high-level code, the more refined your machine code will be.

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

    This channel is the best to learn new things for brief introduction. Thanks a lot and well done!

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

    I love how you define functions in JeffScript 🤣

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

    LLVM has the best logo for a toolkit

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

    I have some questions, in all of these "100 seconds" videos that you make...how much of the stuff in the videos do you already know? And how much do you have to Google to make these videos?

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

      @Pavel Alexandru the problem is condensing everything into 100 seconds and presenting it in a concise fashion

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

    This is so good, I've come across llvm dozens of times while reading programming content and I've never had a good idea of what it actually was. This was a great video

  • @syntrax-og
    @syntrax-og 2 ปีที่แล้ว +9

    Actually, a tutorial about this would be so freaking awesome!
    Create a language that outputs `hello world` and does basic arithmetic `+,-,*,/`
    I would so watch that and follow along.

    • @thefekete
      @thefekete 2 ปีที่แล้ว

      In the mean time, watch David beazly's presentation on ply.. not llvm, but quite interesting still

    • @Diego01201
      @Diego01201 2 ปีที่แล้ว

      That's what you do when you take a compilers course

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

    Wow, thats a pretty good recap of my Compilers course almost 4 years ago while undergrad!!

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

    Good video as usual 🥳

  • @Unit_00
    @Unit_00 2 ปีที่แล้ว

    For the past 2 days I've been thinking how I would program my own language. Nice timing.

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

    I was waiting for this ❤❤❤
    Edit: I did not understand a single thing tho

  • @TheMR-777
    @TheMR-777 2 ปีที่แล้ว +1

    It was always in front of my eyes, and I never knew it's significance!
    Man, LLVM is awesome!

  • @abcdef-ms9mb
    @abcdef-ms9mb 2 ปีที่แล้ว +4

    Jeffscript is my new favourite language - I want nothing more from a language than functions opening with fu and ending with ck.

  • @alichamas63
    @alichamas63 2 ปีที่แล้ว

    Dude, your presentation skills are the bomb.

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

    I am learning python as my first your videos give me a better idea of what programing is and what programing languages are thank you so much!

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

      Yo, I don't think this video is a good source for learning python as your first. Good luck.

    • @xCwieCHRISx
      @xCwieCHRISx 2 ปีที่แล้ว

      @@excelelmira its about his other programming language videos genius.

    • @excelelmira
      @excelelmira 2 ปีที่แล้ว

      @@xCwieCHRISx Then why is it a comment under this video lol?

    • @yeetdeets
      @yeetdeets 2 ปีที่แล้ว

      @@excelelmira I don't think it's about his other videos specifically, but his videos in general.
      "your videos give me a better idea of [...] what programing languages are".
      Even if you are just writing a JIT compiled language like Python, understanding that it is still compiled is useful. Understanding how compilation happens is also useful.

    • @Effectery
      @Effectery 2 ปีที่แล้ว

      @@excelelmira I agree with both yeet and Xcwei

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

    this guy explained how to make a programming language in 100 seconds
    i'm making my own from 3 months and i'm still on the parser
    fireship is amazing

  • @aprithul
    @aprithul 2 ปีที่แล้ว

    I was trying to learn about llvm literally yesterday. Great timing!

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

    oooomg finally

  • @alexandrzhukov903
    @alexandrzhukov903 2 ปีที่แล้ว

    i was literally waiting for only 4 days for u to make this video. u can literally read minds

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

    Pro Hint: google: "crafting interpreters"

  • @nosferatunoir2740
    @nosferatunoir2740 2 ปีที่แล้ว

    As someone who had to build a prototype programming language and compiler, these 100 seconds gave me PTSD. Awesome video!

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

    time to make brainfuck++

  • @celalergun
    @celalergun 2 ปีที่แล้ว

    It's fast, direct, and informational. I'm a die hard assembly programmer but I really like high level programming languages. I'd like to learn Rust and Julia instead of Python.

    • @celalergun
      @celalergun 2 ปีที่แล้ว

      @@dahmainahgaimah2913 I had an 8086 with a monochrome screen and a diskette driver. I couldn't play computer games, also I got a virus at that time and decided to write one. Curiosity 😎

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

    me thinking html is hard...

    • @ItzPouriya
      @ItzPouriya 3 หลายเดือนก่อน

      😂😂😂😂 lmao

  • @moderneinstein2644
    @moderneinstein2644 2 ปีที่แล้ว

    Thanks a lot , Coincidentally, I downloaded LLVM-MINGW -×64 compiler today before viewing this to compile some C++ programs .

  • @ecampo123
    @ecampo123 2 ปีที่แล้ว

    You basically summarized the compilers course I took this quarter. Nice!

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

    I feel like my knowledge in c++ data structures and compilers from first years of cs just got a major blow

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

    i love internet content about compiler, it's always "all you have to do is write a parser who transform your code into an AST" yeah thank you very much, that's the hardest part. It's like saying "to drive a car you sit, turn the key and turn the wheel to set the direction" thank you very much thanks to you we know how to drive ;c)
    And no that book with a dragon on the cover doesn't help much, it's good to analyse existing parser but not much more. Oh and by the way no yacc and such don't help much neither as they can not fully express the syntax of a true everyday programming language, it has never been made for that and no surprise it's terrible at it. Doing the uni lab about parsing simple mathematics expression is by no mean representative of what it takes to parse real world full fledged programming language code. Remember the first chapter ? That little line that says "for context free grammar", well real world programming languages for most are NOT context free !!!
    The real benefit of LLVM or GNU compiler contrary to what is said here is to be able to reuse the f**ing open source frontends.

    • @inauinalu8640
      @inauinalu8640 2 ปีที่แล้ว

      ? parser is the easier of the bunch tho?? what i would say the hardest part of compiler design would be either the optimizer or codegen

    • @lolaa2200
      @lolaa2200 2 ปีที่แล้ว

      @@inauinalu8640 optimizer is just graph manipulation, if you want to achieve the pristine top maximum level of optimization yes it's difficult, but if you just want a reasonably usable compiler it's not that hard. Once again if you want super good optimization for free then just use LLVM middle layer. Once you have parsed your language to AST it's same for any compiler.
      For codegen well it really depends on your ISA. If it's a VLIW good luck to you, it's been nice to have known you ;c). If it's a RISC that's pretty straight forward. If it's a x64/x86 then just like previously said, it's hard to get premium performance but not so hard to get something reasonably usable. And if there is one place where it really makes no sens to reinvent the wheel it's there, writing a full backend from scratch for x64/x86 would be silly, both LLVM and GNU compiler provide excellent ones for free. Same if it's for arm. The only place where i might see me writing one from scratch would be to target a custom processor, then if you are the one designing the processor or have your word to say in the HW project, use riscV ISA that's why it's for. If it's just for the seek of diy just target a simple risc architecture, it's not that hard.

  • @iOSAcademy
    @iOSAcademy 2 ปีที่แล้ว

    This is awesome!

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

    Beautiful logo, yu gi oh style

  • @Zhung36
    @Zhung36 2 ปีที่แล้ว

    Thanks Jeff! I can put writing a new programing language and compiler in my resume now

  • @felixc.programs8209
    @felixc.programs8209 2 ปีที่แล้ว

    Great advices here! You motivated me to start my own Tech TH-cam channel and I hope one day it will grow like yours did. Thanks a lot!

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

    This is the best LLVM overview tutorial on the web. He condensed 2 advanced college semesters into 100 seconds. LLVM basically replaces the old school tools like bison+flex, yacc+lex, antlr.
    You can choose from different frontend languages like: C++ or Haskell. Haskell is less verbose than C++. Haskell is more popular in the U.K than in U.S.A. If a U.S.A. man goes the Haskell route, then you might have to teach yourself. Start with MegaParsec and Parsec for a Haskell tokenizer and parser all rolled up into one library. You can use both libraries together (for certain parts). I just wanted to add that because It took me like 2 years to actually learn all the different parsing libraries back in the day. I just want to save somebody some time of diddling around with the wrong stuff.

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

    Next video idea: Tensorflow in 100 seconds

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

    This is why im so excited for Mojo replacing Python. Chris Lattner is a genius.

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

    Finally I can add "Software Engineer" to my resume.

  • @MarkoSkace
    @MarkoSkace 2 ปีที่แล้ว

    Congratulations! Your channel is now officially a university course.

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

    I am happy whenever fireship releases a video 🥳

  • @surenshrestha9516
    @surenshrestha9516 2 ปีที่แล้ว

    Do one in Lisp. Talk about syntax, data is code, code is data, reader and writer macros. It will blow away most of the devs here.

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

    I love the fact that the logo is a dragon, which immediately resembles the dragon book.

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

    I'm taking a compilers class in college right now. If only I could write the compiler in 100 seconds.

  • @Aspiiire
    @Aspiiire 2 ปีที่แล้ว

    NOW!!! FINALLY!!!! I CAN go back to my work, thanks

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

    Are you kidding me,?? Like omg! I didn't even know this thing existed! And wow!

  • @ASDFG856
    @ASDFG856 2 ปีที่แล้ว

    thanks a lot for explaining on a high level how LLVM works

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

    Ok, basically this is a compiler of compilers

  • @atoooooooooooooom
    @atoooooooooooooom 9 หลายเดือนก่อน +1

    C++ was made in 1986, but LLVM was made in 2003, and C++ was made with LLVM.