• This repository has been archived on 16/Jan/2018
  • Stars
    star
    312
  • Rank 134,133 (Top 3 %)
  • Language
    Clojure
  • Created over 11 years ago
  • Updated over 7 years ago

Reviews

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

Repository Details

The common BODil Oriented Language

BODOL

This is my language experiment.

Preliminary goals which may or may not be possible to combine:

  • Pure functional language.
  • Homoiconic in the Lisp tradition.
  • Built on the traditional Lisp primitives.
  • Hindley-Milner flavoured type system.
  • Currying function calls.
  • Pattern matching.

This is a work in progress. Don't expect it to even run its own test suite.

Not Implemented Yet

The language, and the reference implementation (which, be warned, is just a dumb, slow interpreter), still misses these things:

  • Type system.
  • Macros.
  • Module system.
  • A decision on lazy vs strict evaluation.

Inspiration

Clojure is great, but sometimes I miss static typing. Haskell is great, but sometimes I miss Lisp's elegantly simple syntax. Shen is a splendid compromise, but I found myself wishing it came with Haskell's uncompromising purity and Standard ML's straightforward type system. BODOL is my attempt at crossbreeding the three, with Shen obviously the major influence.

A Taste of BODOL

Functional hello world:

(Æ’ factorial
  0 → 1
  n → (* n (factorial (- n 1))))

(Æ’ fibonacci
  0 → 0
  1 → 1
  n → (+ (fibonacci (- n 1)) (fibonacci (- n 2))))

More advanced pattern matching:

(Æ’ map
   f () → ()
   f (head . tail) → (cons (f head) (map f tail)))

(= '(2 3 4) (map (λ a → (+ a 1)) '(1 2 3))))

Currying:

