Skip to content

EXPERIMENTAL: Upgrade to Lua 5.5 and use generational gc - #44

Open
msaljuk wants to merge 108 commits into
mainfrom
lua-5.5
Open

msaljuk wants to merge 108 commits into
mainfrom
lua-5.5

Conversation

@msaljuk

@msaljuk msaljuk commented May 28, 2026

Copy link
Copy Markdown
Owner

Goes on top of #41, #42, and #43.

Only commit here is 14f7331.

Saw a slightly smaller (but maybe not statistically significant) memory footprint for the buddy allocator. Didn't appear to give any significant execution time wins in early testing.

msaljuk added 30 commits May 11, 2026 21:15
This commit
- Updates the instrument pipeline to automatically build the lua source, include and link it properly
- Updates the instrumented file generation to properly add lua lib and global includes
- Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

For cleanup, might want to cover all lua runtime compilation under a switch/flag
Contains:

- append_with_lua.exec.c: The core exec file instrumented using a Lua runtime. I'd recommend starting here
- append.lua: A generated Lua file that has all the file specific Lua CN implementations
- append.exec.c: The original exec file instrumented using a C runtime (for comparison)
- runtime/lua/cn/lua_cn_runtime_core.lua: The core CN runtime (think of this as the Lua corollary to cn-executable/utils.h/c)
- runtime/lua/cn/lua_wrappers.h/c: File containing wrapper C funcs to call into the core Lua runtime
I've also updated instrument.ml to easily take a handwritten Lua file and run it through the proper include and linkage steps (skipping Fulminate generation). You can now run

cn run-existing ./lua_output/append_with_lua.exec.c --experimental-lua-runtime and see the handwritten instrumented file get run (and any intermediate steps handled e.g. Lua src and wrapper library compilation, include and linkage)
* Squashed commit of the following:

commit af777d3
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 19:41:01 2026 +0500

    Update arrow_access_with_lua to match API changes

commit 01b3962
Merge: c550d72 dd5877f
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 19:39:21 2026 +0500

    Reconile main

commit c550d72
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 13:56:55 2026 +0500

    Get arrow access working

commit b9d2b4e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 13:48:17 2026 +0500

    Final push for append

commit 5fa0dec
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 21:02:04 2026 +0500

    Add explanation for read_int_list

commit 589d88e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:53:21 2026 +0500

    Update append.lua

commit 9aaca3d
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:47:49 2026 +0500

    Delete liblua.a

commit 12867be
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:46:10 2026 +0500

    Remove compiled append lua files

commit 0ded292
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:44:50 2026 +0500

    Revert append.c changes

commit 473eadc
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:42:56 2026 +0500

    Revert dune changes

commit 359e461
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:40:55 2026 +0500

    Get Lua CN working

    This gets Lua CN into a working state. Changes include:
    - Creating a CN subdirectory under the Lua runtime that has the entire core Lua runtime and a C file with wrapper calls into it. Also added a makefile to compile the wrapper lib.
    - Updated append.lua and append_with_lua.exec.c to properly interact with the working Lua runtime. Most of the Lua CN runtime just forwards to the C runtime (for now), with the exception of the CN frame and the implementation of CN pre and post conditions, which live natively in Lua
    - Updated instrument.ml to auto build the Lua wrapper lib, and link it whenever the Lua runtime is used.

commit e004233
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 31 22:13:04 2025 +0500

    Cleanup

    - make instrument util cleaner to avoid file renaming
    - cleanup lua library

commit cee5a2b
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Dec 29 12:32:35 2025 +0500

    Getting it working

commit 49421fb
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 18 12:20:20 2025 +0500

    Update file reference

commit 532d7c0
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 18 12:15:08 2025 +0500

    2nd Pass of Handwriting append.c with Lua runtime

commit 88b4ab7
Merge: bb54391 1d5a8ff
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 17 09:40:20 2025 +0500

    Merge branch 'main' into lua-handwritten-output

commit 1d5a8ff
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 17 09:34:36 2025 +0500

    Setting up flag to toggle Lua runtime on/off

commit 4e5ca38
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 22:17:31 2025 +0500

    Update gitignore to not track lualib asset and output files

