DEV Community

Cover image for A super fast style sheet language for cool kids! (WIP)
George Lemon
George Lemon

Posted on • Updated on

A super fast style sheet language for cool kids! (WIP)

This is Bro — A super fast style sheet language, alternative to SassC, DartSass, SassJS and Less.

Warning! Bro is still under development. Expect bugs and incomplete features.

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

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.

Benchmark

1.572.876 lines of

button_0
  background: yellow
Enter fullscreen mode Exit fullscreen mode
Benchmark 1: ./dart sass.snapshot big.sass:big.css --no-source-map --style=compressed
  Time (abs ≡):         5.009 s               [User: 6.379 s, System: 0.278 s]

Benchmark 2: sassc big.sass big.css --style=compressed
  Time (abs ≡):         6.448 s               [User: 5.881 s, System: 0.564 s]

Benchmark 3: bro big.sass --minify
  Time (abs ≡):         1.066 s               [User: 0.697 s, System: 0.367 s]

Benchmark 4: node bro.js
  Time (abs ≡):         1.598 s               [User: 1.226 s, System: 0.373 s]

Benchmark 5: bun bro.js
  Time (abs ≡):         1.396 s               [User: 1.088 s, System: 0.308 s]

Benchmark 6: node sass.js
  Time (abs ≡):        14.910 s               [User: 22.484 s, System: 1.483 s]

Benchmark 7: bun sass.js
  Time (abs ≡):        11.963 s               [User: 20.004 s, System: 1.236 s]

Summary
  'bro big.sass --minify' ran
    1.31 times faster than 'bun bro.js'
    1.50 times faster than 'node bro.js'
    4.70 times faster than './dart sass.snapshot big.sass:big.css --no-source-map --style=compressed'
    6.05 times faster than 'sassc big.sass big.css --style=compressed'
   11.22 times faster than 'bun sass.js'
   13.98 times faster than 'node sass.js'
Enter fullscreen mode Exit fullscreen mode

Learn Bro in 5 minutes

https://github.com/openpeeps/bro/wiki/Learn-Bro-in-5-minutes

Follow us on GitHub for more!
https://github.com/openpeeps/bro

Top comments (0)