Skip to content

JakeWheat/burdock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Burdock
=======

Programming language design and implementation learning project.

Invented motivation
-------------------

If this was a project to realistically produce a programming language
that was widely used, this would be the context of why it exists.

Target use cases

* implementing and maintaining non trivial automated test frameworks
  including reports

* benchmarking and profiling data reports/analysis tools

* implementing and maintaining other kinds of automation for complex
  software product dev and maintenance, and for demos, solutions
  architecture

* build scripts

* most of the "scripting" things you might also use bash or python for

Not designed to be good at implementing the stuff that existing low
level languages such as C++/Rust do well, designed for a only a subset
of the appropriate use cases of e.g. F#, Ocaml, Haskell, isn't aimed
at Javascript backends/platforms.

Hypotheses

* it's realistic to ask most devs, devops, qa, sales engineers,
  solutions architects, etc. to pick up Bash or Python, and write and
  maintain scripts in them

* it's not realistic to ask them to use any existing functional
  programming language unless they already know one well - which is
  approximately 0% of the above groups

* a mythical typed functional programming language which is as
  accessible and usable as Python would have huge advantages over
  something like Python or Bash in these scenarios, and it can be
  fairly conservative as far as typed functional programming languages
  go and easily achieve these advantages

* a language can be very successful with a culture of using existing
  code in various languages instead of focusing on rewriting what
  already exists that's good enough/ not where the biggest ROI
  is

* compromising on a more beginner oriented syntax based on Pyret is
  worth it over something based on e.g. Haskell or Ocaml

Plus a provisional principle: not for or against the language evolving
to support more advanced features in principle (e.g. HKT, effects,
metaprogramming), but this should never be at the expense of
beginner/new user experience aspects such as being able to write
useful programs without type checking.

Target language sketch
----------------------

Takes a lot of inspiration from Pyret, particularly the
syntax. Implemented in Haskell.

* functional
* types + unityped
* FFI for Haskell, Python, C
* run exes, "shell FFI"
* Erlang inspired concurrency features
* relational theory inspired features
* automated testing made very easy
* strong focus on ergonomics, an analogy - the left-handed oil test:
  https://www.youtube.com/watch?v=w08XDXjJhsQ&t=127s



Try it out
----------

[currently broken, fix eta Q1 2024]

Install ghc and cabal-install, ghcup is recommended for this, https://www.haskell.org/ghcup/

Update cabal-install package list:

> cabal update

Get the source from github https://github.com/JakeWheat/burdock/

> git clone https://github.com/JakeWheat/burdock.git

Or download the zip file from the green "Code" drop down and unzip it.

Build the interpreter:

> cd burdock
> ./build _build/burdock

Run a script after building:

> _build/burdock examples/ahoy.bur
Ahoy world!

You can copy/link the burdock exe to somewhere in your path and use "#!/usr/bin/env burdock" at the top of your script.

Run the system tests:

> ./build test

Examples
--------

TODO: proper examples, for now there are some files here

* <https://github.com/JakeWheat/burdock/blob/master/examples/>
* <https://github.com/JakeWheat/burdock/blob/master/src/burdock/tests/>
* <https://github.com/JakeWheat/burdock/blob/master/src/burdock/built-ins/>

Links
-----

Github: https://github.com/JakeWheat/burdock/

Contact: [email protected]

About

Programming language interpreter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published