Commit Graph

55 Commits

Author SHA1 Message Date
IgorCielniak
2055aa3b1f renamed some functions in stdlib/arr.sl and made examples/snake.sl use the functions from stdlib/arr.sl instead of custom ones 2026-03-21 14:03:39 +01:00
IgorCielniak
5dd361e563 added strdup 2026-03-20 21:23:45 +01:00
IgorCielniak
e2159bbca2 added memset_bytes, fixed some stack comments, fixed splitby_char and finally implemented splitby_str so splitby if now fully functional 2026-03-20 21:09:44 +01:00
igor
f4d688cac1 small fixes 2026-03-20 15:37:12 +01:00
IgorCielniak
4508433206 added 'ret' and implemented a proper 'strcmp' 2026-03-19 13:29:49 +01:00
igor
cda34e61bd added some functions to the stdlib 2026-03-18 15:27:01 +01:00
igor
78bf6c132f added an option to redefine control structures 2026-03-16 10:30:53 +01:00
IgorCielniak
2193e0bf3c small consistency fix in linux.sl 2026-03-13 19:49:56 +01:00
IgorCielniak
fd115f31dc small update to linux.sl and the syscall instruction, including some small optimizations 2026-03-13 19:42:15 +01:00
igor
0ac7f26a18 added async and hashmap lib to the stdlib as well as tests for them, improved the performance of the compiler, improved the buildt in doc tool and fixed some other small issues 2026-03-11 14:41:40 +01:00
igor
2a1ae2f774 compiler: add -O0/-O2 flags, -v 1..4, whole-word JIT, lazy init, auto-inline control
- Add -O0 (no opts) and -O2 (no opts + no checks) CLI flags
- Add -v 1..4 verbosity: timing, per-function stats, debug dump, optimization diffs
- Whole-word JIT: compile Definition bodies to native x86-64 for CT VM
- Lazy CTMemory/JIT/ctype init (defer ctypes until first CT execution)
- Stack-effect comment parsing for stack-checks
- Peephole rules refactored to module-level dicts with O(1) lookup
- _emitted_start short-circuit (O(1) vs O(n) scan)
- Add --no-auto-inline to disable auto-inlining of small asm bodies
- Fix --ct-run-main to execute after linking (prevent SIGSEGV)
- Stdlib: small optimizations like swap + drop -> nip
2026-03-09 14:04:45 +01:00
igor
1fed85bc0a small fix in the stack effect comments 2026-02-20 21:09:40 +01:00
igor
97f3df3836 update to the doc tool and to arr.sl 2026-02-19 16:14:41 +01:00
igor
2b311c7be7 update to the sorting functions and small fix to the compiler it self 2026-02-19 10:42:53 +01:00
igor
f3de51f5d8 update 2026-02-18 16:05:48 +01:00
igor
b0de836beb general update 2026-02-18 13:58:08 +01:00
IgorCielniak
adfc941538 added formating functions 2026-02-17 12:59:34 +01:00
igor
81ee4a8ff9 refactored the testing system, fixed fput and removed arr_asm.sl 2026-02-16 14:32:13 +01:00
IgorCielniak
a3c68860a7 added get_addr and jmp 2026-02-12 17:39:05 +01:00
IgorCielniak
709377a45b small fix in arr.sl 2026-02-10 17:47:59 +01:00
IgorCielniak
2f5b1f40b1 added a function to convert the buildt in array to a dynamic array 2026-02-10 11:31:39 +01:00
IgorCielniak
a8908819c4 added the option to compile in to .so and .a 2026-02-07 20:49:24 +01:00
IgorCielniak
bf4d11d313 added fdump and frdump for dumping the stack in the new format 2026-02-06 10:46:48 +01:00
IgorCielniak
5fb36ac9bc standardized the system of stack effect comments and updated/corrected the existing comments in stdlib and added some that were lacking 2026-02-05 21:36:03 +01:00
IgorCielniak
ac4c55cb8e some additions to core and test for them 2026-02-03 18:43:04 +01:00
IgorCielniak
c2fcaf8f8d ported dynamic arrays and strlen to l2 2026-02-03 09:41:11 +01:00
IgorCielniak
5ea020100e implemented realloc as well as a bunch of fixes and some small changes like changing the order of arguments for !, making alloc drop etc. 2026-02-02 15:51:58 +01:00
IgorCielniak
725fec9d73 added a simple effect system to avoid the hack with mentioning 'print_buf' in in comments inside of for ex. print 2026-01-16 11:59:41 +01:00
IgorCielniak
fa6e42292d proper cleanup of the return stack in the toint function 2026-01-13 09:26:05 +01:00
IgorCielniak
47a45c050e quite a few fixes, overall repo cleanup and some restructurization in the stdlib 2026-01-12 19:03:49 +01:00
IgorCielniak
4fe4d26511 added abs to stdlib.sl and made a toint function, I'm gonna kms 2026-01-12 10:32:25 +01:00
IgorCielniak
155b0eae07 added rdump to debug.sl for dumping the return stack 2026-01-12 08:47:42 +01:00
IgorCielniak
77594f45f4 rewritten 'sh' inside nob.sl from asm to l2 code, renamed strcpy to memcpy and put it in mem.sl 2026-01-11 19:26:39 +01:00
IgorCielniak
d62f2fe02d introduced direct ability to call syscalls and linux.sl 2026-01-08 20:56:36 +01:00
IgorCielniak
39ed504d88 added ewrite_buf and eputs 2026-01-08 18:44:48 +01:00
IgorCielniak
e7abc47cdf ststic arrays and dynamic arrays 2026-01-08 18:34:34 +01:00
IgorCielniak
b9098d9893 changed the way that functions are defined 2026-01-08 15:28:10 +01:00
IgorCielniak
d4dc6ceef5 small refactor and cleanup 2026-01-08 13:15:27 +01:00
IgorCielniak
c3fc9cf831 unified the block endings 2026-01-03 09:04:50 +00:00
root
d4b8ce6012 removed p! and p@ and added 'mem' that just pushes the addr os the persistent memory on to the stack and than you can write/read using standard ! and @ nd write at an offset uaing pointer arithmetic 2025-12-28 11:46:01 +01:00
IgorCielniak
ecb41d572a small fix in munmap 2025-12-26 21:44:13 +01:00
IgorCielniak
357434991e added a buffer of 64 bytes for some easily accesible persistent storage accesable via p@ and p! 2025-12-26 15:50:37 +01:00
IgorCielniak
7d6c1fb0d3 added argv and argc interaction 2025-12-25 22:37:04 +01:00
IgorCielniak
f76ef276e9 created stdlib/debug.sl and moved int3 there as well as an improved version of debug thats now called dump 2025-12-25 21:30:11 +01:00
IgorCielniak
e2b1368899 added neg and bitnot to the stdlib and made a fib.sl example 2025-12-25 12:20:11 +01:00
IgorCielniak
2b8cd25499 unhardcoded alloc size in strconcat so the buffer doesn't overflow 2025-12-25 10:59:21 +01:00
IgorCielniak
6988a89a51 added strconcat and strcpy functions 2025-12-24 23:19:08 +01:00
IgorCielniak
8419f36283 brought back the working version of mmp 2025-12-23 23:27:17 +01:00
IgorCielniak
852c55a768 small update 2025-12-21 13:41:34 +01:00
IgorCielniak
bfbbebf034 general update 2025-12-20 23:20:53 +01:00