unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* termbox bindings
@ 2017-04-23 19:43 Amirouche
  2017-04-23 22:43 ` Amirouche
  0 siblings, 1 reply; 3+ messages in thread
From: Amirouche @ 2017-04-23 19:43 UTC (permalink / raw)
  To: guile-user@gnu.org

Azul!

I craftedsome ffi bindings for termbox [1] which is a small library
that allows to interact with the terminal (somewhat like ncurses but much
simpler).

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 [4]. The editor itself is less than 400 
lines of
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!

[1] The official repository of termbox is [2] but [3] has some bugfix
[2] https://github.com/nsf/termbox/
[3] https://github.com/tomas/termbox
[4] 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 
implement higher
     level procedure that interact with the ft like a regular list. 
Haskell editor
     use fingertrees too, but IDK exactly how they use finger trees.
     The actual buffer use that indexed list datastructre two times, a 
first time
     to represent the lines. And another time to represent each line. 
And because
     chars are represented as integers the buffer is a ft of ft of integers.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-24 19:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-23 19:43 termbox bindings Amirouche
2017-04-23 22:43 ` Amirouche
2017-04-24 19:15   ` Amirouche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).