• Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language
    Python
  • License
    Other
  • Created almost 13 years ago
  • Updated over 11 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

(Parts of) Clojure implemented on top of Python

PyClojure

This project consists of the first steps of an implementation of the Clojure language in Python. At the moment it is merely interpreted and is incomplete (see file test_lisp.py for examples).

Note: the clojure-py project is much further along at this point; however, I'm keeping this code around as an example of using the Ply tools.

What works:

  • REPL with history and readline support
  • Parsing and storage of trees of lists, vectors, atoms, integers, floats
  • 'def' and simple evaluation
  • A few builtin functions and access to functions in Python's main namespace
  • setup.py packaging

Dependencies

  • PLY, for lexing and parsing. It turns out Python is actually quite serviceable for writing compilers, particularly for prototyping -- one of the reasons for this project was to see how far I could push this.
  • Nose, to run unit tests.
  • Python 2.6+

Why Clojure-in-Python?

The long JVM startup time makes use of Clojure for scripting common system tasks somewhat unworkable, or at least irritating. NewLISP would be an option, but Clojure is such a nice Lisp; this particular implementation is meant to eventually be syntax-compatible with Clojure (as currently implemented on the JVM). The goal is to provide a real Lisp with macros, and Clojure's syntactic goodness, as well as immutable data structures, which can coexist with Python and make use of its extensive, 'batteries included' libraries.

There has been some discussion as well about getting Clojure running under PyPy, something which I think would be quite interesting.

Feel free to join in! For next steps, see Issues list on GitHub. Please see the file guidelines.txt for contribution guidelines.

Author

Primary contact: John Jacobsen, NPX Designs, Inc. [email protected] (See AUTHORS file for complete list of contributors)

More Repositories

1

l1

A simple Lisp written in Go
Go
62
star
2

clj-org

An Org Mode parser
Clojure
42
star
3

conttest

A helper script for continuous testing written in Python
Python
31
star
4

lein-script

Generate stand-alone Clojure scripts trivially
Clojure
27
star
5

i3d3

D3-based plotting and histogramming library
JavaScript
25
star
6

cl-oju

Some Clojure-ish thingies for Common Lisp
Common Lisp
18
star
7

hbook

Text-based histograms in Common Lisp inspired by the venerable HBOOK histogramming library from CERN.
Common Lisp
16
star
8

organa

More publishing with Emacs Org Mode and Clojure
Clojure
16
star
9

blorg

Yet Another Org-Mode-and-Clojure-Based Static Blog
Clojure
11
star
10

jenome

Playing around with the human genome and Clojure
Clojure
11
star
11

emacs-config

Emacs configuration file
Emacs Lisp
11
star
12

weeds

Work in progress porting my blog software to Common Lisp
Common Lisp
10
star
13

lexutil

Go's Template lexer extracted as a stand-alone module
Go
10
star
14

namejen

A random name generator, written in Clojure
Clojure
10
star
15

rf

RSS/Atom Feed Scanner
Go
7
star
16

sketchup-reload

(re-)load SketchUp plugins as they are saved
Ruby
7
star
17

parsepy

Parse Python configuration files with Clojure
Clojure
6
star
18

unmark

Experiments in HTML-free blogging using Clojure/Hiccup.
Clojure
5
star
19

onomat

A simple roguelike written in l1
3
star
20

splasher

A small splash screen library for Clojure GUI apps
Clojure
3
star
21

smallscheme

A small, extendable Scheme interpreter implemented in Python
Python
3
star
22

probs4clojure

Working solutions of problems from 4clojure.com
Clojure
3
star
23

anatomy

Making flash cards for muscular anatomy
HTML
3
star
24

eigenhombre.github.com

HTML
3
star
25

oatmeal

A tool for creating Common Lisp libraries and applications
Clojure
2
star
26

trav

Riffing off a popular 80s-era SF RPG
Clojure
2
star
27

treetop

Command line tool to show top files/directories in a given (possibly very large) directory
Go
2
star
28

sortest

Continuous testing in Python with sorting by test speed and auto-restart when files change
Python
2
star
29

crazyhat

Another Simple Static Blog Engine
Clojure
2
star
30

bask

A basic parallel task runner
Clojure
2
star
31

llbb

Playing with little compilers using Babashka and LLVM
Clojure
2
star
32

logpy-tutorial

logpy tutorial
Python
2
star
33

minpub

A minimal epub generator in Babashka / Clojure
Clojure
2
star
34

logplots

Something that will let all y'all make some log-scale histograms in Clojure. (It shouldn't be so hard.)
Clojure
1
star
35

conttest-go

Continuous Testing Helper (Go version)
Go
1
star
36

toobeci

Yet Another Forth Interpreter Written in Go (YAFIWIG)
Go
1
star
37

vagrant-i3live

Vagrant Setup for IceCube Live
Puppet
1
star
38

yaclomp

YACLOMP -- Yet Another Clojure Org-Mode Parser
Clojure
1
star
39

vaccinesearch

Search for Covid vaccines near a specific US location
Clojure
1
star
40

rosalind

Bioinformatics problems from Rosalind, worked in Clojure
Clojure
1
star
41

mongocrawl

Clojure
1
star
42

lll

LLVM experiments
Go
1
star
43

mac-sbcl-quicklisp-install

Automating my Common Lisp environment setup
Makefile
1
star
44

covid19

Program to summarize local COVID19 case rates
BlitzBasic
1
star
45

oodles

Oodles of Delicious Linguine - a port of Douglas Hofstadter's recursive Italian Dinner program to Clojure
Clojure
1
star