Skip to the content.

IR and His Peculiarities

Document Content:

1.Familiarization with IR

2.Typing

3.Objects in IR


Familiarization with IR

IR (Intermediate Representation) is a structured format used to describe program logic in a way that is independent from any specific programming language.

Instead of writing instructions directly in a language like Rust, Python, or JavaScript, IR describes what should exist and how it should behave in a neutral form.


Core Idea of IR

IR is not code in the traditional sense.

It is:


Main Peculiarities of IR

1. Declarative Structure

IR describes what exists, not how to execute it.


2. JSON-like Representation

IR is typically represented in a structured format (often JSON-like).

This makes it:


3. Language Independence

IR does not belong to any specific programming language.

From the same IR description, you can:


Typing

IR does not have a static type system (no type checking is performed). SITER calculates types itself with type definer


IR Objects


1.Variables Variables in this format:

"var:name_of_variable": {
    "value": value
    }

Example(variable with name myvar and with value string “hello”):

"var:myvar": {
     "value": "hello"
}

Example with number(variable with name count and value number 42):

"var:count": {
            "value": 42
        }

With Boolean:

"var:is_active": {
            "value": true
        }

2.Import(Importing any module) is written at the beginning of the entire script Example(Import module with name ‘requests’):

"imports": ["requests"]

It is possible to import multiple modules: ```json “imports”: [“requests”,”module2”,”module3”]