[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sun, 23 Apr 2017 21:43:16 +0200
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
I craftedsome ffi bindings for termbox  which is a small library
that allows to interact with the terminal (somewhat like ncurses but much
It comes with a toy text editor with rainbow highlighting and some emacs
bindings. I tried to implement keyword highlighting but it was slow. Also
it use finger trees (a (special) persistent functional datastructure from
pfds) to represent the buffer . The editor itself is less than 400
beautiful scheme code, so you can read it:
git clone https://github.com/amirouche/azul.scm
By the way, azul means hello in amazigh!
Hope this helps!
 The official repository of termbox is  but  has some bugfix
 Custom finger tree (ft) datastructure for the buffer is in buffer.scm.
You don't need to understand ft to read the code, because I
level procedure that interact with the ft like a regular list.
use fingertrees too, but IDK exactly how they use finger trees.
The actual buffer use that indexed list datastructre two times, a
to represent the lines. And another time to represent each line.
chars are represented as integers the buffer is a ft of ft of integers.
- termbox bindings,