commit 5067b30
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 3 23:22:53 2025 +0000

    Build and call into Lua

    This commit
    - Updates the instrument pipeline to automatically build the lua source, include and link it properly
    - Updates the instrumented file generation to properly add lua lib and global includes
    - Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

    For cleanup, might want to cover all lua runtime compilation under a switch/flag

commit 2d3065e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Tue Nov 25 00:53:56 2025 +0000

    Add lua 5.4.8 to project

commit bb54391
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 11 08:26:42 2025 +0500

    Fixup inconsistent naming of lua_cn_handle

commit 5b2fea8
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 11 07:43:00 2025 +0500

    v1 Pass of hand-writing an instrumented append.c using a Lua runtime

commit 15203cc
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 22:17:31 2025 +0500

    Update gitignore to not track lualib asset and output files

commit 4b0a160
Merge: d86287e d260aba
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 21:53:19 2025 +0500

    Merge branch 'main' of https://github.com/msaljuk/cn

commit d86287e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 3 23:22:53 2025 +0000

    Build and call into Lua

    This commit
    - Updates the instrument pipeline to automatically build the lua source, include and link it properly
    - Updates the instrumented file generation to properly add lua lib and global includes
    - Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

    For cleanup, might want to cover all lua runtime compilation under a switch/flag

commit bc43127
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Tue Nov 25 00:53:56 2025 +0000

    Add lua 5.4.8 to project

commit d260aba
Merge: d1dad84 94e15d3
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 21:49:49 2025 +0500

    [Fulminate] Build and call into Lua from Fulminate instrumented code

commit 94e15d3
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 3 23:22:53 2025 +0000

    Build and call into Lua

    This commit
    - Updates the instrument pipeline to automatically build the lua source, include and link it properly
    - Updates the instrumented file generation to properly add lua lib and global includes
    - Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

    For cleanup, might want to cover all lua runtime compilation under a switch/flag

commit d1dad84
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Tue Nov 25 00:53:56 2025 +0000

    Add lua 5.4.8 to project

* Remove unnecessary append files
commit af777d3
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 19:41:01 2026 +0500

    Update arrow_access_with_lua to match API changes

commit 01b3962
Merge: c550d72 dd5877f
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 19:39:21 2026 +0500

    Reconile main

commit c550d72
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 13:56:55 2026 +0500

    Get arrow access working

commit b9d2b4e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 13:48:17 2026 +0500

    Final push for append

commit 5fa0dec
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 21:02:04 2026 +0500

    Add explanation for read_int_list

commit 589d88e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:53:21 2026 +0500

    Update append.lua

commit 9aaca3d
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:47:49 2026 +0500

    Delete liblua.a

commit 12867be
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:46:10 2026 +0500

    Remove compiled append lua files

commit 0ded292
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:44:50 2026 +0500

    Revert append.c changes

commit 473eadc
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:42:56 2026 +0500

    Revert dune changes

commit 359e461
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:40:55 2026 +0500

    Get Lua CN working

    This gets Lua CN into a working state. Changes include:
    - Creating a CN subdirectory under the Lua runtime that has the entire core Lua runtime and a C file with wrapper calls into it. Also added a makefile to compile the wrapper lib.
    - Updated append.lua and append_with_lua.exec.c to properly interact with the working Lua runtime. Most of the Lua CN runtime just forwards to the C runtime (for now), with the exception of the CN frame and the implementation of CN pre and post conditions, which live natively in Lua
    - Updated instrument.ml to auto build the Lua wrapper lib, and link it whenever the Lua runtime is used.

commit e004233
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 31 22:13:04 2025 +0500

    Cleanup

    - make instrument util cleaner to avoid file renaming
    - cleanup lua library

commit cee5a2b
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Dec 29 12:32:35 2025 +0500

    Getting it working

commit 49421fb
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 18 12:20:20 2025 +0500

    Update file reference

commit 532d7c0
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 18 12:15:08 2025 +0500

    2nd Pass of Handwriting append.c with Lua runtime

commit 88b4ab7
Merge: bb54391 1d5a8ff
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 17 09:40:20 2025 +0500

    Merge branch 'main' into lua-handwritten-output

