From: Amirouche <amirouche@hypermove.net>
To: "guile-user@gnu.org" <guile-user@gnu.org>
Subject: termbox bindings
Date: Sun, 23 Apr 2017 21:43:16 +0200 [thread overview]
Message-ID: <95df1b07-4c4a-9c98-9d15-35fb86436528@hypermove.net> (raw)
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.
next reply other threads:[~2017-04-23 19:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-23 19:43 Amirouche [this message]
2017-04-23 22:43 ` termbox bindings Amirouche
2017-04-24 19:15 ` Amirouche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=95df1b07-4c4a-9c98-9d15-35fb86436528@hypermove.net \
--to=amirouche@hypermove.net \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).