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

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

ยท

2 min read

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

ย