Bro Lang - 1,5M lines of SASS code in ~650ms


This is Bro โ A super fast style sheet language, alternative to SassC, DartSass, SassJS and Less.
Key features
๐ Lightweight, tiny executable
๐ฑ Dependency Free / No Virtual Machine
๐ Works on Linux, macOS, Windows
๐ช Strong Typed = Perfect Cascading Style Sheets ๐คฉ
๐ CSS Minifier
๐บ CSS SourceMap Generator
๐ CSS Reload & Browser sync Setup info
๐
JSON
/YAML
stream to Stylesheet๐ด Abstract Syntax Tree binary serialization via MessagePack
๐ Built-in
HTML
Documentation Generator๐ฅ Works with NodeJS & BunJS via
NAPI
๐ฉ Open Source | LGPLv3 license
๐ Written in Nim language
๐ Made for Cool Kids
Warning! Bro is still under development. Expect bugs/incomplete features.
Dummy benchmark
1.572.876 lines of
.btn
background: yellow
Benchmark 1:./dart sass.snapshot test.sass:test.css --no-source-map --style=compressed
Time(abs โก):4.846 s [User:6.077 s,System:0.208 s]
Benchmark 2: sassc test.sass test.css --style=compressed
Time(abs โก):5.982 s [User:5.531 s,System:0.448 s]
Benchmark 3: bro test.sass test.css --min
Time(abs โก):658.9 ms [User:543.7 ms,System:112.8 ms]
Benchmark 4: node bro.js
Time(abs โก):942.3 ms [User:835.2 ms,System:107.9 ms]
Benchmark 5: bun bro.js
Time(abs โก):969.6 ms [User:775.7 ms,System:153.5 ms]
Benchmark 6: node sass.js
Time(abs โก):12.566 s [User:19.499 s,System:1.212 s]
Benchmark 7: bun sass.js
Time(abs โก):9.892 s [User:18.939 s,System:0.938 s]
Summary
'bro test.sass test.css --min' ran
1.43 times faster than 'node bro.js'
1.47 times faster than 'bun bro.js'
7.35 times faster than './dart sass.snapshot test.sass:test.css --no-source-map --style=compressed'
9.08 times faster than 'sassc test.sass test.css --style=compressed'
15.01 times faster than 'bun sass.js'
19.07 times faster than 'node sass.js'
Benchmark: hyperfine
What makes Bro fast?
First of all, Bro is fully written in Nim, a state-of-the-art programming language well-suited for systems and application programming. It offers high performance with type and memory safety while keeping the source code short and readable. Wanna know more about it? Check "Computer Programming with Nim" written by Dr. Stefan Salewski.
Learn Bro in 5 minutes
https://github.com/openpeeps/bro/wiki/Learn-Bro-in-5-minutes
Keep your style sheets clean with Bro!
https://github.com/openpeeps/bro
Subscribe to my newsletter
Read articles from George Lemon directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
