The UNCOL Problem - Computerphile

Computerphile · Intermediate ·📐 ML Fundamentals ·6y ago

Key Takeaways

The UNCOL problem explores the concept of a universal intermediate programming language, discussing its feasibility and challenges, with references to Java's byte code, C++, PostScript, and GCC's cross-compilation system.

Full Transcript

on computer file we just love provocative and mysterious titles and carrying on from the last time we spoke let's say this is going to be a chat about what it came to be called the on-call problem universal computer language i think it stands for it was more specific than just any old computer language it was is there a unique intermediate language which would suit everybody you know not as high as c even and not quite down at the absolute binary level but more like a sort of absolutely universal assembler a pseudo assembler it it's not really hardware implemented on any machine but it's it's one that we can all work with and every compiler in the whole world all they would have to do is produce the uncore language if we can only agree what it is and then every system could talk to every other system at this agreed low level well as you can imagine it doesn't work like that uh it very soon became only obvious that yes this business of putting a level in there and saying we'll all compile to intermediate code is fine but when you start looking at what facilities it should have what facilities it shouldn't have you're up against the fact that computer hardware designers like to do things their own way i mean numbers of registers might be 16 might be fewer that's no big deal some of them arrange those registers in a formal or informal stack others don't should we always assume that we have stack capabilities and i think as somebody pointed out to me i think ron ron knott who originally created these notes he said the thing in the end that kills you is that they all do input output differently there's almost no agreement about how you do io so fairly soon the idea of finding one unique intermediate language had to be forgotten about but the idea of different intermediate languages at different levels of sophistication really did gain traction in the 1980s we mentioned that steve bourne had his zed code as part of his alcohol 68 project way back in the early 80s a little bit later on i think it was in the 80s many of you will know this one better james gosling developed the language java in which he decided that pointers were dangerous and should be hidden but there in lane lies another story but the big thing that james made a feature of was to say i want my java systems to compile down to what he called byte code in other words it was a sort of pseudo assembler with really like single byte op codes like a and zed and whatever and yes byte code became flavor of the month we all go down to bytecode well then what do you do well you've got choices you could either write an interpreter for bytecode um which will be easy to change it will be a little slow a bit big if you really care passionately about having the ultimate super fast and efficient binary you could always compile the byte code um get it smaller and all that so you had options but the idea was that yes you would have an intermediate code even so it's not a one-size-fits-all it's still it was ideal for what james wanted to do but it's extensibility to be a universal panacea not so you see let me give you another good example of why some people might want to move the semantic barrier a bit higher i mean by code is fairly low level what about if we move it up so we're getting more airy fairy heaven knows you might encounter haskell way up there somewhere classic example of course is the development of c plus and as many of you know as its name implies it goes beyond c it adds classes and all sorts of other features too c and the idea from bjarna strewstrap the inventor was that to get something going in the first instance at least he would of course do the obvious thing he his compiler would compile a c plus plus down to c and then you could put it just through an ordinary c compiler for the back end so you see his uncle is at a much higher level of sophistication than pseudo assembler type bytecode level and you might say oh well that's great i mean it's obviously suits c plus plus to do that yes it did but there are big problems with this approach once you broadcast the fact that actually c plus plus your mach one compiler is producing c under the hood you will have the devil's own job in convincing benevolent hackers who think they can generate better c code than be honest true stroke can getting in behind the scenes and messing about with the way he does classes for example so i suppose what i'm saying more generally about this is that very often you will have a very good solution for language system to establish a bridge head and to get something working but in the longer run you might want a more direct version that isn't as prone to hacker intrusion gross abuse or just things going a bit wrong because of the nature of the intermediate language being so rich and having a mind of its own now you might say well that can't be an issue can it yes it can um because this whole question of level of your intermediate code this thing gets me there why do i need to go direct let me give you another example not c plus this time another well-known example for many of you is pdf it's been so well established for so long now since 1989 that many of you using it will not know that in the early days it came off the back of adobe's very successful language called postscript and postscript was there as you know the universal graphics language it drove laser printers it drove whatever is a wonderful achievement in order to get a pdf the way you did it originally was you compiled your postscript with an adobe provided utility called distiller but the problem was in many ways it was very graphically sophisticated but it was turing complete you could do anything in it and indeed i often thought well the next program i write in postscript before i do any type setting as ordered by the customer i will get my program to solve ackerman's function first can you imagine the delay i'm sorry i'm going to compute ackermann 3-1 before i turn my attention to doing your miserable little piece of typesetting but in principle you could have done that as long as it didn't run out of memory but you know i'm just saying this to make the silly point that that's perfectly doable you sometimes found that your pdf produced out of compiling postscript interstellar was yards bigger than the input not very often but sometimes so there again you see in order to stop abuse and to point the way to the future adobe very quickly said what we must do for those that don't know about postcode have no need for it is to give a direct route to pdf and they called it pdf writer back in the early days and then of course people not wanting to be bound into adobe quite rightly so fabulous what we need to do is to replicate something what distiller does we'll write utilities with names like ps2 pdf which you'll typically find in uh postscript offerings on linux and all this kind of stuff but it makes the point that very often that directness of approach gives you a good result and stops people messing about under the hood and doing things which are ridiculous and expensive if you start saying no from now on it's much quicker to go direct we know how to do it let's do it let's keep it clean so that is i guess i think a feature still i keep reading stories of people using intermediate codes for compiling programming languages who suddenly say well 20 years down the line we think intermediate codes are bad it's far better to do it direct in some other way and all he can say out of this is that every time you get into porting software you learn something every time about the pros and cons of having an intermediate representation or do you jump over it and go direct there is no universal right answer the more you look at the scene at the moment about program language implementation the more you realize that a huge number of the offerings out there might look to you like straightforward point-to-point compilers you know i'm running on a whatever i'm running on at the moment i'm running on an arm chip it's all self-hosted on the arm chip it compiles arm code for further use on further arm chips it doesn't do anything else not true if you look under the hood of gcc of course the stallman and the gnu effort did such a wonderful job in creating for us gnu version of cc when you look in there at the possible back ends for different architectures you realize it's really a cross-compilation system you can compile from anything to anything now other people other than the gnu effort got there eventually and realized the same thing i mean i think microsoft in the mid 80s actually had the nerve to develop something that i think they called intermediate language i don't know whether microsoft did try and actually copyright the phrase intermediate language but it's part of the same mindset it's not just them that apple and steve jobs always used to have it may have existed but it was done by a bunch of no hopers and until we discovered it packaged it marketed and put it for you you might as well think it never existed and that was jobs through and through but maybe all big computer companies have a little bit of this inside them it didn't really exist in a usable way until we discovered it that's an update variable a if i have the token so let's bring back friendly steve so we've now got a token and what we're going to say is that unless i've got the token i cannot access it delivers back the integer result in its local variable that it declares for itself for holding the answer and eventually of course look it's going to return