commit 1d5a8ff
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 17 09:34:36 2025 +0500

    Setting up flag to toggle Lua runtime on/off

commit 4e5ca38
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 22:17:31 2025 +0500

    Update gitignore to not track lualib asset and output files

commit 5067b30
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 3 23:22:53 2025 +0000

    Build and call into Lua

    This commit
    - Updates the instrument pipeline to automatically build the lua source, include and link it properly
    - Updates the instrumented file generation to properly add lua lib and global includes
    - Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

    For cleanup, might want to cover all lua runtime compilation under a switch/flag

commit 2d3065e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Tue Nov 25 00:53:56 2025 +0000

    Add lua 5.4.8 to project

commit bb54391
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 11 08:26:42 2025 +0500

    Fixup inconsistent naming of lua_cn_handle

commit 5b2fea8
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 11 07:43:00 2025 +0500

    v1 Pass of hand-writing an instrumented append.c using a Lua runtime

commit 15203cc
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 22:17:31 2025 +0500

    Update gitignore to not track lualib asset and output files

commit 4b0a160
Merge: d86287e d260aba
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 21:53:19 2025 +0500

    Merge branch 'main' of https://github.com/msaljuk/cn

commit d86287e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 3 23:22:53 2025 +0000

    Build and call into Lua

    This commit
    - Updates the instrument pipeline to automatically build the lua source, include and link it properly
    - Updates the instrumented file generation to properly add lua lib and global includes
    - Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

    For cleanup, might want to cover all lua runtime compilation under a switch/flag

commit bc43127
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Tue Nov 25 00:53:56 2025 +0000

    Add lua 5.4.8 to project

commit d260aba
Merge: d1dad84 94e15d3
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 21:49:49 2025 +0500

    [Fulminate] Build and call into Lua from Fulminate instrumented code

commit 94e15d3
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 3 23:22:53 2025 +0000

    Build and call into Lua

    This commit
    - Updates the instrument pipeline to automatically build the lua source, include and link it properly
    - Updates the instrumented file generation to properly add lua lib and global includes
    - Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

    For cleanup, might want to cover all lua runtime compilation under a switch/flag

commit d1dad84
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Tue Nov 25 00:53:56 2025 +0000

    Add lua 5.4.8 to project
* Add initial support for loop ownerships and check with for loop example

* Squashed commit of the following:

commit dd5877f
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 19:34:15 2026 +0500

    Remove append from main directory

* Fix leak in loop instrumentation

* Update runtime to support existing Fulminate flags

* Update append example to support new flags

* Squashed commit of the following:

commit af777d3
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 19:41:01 2026 +0500

    Update arrow_access_with_lua to match API changes

commit 01b3962
Merge: c550d72 dd5877f
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 19:39:21 2026 +0500

    Reconile main

commit c550d72
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 13:56:55 2026 +0500

    Get arrow access working

commit b9d2b4e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 13:48:17 2026 +0500

    Final push for append

commit 5fa0dec
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 21:02:04 2026 +0500

    Add explanation for read_int_list

commit 589d88e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:53:21 2026 +0500

    Update append.lua

commit 9aaca3d
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:47:49 2026 +0500

    Delete liblua.a

commit 12867be
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:46:10 2026 +0500

    Remove compiled append lua files

commit 0ded292
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:44:50 2026 +0500

    Revert append.c changes

commit 473eadc
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:42:56 2026 +0500

    Revert dune changes

commit 359e461
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:40:55 2026 +0500

    Get Lua CN working

    This gets Lua CN into a working state. Changes include:
    - Creating a CN subdirectory under the Lua runtime that has the entire core Lua runtime and a C file with wrapper calls into it. Also added a makefile to compile the wrapper lib.
    - Updated append.lua and append_with_lua.exec.c to properly interact with the working Lua runtime. Most of the Lua CN runtime just forwards to the C runtime (for now), with the exception of the CN frame and the implementation of CN pre and post conditions, which live natively in Lua
    - Updated instrument.ml to auto build the Lua wrapper lib, and link it whenever the Lua runtime is used.

