M.V. Hutz 0eff85f8fa feat: add output flag (#13)
## Description

The lambda CLI previously only wrote output to stdout using shell redirection.
This PR adds support for writing results to files using the `-o` flag.
This is implemented using a new `Destination` interface that mirrors the existing `Source` pattern.

Changes:
- Added `Destination` interface with `StdoutDestination` and `FileDestination` implementations.
- Added `-o` flag to CLI argument parser for output file specification.
- Updated `Config` to use `Destination` instead of direct output handling.
- Refactored main to use `Destination.Write()` for result output.
- Updated Makefile targets (`run`, `profile`, `explain`) to use `-o` flag instead of shell redirection.

### Decisions

The `-o` flag defaults to stdout when not specified or when set to `-`.
This maintains backward compatibility while providing explicit file output capability.

## Benefits

- Cleaner command-line interface without shell redirection.
- Symmetric design with `Source` interface for input.
- More portable across different shells and environments.
- Explicit output handling improves code clarity.

## Checklist

- [x] Code follows conventional commit format.
- [x] Branch follows naming convention (`<type>/<description>`).
- [ ] Tests pass (if applicable).
- [ ] Documentation updated (if applicable).

Reviewed-on: #13
Co-authored-by: M.V. Hutz <git@maximhutz.me>
Co-committed-by: M.V. Hutz <git@maximhutz.me>
2026-01-11 22:14:48 +00:00
2026-01-11 22:14:48 +00:00
2026-01-10 11:37:18 -05:00
2026-01-11 22:14:48 +00:00
2025-12-29 02:40:42 -05:00
2025-12-23 14:17:43 -05:00
2025-12-22 21:09:00 +00:00
2026-01-11 22:14:48 +00:00
2025-12-29 19:28:45 -05:00

lambda

Making a lambda calculus interpreter in Go.

Things to talk about

  • Exhaustive sum types.
  • Recursive descent and left-recursion.
  • Observer pattern, event emission.

https://zicklag.katharos.group/blog/interaction-nets-combinators-calculus/ https://arxiv.org/pdf/2505.20314

Description
Making a lambda calculus interpreter in Go.
Readme AGPL-3.0 863 KiB
Languages
Go 96.6%
Makefile 3.4%