Original Description

Can there be a universal intermediate programming language? Sounds like Esperanto to us - Professor Brailsford has more. https://www.facebook.com/computerphile https://twitter.com/computer_phile This video was filmed and edited by Sean Riley. Computer Science at the University of Nottingham: https://bit.ly/nottscomputer Computerphile is a sister project to Brady Haran's Numberphile. More at http://www.bradyharan.com
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Computerphile · Computerphile · 0 of 60

← Previous Next →
1 Follow the Cookie Trail - Computerphile
Follow the Cookie Trail - Computerphile
Computerphile
2 EXTRA BITS - Follow the Cookie Trail - Computerphile
EXTRA BITS - Follow the Cookie Trail - Computerphile
Computerphile
3 Musical Floppy Drives - Computerphile
Musical Floppy Drives - Computerphile
Computerphile
4 The Hair Algorithm - Computerphile
The Hair Algorithm - Computerphile
Computerphile
5 Getting Sorted & Big O Notation - Computerphile
Getting Sorted & Big O Notation - Computerphile
Computerphile
6 Quick Sort - Computerphile
Quick Sort - Computerphile
Computerphile
7 Hyper History and Cyber War - Computerphile
Hyper History and Cyber War - Computerphile
Computerphile
8 Entropy in Compression - Computerphile
Entropy in Compression - Computerphile
Computerphile
9 Original Elite on the BBC B - Computerphile
Original Elite on the BBC B - Computerphile
Computerphile
10 IP Addresses and the Internet - Computerphile
IP Addresses and the Internet - Computerphile
Computerphile
11 A Career in Video Games - Computerphile
A Career in Video Games - Computerphile
Computerphile
12 Error Detection and Flipping the Bits - Computerphile
Error Detection and Flipping the Bits - Computerphile
Computerphile
13 Programming BASIC and Sorting - Computerphile
Programming BASIC and Sorting - Computerphile
Computerphile
14 Birthplace of the World Wide Web - Computerphile
Birthplace of the World Wide Web - Computerphile
Computerphile
15 Punch Card Programming - Computerphile
Punch Card Programming - Computerphile
Computerphile
16 Programming Paradigms - Computerphile
Programming Paradigms - Computerphile
Computerphile
17 CERN Computing Centre (and mouse farm) - Computerphile
CERN Computing Centre (and mouse farm) - Computerphile
Computerphile
18 Error Correction - Computerphile
Error Correction - Computerphile
Computerphile
19 Home-Made Code - Computerphile
Home-Made Code - Computerphile
Computerphile
20 Security of Data on Disk - Computerphile
Security of Data on Disk - Computerphile
Computerphile
21 Gesture Controls - Computerphile
Gesture Controls - Computerphile
Computerphile
22 How Intelligent is Artificial Intelligence? - Computerphile
How Intelligent is Artificial Intelligence? - Computerphile
Computerphile
23 Encryption and Security Agencies - Computerphile
Encryption and Security Agencies - Computerphile
Computerphile
24 Virtual Machines Power the Cloud - Computerphile
Virtual Machines Power the Cloud - Computerphile
Computerphile
25 Hacking Websites with SQL Injection - Computerphile
Hacking Websites with SQL Injection - Computerphile
Computerphile
26 How Huffman Trees Work - Computerphile
How Huffman Trees Work - Computerphile
Computerphile
27 Cracking Websites with Cross Site Scripting - Computerphile
Cracking Websites with Cross Site Scripting - Computerphile
Computerphile
28 Cloud Computing (Cloudy with a Chance of Pizza) - Computerphile
Cloud Computing (Cloudy with a Chance of Pizza) - Computerphile
Computerphile
29 Texting Cabbage with a Recorder - Computerphile
Texting Cabbage with a Recorder - Computerphile
Computerphile
30 Hashing Algorithms and Security - Computerphile
Hashing Algorithms and Security - Computerphile
Computerphile
31 How YouTube Works - Computerphile
How YouTube Works - Computerphile
Computerphile
32 How NOT to Store Passwords! - Computerphile
How NOT to Store Passwords! - Computerphile
Computerphile
33 A New Golden Age of Video Games - Computerphile
A New Golden Age of Video Games - Computerphile
Computerphile
34 A Universe of Triangles - Computerphile
A Universe of Triangles - Computerphile
Computerphile
35 Cross Site Request Forgery - Computerphile
Cross Site Request Forgery - Computerphile
Computerphile
36 The True Power of the Matrix (Transformations in Graphics) - Computerphile
The True Power of the Matrix (Transformations in Graphics) - Computerphile
Computerphile
37 The Great 202 Jailbreak - Computerphile
The Great 202 Jailbreak - Computerphile
Computerphile
38 EXTRA BITS - Printing and Typesetting History - Computerphile
EXTRA BITS - Printing and Typesetting History - Computerphile
Computerphile
39 Triangles to Pixels - Computerphile
Triangles to Pixels - Computerphile
Computerphile
40 The Problem with Time & Timezones - Computerphile
The Problem with Time & Timezones - Computerphile
Computerphile
41 The Visibility Problem - Computerphile
The Visibility Problem - Computerphile
Computerphile
42 Lights and Shadows in Graphics - Computerphile
Lights and Shadows in Graphics - Computerphile
Computerphile
43 The Penguin Barcode - Computerphile
The Penguin Barcode - Computerphile
Computerphile
44 Typesetters in the '80s - Computerphile
Typesetters in the '80s - Computerphile
Computerphile
45 The Font Magicians - Computerphile
The Font Magicians - Computerphile
Computerphile
46 The Little Mac with the Big Bite - Computerphile
The Little Mac with the Big Bite - Computerphile
Computerphile
47 EXTRA BITS - More on the Original Mac at 30 - Computerphile
EXTRA BITS - More on the Original Mac at 30 - Computerphile
Computerphile
48 XP to Ubuntu with an 8yr old Hacktop - Computerphile
XP to Ubuntu with an 8yr old Hacktop - Computerphile
Computerphile
49 EXTRA BITS - Hacktop Real-Time Boot Comparison - Computerphile
EXTRA BITS - Hacktop Real-Time Boot Comparison - Computerphile
Computerphile
50 EXTRA BITS - Making a Bootable USB in Linux - Computerphile
EXTRA BITS - Making a Bootable USB in Linux - Computerphile
Computerphile
51 EXTRA BITS - Installing Ubuntu Permanently - Computerphile
EXTRA BITS - Installing Ubuntu Permanently - Computerphile
Computerphile
52 The Dawn of Desktop Publishing - Computerphile
The Dawn of Desktop Publishing - Computerphile
Computerphile
53 What is Bootstrapping? - Computerphile
What is Bootstrapping? - Computerphile
Computerphile
54 Reverse Polish Notation and The Stack - Computerphile
Reverse Polish Notation and The Stack - Computerphile
Computerphile
55 Home-Made Z80 Retro Computer - Computerphile
Home-Made Z80 Retro Computer - Computerphile
Computerphile
56 Should Everybody Learn to Code? - Computerphile
Should Everybody Learn to Code? - Computerphile
Computerphile
57 Programming in PostScript - Computerphile
Programming in PostScript - Computerphile
Computerphile
58 Heartbleed, Running the Code - Computerphile
Heartbleed, Running the Code - Computerphile
Computerphile
59 YouTube's Secret Algorithm - Computerphile
YouTube's Secret Algorithm - Computerphile
Computerphile
60 YouTube Search & Discovery - Computerphile
YouTube Search & Discovery - Computerphile
Computerphile

