Aida and mini-Aida, a solution to the two language problem.
So what is this two language problem?
So a bit everywhere where programming is used, you see similar setup, you have people
using a typical scripting language for prototyping, for processing data, for generating code,
or whatever else, or do some simulation, or shell scripts, or for studying things.
And so on and so on.
Typically, you have things like Python or MATLAB, whatever on the left side.
On the right side, you have typically C++, Aida, and other statically typed languages.
There are therefore performance.
And as long as people work in their world separately, it's okay.
But more than often, they have to interact.
And then there's a problem because there's this language role.
And it's something that many people are trying to break this role.
And a solution that I want to present is to use Aida, but in perhaps depending on how the context
in two different forms, use Aida on both sides.
So you have some flexibility between the prototyping and the productive application.
And of course, on some things like SQL, you can keep it as such.
It's not a problem for you to have the second world, not an issue.
Yes. So one thing you would you see in the professional world, or academic as well.
Everywhere you have one team, which is doing a sketch in pseudo code, or a prototype in a scripting language.
It can be MATLAB, for instance.
They are working in a bit in their bubble, basically.
And the implementation is left to other people who are using another language, so the language, why, for instance.
So they have to translate everything.
And suddenly the team X wants to make a modification.
They have to call the team Y to try to adapt to the modification.
And as you can guess, it's a very tedious complex and inefficient process.
So here, a solution, depending on where what, depending on the context, would be to use my small hack Aida compiler.
For X, for prototyping, because you have a very quick compile run cycle.
Basically, you don't see the compilation, it runs immediately.
And useful Aida for as a Y language, so for the rights.
Another situation you see is you have both languages.
You have a team doing Python or R, for instance.
Another team doing, let's say, C++.
And a third team doing the interface between both or translating bits of X into Y,
and maintaining painfully the interface.
So it's even, it's a bit less complex, but it's a bit more complicated in terms of teams,
because you will unit basically more or less three teams.
So here, a solution would be to use full Aida everywhere, because it's very accessible also for engineers,
and people with no programming training or hack the hack compiler for the X language.
And for Y, you would have the, for the heavy lifting.
You would have the, you use, you use Gnat, essentially.
I say full Aida, because there are other Aida compilers.
Something called object Aida, which is full Aida 2012, so an apex Aida, at least.
So actually you have three Aida 2012 plus compilers valuable.
And the third case is embedding.
So you have typically industrial software or a game embedding, kind of scripting mechanism,
in order to do some live configuration or, for a game, you can spawn some monsters or whatever.
And yeah, so the typical X language is, as usual, C++, for X and Y is, can be Python or lower.
You see, often, as a mini language, which is embedded in a software.
So, yeah, for a game, it's not a problem, because people don't know to struggle with C++.
They play their game, and they, they program their lowest script.
But for an internal software, it's a bit more difficult, because you need,
normally, the knowledge of both languages.
It's not a mass product, so it becomes, again, a bit difficult.
The developers in the X language need to explain things to the Y people and so on.
And they want new features and they, it's a bit tedious.
And the languages are, as in the two other cases, not compatible, which is not good.
So here, the solution is to embed the hack, Aida compiler.
So it's a mini compiler, I'm maintaining and developing.
I'm going to the full Aida application.
So I make a little, yeah, we'll see a demo, but just I summarize advantages.
So it's the same language.
So you have more or less the same people who can understand the application and the scripts, basically.
And you can even share the same source codes between both.
That's a very powerful feature. You have the same type system.
So how does look, does look, does, how does the embedding of hack look like in an application?
So here, you have the possibility, the simplest useable way of embedding the hack compiler into an Aida main program.
So you have bills from a command line argument, file name.
And if the bill is successful, you run the program.
So here you have a very small example, or you can run an Aida program from another Aida program.
But it will be better to see a live demo. So I do it.
Next.
So here, here you have a Gnat Studio, the programming studio provided by Aida Core for the Gnat compiler.
Here.
Yeah, of course.
A bit like that.
Or perhaps I change the resolution.
No, I think it's okay.
Is everybody able to read more or less?
I give a choice.
So I will have to scroll a bit more.
So here, you have the main full Aida program.
The little difficulty is since you have Aida in Aida, not completely different languages.
I have to explain which Aida is which.
Yeah.
It's the backside of the power of Aida in this context.
So here I have an almost infinite loop.
It will terminate with the last positive number, but you won't see it.
And each time it builds a mini hack program, which is called Exchange Hackside Simple.
Hopefully it's simple enough.
And then it's run.
And there's a pause in order to protect your eyes.
But here you have a callback mechanism, which is initiated.
So I show you very quickly.
So you have, so it's a full Aida callback, which is registered, which is doing something data.
So you will see there's a data exchange between the callback and hack.
And this callback, so here you have the pointer to the callback.
And it is registered.
And now the hack program, I open in another editor just to make it more Aida.
So you have to.
Yeah, that should be a readable criminal enough.
Of course if I try to run it, it doesn't work.
From, I mean, as a main, because I have to connect the callback.
So you have a plasma import, import aspects with the callback here.
And yeah, this.
So this callback will put the usage of I in both places, so I change it.
It's more readable like that.
Yeah, no error.
Okay, three minutes is perfect.
We'll have done the demo in the meantime.
So I put the value 1, 2, 3, 4 into the I per meter, it's very simple.
And I see the callback on the gnat side.
So before the call, the value is 9876.
And after it will have changed.
Or vice versa.
No, it's after.
Okay, you will see with the demo how it works.
So yeah, here.
So you have this quasi infinite loop.
So each time the native is calling hack, which is calling native.
It's a bit complicated.
But you see the value 1, 2, 3, 4, 9, 8, 7, 6.
And I can't really change live the program.
So you have the gnat program running, still running.
And I put 10, for instance.
So you see the newly compiled program gives 10 as a result.
Or you can put another message.
Hello, whoops.
First them.
And let's save it.
Hello, first them now.
Questions?
No question.
It's not.
The question is, is the source cache in any way?
No, it's right from the file.
But you could.
The hack compiler is able to read from any stream possible.
You could cache.
You can read from memory all the time.
That's the script.
Very simple.
Yeah, I do it all the time.
For the next time, yes.
So the question is, is the hack compiler bytecode compiler, which interprets the bytecode?
But actually, it can also output native code, but it's working progress.
But the thing which is working is the bytecode.
But it's actually multi-target.
It's very, it's just compiled every cycle.
I mean by a just compiler, maybe.
You notice that some code is running off.
It takes the bytecode and optimizes and produces the machine code.
Because we have to do one.
And then it can be to the password.
So the question is, is there just in time compilation?
Answer not yet.
Thank you.