Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
260 commits
Select commit Hold shift + click to select a range
8746b82
docs(website): add example for formatting specifiers in f-strings
nedanwr Jan 27, 2026
9c87762
feat(website): add accordion section for string interpolation enhance…
nedanwr Jan 27, 2026
49e2957
feat(website): expand f-string documentation with detailed format spe…
nedanwr Jan 27, 2026
d98ba8a
feat: add format specifiers to f-strings (#31)
nedanwr Jan 28, 2026
cf9eb70
chore(roadmap): mark string interpolation as done
nedanwr Jan 28, 2026
77f08b3
chore(roadmap): update status of anonymous functions/lambdas to compl…
nedanwr Jan 28, 2026
c03646a
feat(compiler): implement lambda expression compilation
nedanwr Jan 28, 2026
7f200a9
feat(compiler): add opcodes for function creation and invocation
nedanwr Jan 28, 2026
7aeae68
feat(core): enhance function value creation with parameter name support
nedanwr Jan 28, 2026
edaf5f6
feat(core): add parameter name support to function value creation
nedanwr Jan 28, 2026
f8c1553
feat(frontend): implement parsing for anonymous function (lambda) exp…
nedanwr Jan 28, 2026
a2882df
feat(frontend): add support for lambda expressions in AST structure
nedanwr Jan 28, 2026
0a1fac1
feat(vm): implement lambda function handling in VM.
nedanwr Jan 28, 2026
6f2f902
feat(vm): add `owned_bytecode` field for lambda function management i…
nedanwr Jan 28, 2026
f8effef
feat(lsp): enhance diagnostics for lambda expressions by checking fun…
nedanwr Jan 28, 2026
5d1359f
feat(lsp): update function completion description to include lambda e…
nedanwr Jan 28, 2026
ae060b2
feat(core): extend `value_new_function` to support parameter names
nedanwr Jan 28, 2026
c5d1369
feat(tests): add integration tests for basic and multi-line lambda ex…
nedanwr Jan 28, 2026
2317557
feat(website): add documentation for anonymous functions (lambdas) in…
nedanwr Jan 28, 2026
b39cb62
feat(core): enable POSIX functions by defining `_POSIX_C_SOURCE` in r…
nedanwr Jan 28, 2026
c22c0eb
feat: Add anonymous functions (lambdas) support (#32)
nedanwr Jan 28, 2026
bb5793a
feat(compiler): add tuple expression and unpacking assignment support
nedanwr Jan 28, 2026
6db3a22
feat(compiler): add opcodes for tuple creation and unpacking
nedanwr Jan 28, 2026
5f804af
feat(core): implement tuple value creation and management
nedanwr Jan 28, 2026
addbf94
feat(core): add tuple data structure and creation function
nedanwr Jan 28, 2026
b8c6634
feat(frontend): implement unpack assignment and multiple return value…
nedanwr Jan 28, 2026
e24e968
feat(frontend): add tuple and unpack assignment AST node types
nedanwr Jan 28, 2026
44ef933
feat(vm): implement `OP_TUPLE_NEW` and `OP_UNPACK` opcodes for tuple …
nedanwr Jan 28, 2026
96a4c42
feat(lsp): enhance reference search for unpack assignments and tuples
nedanwr Jan 28, 2026
0405a20
feat(lsp): add recursive checks for tuples and unpack assignments in …
nedanwr Jan 28, 2026
a04752f
feat(lsp): implement symbol creation and reference counting for unpac…
nedanwr Jan 28, 2026
ee57a43
feat(tests): add integration tests for multiple return values and unp…
nedanwr Jan 28, 2026
9c4524b
fix(tests): correct assertion for return statement to handle multiple…
nedanwr Jan 28, 2026
3a141de
feat(website): enhance quick reference and language sections with exa…
nedanwr Jan 28, 2026
941cbc1
docs(roadmap): update status of multiple return values feature to com…
nedanwr Jan 28, 2026
98a0fc7
feat(website): mark string interpolation, anonymous functions & multi…
nedanwr Jan 28, 2026
e8778ca
feat: Add multiple return values support (#33)
nedanwr Jan 28, 2026
877c7e2
feat(vm): enhance function call handling with support for default and…
nedanwr Feb 18, 2026
7eb206c
feat(vm): add support for required and optional parameters in functio…
nedanwr Feb 18, 2026
2562abf
feat(compiler): implement default parameter values and named argument…
nedanwr Feb 18, 2026
7505d2f
feat(core): extend function value structure to include required arity…
nedanwr Feb 18, 2026
515fd41
feat(core): update function value structure to include required arity…
nedanwr Feb 18, 2026
512d16d
feat(frontend): implement extended parameter parsing with support for…
nedanwr Feb 18, 2026
82a3d99
feat(frontend): enhance ASTNode structure with default parameter valu…
nedanwr Feb 18, 2026
be02900
feat(frontend): add support for ellipsis and equals tokens in tokeniz…
nedanwr Feb 18, 2026
f002c80
feat(frontend): add `TOK_ELLIPSIS` token to tokenizer for variadic pa…
nedanwr Feb 18, 2026
e22fb99
feat(lsp): enhance type inference with recursion depth tracking and i…
nedanwr Feb 18, 2026
bc3e707
feat(lsp): improve hover information for functions by enhancing param…
nedanwr Feb 18, 2026
7bae3b8
feat(lsp): enhance symbol structure to support required and variadic …
nedanwr Feb 18, 2026
0ad9015
feat(lsp): add required and variadic parameter support to Symbol stru…
nedanwr Feb 18, 2026
0d79cdb
fix(main): improve error handling during AST parsing by capturing par…
nedanwr Feb 18, 2026
144d340
feat(tests): update unit tests for `value_new_function` to include re…
nedanwr Feb 18, 2026
38f17b5
feat(tests): add unit tests for hover and diagnostics of functions wi…
nedanwr Feb 18, 2026
0f19455
docs(ROADMAP): update function enhancements section to indicate compl…
nedanwr Feb 18, 2026
897d0ca
feat(website): mark function enhancements section as complete with a …
nedanwr Feb 18, 2026
dc89eb7
feat(website): add sections on default parameter values, variadic par…
nedanwr Feb 18, 2026
e7b43bc
feat(website): add examples for default parameters, variadic paramete…
nedanwr Feb 18, 2026
f9b082c
test(integration): add test for function with required parameter foll…
nedanwr Feb 18, 2026
3dfa347
feat: Add default parameters, variadic functions, and named arguments…
nedanwr Feb 19, 2026
b929890
fix(core): improve slot handling in garbage collection by refining to…
nedanwr Feb 19, 2026
70ff474
test(gc): add unit test for untracking behavior after tombstone colli…
nedanwr Feb 19, 2026
af3a970
fix(vm): enhance function memory management and error handling during…
nedanwr Feb 19, 2026
cd01655
test(vm): add unit tests for function definition and execution error …
nedanwr Feb 19, 2026
a6b4cdd
fix(frontend): improve memory management in if-else parsing by using …
nedanwr Feb 19, 2026
2ddcf86
test(parser): add unit test for parsing if-else-if chains to validate…
nedanwr Feb 19, 2026
2eb31c4
fix(core): implement recursive fallback for value release to handle m…
nedanwr Feb 19, 2026
e98e0a6
test(runtime): add unit test for deep nested list equality and implem…
nedanwr Feb 19, 2026
70dfd11
fix(lsp): enhance parameter handling in function symbol processing to…
nedanwr Feb 19, 2026
4d1a0d1
test(lsp): add unit tests for symbol processing in functions, validat…
nedanwr Feb 19, 2026
2748e02
test(makefile): add `lsp_utils` test source to unit test build process
nedanwr Feb 19, 2026
a64ed65
fix(main): ensure proper memory cleanup for `execute_args` in usage a…
nedanwr Feb 19, 2026
181ccf9
fix(website): update string formatting in `HomePage` component for pr…
nedanwr Feb 19, 2026
db5efcf
fix(website): replace anchor tag with Next.js Link component for impr…
nedanwr Feb 19, 2026
3c331b5
refactor(examples): streamline variable assignments and enhance boole…
nedanwr Feb 19, 2026
f88990f
refactor(examples): update print statements to use f-string formattin…
nedanwr Feb 19, 2026
fb3b26e
refactor(examples): update exception handling examples for clarity an…
nedanwr Feb 19, 2026
e6792ff
refactor(website): restructure PostCSS configuration for improved cla…
nedanwr Feb 19, 2026
9bcf9c6
refactor(tests): improve function initialization in unit tests for be…
nedanwr Feb 19, 2026
8a129ad
refactor(runtime): implement interned string release function to enha…
nedanwr Feb 19, 2026
fff2f32
refactor(runtime): add internal function to release interned strings …
nedanwr Feb 19, 2026
9e76a94
refactor(gc): simplify `gc_init` and `gc_cleanup` functions for impro…
nedanwr Feb 19, 2026
a63ace7
feat(lsp): enable `POSIX` function declarations for strict C builds i…
nedanwr Feb 19, 2026
5e6779b
fix: harden memory management and add regression coverage across core…
nedanwr Feb 19, 2026
0548401
docs(roadmap): update roadmap for versions 0.6.0 to 1.0.0, detailing …
nedanwr Mar 5, 2026
a701426
docs(website): update roadmap for versions 0.6.0 to 1.0.0, detailing …
nedanwr Mar 5, 2026
38e7745
feat(vm): add higher-order functions `filter` and `map` with callback…
nedanwr Mar 6, 2026
cf983e6
feat(frontend): enhance error handling for function call parsing to s…
nedanwr Mar 6, 2026
78c95d0
feat(lsp): add support for `filter` and `map` functions in built-in a…
nedanwr Mar 6, 2026
48b0789
feat(lsp): extend argument validation to include `filter` and `map` f…
nedanwr Mar 6, 2026
9f5dbd4
feat(lsp): add descriptions for `filter` and `map` functions in compl…
nedanwr Mar 6, 2026
a0e2568
test(vm): add unit tests for `filter` and `map` built-in functions, i…
nedanwr Mar 6, 2026
4ba825a
feat(lsp): add diagnostics and completion tests for `filter` and `map…
nedanwr Mar 6, 2026
4b766d3
test(integration): add higher-order function tests for `filter` and `…
nedanwr Mar 6, 2026
46344e6
docs(website): add documentation for `filter` and `map` functions, in…
nedanwr Mar 6, 2026
0db3e3b
docs(README): update Enhanced Standard Library section to include `fi…
nedanwr Mar 6, 2026
3a6bf14
docs(ROADMAP): mark completion of List Utilities section with `filter…
nedanwr Mar 6, 2026
275c2ee
docs(website): update Higher-Order Functions section to indicate comp…
nedanwr Mar 6, 2026
7371be8
Feat/list utilities (#36)
nedanwr Mar 7, 2026
b8f7465
chore(ci): update GitHub Actions workflow to grant write permissions …
nedanwr Mar 7, 2026
13e7198
chore(ci): update auto-label workflow to adjust permissions for issue…
nedanwr Mar 7, 2026
3cbfc5b
feat(frontend): add support for bracket tokens
nedanwr Mar 7, 2026
9690a40
feat(frontend): add left and right bracket tokens to tokenizer
nedanwr Mar 7, 2026
3bef5aa
feat(compiler): implement list comprehension expression compilation
nedanwr Mar 7, 2026
54c3a74
feat(frontend): enhance parser to support list comprehensions and bra…
nedanwr Mar 7, 2026
376b91f
feat(lsp): add support for list comprehension references in AST trave…
nedanwr Mar 7, 2026
2095e55
feat(lsp): implement recursive checks for list comprehensions in AST …
nedanwr Mar 7, 2026
b60701b
feat(lsp): enhance AST traversal with recursive symbol processing for…
nedanwr Mar 7, 2026
bbd0370
test(lsp): add unit tests for list comprehension loop variable handling
nedanwr Mar 7, 2026
bc1f9d9
test(lsp): implement lsp_definition function for retrieving symbol de…
nedanwr Mar 7, 2026
5101829
test(lsp): add lsp_definition function declaration for symbol definit…
nedanwr Mar 7, 2026
d383f61
test(compiler): add unit test for list comprehension compilation and …
nedanwr Mar 7, 2026
6a68662
test(parser): add unit tests for parsing bracket list literals and li…
nedanwr Mar 7, 2026
9b85970
test(tokenizer): add unit test for tokenizing bracket list comprehens…
nedanwr Mar 7, 2026
b1838c4
test(vm): add unit tests for list comprehension execution in the VM
nedanwr Mar 7, 2026
7dba7ba
test(integration): add integration test for list comprehensions with …
nedanwr Mar 7, 2026
7bfd44d
docs(website): add examples for list comprehensions using bracket lit…
nedanwr Mar 7, 2026
0b31093
docs(website): update accordion title for list comprehensions to indi…
nedanwr Mar 7, 2026
d252418
docs(website): expand list documentation with bracketed lists and lis…
nedanwr Mar 7, 2026
db26f01
docs(roadmap): mark list comprehensions as completed in the roadmap
nedanwr Mar 7, 2026
cd248c4
docs(readme): enhance lists and arrays section with details on list c…
nedanwr Mar 7, 2026
691937d
feat(vm): implement built-in function registry with binary search for…
nedanwr Mar 7, 2026
0571074
feat(vm): add internal header for built-in functions in the VM
nedanwr Mar 7, 2026
8211994
feat(vm): create header file for built-in function lookup in the VM
nedanwr Mar 7, 2026
f1fe0aa
feat(vm): implement built-in functions in the VM with portable file h…
nedanwr Mar 7, 2026
c03a50c
feat(vm): add header file for built-in function handlers and invocati…
nedanwr Mar 7, 2026
6744845
refactor(vm): rename `call_function_value` to `vm_call_function_value…
nedanwr Mar 7, 2026
20d122a
build(makefile): include additional VM source files for built-in func…
nedanwr Mar 7, 2026
c104b47
Feat/list comprehension (#37)
nedanwr Mar 7, 2026
b9f23a4
feat(frontend): add new token types for match-case syntax
nedanwr Mar 8, 2026
a274f41
feat(frontend): update token types to include match-case syntax
nedanwr Mar 8, 2026
874d750
feat(compiler): implement match statement compilation
nedanwr Mar 8, 2026
3632868
feat(frontend): add match statement support in AST structure
nedanwr Mar 8, 2026
778a144
feat(frontend): implement match statement parsing and case handling
nedanwr Mar 8, 2026
18afffe
feat(frontend): enhance match statement support with case and default…
nedanwr Mar 8, 2026
d144fac
test(tokenizer): add unit test for `tokenize_match_keywords` function
nedanwr Mar 8, 2026
0b31c69
test(vm): add unit test for match statement execution in a loop
nedanwr Mar 8, 2026
0888efa
test(parser): add unit test for match statement parsing with cases an…
nedanwr Mar 8, 2026
1acf40c
test(compiler): add unit test for match statement compilation with ca…
nedanwr Mar 8, 2026
f86fad9
test(lsp): add unit tests for match statement features including patt…
nedanwr Mar 8, 2026
8004875
docs(roadmap): update Pattern Matching section to indicate completion…
nedanwr Mar 8, 2026
c6b4789
feat(frontend): add new keywords for match statement support includin…
nedanwr Mar 8, 2026
80b0a40
test(integration): add test for default case in match statement to en…
nedanwr Mar 8, 2026
99d9756
test(integration): add integration test for basic pattern matching fu…
nedanwr Mar 8, 2026
804bec2
fix(vscode-extension): update keyword patterns to include 'match', 'c…
nedanwr Mar 8, 2026
2224987
fix(website): extend keyword patterns in kronos.tmLanguage.json to in…
nedanwr Mar 8, 2026
92468e2
docs(website): add Pattern Matching section with usage examples for '…
nedanwr Mar 8, 2026
a7ee0a9
docs(website): include example usage of pattern matching with 'match'…
nedanwr Mar 8, 2026
e49573e
docs(roadmap): update Pattern Matching section to reflect completion …
nedanwr Mar 8, 2026
2a539b1
docs(bootstrap): add comprehensive analysis of Kronos bootstrap strat…
nedanwr Mar 8, 2026
cea3f49
feat: implement pattern matching (#38)
nedanwr Mar 8, 2026
7e6352a
feat(tokenizer): add support for angle brackets in tokenizer
nedanwr Mar 8, 2026
95144d9
feat(runtime): enhance type checking with support for generic types a…
nedanwr Mar 8, 2026
35fa270
feat(compiler): add support for type aliases as compile-time metadata…
nedanwr Mar 8, 2026
6a912dc
feat(parser): implement type alias support in the parser
nedanwr Mar 8, 2026
b289d2f
feat(lsp): add support for type aliases in completion, hover, and dia…
nedanwr Mar 8, 2026
f19feb3
feat(vm): add type validation for global and local variable assignments
nedanwr Mar 8, 2026
4abb5d0
test(vm): add tests for type validation in global and local variable …
nedanwr Mar 8, 2026
091aacf
test(tokenizer): add test for tokenizing generic type delimiters
nedanwr Mar 8, 2026
97666b0
test(runtime): add unit tests for type validation with unions, generi…
nedanwr Mar 8, 2026
848c8e8
test(parser): add unit tests for parsing typed assignments with gener…
nedanwr Mar 8, 2026
2dc71bb
test(lsp): add tests for type alias completion, hover, and diagnostics
nedanwr Mar 8, 2026
cc16650
test(integration): add tests for type alias, generic, and union type …
nedanwr Mar 8, 2026
a8f6d8c
docs(website): update roadmap to indicate completion of type system e…
nedanwr Mar 8, 2026
3e41af2
docs(website): enhance data types documentation with richer type expr…
nedanwr Mar 8, 2026
1f56f8f
docs(website): add examples for generic, union type annotations, and …
nedanwr Mar 8, 2026
9947f6a
docs(readme): clarify optional type annotations with examples for pri…
nedanwr Mar 8, 2026
60db259
docs(roadmap): update type system enhancements section to indicate co…
nedanwr Mar 8, 2026
18cd1e4
feat: complete type system enhancements (#39)
nedanwr Mar 8, 2026
97d5caf
feat(compiler): add debug statement compilation support
nedanwr Mar 11, 2026
6e231cf
feat(parser): implement debug statement parsing and AST support
nedanwr Mar 11, 2026
4fc29f4
feat(tokenizer): add DEBUG token support to tokenizer and header
nedanwr Mar 11, 2026
34c0fff
feat(lsp): add support for debug statements in completion, diagnostic…
nedanwr Mar 11, 2026
c223874
feat(vm): implement debug operation for runtime value inspection
nedanwr Mar 11, 2026
2119aa1
test(lsp): add tests for debug statement functionality in completion …
nedanwr Mar 11, 2026
1c2ebff
test(compiler): add unit test for debug statement compilation
nedanwr Mar 11, 2026
92ae920
test(parser): add unit test for parsing debug statements with multipl…
nedanwr Mar 11, 2026
a4ab1d3
test(tokenizer): add unit test for 'debug' keyword tokenization
nedanwr Mar 11, 2026
f939eaa
test(vm): add unit test for executing debug statements in the VM
nedanwr Mar 11, 2026
abc0afd
feat(website): include 'debug' keyword in syntax highlighting for imp…
nedanwr Mar 11, 2026
04e922f
feat(website): update keyword matching to include 'debug' for enhance…
nedanwr Mar 11, 2026
d52ad4a
docs(website): enhance roadmap with debugging support details and exa…
nedanwr Mar 11, 2026
b281197
docs(website): update editor setup documentation to include 'debug' i…
nedanwr Mar 11, 2026
918e1eb
docs(website): add section on 'debug' statements for runtime visibili…
nedanwr Mar 11, 2026
58073b3
feat(vscode-extension): update keyword matching to include 'debug' fo…
nedanwr Mar 11, 2026
2c04950
test(integration): add integration test for debugging support stateme…
nedanwr Mar 11, 2026
12d14f7
feat(keywords): add 'debug' keyword for token recognition in syntax h…
nedanwr Mar 11, 2026
8d55c66
docs(roadmap): update debugging support section with completed featur…
nedanwr Mar 11, 2026
833ee2a
feat: implement debugging support (#40)
nedanwr Mar 11, 2026
47ae49a
feat(lsp): enhance language server capabilities with new features
nedanwr Mar 11, 2026
7e55d0c
test(lsp): add comprehensive LSP feature tests for signature help, se…
nedanwr Mar 11, 2026
fe44c4a
fix(lsp): enhance error reporting for functions requiring number argu…
nedanwr Mar 11, 2026
90dc6a9
feat(lsp): add functions to find call expression and argument positio…
nedanwr Mar 11, 2026
fec1e64
feat(lsp): add functions to locate call expression and argument posit…
nedanwr Mar 11, 2026
652d594
test(lsp): add tests for diagnostics on invalid argument types in bui…
nedanwr Mar 11, 2026
79cafe3
test(integration): expand integration tests for built-in numeric func…
nedanwr Mar 11, 2026
f48b1c6
refactor(lsp): improve variable reassignment checks in diagnostics by…
nedanwr Mar 11, 2026
ccc6809
test(lsp): add test for diagnostics on comparison type errors involvi…
nedanwr Mar 11, 2026
e8f8e9d
fix(scripts): resolve script and project root directory issues in ins…
nedanwr Mar 11, 2026
27c78bc
feat(lsp): implement diagnostics for missing keys in static maps duri…
nedanwr Mar 11, 2026
5a4ec04
test(lsp): add tests for diagnostics on deleting nonexistent and exis…
nedanwr Mar 11, 2026
8a9dc22
test(integration): add tests for deleting nonexistent map keys in var…
nedanwr Mar 11, 2026
9754c5f
feat(lsp): implement import stack management and diagnostics for circ…
nedanwr Mar 12, 2026
8e76b17
test(lsp): add tests for diagnostics on missing module files and circ…
nedanwr Mar 12, 2026
716062f
feat(lsp): enhance diagnostics for division and modulo by zero with c…
nedanwr Mar 12, 2026
4c60456
test(lsp): add test for diagnostics on division and modulo by zero us…
nedanwr Mar 12, 2026
bc77154
fix(vscode-extension): update end pattern for 'with' keyword to allow…
nedanwr Mar 12, 2026
3e07eef
fix(web): modify end pattern for 'with' keyword to include end of lin…
nedanwr Mar 12, 2026
fc8ac78
test(integration): update tests for file I/O to use direct calls inst…
nedanwr Mar 12, 2026
020c74c
feat(lsp): enhance diagnostics for file I/O functions to require stri…
nedanwr Mar 12, 2026
fa990df
test(lsp): add test for diagnostics on file I/O functions requiring s…
nedanwr Mar 12, 2026
1b637e8
fix(vm): improve exception handling logic in vm_execute to ensure pro…
nedanwr Mar 12, 2026
3c607a0
test(integration): add test for handling runtime exceptions in file I…
nedanwr Mar 12, 2026
59d73d8
docs(website): add new section for LSP improvements including signatu…
nedanwr Mar 12, 2026
d6a73b8
docs(website): update editor setup documentation to reflect new LSP f…
nedanwr Mar 12, 2026
0a0be2f
feat: add advanced language-server features and stronger diagnostics …
nedanwr Mar 12, 2026
de111e8
docs(README): update LSP support section to include comprehensive fea…
nedanwr Mar 12, 2026
563f07e
docs(ROADMAP): mark LSP improvements as completed with detailed featu…
nedanwr Mar 12, 2026
4a10c5a
fix(compiler): improve error handling for return statements and defau…
nedanwr Mar 12, 2026
b9c8c60
fix(lsp): enhance reference search in match statements to handle null…
nedanwr Mar 12, 2026
0f875c5
refactor(lsp): rename import stack fields for clarity and update rela…
nedanwr Mar 12, 2026
81f81dd
feat(lsp): add function to detect non-linear control flow in statements
nedanwr Mar 12, 2026
b9d152d
fix(gc): add memory cleanup for tuple objects in garbage collection
nedanwr Mar 12, 2026
7c3ad32
feat(compiler): add support for lambda and tuple expressions in state…
nedanwr Mar 12, 2026
3163162
fix(lsp): extend module name check in diagnostics to include "regex" …
nedanwr Mar 12, 2026
ce8d435
feat(lsp): add scope tracking to symbols with new properties and func…
nedanwr Mar 12, 2026
e1e0d29
fix(lsp): update symbol lookup to use position-based search for impro…
nedanwr Mar 12, 2026
2012066
fix(lsp): update reference counting to use symbol-based lookup for im…
nedanwr Mar 12, 2026
aba4740
fix(lsp): update symbol lookup to use position-based function for imp…
nedanwr Mar 12, 2026
35cf1f0
feat(lsp): implement node position tracking with recursive bounds col…
nedanwr Mar 12, 2026
2bb61a2
feat(lsp): add function to check if position is inside quoted strings…
nedanwr Mar 12, 2026
e1b8d26
refactor(roadmap): clarify crypto module features by separating legac…
nedanwr Mar 12, 2026
0a5c081
refactor(roadmap): update crypto module documentation to separate leg…
nedanwr Mar 12, 2026
24a88d8
feat(vm): enhance path handling functions with improved separator man…
nedanwr Mar 12, 2026
271334e
fix(vm): improve error handling in `builtin_read_lines` to ensure com…
nedanwr Mar 12, 2026
563d722
feat(lsp): enhance reference matching logic to include target symbol …
nedanwr Mar 12, 2026
e1dc3b6
feat(lsp): add tests for excluding shadowed comprehension variables i…
nedanwr Mar 12, 2026
3f635ac
test(integration): add failing test for `to_number` with empty string…
nedanwr Mar 12, 2026
29aab6f
fix(compiler): enhance `bytecode_print` to handle function metadata a…
nedanwr Mar 13, 2026
c2ba8cd
feat(gc): add tracking and untracking for tuple items in garbage coll…
nedanwr Mar 13, 2026
1fb2bfa
test(gc): add test for tuple allocated bytes accounting in garbage co…
nedanwr Mar 13, 2026
91a6c62
feat(lsp): implement module caching and diagnostics improvements with…
nedanwr Mar 13, 2026
b39b451
fix(vm): ensure proper cleanup of stack values in `run_function_callb…
nedanwr Mar 13, 2026
3aa8e95
feat(lsp): introduce `lsp_find_symbol_for_var_node` function to strea…
nedanwr Mar 13, 2026
8ef8875
fix(lsp): add check for match statement value in function call diagno…
nedanwr Mar 13, 2026
753710b
fix(lsp): improve memory management in `handle_folding_range` by dyna…
nedanwr Mar 13, 2026
dc8a743
fix(lsp): adjust position calculation in `find_call_expression_positi…
nedanwr Mar 13, 2026
4bdde2e
fix(vm): enhance `builtin_dirname` and `builtin_basename` to correctl…
nedanwr Mar 13, 2026
97acaee
fix(lsp): improve memory management in `handle_formatting` by adding …
nedanwr Mar 13, 2026
6c02207
fix(lsp): simplify callee normalization in `parse_call_edges` by remo…
nedanwr Mar 13, 2026
8852e7e
fix(compiler): enhance validation for lambda and function parameter m…
nedanwr Mar 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions .cursor/rules/no-reference.mdc

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/auto-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ on:
pull_request:
types: [opened, edited]

permissions:
contents: read
issues: write
pull-requests: write

jobs:
label-issues:
name: Label Issues
if: github.event_name == 'issues'
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Auto-label issue based on title and body
uses: actions/github-script@v8
Expand Down Expand Up @@ -109,6 +106,9 @@ jobs:
name: Label Pull Requests
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v6
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
build-binaries:
name: Build Release Binary
runs-on: ${{ matrix.os }}
permissions:
contents: write

strategy:
matrix:
Expand Down
161 changes: 161 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

Kronos is a programming language written in C with human-readable syntax. It features a bytecode VM, reference-counting garbage collection, and an LSP server for IDE support.

## Build Commands

```bash
make # Build main binary (kronos)
make lsp # Build LSP server (kronos-lsp)
make clean # Remove build artifacts
make test-unit # Run unit tests
./scripts/run_tests.sh # Run full test suite (129 tests)
```

Run a single file:
```bash
./kronos examples/hello.kr
./kronos tests/integration/pass/variables_immutable.kr
```

Start the REPL:
```bash
./kronos
```

## Architecture

The project follows a classic compiler pipeline:

```
Source (.kr) → Tokenizer → Parser → Compiler → VM
```

### Directory Structure

- `src/core/` - Runtime value system (`KronosValue`) and reference-counting GC
- `src/frontend/` - Tokenizer and recursive descent parser (produces AST)
- `src/compiler/` - AST to bytecode compilation (60+ opcodes)
- `src/vm/` - Stack-based bytecode VM execution
- `src/lsp/` - Language Server Protocol implementation
- `main.c` - CLI entry point (file execution + REPL)

### Key Data Flow

1. **Tokenizer** (`tokenizer.c`) converts source to token stream
2. **Parser** (`parser.c`) builds AST from tokens (40+ node types)
3. **Compiler** (`compiler.c`) generates bytecode + constant pool
4. **VM** (`vm.c`) executes bytecode on a 1024-slot value stack

### Value System

`KronosValue` (in `runtime.h`) is a reference-counted union type supporting: numbers, strings, booleans, nil, functions, lists, ranges, maps, and channels.

## Feature Implementation Workflow

**Follow these steps strictly when implementing new features.**

### Step 1: Planning

Before writing any code, plan how to tackle the feature. Determine the order of events and which parts to implement first. Always prioritize the best and most efficient approach, NOT ease of implementation.

For the core language, this typically means modifying in order:
- `src/frontend/tokenizer.c/h` - Add token types if needed
- `src/frontend/parser.c/h` - Extend AST node types
- `src/compiler/compiler.c/h` - Generate bytecode
- `src/vm/vm.c/h` - Implement execution

### Step 2: Implementation Review

After implementing the feature, review the work **twice**, looking for:
- Bugs or logic errors
- Inefficiencies or unnecessary resource usage
- Opportunities to achieve the same result with less memory/CPU

The language must not be a resource hog. If any changes are made during review, repeat Step 2 (review twice again) until no more issues are found.

### Step 3: Core Tests

Add test cases in `tests/integration/pass/` and `tests/integration/fail/` to test the implementation. Run the tests. If tests fail:
1. Investigate why
2. Implement fixes
3. Return to Step 2 (review twice)
4. Only skip Step 3 if no additional tests are needed

Repeat until all tests pass.

### Step 4: LSP Implementation

Modify the LSP (`src/lsp/`) to support the new feature. The LSP is one of the trickiest components to get right.

After modifying the LSP, review your work **three times**, checking for bugs, inefficiencies, and anything missed. If any issues are found and fixed, review **three times again**. Repeat as needed until the review is clean.

### Step 5: LSP Tests

Create test cases for the LSP implementation in `tests/lsp/`. If tests fail:
1. Return to Step 4 and follow it exactly
2. Repeat Steps 4 and 5 until all LSP tests pass

### Step 6: Memory Checks

Run valgrind memory checks to detect leaks, invalid reads/writes, and other memory issues. Use `act` or `docker` to run valgrind:

```bash
# Using act to run the memory-check workflow locally
act -j memory-check

# Or using docker directly
docker run --rm -v $(pwd):/workspace -w /workspace gcc:latest bash -c \
"apt-get update && apt-get install -y valgrind && make clean && make && \
valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1 \
./kronos tests/integration/pass/your_test.kr"
```

Run memory checks against multiple test files covering the new feature. If any memory issues are found:
1. Fix the issues
2. Return to Step 1 (re-plan the approach if the fix requires architectural changes)
3. Return to Step 2 (review twice)
4. Return to Step 3 (add/run tests) if needed
5. Re-run Steps 4-6 as needed

Do not proceed until valgrind reports zero errors and zero leaks.

### Step 7: REPL Support

Modify the REPL (in `main.c`) to support the new feature. After making changes, review your work **twice** as per Step 2. Fix any issues and re-run the twice review. Repeat as long as fixes are being made.

### Step 8: Documentation

Update the website documentation (`website/`) to reflect the changes made.

### Step 9: Compliance

Follow all steps above strictly. Do not skip steps or reduce the number of reviews.

## Code Style

- 4-space indentation, K&R braces
- Functions: `snake_case` (e.g., `value_new_number`)
- Types: `PascalCase` (e.g., `KronosValue`)
- Constants/Opcodes: `UPPER_SNAKE_CASE` (e.g., `OP_LOAD_CONST`)

## Testing

- **Integration tests**: `tests/integration/pass/` (should succeed) and `tests/integration/fail/` (expected errors)
- **Unit tests**: `tests/unit/` for tokenizer, parser, compiler, VM, runtime, GC
- Run a specific test: `./kronos tests/integration/pass/your_test.kr`
- Memory check with valgrind: `valgrind --leak-check=full ./kronos tests/integration/pass/your_test.kr`

## Commit Conventions

Format: `(Type): description`

Types: `Feat`, `Fix`, `Docs`, `Test`, `Refactor`, `Chore`

## Important Rules

Do not reference, cite, or link to any file that is not committed to git. Only reference tracked files that are expected to be committed.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LDFLAGS = -lm
CORE_SRC = src/core/runtime.c src/core/gc.c
FRONTEND_SRC = src/frontend/tokenizer.c src/frontend/keywords_hash.c src/frontend/parser.c
COMPILER_SRC = src/compiler/compiler.c
VM_SRC = src/vm/vm.c
VM_SRC = src/vm/vm.c src/vm/vm_builtins.c src/vm/vm_builtins_registry.c
MAIN_SRC = main.c
LINENOISE_SRC = linenoise.c

Expand Down Expand Up @@ -118,6 +118,7 @@ TEST_UNIT_SRC = tests/unit/test_tokenizer.c \
tests/unit/test_compiler.c \
tests/unit/test_vm.c \
tests/unit/test_gc.c \
tests/unit/test_lsp_utils.c \
tests/unit/test_main.c

# Unit test object files
Expand All @@ -130,9 +131,10 @@ TEST_TARGET = tests/unit/kronos_unit_tests
# Object files for unit tests (exclude main.o)
TEST_OBJ_SRC = $(CORE_SRC) $(FRONTEND_SRC) $(COMPILER_SRC) $(VM_SRC)
TEST_OBJ_BASE = $(TEST_OBJ_SRC:.c=.o)
TEST_UNIT_EXTRA_OBJ = src/lsp/lsp_utils.o

# Build unit tests
$(TEST_TARGET): $(TEST_OBJ_BASE) $(TEST_OBJ)
$(TEST_TARGET): $(TEST_OBJ_BASE) $(TEST_UNIT_EXTRA_OBJ) $(TEST_OBJ)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

# Build test object files
Expand Down
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ A high-performance programming language built in C with human-readable syntax, f

- **Human-Readable Syntax**: Natural language keywords like `set`, `let`, `to`, `print`, `is equal`, `greater than`, etc.
- **Mutable & Immutable Variables**: Choose between `let` (mutable) and `set` (immutable)
- **Optional Type Annotations**: Enforce types with the `as` keyword
- **Optional Type Annotations**: Enforce primitive, generic, union, and alias types with `as`
- **F-Strings**: Formatted string literals with expression interpolation (`f"Hello, {name}!"`)
- **String Operations**: Concatenation, indexing, slicing, and comprehensive built-in functions
- **Lists & Arrays**: List literals, indexing, slicing, and iteration
- **Lists & Arrays**: Keyword and bracket list literals, list comprehensions, indexing, slicing, and iteration
- **Maps/Dictionaries**: Key-value storage with hash table implementation, map literals, and indexing
- **Range Objects**: First-class range support with indexing, slicing, and iteration
- **Enhanced Standard Library**: Math functions (sqrt, power, abs, round, floor, ceil, rand, min, max), type conversion (to_number, to_bool), and list utilities (reverse, sort)
- **Enhanced Standard Library**: Math functions (sqrt, power, abs, round, floor, ceil, rand, min, max), type conversion (to_number, to_bool), and list utilities (reverse, sort, filter, map)
- **Module System**: Import built-in modules (`import math`) and file-based modules (`import utils from "utils.kr"`). Use namespaced functions (`math.sqrt`, `utils.function`). String functions are global built-ins.
- **Control Flow**: If/else-if/else, for/while loops, break/continue statements
- **Functions**: First-class functions with parameters, return values, and local scoping
Expand All @@ -30,8 +30,8 @@ A high-performance programming language built in C with human-readable syntax, f
### Developer Experience

- **Editor Support**: Syntax highlighting for VSCode, Vim, Sublime, and more
- **LSP Support**: Real-time error checking, go-to-definition, hover information, and autocomplete
- **Comprehensive Testing**: 129 tests (83 passing, 46 expected fail cases) ensuring reliability
- **LSP Support**: Real-time diagnostics, definitions/references, hover, autocomplete, signature help, inlay hints, call hierarchy, semantic tokens, and folding
- **Comprehensive Testing**: Unit, integration, and LSP coverage across implemented language features

## Quick Start

Expand Down Expand Up @@ -63,7 +63,7 @@ Run the comprehensive test suite:
./scripts/run_tests.sh
```

This runs 129 tests (83 passing, 46 expected fail cases) covering all implemented features. See [tests/README.md](tests/README.md) for details.
This runs the project test suites covering implemented language features. See [tests/README.md](tests/README.md) for details.

### Editor Setup (Optional)

Expand All @@ -88,6 +88,11 @@ let counter to counter plus 1 # Can reassign
# Type annotations
let age to 25 as number
set name to "Alice" as string
let scores to list 95, 87, 92 as list<number>
let value to 42 as number or string

type Point to map x: number, y: number
set origin to map x: 0, y: 0 as Point

# Data types
set isActive to true
Expand Down Expand Up @@ -131,6 +136,7 @@ while counter is less than 10:

# Lists and ranges
set my_list to list 1, 2, 3, 4, 5
set squares to [x times x for x in range 1 to 6]
print my_list at 0 # First element
print my_list at -1 # Last element
print my_list from 1 to 3 # Slice
Expand Down
Loading
Loading