We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

HAC: the Compiler which will Never Become Big

00:00

Formal Metadata

Title
HAC: the Compiler which will Never Become Big
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
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
In the Ada world, we are surrounded by impressive and professional tools that can handle large and complex projects. Did you ever dream of a tiny, incomplete but compatible system to play with? Are you too impatient, when developing small pieces of code, for long compile-bind-link-run cycles? Are you a beginner intimidated by project files and sophisticated tools? Then HAC (the HAC Ada Compiler, or the Hello-world Ada Compiler) is for you. HAC is a revival of the SmallAda project, which supported the "Pascal subset" plus tasking.
Computer animation
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
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
Addressing modeText editorPascal's triangleOpen sourcePascal's triangleText editorOpen setBasis <Mathematik>DistanceCompilerBitCompilerFocus (optics)Computer animation
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
IntegerFunction (mathematics)Video game consoleComputer configurationWindowView (database)Computer virusLine (geometry)Loop (music)Message passingGroup actionSinc functionSpreadsheetNumberState of matterResultantAlgorithmComputer animation
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
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
Function (mathematics)Execution unitPoint cloudFacebookOpen sourceComputer animationLecture/Conference
Transcript: English(auto-generated)
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
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
So it's experimental it's Very likely to be forever incomplete and very incomplete
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Ada Not Ada at all typically Yeah, you have in Pascal and in I think almost every language except Ada silent
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
With a blank page. Okay. I have a few notions of the syntax, but let's try Okay, something like that and
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
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
Okay And perhaps I I just display something with the number
So here you go. You have I square and so on and so on Here a real
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
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
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
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
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
So you have also the same results Yeah so questions
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
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
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
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
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
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
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
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
Just one core is used for compilation. Yeah so It's very quick
Currently it's using only It's an ad hoc parser
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
Also as a package, so that it has the potential to be used for dynamic compilation in some environment
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
You