1 May 2026, 11:37 UTC88 views2 reactionsread 10 August 2026 Photo
Конец ? Да, но только для этого канала. Данный ряд постов, была тестовая для этого канала, и подобного кантетна тут больше не будет, подобное перемещается на другой канал https://t.me/freyzanIT. Тут же возвращается контет связанный именно по full stack разработке.
👍2
9 Apr 2026, 09:37 UTC103 views3 reactionsread 10 August 2026 Реализация в коде:
Интепритатор(core.intepritator.py):
from typing import Dict
class IRInterpreter:
def __init__(self):
self.variables: Dict = {}
self.temps: Dict = {}
def get_value(self, name):
if isinstance(name, (int, float)):
return name
if name in self.temps:
return self.temps[name]
if name in self.variables:
return self.v…
🔥2❤1
9 Apr 2026, 09:29 UTC76 views1 reactionsread 10 August 2026 Photo
Этап Code Generation - самый интересный этап, давайте освежим в памяти весь pipline:
0. Source code
1. Lexer
2. Parser
3. AST
4. Semantic Analysis
5. IR
6. Optimization
7. Code Generation *
Есть несколько вариантов генерации:
- Assembly (x86-64)
- Bytecode (как у JVM)
- WebAssembly
- Интерпретация IR
Мы возьмём вариант Интерпретация IR.
IR Interpreter:
выполняет инструкции по типу таких IRInstruction(op='STORE', a…
🔥1
26 Mar 2026, 10:06 UTC78 views4 reactionsread 10 August 2026 Origin IR:
IRInstruction(op='LOAD_CONST', arg1=3, arg2=None, result='t1')
IRInstruction(op='STORE', arg1='t1', arg2=None, result='b')
IRInstruction(op='LOAD_CONST', arg1=10, arg2=None, result='t2')
IRInstruction(op='ADD', arg1='t2', arg2='b', result='t3')
IRInstruction(op='STORE', arg1='t3', arg2=None, result='a')
IRInstruction(op='LOAD_CONST', arg1=2, arg2=None, result='t4')
IRInstruction(op='MUL', arg1='a', arg2='t…
❤1👍1🔥1🤯1
26 Mar 2026, 10:06 UTC58 views3 reactionsread 10 August 2026 Кодавая реализация на python:
1. Constant Folding
core.optimizations.constant_folder.py
from core.ir import IRInstruction
class ConstantFolder:
def optimize(self, instructions):
constants = {}
optimized = []
for instr in instructions:
if instr.op == "LOAD_CONST":
constants[instr.result] = instr.arg1
optimized.append(instr)
elif i…
👍1🔥1🤯1
26 Mar 2026, 09:29 UTC38 viewsread 10 August 2026 1. Constant Folding
тут мы заранее оптимизируем константы и их вычисления
до код:
int a = 2 * 3
до IR
IRInstruction(op='LOAD_CONST', arg1=3, arg2=None, result='t1')
IRInstruction(op='LOAD_CONST', arg1=2, arg2=None, result='t4')
IRInstruction(op='MUL', arg1='t1', arg2='t2', result='t3')
После код:
int a = 6
После IR
IRInstruction(op='LOAD_CONST', arg1=6, arg2=None, result='t1')
2. Constant Propagation
Если переме…
26 Mar 2026, 09:23 UTC44 views1 reactionsread 10 August 2026 Photo
Следующий этап "Оптимизация".
Оптимизации (Compile-time optimizations) - это процесс когда мы, улучшаем скорость работы программы, на уровне компиляции, при этом сохраняем правельность работы программы.
Это преобразования программы, которые:
* выполняются во время компиляции
* не меняют результат программы
* улучшают производительность / размер / читаемость IR
Мы проведём самые базовые 3 вида оптимизаций в нашем …
🔥1
13 Mar 2026, 08:34 UTC62 views4 reactionsread 10 August 2026 Реализация на python
core.ir.py
@dataclass
class IRInstruction:
op: str
arg1: str | None = None
arg2: str | None = None
result: str | None = None
core.ir.py
class IRBuilder:
def __init__(self):
self.instructions = []
self.temp_count = 0
def new_temp(self):
self.temp_count += 1
return f"t{self.temp_count}"
def build(self, nodes):
for node in node…
❤1👍1🔥1🤔1
13 Mar 2026, 08:28 UTC54 views1 reactionsread 10 August 2026 Photo
После проверки программы на осмысленные конструкции, идёт следующий этап
Intermediate Representation (IR) - данный слой решает проблему, связанную с тем что AST является удобным для анализа
Напомню AST:
[VarDeclaration(var_type='int', name='b', value=Number(value=3)), VarDeclaration(var_type='int', name='a', value=BinaryOp(left=Number(value=10), operator='+', right=Identifier(name='b'))), VarDeclaration(var_type='i…
🔥1
6 Mar 2026, 10:55 UTC71 views3 reactionsread 10 August 2026 Реализация на python
core.semantic.py
class SemanticAnalyzer:
def __init__(self):
self.symbol_table = {}
def analyze(self, nodes):
for node in nodes:
self.visit(node)
def visit(self, node):
method_name = f"visit_{type(node).__name__}"
method = getattr(self, method_name, self.generic_visit)
return method(node)
def generic_visit(self, node):
…
🤯2👍1
6 Mar 2026, 10:53 UTC65 views3 reactionsread 10 August 2026 Photo
После проверки структуры кода и создания AST идёт этап Семантического анализа(Semantic Analyzer)
Semantic Analyzer - это процесс когда код программы, проверяется на осмысленность программы, к примеру:
————
Код:
int a = b + 10;
Ошибка
Variable 'b' not defined
————
Код:
int a = 10;
int a = 20;
Ошибка
Variable 'a' already declared
————
и еще довольно большой раяд подобных проверок.
На выходе данного layer мы получ…
👍3
26 Feb 2026, 09:36 UTC67 views2 reactionsread 10 August 2026 реализация на python:
main.py
from core.lexer import Lexer
from core.parser import Parser
def main():
code = """
int a = 10 + b;
int c = a * 2;
"""
lexer = Lexer(code)
tokens = lexer.tokenize()
for token in tokens:
print(token)
parser = Parser(tokens)
ast = parser.parse()
print(ast)
if __name__ == "__main__":
main()
ast.py
from dataclasses import dataclass…
❤2
Showing the 12 most recent of 20 posts we hold for @fullStackDevelopment55. View and reaction counts are the latest single reading for each post, not a live figure, and a recent post is still accumulating both. A view count marked ≈ was rounded by Telegram before we ever saw it — t.me prints views in full below 1,000 and to three significant figures above, so ≈1,200,000 means somewhere between 1,150,000 and 1,249,999. Unmarked counts are exact. Text is reproduced from the public post preview and truncated for length.