summaryrefslogtreecommitdiff
path: root/content/projects/lolcat-c/index.rst
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-03-19 00:53:31 +0100
committerjaseg <git@jaseg.de>2023-03-19 00:53:31 +0100
commit92e3b5f49f6f5336530988e7839ab3ed283b86e4 (patch)
tree23abd87cb15055b7f4cbb5c0e4f2d1518d3ac6cc /content/projects/lolcat-c/index.rst
parent072b2d38e254cfa662d4d9e994e624f612d1766e (diff)
downloadblog-92e3b5f49f6f5336530988e7839ab3ed283b86e4.tar.gz
blog-92e3b5f49f6f5336530988e7839ab3ed283b86e4.tar.bz2
blog-92e3b5f49f6f5336530988e7839ab3ed283b86e4.zip
Big site update
Diffstat (limited to 'content/projects/lolcat-c/index.rst')
-rw-r--r--content/projects/lolcat-c/index.rst105
1 files changed, 105 insertions, 0 deletions
diff --git a/content/projects/lolcat-c/index.rst b/content/projects/lolcat-c/index.rst
new file mode 100644
index 0000000..6217b34
--- /dev/null
+++ b/content/projects/lolcat-c/index.rst
@@ -0,0 +1,105 @@
+---
+title: "lolcat-c"
+external_links:
+ - name: Sources
+ url: "https://git.jaseg.de/lolcat.git"
+ - name: Issues
+ url: "https://github.com/jaseg/lolcat/issues"
+summary: >
+ lolcat-c is a small, high-performance re-implementation of the
+ `lolcat <https://github.com/busyloop/lolcat>`__
+ rainbow cat utility. lolcat-c is meant as a lolcat that you can actually use in production. It is fast, not slowing
+ down whatever you pipe through it, and it robustly handles real-world terminal output including escape sequences.
+---
+
+What?
+=====
+
+.. image:: LOLCat-Rainbow.jpg
+
+Screenshot
+==========
+
+.. image:: screenshot.png
+
+.. image:: sl.gif
+
+Installation
+============
+
+Archlinux
+---------
+
+There's an `AUR package <https://aur.archlinux.org/packages/c-lolcat>`__:
+
+.. code:: sh
+
+ $ git clone https://aur.archlinux.org/packages/c-lolcat
+ $ cd c-lolcat
+ $ makepkg -csi
+
+Fedora
+------
+
+.. code:: sh
+
+ $ dnf install lolcat
+
+Ubuntu (Snap)
+-------------
+
+See `this awesome blog post by a kind person from the internet <https://blog.simos.info/how-to-make-a-snap-package-for-lolcat-with-snapcraft-on-ubuntu/>`__:
+
+.. code:: sh
+
+ $ snap install lolcat-c
+
+Mac
+---
+
+Build loclcat with:
+
+.. code:: sh
+
+ $ make lolcat
+
+...and put the resulting binary at a place of your choice.
+
+Others
+------
+
+.. code:: sh
+
+ $ make && sudo make install
+
+Why?
+====
+
+This `lolcat` clone is an attempt to reduce the world's carbon dioxide emissions by optimizing inefficient code. It's
+>10x as fast and <0.1% as large as the original one.
+
+.. code:: sh
+
+ newton~/d/lolcat <3 dmesg>foo
+ newton~/d/lolcat <3 time upstream/bin/lolcat foo
+ 13.51user 1.34system 0:15.99elapsed 92%CPU (0avgtext+0avgdata 10864maxresident)k
+ 0inputs+0outputs (0major+1716minor)pagefaults 0swaps
+ newton~/d/lolcat <3 time ./lolcat foo
+ 0.02user 0.00system 0:00.09elapsed 34%CPU (0avgtext+0avgdata 1936maxresident)k
+ 0inputs+0outputs (0major+117minor)pagefaults 0swaps
+
+Bonus comparison with `python-lolcat <https://github.com/tehmaze/lolcat/>`__:
+
+.. code:: sh
+
+ newton~/d/lolcat <3 dmesg>foo
+ $ time python-lolcat foo
+ 12.27user 0.00system 0:12.29elapsed 99%CPU (0avgtext+0avgdata 11484maxresident)k
+ 0inputs+0outputs (0major+1627minor)pagefaults 0swaps
+ $ time c-lolcat foo
+ 0.29user 0.00system 0:00.30elapsed 98%CPU (0avgtext+0avgdata 468maxresident)k
+ 0inputs+0outputs (0major+21minor)pagefaults 0swaps
+
+(Read: `c-lolcat << python-lolcat << ruby-lolcat`)
+
+