-
Notifications
You must be signed in to change notification settings - Fork 1
About Cirru
Ancestor of Cirru is Peter Norvig's little lispy interpreter, Cirru is not an real interpreter though. (How to Write a (Lisp) Interpreter (in Python)) There is a difference, lispy enbraces parentheses, while Cirru gets gid of most of them.
And videos of Intentional Programming by Charles Simonyi inspired me too.
Early ideas of Cirru can be traced to a Graphical editor I made in April 2012, which was inspired by @yinwang0
I named it Cirru, it was supposed to be a graphical editor that runs interpreter on JavaScript. That editor is still available for playing, in blue boxes.
I rewrote it once and made it clickable, but it appears quite bad:
Also I started small projects to add brackets to Scheme, making it an indentation-based language. Well, I gave up after some weeks.
- http://jiyinyiyong.github.io/she/bin/
- https://github.com/jiyinyiyong/she
- https://github.com/jiyinyiyong/She.sublime
As I can see, brackets and symbols are for machines, while humans may hate those things. I was trying to make a graphical code editor based on Lisp-like AST tree. People will edit and debug code on top of GUI, and that would be cool. Later I found myself not experenced, that project failed, and I turned to one which is based on text and indentations.
By now Cirru is mainly a grammer based on indetations, $
s, and ()
s.
Most of the code is implemeted in CoffeeScript, the central project is the cirru-parser
.
Here's a small example(forget about the words..), notice that:
-
$
is from Haskell -
""
s markup tokens but not strings
define a (read cd)
if (> a cd)
print "demo"
print "not demo"
say $ print a
save $ b
x $ c 8
See the repo to find more:
Projects around Cirru, there are Syntax highlighting, interpreter, and others
- Convert to Mustache https://github.com/jiyinyiyong/cirru-to-mustache
- CodeMirror syntax https://github.com/jiyinyiyong/cirru-mode
- Sublime Text Package https://github.com/jiyinyiyong/Sublime-Cirru
- Interpreter https://github.com/jiyinyiyong/cirru-interpreter
- Conver to JavaScript AST https://github.com/jiyinyiyong/scirpus
- Syntax in Rainbow https://github.com/jiyinyiyong/cirru-rainbow
I posted some screenshot on Ruby China, fortunately many people like it. And I wrote some of my intentions of V2EX.
The purpose of Cirru is mainly to help me learn things of computers. And I wish people are more interested in futuristic techniques that evolving programming languages quickly, and people use Cirru Grammer as their tools of building small languages.
- logo and fontface customized for Cirru
- partialy reloading code environment, Smalltalk like coding environment
- parser and VM in golang so I can play with more details
- follow Bret Victor's ideas to expose internals of running code to developer