Skip to content
/ emil Public

A type-system and data-structures for Emacs-Lisp

License

Notifications You must be signed in to change notification settings

politza/emil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

A type-system and data-structures for Emacs-Lisp

Warning

The packages in this repository are experimental.

This repository contains a type-system for Emacs-Lisp and two abstractions called Struct and Trait making use of it.

Using these tools we are able to write Lisp code like the following.

(Trait:implement Rs:Publisher Rs:Processor:EmitOnTimer
  (fn subscribe (self (subscriber (Trait Rs:Subscriber)))
    (when self.subscriber
      (error "Multiple subscriber not supported"))
    (setf self.subscriber subscriber)
    (self.publisher.subscribe self)))

Pleas refer to the individual packages which each have their own README.

Emil
A type-system for Emacs-Lisp.
Struct
A struct-like data-type and a trait abstraction.
Rs
A simple reactive streams implementation for demo purposes.

Installation

Using straight

(progn
  (straight-register-package
   '(Commons
     :type git
     :host github
     :repo "politza/emil"
     :files
     ("packages/Commons/src/*.el")))

  (straight-register-package
   '(Struct
     :type git
     :host github
     :repo "politza/emil"
     :files
     ("packages/Struct/src/*.el"
      ("Struct" "packages/Struct/src/Struct/*.el")
      ("Struct/Support" "packages/Struct/src/Struct/Support/*.el"))))

  (straight-register-package
   '(Transformer
     :type git
     :host github
     :repo "politza/emil"
     :files
     ("packages/Transformer/src/*.el")))

  (straight-register-package
   '(Emil
     :type git
     :host github
     :repo "politza/emil"
     :files
     ("packages/Emil/src/*.el"
      ("Emil" "packages/Emil/src/Emil/*.el")
      ("Emil/Support" "packages/Emil/src/Emil/Support/*.el"))))

  (straight-register-package
   '(Rs
     :type git
     :host github
     :repo "politza/emil"
     :files
     ("packages/Rs/src/*.el"
      ("Rs" "packages/Rs/src/Rs/*.el")
      ("Rs/Processor" "packages/Rs/src/Rs/Processor/*.el")
      ("Rs/Publisher" "packages/Rs/src/Rs/Publisher/*.el"))))

  (straight-use-package 'Rs))

Configuration

There is some support for extended syntax-hightlighting and completion avaiable, which can be enabled like this:

(add-hook 'emacs-lisp-mode-hook
  (defun enable-emil-support ()
    (when (require 'Struct/Support nil t)
      (Struct:Support:syntax-mode 1)
      (add-hook 'completion-at-point-functions #'Emil:Support:completion-at-point -10 t))
    (when (require 'Struct/Support/Imenu nil t)
      (Struct:Support:Imenu:mode 1))
    (when (require 'Emil/Support/Completion nil t)
      (add-hook 'completion-at-point-functions #'Struct:Support:completion-at-point -20 t))
    (require 'Struct/Support/Edebug nil t)))

About

A type-system and data-structures for Emacs-Lisp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published