commit e004233
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 31 22:13:04 2025 +0500

    Cleanup

    - make instrument util cleaner to avoid file renaming
    - cleanup lua library

commit cee5a2b
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Dec 29 12:32:35 2025 +0500

    Getting it working

commit 49421fb
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 18 12:20:20 2025 +0500

    Update file reference

commit 532d7c0
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 18 12:15:08 2025 +0500

    2nd Pass of Handwriting append.c with Lua runtime

commit 88b4ab7
Merge: bb54391 1d5a8ff
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 17 09:40:20 2025 +0500

    Merge branch 'main' into lua-handwritten-output

commit 1d5a8ff
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 17 09:34:36 2025 +0500

    Setting up flag to toggle Lua runtime on/off

commit 4e5ca38
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 22:17:31 2025 +0500

    Update gitignore to not track lualib asset and output files

commit 5067b30
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 3 23:22:53 2025 +0000

    Build and call into Lua

    This commit
    - Updates the instrument pipeline to automatically build the lua source, include and link it properly
    - Updates the instrumented file generation to properly add lua lib and global includes
    - Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

    For cleanup, might want to cover all lua runtime compilation under a switch/flag

commit 2d3065e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Tue Nov 25 00:53:56 2025 +0000

    Add lua 5.4.8 to project

commit bb54391
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 11 08:26:42 2025 +0500

    Fixup inconsistent naming of lua_cn_handle

commit 5b2fea8
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 11 07:43:00 2025 +0500

    v1 Pass of hand-writing an instrumented append.c using a Lua runtime

commit 15203cc
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 22:17:31 2025 +0500

    Update gitignore to not track lualib asset and output files

commit 4b0a160
Merge: d86287e d260aba
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 21:53:19 2025 +0500

    Merge branch 'main' of https://github.com/msaljuk/cn

commit d86287e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 3 23:22:53 2025 +0000

    Build and call into Lua

    This commit
    - Updates the instrument pipeline to automatically build the lua source, include and link it properly
    - Updates the instrumented file generation to properly add lua lib and global includes
    - Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

    For cleanup, might want to cover all lua runtime compilation under a switch/flag

commit bc43127
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Tue Nov 25 00:53:56 2025 +0000

    Add lua 5.4.8 to project

commit d260aba
Merge: d1dad84 94e15d3
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 21:49:49 2025 +0500

    [Fulminate] Build and call into Lua from Fulminate instrumented code

commit 94e15d3
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 3 23:22:53 2025 +0000

    Build and call into Lua

    This commit
    - Updates the instrument pipeline to automatically build the lua source, include and link it properly
    - Updates the instrumented file generation to properly add lua lib and global includes
    - Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

    For cleanup, might want to cover all lua runtime compilation under a switch/flag

commit d1dad84
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Tue Nov 25 00:53:56 2025 +0000

    Add lua 5.4.8 to project

* Remove unnecessary append files