The UNCOL problem is about finding a universal intermediate representation that can be used by all compilers to produce intermediate code. This concept has been explored in various programming languages, including Java, C++, and PostScript. Understanding the challenges and feasibility of a universal intermediate language is crucial for compiler design and development.

Key Takeaways
  1. Define the UNCOL problem and its objectives
  2. Analyze the challenges of creating a universal intermediate language
  3. Examine the role of intermediate languages in compiling programming languages
  4. Investigate the use of cross-compilation systems, such as GCC
  5. Evaluate the feasibility of a universal intermediate representation
💡 The UNCOL problem highlights the complexity of creating a universal intermediate language that can be used by all compilers, due to differences in computer hardware design and language compilation.

Related Reads

📰
Cross-Modal Knowledge Distillation for coastal climate resilience planning for extreme data sparsity scenarios
Learn how Cross-Modal Knowledge Distillation can help with coastal climate resilience planning in areas with limited data
Dev.to AI
📰
I Spent Days Building a Transformer. A 5-Line Model Beat It.
A simple 5-line model outperforms a complex transformer model, teaching a valuable lesson about model complexity and effectiveness
Medium · Data Science
📰
Inside the Machine: How Monte Carlo Simulation Actually Works
Learn how Monte Carlo simulation works and its applications in finance, including pricing options and measuring risk
Medium · Python
📰
Batches, Epochs, and Validation: What model.fit() Is Actually Doing
Understand the basics of model training in deep learning using model.fit()
Medium · Machine Learning
Up next
Is Python Dead in 2026?| Truth About Python in AI Era | 90 Days Roadmap @FameWorldEducationalHub
FAME WORLD EDUCATIONAL HUB
Watch →