Porting Compilers - Computerphile

Sdílet
Vložit
  • čas přidán 9. 10. 2019
  • Concluding his series on compilers and porting, Professor Brailsford takes the plunge and "T-Diagrams" his way over to a new machine.
    Previous Video: • Improving Intermediate...
    / computerphile
    / computer_phile
    This video was filmed and edited by Sean Riley.
    Computer Science at the University of Nottingham: bit.ly/nottscomputer
    Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com

Komentáře • 61

  • @xJackkHD
    @xJackkHD Před 4 lety +15

    I love Brailsford, he’s like the Attenborough of computers.
    More! More! More Computerphile!

  • @danielbakergill
    @danielbakergill Před 4 lety +123

    "The pope hasn't even written a compiler." -Terry A. Davis

    • @longlostwraith5106
      @longlostwraith5106 Před 4 lety +10

      Wiser words were never spoken. All praise God's chosen programmer!

    • @Gooberpatrol66
      @Gooberpatrol66 Před 4 lety +7

      St. IGNUcius has written a compiler.

  • @odpJatoUnitRecs
    @odpJatoUnitRecs Před 4 lety +50

    Brailsford seriously need to record some audiobooks. C for dummies, or Harry Potter would be a start ♥️

    • @hydrochloricacid2146
      @hydrochloricacid2146 Před 4 lety +1

      definitely

    • @casperes0912
      @casperes0912 Před 4 lety +2

      Very different genres, but both could work very well. I'd like the Harry Potter one the most as I don't need the C one, plus I don't think technical books work so well in audio form compared to written

    • @odpJatoUnitRecs
      @odpJatoUnitRecs Před 4 lety +1

      This guy would make it work. Trust

    • @Gooberpatrol66
      @Gooberpatrol66 Před 4 lety +3

      He should launch a tv show for kids teaching them computer science

  • @marsgal42
    @marsgal42 Před 4 lety +35

    I maintain several legacy applications that run on embedded 68k systems. The code is written in C and we use an antiquated (1994) compiler that runs on Solaris. I've built a gcc 68k cross-compiler on Linux with interesting results, but haven't convinced my boss to pursue it further.
    The boxes in question have ADSP-2181s in them as well, programmed in assembler.

    • @davids5a2
      @davids5a2 Před 4 lety +1

      What is the field of these legacy applications?

    • @longlostwraith5106
      @longlostwraith5106 Před 4 lety +1

      Oh, wow. Old factory equipment perhaps?

    • @marsgal42
      @marsgal42 Před 4 lety +6

      Paging systems. Yes, they still exist. :-)

    • @javabeanz8549
      @javabeanz8549 Před 4 lety +5

      @@marsgal42 still much cheaper and more reliable for places like hospitals, from what I understand.

    • @marsgal42
      @marsgal42 Před 4 lety

      Our target market is first responders, including hospitals. A niche product in 2019, but a good niche product has always been a license to print money. :-)

  • @esbenablack
    @esbenablack Před 4 lety +2

    This is a wonderful series!
    It really takes me back to my compiler course, but in a good way.

  • @TonyAlloa
    @TonyAlloa Před 4 lety

    Absolutely fascinating. Thank you very much.

  • @Kirillissimus
    @Kirillissimus Před 4 lety +1

    The thing to remember is that the trick relies on the assumption that high level code designed for one machine can be directly compiled on another one. Generally it is not the case because of different incompatiable environments and hardware features available on different platforms. So in practice porting tends to get a bit more complex and messy than described here.

  • @rikwisselink-bijker
    @rikwisselink-bijker Před 4 lety +15

    Every video I become more convinced that C has taken on the role of uncol or intermediary code.

    • @allenjunge4127
      @allenjunge4127 Před 4 lety +4

      Not quite. C is kind of like the standard language to create other languages and stuff. The real universal intermediate language is C's intermediary, LLVM.

    • @v4lgrind
      @v4lgrind Před 4 lety +4

      @@allenjunge4127 LLVM is a compiler, it has an IR, as does gcc, and most other compilers. The IRs are not the same.

    • @kuhluhOG
      @kuhluhOG Před 4 lety +5

      @@allenjunge4127 LLVM isn't the intermediate for every C compiler; the GNU Compiler Collection for example uses RTL

    • @mavhunter8753
      @mavhunter8753 Před 4 lety +3

      @@v4lgrind LLVM itself isn't a compiler, Clang is. LLVM is more so a framework for compilers.

    • @KuraIthys
      @KuraIthys Před 4 lety +1

      It's not surprising given what C was intended for, and what it commonly gets used for.
      C is the language of Unix, originally.
      But you can see that the majority of operating systems (aside from those written wholly or partly in assembly for various reasons) were written in C (maybe C++)
      Most of the Api's related to those operating systems were also written in C, and most high performance applications (again, aside from ones written in Assembly) tended to be written in C or C++ as well.
      Linux, like most unix-likes is mostly built on C, and even has C-like shell scripting languages.
      Windows has diversified over time due to Microsoft's .net system...
      But you'll still find the standard Api's are written with the assumption that C/C++ is in use, and access to these api's through other methods typically results from a wrapper that was written in C/C++
      The DDK (driver development kit) tends to discourage the use of C++, but it does mostly use C...
      Whether this is due to something specific about the language (perhaps it's relatively low level, high performance features, that closely approximate assembly while being slightly easier to work with and vastly more portable), or just a quirk of history...
      Who can say.
      But yes, C is a pretty central language to many things, and quite a few other languages have been implemented in C, rely on C for supporting functionality, or similar.
      (python is written in C/C++ and can interface with modules written in C. Java similarly largely depends on modules written in C/C++ for access to hardware features it doesn't natively support, such as advanced graphics handling...)

  • @coffeedude
    @coffeedude Před 4 lety +7

    It'd be nice to have the previous video linked!

    • @Computerphile
      @Computerphile  Před 4 lety +4

      Done - and for good measure: czcams.com/video/TiJn9D6lZ-Y/video.html >Sean

  • @ad_sh8240
    @ad_sh8240 Před 4 lety

    Great Video

  • @Diligent3294
    @Diligent3294 Před 4 lety

    YAY! We finally did it!!

    • @Roomsaver
      @Roomsaver Před 4 lety

      @MichaelKingsfordGray Ok, boomer

  • @RhinoBlindado
    @RhinoBlindado Před 4 lety

    I would love if you guys could make a video on Hoares Triples!
    If any viewer knows if they already have touched the topic, please let me know.

    • @C4rb0neum
      @C4rb0neum Před 4 lety +1

      Agreed. The more formal the more better!

  • @KryptKicker5
    @KryptKicker5 Před 4 lety

    So we’re porting the assembler one step at a time right? Write the assembler for new computer as B’ outputting B’’ then feed it the assembler code, which gives us a B’’ which is then fed everything else?

  • @bluppfisk
    @bluppfisk Před 4 lety +1

    Could you do a video on finding the Horadric Staff?

  • @SpoopyGamer
    @SpoopyGamer Před 4 lety +4

    9:30 , Chillin in the corridor?

  • @FrankHarwald
    @FrankHarwald Před 4 lety +1

    The Rubik's Cube in the background is finally solved - OCD-plagued can finally get some reilef. :)

  • @vtbn53
    @vtbn53 Před 4 lety

    ...and here I was thinking all you needed was a new back end, I'll have to recall all of my ports now.

  • @ImmortalDuke
    @ImmortalDuke Před 4 lety +1

    Compiling...

  • @AgentM124
    @AgentM124 Před 4 lety +2

    I tried writing a compiler. I regret it. I started over and made a simple desugarer to desugar to a known language so it can be compiled.

  • @quiet5811
    @quiet5811 Před 4 lety

    Teddy😺

  • @eclipse-xl4ze
    @eclipse-xl4ze Před 4 lety +2

    do more videos about AI please!

    • @geinko
      @geinko Před 4 lety +1

      More on compilers u mean?

  • @M-Wulff
    @M-Wulff Před 4 lety

    Can we please get a comment from some of the old boys on what is going on with webassembly with system integration (WASI) and how it let us run any code on any machine. Like: what would technology like this have meant for their profissional life if this was available when they started programming.

    •  Před 3 lety

      Why? Webassembly tries to do exactly the same thing as Java, and they already mentioned Java and Java bytecode (as a type of intermediate code). Of course, WA has an advantage over Java in that unlike Java, there's not some big company trying to control how people use it and suing people that do things they don't like, which has limited Java's usefulness as a universal platform, but that's not a technical issue.

  • @krasimirrangelov1767
    @krasimirrangelov1767 Před 4 lety

    Brailsford looks older than before.

    • @Halolaloo
      @Halolaloo Před 4 lety

      i think it is the lighting, in his other videos he was filme with the liight shining through the window behind

  • @bopDS
    @bopDS Před 4 lety

    this tude has the same chair as me lloool :D

  • @w3sp
    @w3sp Před 4 lety +1

    First Kappa

  • @Hofer2304
    @Hofer2304 Před 4 lety

    Couldn't the compiler be simpler if the editor checked and signed the code? If the editor is trustworthy, the compiler wouldn't need to check the syntax. The editor could even be much more restrictive than a standard compiler for this language. If the editor could do the type checking, it should do it.

    • @nosuchthing8
      @nosuchthing8 Před 4 lety

      Somethings only compile at run time though.

    • @Hofer2304
      @Hofer2304 Před 4 lety +1

      @@nosuchthing8 Every piece of code should be checked, and signed if it passes the test, and only signed pieces of code should be compiled. If the programm should read keyboard inputs, they should be checked before the program sees the correct inputs. Every input should be checked before the programm sees it and accepts the signed inputs.

    • @nosuchthing8
      @nosuchthing8 Před 4 lety

      @@Hofer2304 I admit to being a user of compilers. I don't know enough to comment on your proposal.

    •  Před 3 lety

      Prechecking would hardly help at all. Syntax or type checking isn't something a compiler does separately just to verify correctness. The compiler needs to make sense of the syntax and types in a program in order to create a correct program, it can't just choose not do it. Errors appear if the compiler can't make sense of it, thus, the error checking is pretty much free. Or at least the easiest part of it. Besides, such checks are done in the frontend (the H to I part), not in the backend part (the I to B part) this video focuses on. That's one of the advantages of the two-stage process he discussed: if don't need to rewrite the frontend, you don't need to reimplement the error checking.