HAC: the Compiler which will Never Become Big
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Title of Series | ||
Number of Parts | 490 | |
Author | ||
License | CC Attribution 2.0 Belgium: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor. | |
Identifiers | 10.5446/47037 (DOI) | |
Publisher | ||
Release Date | ||
Language |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
|
00:00
Computer animation
00:21
CompilerCompilerPascal's triangleDialectIdeal (ethics)Portable communications deviceAxiom of choiceSource codeRevision controlDensity of statesTURBO-PASCALComputerSoftwareType theorySoftware testingStatement (computer science)Software developerForm (programming)CompilerDialectPascal's triangleProjective planeType theoryCodeRow (database)Revision controlIdeal (ethics)Axiom of choiceHacker (term)Real numberCompilerMultiplication signElectric generatorBitStatement (computer science)Physical systemKey (cryptography)CoroutineAbstractionConcurrency (computer science)Scripting languageResultantEmailCodeScaling (geometry)Connectivity (graph theory)Service (economics)SurgeryTrailWordTerm (mathematics)InternetworkingMultilaterationTime zoneFitness functionEqualiser (mathematics)Computer animation
05:22
Type theoryPascal's triangleSoftware testingStatement (computer science)Rule of inferenceData conversionScripting languageCodeFeedbackTask (computing)SubsetRecursionGeneric programmingStreaming mediaoutputText editorSource codeBuildingCompilerInterpreter (computing)Hacker (term)Physical systemVirtual machineVirtual realityAbstractionCharacteristic polynomialMaizeSource codeoutputStreaming mediaWeb 2.0Rule of inferenceDenial-of-service attackOpen sourceSubsetArithmetic progressionCompilerSoftwareMetric systemPortable communications deviceServer (computing)Physical systemGoodness of fitWordPolygon meshCondition numberAsynchronous Transfer ModeNumberType theoryPascal's triangleInterpreter (computing)Software testingCodeException handlingCodeLibrary (computing)Key (cryptography)Natural languageSpecial unitary groupTouchscreenFormal languageFreewareMultiplication signCausalityCompilerNumeral (linguistics)DampingComputer fileText editorInstance (computer science)File archiverHacker (term)Software bugModul <Datentyp>Complex (psychology)AbstractionData conversionComputer clusterElectronic mailing listIntegerVirtual machineRoundness (object)Generic programmingScripting language2 (number)Computer animation
10:23
Addressing modeText editorPascal's triangleOpen sourcePascal's triangleText editorOpen setBasis <Mathematik>DistanceCompilerBitCompilerFocus (optics)Computer animation
11:12
Computer virusComputer configurationView (database)WindowGroup actionLine (geometry)Message passingVideo game consoleGamma functionOptical disc driveLoop (music)Web pageCompilerComputer virusLoop (music)Hacker (term)Real numberComputer programmingAbgeschlossene TeilmengeNumberWeightSquare numberElectronic visual displayComputer animation
12:53
IntegerFunction (mathematics)Video game consoleComputer configurationWindowView (database)Computer virusLine (geometry)Loop (music)Message passingGroup actionSinc functionSpreadsheetNumberState of matterResultantAlgorithmComputer animation
13:45
Video game consoleSoftware engineeringMenu (computing)Degree (graph theory)Division (mathematics)WindowView (database)Group actionComputer configurationFunction (mathematics)SpywareBuildingComputer fileCodeLine (geometry)CompilerFunctional (mathematics)Metropolitan area networkMathematicianCodeBitResultantLink (knot theory)RecursionKeyboard shortcutComputer animation
14:44
Run time (program lifecycle phase)ParsingWeb serviceException handlingMereologyBranch (computer science)RecursionStreaming mediaDifferent (Kate Ryan album)CompilerSubsetObject (grammar)Physical systemResultantIntegrated development environmentCodeMoment (mathematics)Pascal's triangleBitCartesian coordinate systemCore dumpInstance (computer science)Ocean currentCompilerFraction (mathematics)Multiplication signComplete metric spaceWave packetMessage passingGoodness of fitBoss CorporationCASE <Informatik>Process (computing)Ideal (ethics)Lecture/Conference
19:49
Function (mathematics)Execution unitPoint cloudFacebookOpen sourceComputer animationLecture/Conference
Transcript: English(auto-generated)
00:05
Good morning Is it okay with the mic? Yeah So after everything you heard about the serious things you can do with Ada, now something totally
00:22
unserious Hack, what's hack? You have the choice hack Ada compiler, hello world Ada compiler Hackers Ada compiler, so you get it. It's not a Real Ada compiler at least at the time being you don't know in ten years or whatever
00:48
So it's experimental it's Very likely to be forever incomplete and very incomplete
01:00
So what's the goal? The goal is to have An Ada system for beginners Or for people who are more used to script languages you see you have your Bit of code you punch a key you get a result something like that
01:22
But it also can be useful for Real Ada developers if you start a little piece of code a little algorithm and And you want to to have something simple to play with and then you can port it To gnat or whatever when it becomes more complex
01:45
Fortunately hack already existed in another form So it was already done but it was a dead Project but the idea was to leverage this work and actually it's a
02:08
Renovation work so like pimp my rides for the the old cars So you you had something we Was written in Pascal it ran only on old system. That's nobody knows anymore and
02:27
The main problem was it was written in Pascal So it means it was written in dialects actually two dialects you have two version of this small Ada which is the
02:40
ancestor of hack two version which are incompatible and so you need to do something like that, so the idea was to port this project To a language, which is very portable which is time resistant
03:02
Because it's a long-term project and the ideal choice of course is Ada and the consequence of it you have and a full Ada in Ada compiler down to the code generation a bit of history behind so you see it's a
03:27
Very old project or you have a long history, but it happens more and more and so it began with a special Pascal compiler of Pascal in Pascal written by the inventor of Pascal himself and
03:48
then in 86 there was something called Co Pascal with the introduction of co routines and Someone had the idea of porting this small this Co Pascal to the Ada syntax and
04:05
to the Ada tasking for concurrency and then what happened those and the old Mac OS disappeared and the project as well was more or less dead
04:23
But you could find it on internet, and I also got some copies Through email so it was kind of archaeological work basically so 20 years ago already I tried to
04:40
translate small Ada the codes into Ada and The main roadblock was they were there are plenty of with statement in Pascal which makes abstraction of a variable of type record type and
05:01
The translator needs to know What to do with that so I had to improve the P to Ada translator Actually, it's kind of almost a Pascal compiler hiding and it understands these Statements and a few years later after some manual work
05:25
Finally the at least hello world, but also more complex things like Recursion and Nesting and so on are working. I will demonstrate later So now you have the long history behind now. We have an even longer future
05:48
Before So you have two steps or less parallel, but the most urgent thing is to get rid of the Pascalism Some rules that are absolutely not
06:04
Ada Not Ada at all typically Yeah, you have in Pascal and in I think almost every language except Ada silent
06:21
Numerical type conversions like you have an integer and suddenly it's converted Magically into a float and you have a float type magically converted into another float type and you have roundings and so it's a nice feature of
06:41
many languages except Ada It's nice, but it's actually a bad idea. It's it's a cause of a Good portion of bugs in every software you you meet That's only an example, but you have some Pascal things
07:03
Remaining so they need to be removed and the third step is to Increase this small subset it was hack currently As you see here
07:22
Features only the let's say the Pascal subset, but it's already not too bad. You can already do Cool things with that so you can define your own types you have nesting and a
07:40
Recursion, but you don't have yet the probably the most useful Feature of Ada which is the modularity the packages and also, you don't have generics and the list is down to here because Every almost everything is missing
08:02
So it's really work in progress and some metrics about hack the whole Compiler and the virtual machine interpreter. It needs two seconds depending on the machine to compile with knatz
08:24
knatz is the free Ada compiler you heard about just before the Built time of let's say you have a piece of code you play with hack. It's less than 100th of second so it's really compiles and typically a beginner or a
08:45
script language user Who just doesn't know what's a compiler is whatever they just see This person wants to just run the thing. It's runs without
09:00
even It doesn't notice. There is a compilation behind And It's completely portable so it's really you can compile it on a Linux whatever system that's Leveraging the portability of Ada
09:20
So no conditional whatever no no special codes The source And Ada source input to hack Can be a file but it can be actually any stream so you could Have a zip archive for instance with with a library and can compile all that or editor data or
09:45
web stream you can Could have a good put hack on a web server Currently the target there is only one target. It's a virtual machine, but
10:00
You can do everything with with hack. I mean it's open source. It's free you can implement your own targets Ideally through an abstraction So where do you find hack? It's on source forge on github
10:23
You can google it and you you find it easily and this I can mention two Open source Projects one is layer is is an editor with an ada focus
10:41
which embeds This compiler this hack compiler as well But you could also embed into your Editor whatever it's all open and I mentioned Pascal to Ada if you Did this translator which was the basis of
11:01
Translating small ada into hack Now if I've just a little some minutes I can I show you a bit how it works So, let's see. I'm just completely beginning
11:21
With a blank page. Okay. I have a few notions of the syntax, but let's try Okay, something like that and
11:43
Okay, so let's try oh I forgot Okay, instead of text. I owe which is familiar I have a special package. So that's something that also There is a real hack pack for real ada compiler like NAT and so and so you can run the same program
12:06
with hack and serious ada compiler Okay, but I get my hello. Oh It's too trivial. I put a loop. I forget the end loop and oh missing closing loop
12:38
Okay And perhaps I I just display something with the number
12:44
So here you go. You have I square and so on and so on Here a real
13:02
Real use I had I had to given year months and day. I had to give the Have an algorithm that gives the number of days since date, but since 1901
13:21
It's for dates in spreadsheets. They began begin around this date. So so it's an Small snippet you I've developed with hack and so you have the results
13:40
So it is typically something you can already do with hack here you have a Diabolic Diabolical Recursive function by a mathematician called Ackermann and
14:04
Yeah, so you have it's very deeply recursive and use you have the same With gnat so So the same piece of code I run it. It's a bit slower, of course with some
14:24
so it needs to be built and So you see the advantage of having something perhaps faster like hack For a small piece of codes, you know Perhaps a beginner would be afraid by all this compile bind and link or whatever and
14:46
So you have also the same results Yeah so questions
15:07
So web services no, I didn't try so far but you can plug any stream to that so it's feasible, but Yeah, I did not try. Yeah. Yeah
15:30
That's good. It could be a good idea, but perhaps At the moment the quality is really bad with with hack really. It's a bit
15:42
still a bit buggy or not really it has So it's I would first address that the quality issues and then put as a web service Because it would be a bad promotion for Ada
16:06
and so for runtimes runtime errors Presently there is absolutely Nothing, I think no exceptions and so on so is a perhaps it would be good for a
16:23
Target with where you don't want exceptions for instance Perhaps all very small embedded you see complex thing or you Hey, we would need to to add exceptions to to hack here So currently it's a bit disappointing. He said there is no no no exception or disappointing or not depending on
17:05
You know the The idea I mean now it's the common Denominator is very small, but the idea to increase this common part to increase the subset
17:20
so it would be Even if it is a very small subset. It would be real Ada. It would be the completely compatible It's not the idea of making a branch of Ada or whatever It's better to have something that you you can use in a different system in
17:41
Object data gnat whatever Yeah, yeah, of course I I do I do that already to To check. Yeah, of course. Yeah, it's also useful for that for debugging hack basically
18:12
Just one core is used for compilation. Yeah so It's very quick
18:33
Currently it's using only It's an ad hoc parser
18:40
so it Originates from this Pascal parser. It's recursive and so on. It's So it's an own parser. Basically. It's a big piece of code Other questions
19:15
Also as a package, so that it has the potential to be used for dynamic compilation in some environment
19:23
Yeah, why not? And then the compiler proper to be just a package that you use and that you can operate whenever you need Ada compilation in your application Yeah, it's it's a possibility. I think it's really open you you can
19:41
You