* Lua Example - Arrow Access (#9)

* Squashed commit of the following:

commit af777d3
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 19:41:01 2026 +0500

    Update arrow_access_with_lua to match API changes

commit 01b3962
Merge: c550d72 dd5877f
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 19:39:21 2026 +0500

    Reconile main

commit c550d72
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 13:56:55 2026 +0500

    Get arrow access working

commit b9d2b4e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 13:48:17 2026 +0500

    Final push for append

commit 5fa0dec
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 21:02:04 2026 +0500

    Add explanation for read_int_list

commit 589d88e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:53:21 2026 +0500

    Update append.lua

commit 9aaca3d
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:47:49 2026 +0500

    Delete liblua.a

commit 12867be
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:46:10 2026 +0500

    Remove compiled append lua files

commit 0ded292
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:44:50 2026 +0500

    Revert append.c changes

commit 473eadc
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:42:56 2026 +0500

    Revert dune changes

commit 359e461
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:40:55 2026 +0500

    Get Lua CN working

    This gets Lua CN into a working state. Changes include:
    - Creating a CN subdirectory under the Lua runtime that has the entire core Lua runtime and a C file with wrapper calls into it. Also added a makefile to compile the wrapper lib.
    - Updated append.lua and append_with_lua.exec.c to properly interact with the working Lua runtime. Most of the Lua CN runtime just forwards to the C runtime (for now), with the exception of the CN frame and the implementation of CN pre and post conditions, which live natively in Lua
    - Updated instrument.ml to auto build the Lua wrapper lib, and link it whenever the Lua runtime is used.

commit e004233
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 31 22:13:04 2025 +0500

    Cleanup

    - make instrument util cleaner to avoid file renaming
    - cleanup lua library

commit cee5a2b
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Dec 29 12:32:35 2025 +0500

    Getting it working

commit 49421fb
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 18 12:20:20 2025 +0500

    Update file reference

commit 532d7c0
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 18 12:15:08 2025 +0500

    2nd Pass of Handwriting append.c with Lua runtime

commit 88b4ab7
Merge: bb54391 1d5a8ff
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 17 09:40:20 2025 +0500

    Merge branch 'main' into lua-handwritten-output

commit 1d5a8ff
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 17 09:34:36 2025 +0500

    Setting up flag to toggle Lua runtime on/off

commit 4e5ca38
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 22:17:31 2025 +0500

    Update gitignore to not track lualib asset and output files

commit 5067b30
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 3 23:22:53 2025 +0000

    Build and call into Lua

    This commit
    - Updates the instrument pipeline to automatically build the lua source, include and link it properly
    - Updates the instrumented file generation to properly add lua lib and global includes
    - Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

    For cleanup, might want to cover all lua runtime compilation under a switch/flag

commit 2d3065e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Tue Nov 25 00:53:56 2025 +0000

    Add lua 5.4.8 to project

commit bb54391
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 11 08:26:42 2025 +0500

    Fixup inconsistent naming of lua_cn_handle

commit 5b2fea8
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 11 07:43:00 2025 +0500

    v1 Pass of hand-writing an instrumented append.c using a Lua runtime

commit 15203cc
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 22:17:31 2025 +0500

    Update gitignore to not track lualib asset and output files

commit 4b0a160
Merge: d86287e d260aba
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 21:53:19 2025 +0500

    Merge branch 'main' of https://github.com/msaljuk/cn

commit d86287e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 3 23:22:53 2025 +0000

    Build and call into Lua

    This commit
    - Updates the instrument pipeline to automatically build the lua source, include and link it properly
    - Updates the instrumented file generation to properly add lua lib and global includes
    - Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

    For cleanup, might want to cover all lua runtime compilation under a switch/flag

commit bc43127
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Tue Nov 25 00:53:56 2025 +0000

    Add lua 5.4.8 to project

commit d260aba
Merge: d1dad84 94e15d3
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 21:49:49 2025 +0500

    [Fulminate] Build and call into Lua from Fulminate instrumented code

commit 94e15d3
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 3 23:22:53 2025 +0000

    Build and call into Lua

    This commit
    - Updates the instrument pipeline to automatically build the lua source, include and link it properly
    - Updates the instrumented file generation to properly add lua lib and global includes
    - Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

    For cleanup, might want to cover all lua runtime compilation under a switch/flag

commit d1dad84
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Tue Nov 25 00:53:56 2025 +0000

    Add lua 5.4.8 to project

* Remove unnecessary append files

* Update arrow_access to work with new flags

* Lua Example - Enum And And (#10)

* Get example working

* Fix typo in ghost remove call

* Update runtime to support existing Fulminate flags

* Update append example to support new flags

* Squashed commit of the following:

commit af777d3
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 19:41:01 2026 +0500

    Update arrow_access_with_lua to match API changes

commit 01b3962
Merge: c550d72 dd5877f
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 19:39:21 2026 +0500

    Reconile main

commit c550d72
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 13:56:55 2026 +0500

    Get arrow access working

commit b9d2b4e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 13:48:17 2026 +0500

    Final push for append

commit 5fa0dec
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 21:02:04 2026 +0500

    Add explanation for read_int_list

commit 589d88e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:53:21 2026 +0500

    Update append.lua

commit 9aaca3d
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:47:49 2026 +0500

    Delete liblua.a

commit 12867be
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:46:10 2026 +0500

    Remove compiled append lua files

commit 0ded292
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:44:50 2026 +0500

    Revert append.c changes

commit 473eadc
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:42:56 2026 +0500

    Revert dune changes

commit 359e461
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:40:55 2026 +0500

    Get Lua CN working

    This gets Lua CN into a working state. Changes include:
    - Creating a CN subdirectory under the Lua runtime that has the entire core Lua runtime and a C file with wrapper calls into it. Also added a makefile to compile the wrapper lib.
    - Updated append.lua and append_with_lua.exec.c to properly interact with the working Lua runtime. Most of the Lua CN runtime just forwards to the C runtime (for now), with the exception of the CN frame and the implementation of CN pre and post conditions, which live natively in Lua
    - Updated instrument.ml to auto build the Lua wrapper lib, and link it whenever the Lua runtime is used.

commit e004233
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 31 22:13:04 2025 +0500

    Cleanup

    - make instrument util cleaner to avoid file renaming
    - cleanup lua library

commit cee5a2b
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Dec 29 12:32:35 2025 +0500

    Getting it working

commit 49421fb
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 18 12:20:20 2025 +0500

    Update file reference

commit 532d7c0
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 18 12:15:08 2025 +0500

    2nd Pass of Handwriting append.c with Lua runtime

commit 88b4ab7
Merge: bb54391 1d5a8ff
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 17 09:40:20 2025 +0500

    Merge branch 'main' into lua-handwritten-output

commit 1d5a8ff
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 17 09:34:36 2025 +0500

    Setting up flag to toggle Lua runtime on/off

commit 4e5ca38
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 22:17:31 2025 +0500

    Update gitignore to not track lualib asset and output files

commit 5067b30
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 3 23:22:53 2025 +0000

    Build and call into Lua

    This commit
    - Updates the instrument pipeline to automatically build the lua source, include and link it properly
    - Updates the instrumented file generation to properly add lua lib and global includes
    - Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

    For cleanup, might want to cover all lua runtime compilation under a switch/flag

commit 2d3065e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Tue Nov 25 00:53:56 2025 +0000

    Add lua 5.4.8 to project

commit bb54391
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 11 08:26:42 2025 +0500

    Fixup inconsistent naming of lua_cn_handle

commit 5b2fea8
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 11 07:43:00 2025 +0500

    v1 Pass of hand-writing an instrumented append.c using a Lua runtime

commit 15203cc
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 22:17:31 2025 +0500

    Update gitignore to not track lualib asset and output files

commit 4b0a160
Merge: d86287e d260aba
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 21:53:19 2025 +0500

    Merge branch 'main' of https://github.com/msaljuk/cn

commit d86287e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 3 23:22:53 2025 +0000

    Build and call into Lua

    This commit
    - Updates the instrument pipeline to automatically build the lua source, include and link it properly
    - Updates the instrumented file generation to properly add lua lib and global includes
    - Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

    For cleanup, might want to cover all lua runtime compilation under a switch/flag

commit bc43127
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Tue Nov 25 00:53:56 2025 +0000

    Add lua 5.4.8 to project

commit d260aba
Merge: d1dad84 94e15d3
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 21:49:49 2025 +0500

    [Fulminate] Build and call into Lua from Fulminate instrumented code

commit 94e15d3
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 3 23:22:53 2025 +0000

    Build and call into Lua

    This commit
    - Updates the instrument pipeline to automatically build the lua source, include and link it properly
    - Updates the instrumented file generation to properly add lua lib and global includes
    - Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

    For cleanup, might want to cover all lua runtime compilation under a switch/flag

commit d1dad84
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Tue Nov 25 00:53:56 2025 +0000

    Add lua 5.4.8 to project

* Remove unnecessary append files

* Lua Example - Arrow Access (#9)

* Squashed commit of the following:

commit af777d3
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 19:41:01 2026 +0500

    Update arrow_access_with_lua to match API changes

commit 01b3962
Merge: c550d72 dd5877f
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 19:39:21 2026 +0500

    Reconile main

commit c550d72
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 13:56:55 2026 +0500

    Get arrow access working

commit b9d2b4e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Jan 14 13:48:17 2026 +0500

    Final push for append

commit 5fa0dec
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 21:02:04 2026 +0500

    Add explanation for read_int_list

commit 589d88e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:53:21 2026 +0500

    Update append.lua

commit 9aaca3d
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:47:49 2026 +0500

    Delete liblua.a

commit 12867be
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:46:10 2026 +0500

    Remove compiled append lua files

commit 0ded292
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:44:50 2026 +0500

    Revert append.c changes

commit 473eadc
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:42:56 2026 +0500

    Revert dune changes

commit 359e461
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Jan 5 20:40:55 2026 +0500

    Get Lua CN working

    This gets Lua CN into a working state. Changes include:
    - Creating a CN subdirectory under the Lua runtime that has the entire core Lua runtime and a C file with wrapper calls into it. Also added a makefile to compile the wrapper lib.
    - Updated append.lua and append_with_lua.exec.c to properly interact with the working Lua runtime. Most of the Lua CN runtime just forwards to the C runtime (for now), with the exception of the CN frame and the implementation of CN pre and post conditions, which live natively in Lua
    - Updated instrument.ml to auto build the Lua wrapper lib, and link it whenever the Lua runtime is used.

commit e004233
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 31 22:13:04 2025 +0500

    Cleanup

    - make instrument util cleaner to avoid file renaming
    - cleanup lua library

commit cee5a2b
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Mon Dec 29 12:32:35 2025 +0500

    Getting it working

commit 49421fb
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 18 12:20:20 2025 +0500

    Update file reference

commit 532d7c0
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 18 12:15:08 2025 +0500

    2nd Pass of Handwriting append.c with Lua runtime

commit 88b4ab7
Merge: bb54391 1d5a8ff
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 17 09:40:20 2025 +0500

    Merge branch 'main' into lua-handwritten-output

commit 1d5a8ff
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 17 09:34:36 2025 +0500

    Setting up flag to toggle Lua runtime on/off

commit 4e5ca38
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 22:17:31 2025 +0500

    Update gitignore to not track lualib asset and output files

commit 5067b30
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 3 23:22:53 2025 +0000

    Build and call into Lua

    This commit
    - Updates the instrument pipeline to automatically build the lua source, include and link it properly
    - Updates the instrumented file generation to properly add lua lib and global includes
    - Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

    For cleanup, might want to cover all lua runtime compilation under a switch/flag

commit 2d3065e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Tue Nov 25 00:53:56 2025 +0000

    Add lua 5.4.8 to project

commit bb54391
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 11 08:26:42 2025 +0500

    Fixup inconsistent naming of lua_cn_handle

commit 5b2fea8
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Thu Dec 11 07:43:00 2025 +0500

    v1 Pass of hand-writing an instrumented append.c using a Lua runtime

commit 15203cc
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 22:17:31 2025 +0500

    Update gitignore to not track lualib asset and output files

commit 4b0a160
Merge: d86287e d260aba
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 21:53:19 2025 +0500

    Merge branch 'main' of https://github.com/msaljuk/cn

commit d86287e
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 3 23:22:53 2025 +0000

    Build and call into Lua

    This commit
    - Updates the instrument pipeline to automatically build the lua source, include and link it properly
    - Updates the instrumented file generation to properly add lua lib and global includes
    - Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

    For cleanup, might want to cover all lua runtime compilation under a switch/flag

commit bc43127
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Tue Nov 25 00:53:56 2025 +0000

    Add lua 5.4.8 to project

commit d260aba
Merge: d1dad84 94e15d3
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 10 21:49:49 2025 +0500

    [Fulminate] Build and call into Lua from Fulminate instrumented code

commit 94e15d3
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Wed Dec 3 23:22:53 2025 +0000

    Build and call into Lua

    This commit
    - Updates the instrument pipeline to automatically build the lua source, include and link it properly
    - Updates the instrumented file generation to properly add lua lib and global includes
    - Tests this all out with a sample hello world snippet of the Lua C API (this is temp - will remove later. Just wanted to try things out and see how they look)

    For cleanup, might want to cover all lua runtime compilation under a switch/flag

commit d1dad84
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Tue Nov 25 00:53:56 2025 +0000

    Add lua 5.4.8 to project

* Remove unnecessary append files

* Update arrow_access to work with new flags

* Get example working

* Fix typo in ghost remove call

* Update enum_and_and to work with new flags

* Add initial support for loop ownerships and check with for loop example

* Fix leak in loop instrumentation

* Get forloop working with new flags
This commit:
- Adds a new Runtime Config that tracks the current runtime being used for Fulminate
- Leverages this module to make branching decisions across Fulminate's existing code instead of duplicating it entirely
commit 0b843ef
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Sat Feb 7 13:38:17 2026 +0000

   Introduce basic Lua AST and get something generating

commit 963f26d
Author: Saljuk Gondal <62533326+msaljuk@users.noreply.github.com>
Date:   Fri Feb 6 21:16:52 2026 +0000

    Refactor cn-to-ail to bubble up lua stmts entry
This PR:

* Adds functionality to parse all c function args and use them to issue a frame function push call at the start of any c function to support copying of all c args into Lua
* Refactors the previous lua_stmt plumbing into a lua_cn_exec type that holds lua_stmts as well as decls and defs for any wrapper calls to those lua functions.
* Adds support for generation of all wrapper calls with any number of arguments
* Adds support for generation of lua-side frame function pushes
* Begins adding support for translating pre/post conditions on Lua side

At the end of this PR, we have:

* A machinery to spit out helper/wrapper functions for any calls into Lua
* Frame function pushes from C into Lua working
* The beginnings of translation of CN pre/post condition spec in Lua
* Get struct peekers properly generating in C

* Ammend append example to show struct peeking in action

* Push base and custom c type sizes to separate Lua table for ease-of-use
* Update to lua_cn_exec and starting translation

This commit:
- Updates lua_cn_exec to carry an inprogress expression that is then finalized into a statement
- Adds some rudimentary lua translation for const and sym terms

* Add support for binops (and test using rudimentary asserts)

* Get full assert pipeline working

Gets asserts working to demo first round of ail expressions being generated in lua (consts, syms, binops)

Includes assert wrapper calls, wrapper defs and decs, and the actual lua statements
This commit:
- Adds a handwritten version of our canonical example (used to test all the various forms of marshalling/using data from C to Lua)
- Edits the lua/c runtime libraries to facilitate complete execution of this handwritten example
* Get struct pushes and gets working as intended

* Push c function parameters into Lua properly

* Generate function to push struct offsets into Lua

* Get owned and member_shift calls working as intended

* Get postcondition owned and assert calls working as intended

* Get StructMember term in cn-to-ail-expr working

* Remaining work to get canonical example generation executable

Includes:
- Generation of single 'push_metadata' function that pushes the struct readers, sizeofs and offsets of each custom struct into lua at startup time
- Fixes a bug with not returning cn from the lua file

(NOTE: Still need to fix issue with lua filepath not being resolved properly but barring that, this now produces an executable spec)

* Fix bug with Lua filename not being generated properly

With this change, generation is fully executable

* Add example to showcase generation
pqwy and others added 28 commits May 11, 2026 21:15
Type inference is a thing.
This was causing some tests like max_min_consts to fail since ~ has a lower operator precedence than - in Lua
- Fixes a bug where some predicate statements were getting lost
- Fixes a bug with cerb_types not being accessible
- Adds support for size_t and u_long_long

At this point, need to support ghost args. Rest appears to be working as intended
Gets hyp allocator fully running
- Removes AddI, SubtractI, MultiplyI
- Adds explicit reductions for all of these (and division too).

We now don't have any non-native arithmetic operation in buddy allocator except for u64.mod (which is necessary)
- Adds a noteq binary operator and adds a specialized match case in Not to find and replace Not == calls with the new NotEq node
- Removes the need to call the bw_compl function (last non-native number operation in hyp allocator)
- Also cleans up unused parameter for negate and fixes up spacing for these 2 unary ops
- Adds a new Lua AST type to generate a for loop in Lua
- Adds a utility function to take parameters for a while loop and extract the corresponding for loop parameters
- Converts the two existing callsites for while loops to for loops by default
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