3 ms·
Yak shaving :) I want to write a source code spell checker with performance better than scspell. I didn't want to take that on as my learning project, so I in
by epage 9y ago
Yak shaving :)
I want to write a source code spell checker with performance better than scspell.
I didn't want to take that on as my learning project, so I instead started with a lint tool that is driven by user-defined regexes.
But I wanted to blog about my experience learning Rust. I wanted a blog that was good with code (so I'm moving off of blogspot finally) and easy to deploy (so no Jekyll) and decided on Cobalt which is written in Rust. There are some features lacking, so I've been contributing back (and have become the primary maintainer).
One year later and I've still not gotten around to my regex-based linter or source code spell checker.
What gets me excited about Rust:
- Cargo
- Level of confidence that compiled code will work because of both the type system and the borrow checker
- Zero cost abstraction (I'm weird)
- Error handling that has similar ergonomics to exceptions, easier to reason about, but can work in any environment. Exceptions can't run in places like the Windows kernel, so you end up using what feels like a fork of the language + standard library.
Misc notes on my experience:
- Borrow checker has rarely been a problem for me. Yes, sometimes it complains but is usually right and easy to fix
- I've never used the `unsafe` escape hatch
The things that frustrate me are nitpicky and I recognize they will go away as the language matures:
- Lack of specialization. e.g. I have a type that I want convertable from/to iterators but the trait for this has a no-op implementation for "convert from self to self", causing ambiguity that fails to compile.
- Can't have a struct implement the function-trait
- You can't specify that a variable should implement multiple traits (like the primary one and Debug). Instead you need to make a treat that inherits all of the traits you care about.
- CI conventions have too much maintenance overhead for an ecosystem that encourages a lot of small packages.
The last one is probably my next step in Yak Shaving once I get cobalt into a "good enough" state for myself.