WEBVTT

00:00.000 --> 00:13.000
Aida and mini-Aida, a solution to the two language problem.

00:13.000 --> 00:18.600
So what is this two language problem?

00:18.600 --> 00:26.800
So a bit everywhere where programming is used, you see similar setup, you have people

00:26.800 --> 00:39.800
using a typical scripting language for prototyping, for processing data, for generating code,

00:39.800 --> 00:51.800
or whatever else, or do some simulation, or shell scripts, or for studying things.

00:51.800 --> 00:53.800
And so on and so on.

00:53.800 --> 01:01.800
Typically, you have things like Python or MATLAB, whatever on the left side.

01:01.800 --> 01:12.800
On the right side, you have typically C++, Aida, and other statically typed languages.

01:12.800 --> 01:17.800
There are therefore performance.

01:17.800 --> 01:26.800
And as long as people work in their world separately, it's okay.

01:26.800 --> 01:29.800
But more than often, they have to interact.

01:29.800 --> 01:37.800
And then there's a problem because there's this language role.

01:37.800 --> 01:44.800
And it's something that many people are trying to break this role.

01:44.800 --> 01:54.800
And a solution that I want to present is to use Aida, but in perhaps depending on how the context

01:54.800 --> 01:59.800
in two different forms, use Aida on both sides.

01:59.800 --> 02:08.800
So you have some flexibility between the prototyping and the productive application.

02:08.800 --> 02:16.800
And of course, on some things like SQL, you can keep it as such.

02:16.800 --> 02:27.800
It's not a problem for you to have the second world, not an issue.

02:28.800 --> 02:37.800
Yes. So one thing you would you see in the professional world, or academic as well.

02:37.800 --> 02:50.800
Everywhere you have one team, which is doing a sketch in pseudo code, or a prototype in a scripting language.

02:50.800 --> 02:54.800
It can be MATLAB, for instance.

02:54.800 --> 02:59.800
They are working in a bit in their bubble, basically.

02:59.800 --> 03:08.800
And the implementation is left to other people who are using another language, so the language, why, for instance.

03:08.800 --> 03:11.800
So they have to translate everything.

03:11.800 --> 03:15.800
And suddenly the team X wants to make a modification.

03:15.800 --> 03:22.800
They have to call the team Y to try to adapt to the modification.

03:22.800 --> 03:33.800
And as you can guess, it's a very tedious complex and inefficient process.

03:33.800 --> 03:47.800
So here, a solution, depending on where what, depending on the context, would be to use my small hack Aida compiler.

03:47.800 --> 03:57.800
For X, for prototyping, because you have a very quick compile run cycle.

03:57.800 --> 04:01.800
Basically, you don't see the compilation, it runs immediately.

04:01.800 --> 04:12.800
And useful Aida for as a Y language, so for the rights.

04:12.800 --> 04:18.800
Another situation you see is you have both languages.

04:18.800 --> 04:25.800
You have a team doing Python or R, for instance.

04:25.800 --> 04:30.800
Another team doing, let's say, C++.

04:30.800 --> 04:39.800
And a third team doing the interface between both or translating bits of X into Y,

04:39.800 --> 04:45.800
and maintaining painfully the interface.

04:45.800 --> 04:54.800
So it's even, it's a bit less complex, but it's a bit more complicated in terms of teams,

04:54.800 --> 04:59.800
because you will unit basically more or less three teams.

04:59.800 --> 05:08.800
So here, a solution would be to use full Aida everywhere, because it's very accessible also for engineers,

05:08.800 --> 05:18.800
and people with no programming training or hack the hack compiler for the X language.

05:18.800 --> 05:23.800
And for Y, you would have the, for the heavy lifting.

05:23.800 --> 05:31.800
You would have the, you use, you use Gnat, essentially.

05:31.800 --> 05:35.800
I say full Aida, because there are other Aida compilers.

05:35.800 --> 05:45.800
Something called object Aida, which is full Aida 2012, so an apex Aida, at least.

05:45.800 --> 05:55.800
So actually you have three Aida 2012 plus compilers valuable.

05:55.800 --> 06:00.800
And the third case is embedding.

06:00.800 --> 06:14.800
So you have typically industrial software or a game embedding, kind of scripting mechanism,

