Giter Club home page Giter Club logo

elang's Introduction

https://api.travis-ci.org/vkazanov/elang.svg http://melpa.org/packages/elang-badge.svg

What is Elang?

Elang is a a Python-like language for the Emacs VM.

It is a Frankenstein’s monster, created using a ported Python tokenizer, a Python subset parser and a compiler which emits Emacs VM byte-code.

How to play with it?

Install the names package.

Clone the repository, add the resulting directory to your load-path and do (require 'elang).

Then open one of the example files in the examples/ directory and do, say, (elang-eval-current-defun) while having the point somewhere within one of the test functions there.

The function should become available through M-: or any other means of running Emacs Lisp functions.

Check the examples/ directory for code that should work now.

Alternatively, Elang is also available on MELPA (see the elang package), although I still recommend doing it manually.

How does it work?

What do you think? It tokenizes (see elang-tokenizer.el) the code, parses (elang-parser.el) the token stream, then compiles (elang-compiler.el) the parse tree to a byte-compiled Emacs function and executes the latter.

To load a complete file it just parses the file, finding def’s and global assignments, loading the functions and setting global variables.

Note that global assignments currently do not evaluate it’s values.

Who needs such a beast?

In it’s current state - nobody, as there’s just too much to do for me. This is something I created just to see if Emacs VM can be a target for a language different from Lisps. And it turns out it can..! I believe this prototype can be turned into something quite useful, or interesting at least.

So see TODO.org for a list of things currently missing, and don’t hesitate to ask questions or offer code improvements!

Gotchas

Actually, only the most basic things currently work, i.e. expressions and funcalls. Things to remember additionally:

  1. This is not Python. This is not even a port of the language. Technically this is Emacs Lisp using basic Python syntax ideas.
  2. The language uses dynamic binding.
  3. The language does not interoperate with Emacs Lisp in a nice way, i.e. there’s no was to deal with symbols, or declare an interactive function.
  4. No list or map-related syntax.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.