Guidance for Claude Code when working with this repository.
Morloc is a multi-lingual typed workflow language enabling function composition across Python, C++, and R under a unified type system.
- Errors are ALWAYS serious
- Do not ignore an error because it is pre-existing
- If an unexpected error is found, stop and describe it
- Performance is critical
- Morloc programs may run for days or nanoseconds
- All between process communication must be as fast as possible (no more than a few microseconds), and yet the processes must accommodate very large packets and programs that run for a very long time.
After making a substantial change to the Haskell code, run:
$ stack install --no-run-tests $ stack test morloc:morloc-test # This is the usual test
To run the full heavy integrated test suite, run:
$ stack test # ONLY do this at the very end of a session; IT IS EXPENSIVE
If you make any change to the non-haskell code in data/, then you MUST run
morloc init -f. This will rebuild shared libraries, the nexus executable, and
language bindings.
- Stack test runs unit tests and golden-tests
- Golden-tests are full morloc programs
- Each golden test is in the path @test-suite/golden-tests/
- These tests produce build errors in
build.errand runtime errors inobs.err. These outputs are VITAL to debugging errors.
If the required morloc libraries may have changed, you may run:
$ morloc install --force
Never ignore errors
- DO NOT commit code
- DO NOT use any destructive git commit
- DO USE for
git logandgit diffvariants
- comments should be sparse and succinct
- comments should explain complex code and a rationale
- avoid non-total functions when possible
- tests should be written for all new features
- tests may be unit tests or integrated golden-tests
- test strategies, and justification for why they cover the new feature, should be provided
# Typecheck only
morloc typecheck script.loc
# Dump intermediate representations
morloc dump script.loc
# Run specific tests
stack test --test-arguments="--pattern='native-morloc'"- Haskell (GHC 9.6.6, LTS 22.44)
- Build tool: Stack
- Module naming:
Morloc.CodeGenerator.Generate - Morloc syntax: Functional, ML-style
- ASCII only in all source files (C, C++, Haskell, Python, R, templates). No Unicode characters (em-dashes, smart quotes, etc). Non-ASCII in Template Haskell-embedded files causes silent truncation under POSIX locale.