Repository navigation
Releases
0.3.0
Rust sed 0.3.0 Release:
We are happy to announce the release of Rust sed 0.3.0.
The GNU-specific commands F, W and R are now implemented. Most of the remaining work went into the details scripts actually depend on: how n and Q end a cycle, when text queued by a, r and R is written or dropped, how l shows an empty pattern space, and how -i treats each file as a separate input.
Diagnostics were reworked as well: errors now follow the modern style used by Rust Coreutils, point at the right position in the script (even at its very end), and report where an unmatched { was opened.
At a terminal, the offending character is underlined in the script. Here is the same typo with both implementations:
GNU sed 4.9:
$ sed 's/foo/bar/gq' file.txt
sed: -e expression #1, char 12: unknown option to `s'Rust sed 0.3.0:
$ sed 's/Normandie/Bretagne/gq' fromages.txt
sed: <script argument 1>:1:23: error: invalid substitute flag: 'q'
ββ[ <script argument 1>:1:23 ]
β
1 β s/Normandie/Bretagne/gq
β β
ββββ―Test in the playground: https://uutils.org/playground/?cmd=sed+%27s%2FNormandie%2FBretagne%2Fgq%27+fromages.txt
GNU sed reports an unknown option somewhere in the s command. We name the faulty flag, give the line and column, and show where it is. Pipes keep the single-line message; set UUTILS_DIAG=always to force the full output.
We are now at 18 passing, 39 failing, 0 errors on the GNU sed test suite.
GNU Test Suite Compatibility:
| Result | 0.2.0 | 0.3.0 | Change 0.2.0 to 0.3.0 | % Total 0.2.0 | % Total 0.3.0 | % Change 0.2.0 to 0.3.0 |
|---|---|---|---|---|---|---|
| Pass | 14 | 18 | +4 | 21.54% | 27.69% | +6.15% |
| Skip | 10 | 8 | -2 | 15.38% | 12.31% | -3.07% |
| Fail | 41 | 39 | -2 | 63.08% | 60.00% | -3.08% |
| Error | 0 | 0 | 0 | 0% | 0% | 0% |
| Total | 65 | 65 | 0 |
Note: four tests now pass:
cmd-R,distrib,inplace-holdandstdin-prog. The CI now also generates the multibyte locales the suite needs, sotitle-caseandutf8-ruare no longer skipped; they run and fail for now, which is why the failure count only drops by two. Counting only the tests that actually run, we are at 18/57 (31.6%), up from 14/55 (25.5%). We are comparing against GNU sed from its upstream repository.
Highlights:
-
New GNU Commands
F: print the current input file nameW: write the first line of the pattern space to a fileR: read one line from a file and queue it for output
-
GNU Compatibility
ncontinues with the next command instead of starting a new cycleQdiscards text queued bya,randR, and no longer writes a missing final newline- Appended text,
Rtext andeoutput are written at the same point as in GNU sed lshows an empty pattern space as$, even without a trailing newline; Unicode listing matches GNU sed-itreats each file as a separate input, and takes its suffix only when attached (-i.bak), as GNU sed does- A range whose numeric first address was already passed now starts, as GNU sed does
-
Diagnostics
- Error messages use the modern style of Rust Coreutils
- The script position is kept for errors at the end of the script
- An unmatched
{reports where it was opened - An unterminated
sorycommand is reported instead of aborting - At a terminal, the offending character is underlined in the script (see the example above)
-
Robustness
- Panics and zero steps fixed in
~and,addresses
- Panics and zero steps fixed in
-
Performance
- Literal regex needles are stored in an
Arc, avoiding copies
- Literal regex needles are stored in an
-
Distribution
cargo binstallsupport- Extensions and incompatibilities are now documented in
docs/src/extensions.md
-
Contributions: This release landed 57 pull requests from 5 new contributors
Call to Action:
Sponsor us on GitHub to accelerate development: github.com/sponsors/uutils
What's Changed
New Commands
- Support F (output filename) command by @dspinellis in #528
- Implement GNU W (write pattern first line) command by @dspinellis in #531
- Implement GNU R (read one line from file) command by @Jorge-Polanco-Roque in #544
GNU Compatibility
- Make Unicode listing GNU-sed compatible by @dspinellis in #537
- in-place editing: treat each file as a separate input by @SichenLiang in #569
- sed: take the
-isuffix only when attached, as GNU sed does by @DePasqualeOrg in #583 - sed: continue with the next command after n instead of starting a new cycle by @DePasqualeOrg in #592
- sed: show an empty pattern space as $ in l, even without a newline by @DePasqualeOrg in #595
- sed: discard text queued by a, r and R on Q, as GNU sed does by @DePasqualeOrg in #594
- sed: write appended text, R text and e output as GNU sed does by @DePasqualeOrg in #589
- sed: start a range whose numeric first address was already passed by @sap1110 in #581
- sed: don't write a missing final newline on Q, as GNU sed does by @DePasqualeOrg in #597
Diagnostics & Robustness
- sed: fix panics and zero steps in ~ and , addresses by @sylvestre in #578
- sed: keep script position for errors at end of script by @sylvestre in #579
- sed: implement modern diagnostic like coreutils by @sylvestre in #576
- compiler: report an unterminated s or y command instead of aborting by @SichenLiang in #571
- sed: report where an unmatched { was opened by @sylvestre in #580
Performance
- perf: fast_regex: store literal needles in an Arc by @Omkar-Wagholikar in #604
Testing
- Fix failing test under Windows by @dspinellis in #529
- Add tests for non-pattern-print on deletion by @dspinellis in #535
Code Quality & Cleanup
- clippy: fix warnings from
assert_is_emptylint by @cakebaker in #588
CI & Build
- Add binstall support by @sylvestre in #520
- ci: generate multibyte locales for the GNU testsuite by @sylvestre in #539
- ci: use an absolute LLVM_PROFILE_FILE path so coverage includes the sed binary by @DePasqualeOrg in #591
- ci.yml: avoid full git clone (--depth=1) by @oech3 in #600
Documentation
- docs: move extensions and incompatibilities to docs/src/extensions.md by @sylvestre in #575
Dependency Updates
- Update Rust crate ctor to v1.0.13 by @renovate[bot] in #521
- Update Rust crate clap_mangen to v0.3.3 by @renovate[bot] in #523
- Update dawidd6/action-download-artifact action to v23 by @renovate[bot] in #524
- Update Rust crate similar to v3.2.0 by @renovate[bot] in #526
- fix(deps): refactor sha2 package configuration by @xtqqczze in #534
- Update dawidd6/action-download-artifact action to v24 by @renovate[bot] in #536
- Update Rust crate uucore to 0.11.0 by @renovate[bot] in #546
- Update Rust crate uufuzz to 0.11.0 by @renovate[bot] in #547
- Update Rust crate uutests to 0.11.0 by @renovate[bot] in #548
- Bump
getrandomfrom0.4.2to0.4.3by @cakebaker in #554 - Bump
chacha20from0.10.0to0.10.2by @cakebaker in #553 - Update Rust crate console to v0.16.6 by @renovate[bot] in #555
- Update Rust crate uufuzz to 0.12.0 by @renovate[bot] in #563
- Update Rust crate divan to v5.0.2 by @renovate[bot] in #561
- Update Rust crate uucore to 0.12.0 by @renovate[bot] in #562
- Update Rust crate uutests to 0.12.0 by @renovate[bot] in #564
- Update Rust crate rand to v0.10.3 by @renovate[bot] in #566
- Bump
cargo-distfrom0.30.3to0.33.0by @cakebaker in #556 - Update Rust crate clap to v4.6.7 by @renovate[bot] in #558
- Update Rust crate clap_complete to v4.6.11 by @renovate[bot] in #559
- Update Rust crate rustix to v1.1.5 by @renovate[bot] in https://...
latest-commit
0.1.1
uutils sed 0.1.1 Release:
We are excited to announce the first release of uutils sed 0.1.1 - bringing a comprehensive sed implementation to the uutils ecosystem with robust GNU compatibility and high performance!
Note that this release is not production ready.
Highlights:
-
Aims at a complete sed Implementation
- Full command compilation framework with function pointers for optimal performance
- Comprehensive address compilation supporting all standard sed addressing modes
- All major sed commands implemented:
a,c,i,d,p,s,y,n,N,l,q,Q, and more - Advanced features including in-place editing (
-i), multiple files support, and optimized processing
-
Performance focus
- Optimized text processing with memory-mapped file I/O for large files
- Efficient operations with copy_file_range(2) on Linux
- Smart buffer management and text optimization for
a,c,icommands
-
GNU sed Compatibility
- Comprehensive error reporting with accurate line numbers and context
- Improved GNU compatibility for append, change, and insert commands
- Proper handling of script and file arguments matching GNU sed semantics
- Support for silent comment commands and advanced regex handling
-
Modern Rust Implementation
- Built on Rust 2024 edition with robust safety guarantees
- Integration with uutils ecosystem using uucore, uutests, and uufuzz built for the Rust Coreutils
- Comprehensive test suite ensuring reliability and correctness
-
Cross-Platform Support
- Available for Apple Silicon macOS, Intel macOS, Windows (x64), and Linux (x64, ARM64, MUSL). Port to other OS/arch are welcome.
- Automated release pipeline with cargo-dist for consistent builds
-
Developer Experience
- Integrated fuzzing support for enhanced reliability
- Performance benchmarking infrastructure with CodSpeed integration
- Comprehensive CI/CD pipeline ensuring code quality
Key Contributions:
This release represents a significant achievement in bringing a high-quality, performant sed implementation to the Rust ecosystem. Diomidis Spinellis has been the primary architect behind this implementation, contributing the core sed engine, command compilation framework, address parsing, and most of the advanced functionality that makes this a GNU-compatible sed alternative.
This work has been documented by Diomidis Spinellis in this paper:
https://ieeexplore.ieee.org/document/11119110
Platform Availability:
| Platform | Architecture | Package |
|---|---|---|
| macOS | Apple Silicon | sed-aarch64-apple-darwin.tar.xz |
| macOS | Intel | sed-x86_64-apple-darwin.tar.xz |
| Windows | x64 | sed-x86_64-pc-windows-msvc.zip |
| Linux | ARM64 | sed-aarch64-unknown-linux-gnu.tar.xz |
| Linux | x64 | sed-x86_64-unknown-linux-gnu.tar.xz |
| Linux | x64 MUSL | sed-x86_64-unknown-linux-musl.tar.xz |
Call to Action:
π Sponsor uutils development to accelerate the ecosystem: github.com/sponsors/uutils
π§ Try sed 0.1.1 and report feedback: github.com/uutils/sed/issues
π Contribute to the project and help build the future of cross-platform utilities
Major Implementation Milestones
Core Architecture
- Complete CLI processing and compilation framework by @dspinellis in #40
- Address compilation implementation by @dspinellis in #57
- Command compilation refactoring with function pointers by @dspinellis in #108
- Complete implementation of all commands and optimizations by @dspinellis in #77
Command Implementation
- Comprehensive sed commands implementation by @dspinellis in #64
- GNU compatibility improvements for a, c, i commands by @dspinellis in #109
- Silent comment command implementation by @dspinellis in #120
- Text optimization for a, c, i commands by @dspinellis in #111
Performance & Optimization
- Performance improvements with copy_file_range(2) by @dspinellis in #161
- Error reporting improvements by @dspinellis in #92
- Regular expression handling improvements by @dspinellis in #201
Project Infrastructure
- CI improvements and job optimization by @cakebaker in #14
- Testing framework migration to uutests by @sylvestre in #48
- Fuzzing infrastructure integration by @sylvestre in #72
- Performance monitoring with CodSpeed by @sylvestre in #212
- Release automation with cargo-dist by @sylvestre in #214
Modern Rust Migration
- Rust 2024 edition migration by @cakebaker in #50
- LazyLock migration and once_cell removal by @cakebaker in #51
- IsTerminal migration and atty removal by @cakebaker in #73
- Build system cleanup and optimization by @cakebaker in #75
Version & Release Management
- Version support implementation by @pocopepe in #206
- Direct binary generation by @sylvestre in #208
- Release pipeline improvements by @sylvestre in #220
New Contributors
- @dspinellis - Primary sed implementation architect
- @sylvestre - uutils leadership and infrastructure
- @cakebaker - CI improvements and modern Rust migration
- @renovate[bot] - Automated dependency management
- @oech3 - Build optimizations
- @pocopepe - Version support
Full Changelog: https://github.com/uutils/sed/commits/0.1.1