Skip to content

Conversation

@TimWhiting
Copy link
Collaborator

Interesting experiment, not sure if it is worth it though looking at the numbers.

At risk of obfuscating code, this PR uses macros to define closure creating functions.

The upside is mostly related to less generated code:

  • Easier for humans to read and compilers / C parsers too.
  • Less space on disk

This PR: (after warmup of running stack test previously so Haskell is compiled, and then deleting .koka)
stack test: 373.65s user 49.35s system 928% cpu 45.576 total
wc -l .koka/v3.1.3-test/clang-drelease/*: 1625144 total

Before:
stack test: 370.94s user 48.02s system 935% cpu 44.789 total
wc -l .koka/v3.1.3-test/clang-drelease/*: 1681567 total

~3.3% reduction in generated code.

@TimWhiting TimWhiting changed the title macros for functions C macros for closure definitions May 17, 2025
@TimWhiting TimWhiting force-pushed the dev branch 3 times, most recently from 2c83d90 to 00399ab Compare August 13, 2025 15:46
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.

1 participant