Skip to content

XML: Custom infix operators + Peephole optimizer (by Michael Gavrilenko, Danila Rudnev-Stepanyan and Daniel Vlasenko)#57

Merged
Kakadu merged 23 commits intoKakadu:masterfrom
qrutyy:feat/opt
Mar 18, 2026
Merged

XML: Custom infix operators + Peephole optimizer (by Michael Gavrilenko, Danila Rudnev-Stepanyan and Daniel Vlasenko)#57
Kakadu merged 23 commits intoKakadu:masterfrom
qrutyy:feat/opt

Conversation

@spisladqo
Copy link
Contributor

@spisladqo spisladqo commented Mar 13, 2026

Добавил:

  • Возможность создавать и переопределять инфиксные операторы с приоритетами как в OCaml. Тесты в many_tests/codegen_operators.t
  • Peephole оптимизатор. Чтобы сравнить до/после, добавил все тесты кодгена с и без оптимизатора. Diff можно посмотреть в many_tests/optimization_diff.t

Пример оптимизации
до:

    sd t0, -8(s0)
    ld t0, -8(s0)
    sd t0, -16(s0)
    ld t0, -16(s0)
    addi sp, sp, -8
    sd t0, 0(sp)
    ld a0, 0(sp)
    addi sp, sp, 8

после:

    mv a0, t0

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zanuda-linter report

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zanuda-linter report

@spisladqo spisladqo changed the title XML: Peephole optimizer (by Michael Gavrilenko, Danila Rudnev-Stepanyan and Daniel Vlasenko) XML: Infix operators + Peephole optimizer (by Michael Gavrilenko, Danila Rudnev-Stepanyan and Daniel Vlasenko) Mar 17, 2026
@spisladqo spisladqo changed the title XML: Infix operators + Peephole optimizer (by Michael Gavrilenko, Danila Rudnev-Stepanyan and Daniel Vlasenko) XML: Custom infix operators + Peephole optimizer (by Michael Gavrilenko, Danila Rudnev-Stepanyan and Daniel Vlasenko) Mar 17, 2026
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zanuda-linter report

@github-actions
Copy link

Документация и тестовое покрытие (83.80%) должны скоро появиться.

https://kakadu.github.io/comp25/docs/XML

https://kakadu.github.io/comp25/cov/XML

2026-03-17 15:33

Email Commits Files Insertions Deletions Total Lines
vlasenko.daniil26@gmail.com 107 75 16389 7268 23657
qrutyq@gmail.com 52 58 7806 4255 12061
dabzelos@gmail.com 26 54 4661 1927 6588
----- ------- ----- ---------- --------- ---------

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zanuda-linter report

@github-actions
Copy link

Linter report from 2026-03-17 15:33, for mini language XML

Alert zanuda-linter: Using mutable data structures for teaching purposes is usually discouraged. Replace Hashtables by standard tree-like maps or consider Hash-Array Mapped Tries (HAMT). Use mutable `ref`erences and mutable structure fields only if it is really required. In all places where it is needed indeed, describe in a comment why it is needed there.

@Kakadu Kakadu merged commit 431daf6 into Kakadu:master Mar 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants