Skip to content

A python-ish pure and total functional programming language

License

Notifications You must be signed in to change notification settings

johnynek/bosatsu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,440 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Bosatsu Programming Language

Codecov

Bosatsu (菩薩) is the transliteration in Japanese of the sanskrit bodhisattva. A bodhisattva is someone who can reach enlightenment but decides not to, to help others achieve that goal. -- Wikipedia

Bosatsu is a simple, non-turing complete language designed for configuration, queries and scripting. It borrows from Python, Haskell, Dhall and Rust.

Please see the documentation site and the Getting started guide or try basic expressions using this in-browser Bosatsu compiler.

An example of Bosatsu

Here is a working Bosatsu program to solve the first Project Euler problem:

package Euler/One

# see:
# https://projecteuler.net/problem=1
# Find the sum of all the multiples of 3 or 5 below 1000.

operator == = eq_Int
operator % = mod_Int

def operator ||(x, y):
  True if x else y

def keep(i):
  (i % 3 == 0) || (i % 5 == 0)

def sum(as): as.foldl_List(0, add)

# here is the python version:
# >>> sum(i for i in xrange(1000) if keep_fn(i))
# 233168
#
# bosatsu version here
computed = sum([i for i in range(1000) if keep(i)])

test = Assertion(computed == 233168, "expected 233168")

Contributing

Please feel free to file an issue to discuss making a change to Bosatsu or to ask a question about how Bosatsu might be useful for a use-case that is interesting to you.

Release

See release.md for the release workflow and tagging steps.

About

A python-ish pure and total functional programming language

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 9