📜 ⬆️ ⬇️

Perfect scripting language for WEB - Start

Once upon a time ( Ideal scripting language for WEB ) I asked Habravchan to express my thoughts about the programming language for WEB, due to “some events” I had to curtail work on the project, during which time I sketched an approximate architecture of the internal device.



In order to prevent unnecessary talk and angry comments I’ll make a reservation right away that the system is designed on an entry-level VDS, so I’ll try to save every kilobyte of RAM.
')
image

Figure 1. Approximate scheme of work

What we have here:
SPL is a standard library, contains all the prototypes of language classes, is used to extend and supplement the language.
RPC is an interface for working with remote objects, on other virtual machines, and is used to distribute tasks to multiple machines.
WEB Server - built-in web server.
Other modules - modules for working with databases, etc.
In Filters - input filters.
Out Filters - output filters.

User code - user scripts.
User modules are user modules.

Cache byte code - global storage of compiled code bytes.
Byte code - compiled byte code

VM - virtual machine to execute code bytes.

How does it work:
WEB Server receives the user's request and passes the request through In Filters, then the processed request is submitted for execution in the User code, if the requested script is not yet cached, then the script is translated and compiled into a byte code with the necessary libraries connected, then the byte code is either cached Cache byte code and executed in the VM, or if the properties of the script prohibit caching, bypassing the Cache byte code is executed.
After executing the script, through Out Filters the completed request WEB Server gives to the user.
If you connect the necessary libraries, instead of a library, there is a link, then through the RPC interface, the library is called and executed on the remote VM, after which the result is returned.

To be continued…

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


All Articles