06:14.800 --> 06:26.800
in order to do some live configuration or, for a game, you can spawn some monsters or whatever.

06:26.800 --> 06:38.800
And yeah, so the typical X language is, as usual, C++, for X and Y is, can be Python or lower.

06:38.800 --> 06:46.800
You see, often, as a mini language, which is embedded in a software.

06:47.800 --> 06:59.800
So, yeah, for a game, it's not a problem, because people don't know to struggle with C++.

06:59.800 --> 07:05.800
They play their game, and they, they program their lowest script.

07:05.800 --> 07:12.800
But for an internal software, it's a bit more difficult, because you need,

07:12.800 --> 07:17.800
normally, the knowledge of both languages.

07:17.800 --> 07:25.800
It's not a mass product, so it becomes, again, a bit difficult.

07:25.800 --> 07:35.800
The developers in the X language need to explain things to the Y people and so on.

07:35.800 --> 07:42.800
And they want new features and they, it's a bit tedious.

07:42.800 --> 07:51.800
And the languages are, as in the two other cases, not compatible, which is not good.

07:51.800 --> 07:59.800
So here, the solution is to embed the hack, Aida compiler.

07:59.800 --> 08:04.800
So it's a mini compiler, I'm maintaining and developing.

08:04.800 --> 08:07.800
I'm going to the full Aida application.

08:07.800 --> 08:17.800
So I make a little, yeah, we'll see a demo, but just I summarize advantages.

08:17.800 --> 08:19.800
So it's the same language.

08:19.800 --> 08:32.800
So you have more or less the same people who can understand the application and the scripts, basically.

08:32.800 --> 08:38.800
And you can even share the same source codes between both.

08:38.800 --> 08:45.800
That's a very powerful feature. You have the same type system.

08:45.800 --> 08:57.800
So how does look, does look, does, how does the embedding of hack look like in an application?

08:57.800 --> 09:12.800
So here, you have the possibility, the simplest useable way of embedding the hack compiler into an Aida main program.

09:12.800 --> 09:19.800
So you have bills from a command line argument, file name.

09:19.800 --> 09:24.800
And if the bill is successful, you run the program.

09:24.800 --> 09:41.800
So here you have a very small example, or you can run an Aida program from another Aida program.

09:41.800 --> 09:49.800
But it will be better to see a live demo. So I do it.

09:49.800 --> 09:56.800
Next.

09:56.800 --> 10:10.800
So here, here you have a Gnat Studio, the programming studio provided by Aida Core for the Gnat compiler.

10:11.800 --> 10:17.800
Here.

10:17.800 --> 10:19.800
Yeah, of course.

10:19.800 --> 10:24.800
A bit like that.

10:24.800 --> 10:26.800
Or perhaps I change the resolution.

10:26.800 --> 10:28.800
No, I think it's okay.

10:28.800 --> 10:32.800
Is everybody able to read more or less?

10:32.800 --> 10:35.800
I give a choice.

10:36.800 --> 10:43.800
So I will have to scroll a bit more.

10:43.800 --> 10:48.800
So here, you have the main full Aida program.

10:48.800 --> 10:54.800
The little difficulty is since you have Aida in Aida, not completely different languages.

10:54.800 --> 11:00.800
I have to explain which Aida is which.

11:00.800 --> 11:01.800
Yeah.

11:01.800 --> 11:09.800
It's the backside of the power of Aida in this context.

11:09.800 --> 11:19.800
So here I have an almost infinite loop.

11:19.800 --> 11:26.800
It will terminate with the last positive number, but you won't see it.

11:26.800 --> 11:41.800
And each time it builds a mini hack program, which is called Exchange Hackside Simple.

11:41.800 --> 11:43.800
Hopefully it's simple enough.

11:43.800 --> 11:46.800
And then it's run.

11:46.800 --> 11:55.800
And there's a pause in order to protect your eyes.

11:55.800 --> 12:03.800
But here you have a callback mechanism, which is initiated.

12:03.800 --> 12:06.800
So I show you very quickly.

12:06.800 --> 12:18.800
So you have, so it's a full Aida callback, which is registered, which is doing something data.

12:18.800 --> 12:25.800
So you will see there's a data exchange between the callback and hack.

