ya_lang (ya_lang) wrote,
ya_lang
ya_lang

Ya - description of new programming language Ya

I'm Pavel Senatorov from Moscow, the developer of new programming language Ya.

The description in russian look at ya-lang.livejournal.com. The comments to this article better publish in ya-lang.livejournal.com - while now there only russian messages, everybody there understand English well.

Please help to know where this message should be posted for people who are interested in news for C++, C#, Java, Pascal.

Ya is based on C++ and gets most of C++ as is. Yet there is no compatibility with C++, C++ program is not a Ya program and cannot be compiled as is.

Basic concepts (ideas, basics) of Ya
- double compilation - while compiler compiles, parts of the compiling program could be executed. It's required for extending Ya syntax, lexical tokens and to perform optimizations, with optimizer being written in the program being compiled.
- extandable syntax
. - possible to add new statements. For example it's possible to to add statement 'foreach' for newly written type of a container.
. - probably it will be possible to add to language syntax even a new nonterminal and rules for using it
- extandable lexical tokens
. - possibility to add to expressions new operations.
. . - for example for sortings it's required comparison result of lesser or equal or bigger and it's possible to add new operation, let' name it '<=>', which makes it for standard types.
. . - next example: let's '<->' will notify exchange of values of variables (swap). Usage: int i,j; i <-> j;
. - possibility to make other new constants. For example time is typically written like 10:53:17 - addition of a new kind of constant is described as regex and the code for transforming of text of new constant into required type the programmer writes on Ya. Note that this code will be executed on compile time, not run time.
- support for databases and internal structures like databases - it will probably be done as library, but should be mentioned. The same kind of feature in C# is named LinQ
- many small changes in the base of C++
. - no project file. Each Ya project has _main_ source that compiler compiles. Main source contains description of other modules of program and which files contain this modules. It must not be described in main source and could be partially in other modules, yet the compiler should know from sources which modules are parts of program and where they are.
. - named modules: 'module name;' at the start of each compiled file
. - header files are not used. Instead it is the statement 'using module, module;' , so separate header and implementation for a module goes out, because 'using module' gets interface into work but not implementation details.
. - keyword 'class' is not used, 'type' used instead. New types are described like here:
. . - type constint = int-;
. . - type StrC { body of structure-class }
. - all types are considered as classes, for example it's possible to inherit from type 'int'.
Subscribe

  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments