Posts

Showing posts with the label tinylisp

Zen Emacs: First Look

Image
  Zen is a minimal Emacs ( pl. Emacsen ) with multi-thread support . It is a fork of Zepl . (Edit 3/9/23: Zen Emacs is a better name compared to Zep). Demo The video demonstrates: Split window Indirect/cloned buffer - same content but different points (cursor) Asynchronous shell command (top) execution and view update Parallel editing while the command runs in the other window   Components Zepl - Editor backend tinylisp - Lisp interpreter ncurses - Terminal UI Code https://gitlab.com/atamariya/tinylisp (dev branch)  

Tinylisp and Multi-threaded Emacs

Image
TAME-ing the beast!! Here's a fork of tinylisp and a glimpse of a possible multi-threaded future. Below is the content of the file a.el in the demo. It creates one read thread which waits for non-nil value of global-var and a set thread which sleeps for 5s before modifying global-var and notifying the waiting threads. Since these are running in separate threads, main loop is free for user input. (define list (lambda args args)) (define defun (macro (f v . x) (list 'define f (list 'lambda v (cons 'progn x))))) (setq make-condition-variable make-cond) (setq condition-wait cond-wait) (setq condition-notify cond-signal) (setq message p) (setq sleep-for sleep) (setq global-var nil) ;; Create a mutex and an associated condition variable (setq mutex (make-mutex "mutex")) (setq cond-var (make-condition-variable mutex "cond-var")) ;; Read and set functions used by read and set threads (defun set-global-var ()   (mutex-lock mutex)   (sleep 5)   (setq global-...