12:25.800 --> 12:31.800
And this callback, so here you have the pointer to the callback.

12:31.800 --> 12:35.800
And it is registered.

12:35.800 --> 12:47.800
And now the hack program, I open in another editor just to make it more Aida.

12:47.800 --> 12:53.800
So you have to.

12:53.800 --> 12:59.800
Yeah, that should be a readable criminal enough.

12:59.800 --> 13:05.800
Of course if I try to run it, it doesn't work.

13:05.800 --> 13:15.800
From, I mean, as a main, because I have to connect the callback.

13:15.800 --> 13:23.800
So you have a plasma import, import aspects with the callback here.

13:23.800 --> 13:34.800
And yeah, this.

13:34.800 --> 13:44.800
So this callback will put the usage of I in both places, so I change it.

13:44.800 --> 13:51.800
It's more readable like that.

14:02.800 --> 14:04.800
Yeah, no error.

14:04.800 --> 14:09.800
Okay, three minutes is perfect.

14:09.800 --> 14:13.800
We'll have done the demo in the meantime.

14:13.800 --> 14:27.800
So I put the value 1, 2, 3, 4 into the I per meter, it's very simple.

14:27.800 --> 14:31.800
And I see the callback on the gnat side.

14:31.800 --> 14:42.800
So before the call, the value is 9876.

14:42.800 --> 14:46.800
And after it will have changed.

14:46.800 --> 14:49.800
Or vice versa.

14:49.800 --> 14:51.800
No, it's after.

14:51.800 --> 14:56.800
Okay, you will see with the demo how it works.

15:01.800 --> 15:07.800
So yeah, here.

15:07.800 --> 15:11.800
So you have this quasi infinite loop.

15:11.800 --> 15:15.800
So each time the native is calling hack, which is calling native.

15:15.800 --> 15:17.800
It's a bit complicated.

15:17.800 --> 15:23.800
But you see the value 1, 2, 3, 4, 9, 8, 7, 6.

15:23.800 --> 15:28.800
And I can't really change live the program.

15:28.800 --> 15:34.800
So you have the gnat program running, still running.

15:34.800 --> 15:41.800
And I put 10, for instance.

15:41.800 --> 15:47.800
So you see the newly compiled program gives 10 as a result.

15:47.800 --> 15:53.800
Or you can put another message.

15:53.800 --> 15:59.800
Hello, whoops.

15:59.800 --> 16:03.800
First them.

16:03.800 --> 16:08.800
And let's save it.

16:08.800 --> 16:12.800
Hello, first them now.

16:12.800 --> 16:25.800
Questions?

16:25.800 --> 16:34.800
No question.

16:34.800 --> 16:41.800
It's not.

16:41.800 --> 16:49.800
The question is, is the source cache in any way?

16:49.800 --> 16:52.800
No, it's right from the file.

16:52.800 --> 16:54.800
But you could.

16:54.800 --> 16:59.800
The hack compiler is able to read from any stream possible.

16:59.800 --> 17:08.800
You could cache.

17:08.800 --> 17:15.800
You can read from memory all the time.

17:15.800 --> 17:30.800
That's the script.

17:30.800 --> 17:33.800
Very simple.

17:34.800 --> 17:43.800
Yeah, I do it all the time.

17:43.800 --> 17:53.800
For the next time, yes.

17:53.800 --> 18:16.800
So the question is, is the hack compiler bytecode compiler, which interprets the bytecode?

18:17.800 --> 18:25.800
But actually, it can also output native code, but it's working progress.

18:25.800 --> 18:31.800
But the thing which is working is the bytecode.

18:31.800 --> 18:40.800
But it's actually multi-target.

18:41.800 --> 18:47.800
It's very, it's just compiled every cycle.

18:47.800 --> 18:53.800
I mean by a just compiler, maybe.

18:53.800 --> 18:56.800
You notice that some code is running off.

18:56.800 --> 19:00.800
It takes the bytecode and optimizes and produces the machine code.

19:00.800 --> 19:03.800
Because we have to do one.

19:03.800 --> 19:06.800
And then it can be to the password.

19:07.800 --> 19:12.800
So the question is, is there just in time compilation?

19:12.800 --> 19:22.800
Answer not yet.

19:22.800 --> 19:32.800
Thank you.

