📜 ⬆️ ⬇️

The concept of the programming language of the 5th generation. Part 3

Hello. The previous two publications were accompanied by comments "This is all already been." I did some research and offer you another video. The first 4 min. 20 sec contain only new, which I have not found in other frameworks. The rest of the video is something that already exists somewhere, but I did it better (easier and more convenient).

This video is a concept, it is not software ready to use. It is published here to be improved.


')
Transcript under the cut.

Hi everyone!
G5. The first step is aspect-oriented programming.
It's not classical in G5, let's look at it.
Here is a simple method with some business logic. It's short and understandable.
But programs usually contain other aspects
For example, business restrictions.
Another aspect is checking for system errors.
Don't forget about error handlers.
Sometimes you need logger for debugging.
Aspect of documentation is very important too.
As you are looking for your code, you really need it.
Let's also take a look at the metadata tests for unit tests.
And now, you can do it with aspects.
First, you can hide the screen using this buttons.
Secondly, you can debug and optimization.
You can define your own aspect, for example aspect of the security.
You can use the code of the source code.
Specification language: it's designed for distributed applications.
The first part of it is “entities”. They are like data contracts, but better.
You can define it.
Thera are no data types of G5, so you can use it with any programming languages.
Specification of the source code; I’m using metadata for the compiler instead of inheritance.
You can choose your own field.
But it is necessary to be compatible with the types of the entity.
You can set.
You can even rename fields.
You can’t ignore it.
And of course you can't change business restrictions.
Well;
How to create enterprise solutions.
Specification language is an aspect of the design; you can hide it and disable compilation for it.
The second part of the specification language is API.
You can describe your API using WSDL or any other languages. Here is an example for USDS.
I will create a server for this API.
In this case, the compiler will use myServer.
This is a very fast and simple way to create a server application.
The next part is library specifications.
Plugin for the application using specification language.
I defined description of the library, two classes.
Now, I can create realization of this specification.
The compiler will be in the library file.
In the library.
I will import my plugin dynamically.
The compiler will create new business methods and the first class.
You can use the same way to import standard Windows or Linux dynamic libraries.
Chapter three - Declarative programming using widgets.
There are many widgets in G5, I will show you four of them.
The first one is a text widget.
You can use any symbols inside it.
You can define this text field.
The next one is a source code widget.
It is syntax highlighting and macros.
You can use the code.
The third example is a widget for user interfaces.
You can use the elements in the source code.
G5 with regular expressions etc. You can also create a new widget for G5.
The last example is a widget “Report”.
This widget can contain the source code.
It can be used as the “main.code” for the file.
The widget can request data formatting.
You can save the report in PDF, HTML or any other format.
And here is the result.
Chapter four, Language oriented programming.
You can create your own domain-specific programming language using G5.
Thera are in the G5.
The language of semantics. Let's have a look at it.
Here is a class with an array of inside. You can set the element's value using this method.
But it looks not good. The batter way is using an access operator.
I will define this constriction using the keyword “Semantics”.
The first part is the code template.
I wrote only for lines and it works now.
What about more complex constructions?
For example, a cycle in this style.
And again, I'm defining the pattern. Seven lines and it works too.
Another useful thing is physical variables.
You can define it.
You can also define.
The values ​​will be converted correctly after that.
Conversions between possible variables and G5 types are possible too.
The compiler controls all wrong conversions.
Well, create a new domain-specific language.
That's all for today.
If you like this presentation, please share it with your friends.
I’m ready to answer any questions, please contact me at this email address.
Thank you for your attention.

Source: https://habr.com/ru/post/309596/


All Articles