Skip to content

yolio2003/cirru.org

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cirru.org

IPA: /ˈsɪɹə/

Writing code in syntax tree

Home page: http://cirru.org

Twitter: https://twitter.com/cirrulang

Why Cirru?

In programming languages, symbols(like brackets) make lexing and paring simpler, indentations make code readable. And this may lead to really tricky syntaxes.

I want people just write code by editing the syntax tree. So there should be a small language showing us how does it work.

What is Cirru?

The name "Cirru" came from cirrus cloud. I read it like cirrus(but without s).

The core of Cirru is the indetation-based syntax:

  • use prefix syntax, see Lisp
  • () to create expressions inside each line, see Lisp
  • indetation with 2 spaces
  • represent token with optional "" and \, see Bash
  • $ as a function to fold code, see Haskell
  • , as a function to unfold code

Cirru prefers Lisp's notions to make itself minimalistic:

  • Code is data
  • Syntax represents AST

Examples

These examples below are identical:

set a (add (number 1) (numer 2))
set a $ add (number 1) $ number 2
set a $ add
  number 1
  number 2
set a
  add
    number 1
    number 2

Find more examples at cirru-parser.

Usage

While that is simple, there are many subprojects around Cirru, such as:

  • CirruScript: compiled-to-js language
  • interpreter: a demo of scripting language in Go
  • Cirru Editor: graphical syntax tree editor

About

Offcial site for Cirru Grammar

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CoffeeScript 72.7%
  • Cirru 13.4%
  • CSS 10.6%
  • HTML 3.3%