- 24 Feb, 2026 2 commits
-
-
Roman Alifanov authored
- Comparisons set __CT_RET directly instead of $() subshell fork - Logical NOT (!) inlined same way - fs.exists() inlined to [[ -e ]] in conditions - fs.read uses $(<file) instead of $(cat), fs.write/append use printf - fs.exists/remove/mkdir avoid unnecessary $() wrapping - Dict .get()/.has()/.len() inlined for local dict vars - __ct_print simplified: removed unnecessary local variable - String concat ..= uses native += append - Skip __CT_RET self-assignment in return statements
-
Roman Alifanov authored
- Remove redundant echo in @awk functions (leaked to stdout) - Replace range() subshell fork with C-style for ((i=0; i<N; i++)) - Inline string methods (upper/lower/len/trim/replace/contains/starts/ends/substr/index) for simple variable receivers - Direct array subscript for .get() and .set() instead of function calls
-
- 23 Feb, 2026 3 commits
-
-
Roman Alifanov authored
- Fix numeric/string comparison operator selection in expr and stmt codegen - Use ${VAR:-} for env var reads to prevent unbound variable errors - Add {{ and }} as literal brace escapes in string interpolation - Fix DCE to discover transitive class dependencies through method callees - Fix &&/|| condition codegen to prevent __CT_RET variable conflicts -
Roman Alifanov authored
-
Roman Alifanov authored
Add string concatenation assignment operator (..=) across the full pipeline: lexer, parser, and backend codegen for variables, this.field, dict fields, and object fields. Fix __ct_last_instance set after construct call instead of before. Fix IR builder treating field symbols as known function calls. Fix resolver _current_func corruption during constructor resolution.
-
- 22 Feb, 2026 3 commits
-
-
Roman Alifanov authored
Update bootstrap/ → compiler/ in install paths.
-
Roman Alifanov authored
- Add configure_file for content.in → content binary in compiler/meson.build - Update spec: bootstrap/ → compiler/ in %files
-
Roman Alifanov authored
Replace the bootstrap mixin-based compiler with a new IR-based pipeline: Source → Lexer → Parser → Resolver → TypeChecker → IR Builder → Optimizer → Backend New architecture (compiler/): - semantics/: scope resolution, type system, type checker - ir/: intermediate representation with stable node IDs - optimizer/: DCE via call graph BFS, CSE, constant folding - backend/bash/: bash code generation from IR - backend/awk/: AWK code generation sharing same IR - symbols/: symbol table with LSP-ready serialization Key improvements: - Explicit shell command detection (IRCall.is_shell_cmd) - Namespace prefixing only in bash backend, not in resolver - DCE reduced from 580-line fixed-point to ~40-line BFS - CSE uses stable node_id instead of Python id() - Shell commands in assignments use || true for set -e safety - No local keyword in global scope (when/foreach) - Coproc uses exec to prevent orphan child processes All 400 tests pass. Verified with real-world unified-theme-switcher service.
-
- 20 Feb, 2026 3 commits
-
-
Roman Alifanov authored
Duplicate coproc fds with exec instead of copying fd numbers. Bash auto-closes coproc fds when the process exits, causing race conditions on slower systems. Save PID before coproc cleanup and close original write fd after dup to prevent hangs.
-
Roman Alifanov authored
- Add foreach line in proc syntax for process handle iteration - Fix DCE not tracking class methods used via objects - Fix CSE precomputing is_empty/is_number (they echo, don't set __CT_RET) - Fix proc.read() leaking echo to stdout when assigning to variable - Fix if/while condition with shell calls resolving incorrectly - Support hyphenated shell commands in lexer (e.g. dbus-monitor)
-
Roman Alifanov authored
- namespace X { } for symbol isolation (multi-file merge) - using X / using h = X / using X { a, b } (Vala-style) - busing for sourcing .sh scripts with named access - Remove legacy import system - Rewrite cli.ct: action callbacks, aliases, FloatFlag, auto help/version - Add cli examples: cli_demo, cli_flags, cli_subcommands, cli_categories - Fix parent class field initialization in child constructors - Fix var.field.method() dispatch for inherited array/dict fields - Recursive directory scan for content build/run/test - Full build-lib with metadata, directory support, --install - Meson custom_target to compile cli.sh during build - RPM spec: split content-lib-cli subpackage
-
- 19 Feb, 2026 2 commits
-
-
Roman Alifanov authored
-
Roman Alifanov authored
-
- 18 Feb, 2026 5 commits
-
-
Roman Alifanov authored
-
Roman Alifanov authored
- json.unmarshal(str, Class) deserializes JSON into class instance - json.marshal(obj) serializes class instance to JSON string - reflect module: fields, get, set, type, class_name, create - Class metadata generation for runtime introspection - Fix DCE namespace detection inside function bodies - Update telegram bot example with Message class, /json, /info commands
-
Roman Alifanov authored
- DCE: propagate parent methods to child classes so inherited proxy functions are generated (StringFlag.with_short etc.) - stmt_codegen: return this.field.method() now checks field type (array/dict) instead of always assuming string - stmt_codegen: fix missing f-prefix on two RET_VAR f-strings - cli.ct: exit(0) after --help/--version to prevent double output - Add TestInheritance tests covering all fixed bugs
-
Roman Alifanov authored
Fix spaces before parentheses in CT source code within tests.
-
Roman Alifanov authored
Unknown function calls now compile directly as shell commands: grep ("pattern") instead of shell.exec ("grep pattern"). Added mixed pipe support (CT func | shell cmd) with fd 3 redirect. Removed ngrep builtin (grep can be called directly now).
-
- 17 Feb, 2026 12 commits
-
-
Roman Alifanov authored
- CLAUDE.md: expanded @awk section with new features - README.md: updated @awk supported features list - LANGUAGE_SPEC.md: added AWK extras, dict.field syntax
-
Roman Alifanov authored
AWK codegen: - Add string interpolation: "Hello {name}" -> ("Hello " name "!") - Add env.VAR support via ENVIRON["VAR"] - Add time.now() via systime() - Add str.chr() via sprintf("%c", n) - Add assert_eq() for equality assertions - Add print() as statement - Add method calls as statements (arr.push, dict.set) Bash codegen: - Fix dict.field = value for dict variables (was using wrong storage) - Fix dict.field read to use dict["field"] syntax -
Roman Alifanov authored
Support assigning to object fields from outside the class using obj.field = value syntax with all compound operators (=, +=, -=, *=, /=, ..=). Also support typed parameters in functions to enable field assignment on passed objects.
-
Roman Alifanov authored
-
Roman Alifanov authored
- env.VAR = value generates export VAR="value" - Supports interpolation: env.GREETING = "Hello, {name}!" - Add 2 tests for env.set functionality - Update all documentation files -
Roman Alifanov authored
- Access env vars directly: env.HOME, env.USER, env.PATH - Generates ${VAR} without fork (no shell.capture needed) - Type is 'any', can be explicitly typed: port: int = env.PORT - Add 4 tests for env variables including int arithmetic - Update all documentation files -
Roman Alifanov authored
- Add TypeAnnotation AST node for type annotations - Add ClassField dataclass for typed class fields - Extend Parameter, FunctionDecl, Assignment with type_annotation field - Add type parsing: parse_type(), parse_type_annotation(), parse_function_type() - Support types: string, int, float, bool, any, void, T[], dict[K,V], classes, (A) => B - Add type checking at compile time with configurable error handling - Add --no-type-check and --warn-types CLI flags - Fix callback variable calls (prioritize callback_vars, use $() capture) - Document closure limitation (lambdas can't capture outer variables) - Add 28 new tests for typing and callbacks (279 total)
-
Roman Alifanov authored
- User decorators (@obj.method(args)) for handler registration - Callbacks: pass functions/lambdas as arguments - Fix UTF-8 urlencode with LC_ALL=C - Fix dict field access in class methods - Refactor telegram_echobot to use decorators - Add tests for callbacks and user decorators - Update documentation (LANGUAGE_SPEC, README)
-
Roman Alifanov authored
- Split methods.py into methods/ directory with separate modules - Add awk_builtin field to Method for unified AWK generation - Replace hardcoded method dispatch in awk_codegen with generate_awk() - Add RET_VAR/RET_ARR constants, replace hardcoded __CT_RET - Migrate all codegen files to use indented() context manager
-
Roman Alifanov authored
- Import method definitions from methods.py for consistency - Define bash implementations in STRING_IMPLS, ARRAY_IMPLS, DICT_IMPLS - Generate stdlib functions from these definitions - Use context manager (with self.indented()) for cleaner code - Reduce code duplication and improve maintainability
-
Roman Alifanov authored
- Add proper type tracking for function and method parameters - DCE now tracks array-returning methods (keys, split, slice) - Fix split/slice to return arrays via __CT_RET_ARR - Add foreach support for inline split expressions - Detect object parameters by unknown method calls - Add comprehensive tests for parameter passing New test classes: - TestFunctionParameterPassing (11 tests) - TestClassInstancePassing (4 tests)
-
Roman Alifanov authored
- String interpolation with operators: {a == b} now generates proper bash comparison instead of invalid ${a == b} - Double method call in conditions: CSE precompute now correctly reuses temp variable for CallExpr to avoid calling method twice - arr.push() with method call: detect side effects and call method separately to avoid subshell state isolation - charAt() with newline: use printf X marker to preserve trailing newlines - this.field.method() and obj.field.method(): handle nested MemberAccess in return statements and assignments - Namespace vs variable collision: check if identifier is known variable before treating as namespace - return func() with arrays: use _generate_call_arg for proper nameref
-
- 16 Feb, 2026 10 commits
-
-
Roman Alifanov authored
The dead code elimination was not tracking string/array method usage when methods were called on class fields like this.source.len(). Now properly calls _check_method() when field class is unknown.
-
Roman Alifanov authored
-
Roman Alifanov authored
- json.parse() now creates a dict from JSON string - json.stringify() converts dict back to JSON - Dict methods (.get, .set, .has, .del, .keys) work on parsed JSON - Added 4 integration tests for JSON functionality - Updated documentation
-
Roman Alifanov authored
- Fix benchmark numbers (47s/0.09s, ~530x speedup) - Add full project structure with all codegen mixins - Replace "Управление потоком" with "Условия и циклы" - Remove stale internal reference
-
Roman Alifanov authored
Made bench_heavy_awk.ct and bench_heavy_bash.ct identical except for @awk decorator. Fixed compound assignment with method calls that was causing different results.
-
Roman Alifanov authored
-
Roman Alifanov authored
-
Roman Alifanov authored
-
Roman Alifanov authored
New features: - .map() / .filter() for arrays with lambda support - @validate decorator for argument validation - fs.open() / f.read() / f.write() / f.close() file handles - with X in Y { } context manager for auto-closing resources All features work in both Bash and @awk codegen. Added 18 new pytest tests for the new functionality. Updated documentation (LANGUAGE_SPEC.md, README.md, README_ru.md). -
Roman Alifanov authored
-