(ƒ triplet a b c → (list a b c))
(define one-and (triplet 1))
(define one-and-two-and (one-and 2))
(= '(1 2 3) (one-and-two-and 3))

Take a look at the theoretically comprehensive test suite for examples of all the currently defined language features.

Test Drive

The BODOL prototype interpreter is written in Clojure, so you'll need to install Leiningen in order to run it. Optionally, you may also want to install rlwrap for a better line editing experience. Once that's done, check out the BODOL repo, cd over there and type:

$ ./repl
BODOL version 0.0.0
You are in a maze of twisty little passages, all alike.
→→

What's with those non-ASCII characters?

If you're discouraged by the curious absence of λ, ƒ and → on your keyboard, you can substitute Clojure's fn and defn or Common Lisp's lambda and defun for λ and ƒ respectively, and -> for →.

I realise some people feel very strongly that using non-ASCII characters in a programming language syntax, even optionally, is reckless, irresponsible and heretical. BODOL is probably not a great fit for those people.

Emacs bindings

If you're using Emacs, I find it helps to bind ƒ, λ and → to M-f, M-l and M-- (Alt+F, Alt+L and Alt+Minus) respectively.

;; Keybindings for special symbols
(global-set-key (kbd "M-l") (lambda () (interactive) (insert "\u03bb"))) ;lambda
(global-set-key (kbd "M-f") (lambda () (interactive) (insert "\u0192"))) ;function
(global-set-key (kbd "M--") (lambda () (interactive) (insert "\u2192"))) ;right arrow

;; Launch the BODOL REPL in an inferior-lisp buffer
(defun bodol-repl ()
  (interactive)
  (run-lisp "<path to your BODOL repo>/repl"))

Vim bindings

Add this snippet to your .vimrc to enable the same keybindings for vim.

" Keybindings for λ and ƒ
:inoremap <A-l> <C-v>u3bb<Space>
:inoremap <A-f> <C-v>u192<Space>
:inoremap <A--> <C-v>u2192<Space>

Mac OS X keybindings

If you're using Mac OS X, you can enable these keybindings globally by adding the following snippet to ~/Library/KeyBindings/DefaultKeyBinding.dict.

{
"~f" = ("insertText:", "\U0192"); /* alt + f ~> florin */
"~l" = ("insertText:", "\U03BB"); /* alt + l ~> lambda */
"~-" = ("insertText:", "\U2192"); /* alt + - ~> right arrow */
}

License

Copyright 2013 Bodil Stokke

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

typed-html

Type checked JSX for Rust
Rust
1,845
star
2

im-rs

Assorted immutable collection datatypes for Rust
Rust
1,440
star
3

eslint-config-cleanjs

An eslint config which reduces JS to a pure functional language
JavaScript
1,106
star
4

vgtk

A declarative desktop UI framework for Rust built on GTK and Gtk-rs
Rust
1,037
star
5

smartstring

Compact inlined strings for Rust.
Rust
469
star
6

ohai-emacs

The finest hand crafted artisanal emacs.d for your editing pleasure
Emacs Lisp
378
star
7

catnip

A web based Clojure IDE
JavaScript
349
star
8

purescript-signal

Elm style FRP library for PureScript
PureScript
258
star
9

higher

Your favourite Haskell type classes for Rust
Rust
213
star
10

cljs-noderepl

A ClojureScript REPL running on Node.JS
Clojure
166
star
11

emacs.d

Here is my .emacs.d for public perusal.
Emacs Lisp
141
star
12

purescript-is-magic

An educational game with ponies
PureScript
114
star
13

purescript-smolder

A combinator library for generating markup
PureScript
88
star
14

meowhash-rs

Meow hasher for Rust
Rust
87
star
15

purescript-test-unit

An asynchronous unit test runner for PureScript
PureScript
86
star
16

vscode-file-browser

TypeScript
78
star
17

eulalie

ES6 flavoured parser combinators
JavaScript
69
star
18

microkanrens

Implementations of µKanren in assorted languages
PureScript
60
star
19

refpool

An efficient memory pool mechanism for Rust.
Rust
59
star
20

purescript-eulalie

String parser combinators for PureScript.
PureScript
55
star
21

pylon

A Javascript class system in 100% Clojurescript
Clojure
52
star
22

purescript-vdom

A native PureScript virtual DOM implementation.
PureScript
48
star
23

cljs-nashorn

ClojureScript REPL on Nashorn
Clojure
47
star
24

bitmaps

Bitmap types for Rust
Rust
44
star
25

boogaloo

JavaScript
43
star
26

purescript-typelevel

Type level natural numbers and booleans
PureScript
33
star
27

pink

A presentation tool.
JavaScript
31
star
28

clojurescript-all-the-way-down

Code from my Clojure/conj talk
Clojure
30
star
29

lolkanren

This project has moved:
JavaScript
30
star
30

purescript-observable

ES7 Observables for PureScript
PureScript
29
star
31

sized-chunks

Efficient sized chunk datatypes for immutable.rs
Rust
25
star
32

bodil.github.com

Presentation slides etc
CSS
24
star
33

vscode-use-package

Programmatic configuration for VS Code
TypeScript
24
star
34

sized-vec

Rust vectors with type level size
Rust
24
star
35

atom-use-package

Programmatic package configuration for Atom
JavaScript
24
star
36

palmtree

Don't look, I'm just playing with a B+-tree implementation which may or may not turn into a PALM tree.
Rust
24
star
37

spectre-of-free-software

HTML
23
star
38

vscode-init-script

Programmatic configuration for VS Code
TypeScript
23
star
39

vscode-blueprint

TypeScript
22
star
40

are-we-there-yet

Slides for CUFP 2017 keynote
HTML
20
star
41

simdify

SIMD optimised algorithms and data types
Rust
18
star
42

purescript-sized-vectors

Idris style sized vectors in PureScript
PureScript
18
star
43

nixcfg

My NixOS configuration files
Nix
17
star
44

typeify

A Browserify transform module for automated TypeScript compilation
JavaScript
17
star
45

purescript-kanren

Relational programming for PureScript
PureScript
17
star
46

purescript-store

A simple application state store for PureScript.
PureScript
16
star
47

only-better

This project has moved:
JavaScript
16
star
48

opt

Option types for TypeScript with real gradual typing
TypeScript
15
star
49

building-lisp

This project has moved:
Clojure
15
star
50

baconts

This project has moved:
TypeScript
14
star
51

graham

Parser combinators for JS
JavaScript
14
star
52

purescript-pux-smolder-dom

A drop-in replacement for Pux's React based renderer which needs no foreign dependencies.
PureScript
13
star
53

testlol

A Maven test runner for Javascript using Rhino and Env.js
JavaScript
13
star
54

error

A testing toolkit for ClojureScript, designed for testing asynchronous code
Clojure
11
star
55

ohai-atom

My Atom config.
CoffeeScript
11
star
56

pstalk

A slide deck.
JavaScript
11
star
57

gx

JavaScript
10
star
58

joy-of-milner

A talk about the Hindley-Milner type system.
JavaScript
9
star
59

lms

Lightweight Modular Staging in Rust
Rust
9
star
60

hipster

This project has moved:
JavaScript
9
star
61

purescript-chrome-api

PureScript bindings for the Chrome Platform APIs
PureScript
9
star
62

purescript-webapp

work in progress, don't
PureScript
8
star
63

persistence

A talk.
HTML
8
star
64

post-frp

JavaScript
8
star
65

leiningen-for-dummies

A Windows installer for Leiningen
Clojure
7
star
66

bodega-khajiit

May your road lead you to warm sands.
Rust
7
star
67

ONIForcedExit

Oxygen Not Included mod that restricts your game time.
C#
7
star
68

cargo-template-vgtk

Cargo template for vgtk apps.
Rust
6
star
69

newtype-proxy

Automatic deriving of `From` and `Deref` for Rust newtype structs.
Rust
6
star
70

purescript-smolder-dom

PureScript
6
star
71

hellobackbone

JavaScript
6
star
72

array-ops

Ready made default method implementations for array data types.
Rust
6
star
73

purescript-smolder-vdom

A Smolder renderer for purescript-vdom
PureScript
6
star
74

the-mess

This project has moved:
JavaScript
6
star
75

tweetlol

Twitter sidebar extension for Firefox
JavaScript
6
star
76

future-of-clojure

My talk for the Clojure Exchange 2014.
JavaScript
5
star
77

todo15m

A complete Node webapp you can write live on stage in 15 minutes if you come properly prepared.
JavaScript
5
star
78

mylittlecthulhu

A poorly disguised todo list, in Clojure and Clojurescript.
JavaScript
5
star
79

purescript-observable-channel

purescript-signal like channels for purescript-observable.
PureScript
5
star
80

purescript-signal-socket

Node sockets with a Signal interface
PureScript
5
star
81

vscode-prettier-toml

A VS Code formatter for TOML using Prettier
TypeScript
5
star
82

purescript-geom

PureScript 2D matrix transformations
PureScript
4
star
83

lolisp

It's a lisp, in Python.
Python
4
star
84

generators

generators are dashed jolly spiffy
JavaScript
4
star
85

node-gnomenotify

C++ bindings for GNOME libnotify on-screen notifications
C++
4
star
86

bagwell

A talk about Bagwell tries
HTML
4
star
87

ten-minute-clojure

Slides for teaching Clojure basics in a hurry with Catnip
JavaScript
4
star
88

sudokulol

An instructional Sudoku problem generator and solver, using Noir.
JavaScript
3
star
89

lolcode-mode

LOLCODE mode for Emacs.
Emacs Lisp
3
star
90

hands-on-with-clojure

This project has moved:
Clojure
3
star
91

startuplol

My attempt at solving the Extreme Startup exercise
Clojure
3
star
92

frob

This project has moved:
TypeScript
3
star
93

purescript-asap

The `asap` scheduler as a portable PureScript module
PureScript
2
star
94

unbreakwep

Chrome extension that unbreaks keyboard navigation in the weird time tracking app I have to use at work
JavaScript
2
star
95

mandelbrotlol

A very simple Mandelbrot set renderer using HTML5 canvas and web workers
JavaScript
2
star
96

unpredictable

More randomness for Clojure
Clojure
2
star
97

erlang-the-reckoning

HTML
2
star
98

feedlol

FriendFeed on your desktop!
Python
2
star
99

xbobar

This project has moved:
JavaScript
2
star
100

tickerlol

Stock ticker indicator applet for Unity
Clojure
2
star