Sigil 0.4.0
This release makes Sigil leaner and faster. Native list operations cut compilation time in half, release binaries are 44% smaller, and a new profiling module helps you find bottlenecks in your own code. Macro authors get full hygiene support, and error handling improves with catchable VM errors and cleaner stack traces.
Breaking Changes
- sigil-web: Renamed UI components from
sigil-*tosg-*prefix (e.g.,sigil-buttonbecomessg-button) to mirrordata-sg-*attributes
Performance
Profiling revealed hotspots in list operations during macro expansion. Native C implementations of assoc, assq, assv, member, memq, and memv deliver significant speedups:
- Test suite runs 2x faster (33s → 15s)
- Module compilation 50% faster
- Release binaries 44% smaller (3.2MB → 1.8MB)
Macro Hygiene
Full hygienic macro support for syntax-rules and syntax-case. Macros now properly respect lexical scope, preventing accidental variable capture:
- Local and module-level hygiene
free-identifier=?for comparing identifiers during expansion#'reader shorthand for(syntax ...)expressions- New
(sigil syntax)module withsyntax->datum,datum->syntax,generate-temporaries
Error Handling
- Catchable VM errors:
guardcan now catch type errors, division by zero, and out-of-bounds access. Use the newvm-error?predicate in(sigil error). - Better stack traces: Errors display file paths with line and column positions. Anonymous lambda frames are filtered by default for cleaner output.
Profiling
New (sigil profile) module for performance analysis:
(with-profiling
(my-expensive-operation))
(profile-report) ; Shows call counts, timing, allocationsLibrary Improvements
- sigil-http: Keyword arguments for
make-http-serverandhttp-serve(port:,host:,handler:) - sigil-sxml: New
sxml->htmlfor converting SXML trees to HTML strings - sigil-version: New package for semantic version parsing and comparison
Bug Fixes
- Fixed source file names in error stack traces
- Fixed socket API consistency across platforms
- Fixed
with-api-docspath resolution in sigil-publish - Fixed sigil-irc package dependency declaration