Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/glossopoeia/boba
A general purpose statically-typed concatenative programming language.
https://github.com/glossopoeia/boba
compiler concatenative language programming-language type-inference
Last synced: 2 months ago
JSON representation
A general purpose statically-typed concatenative programming language.
- Host: GitHub
- URL: https://github.com/glossopoeia/boba
- Owner: glossopoeia
- License: mit
- Created: 2021-07-03T19:57:20.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-04-28T00:56:16.000Z (over 1 year ago)
- Last Synced: 2024-08-01T19:47:46.842Z (5 months ago)
- Topics: compiler, concatenative, language, programming-language, type-inference
- Language: F#
- Homepage:
- Size: 5.89 MB
- Stars: 50
- Watchers: 2
- Forks: 3
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-programming-languages - Boba - A general purpose statically-typed concatenative programming language. Key features include: (Uncategorized / Uncategorized)
README
# Boba - A Structured Concatenative Language
Boba is an early-stage, general purpose [concatenative](https://concatenative.org/) programming language.
Key features include:
1. Expressive, mostly implicit static types and kinds
2. Language-incorporated unit and property tests + runners
3. Algebraic effects via scoped effect handlers
4. Algebraic data types and pattern matching on constructors
5. Compile-time resolved function overloading
6. Structurally typed tuples, records and variants
8. Byte-code VM-in-Go backend with straight-forward first-order FFI access
9. Familiar looping, branching, and variable definition syntax constructs## Hailstone Example
```
func is-even n = n 2 rem-i32 0 eq-i32about :
/// The `hailstone` function is sometimes named that because of how the values
/// 'bounce' up and down (like hail in a storm cloud) as the sequence computes.
rec func hailstone n =
switch {
| n 1 eq-i32 => []
| n is-even => n 2 div-i32 hailstone
| else => 3 n mul-i32 inc-i32 hailstone
}
n cons-listtest hailstone-1? = 1 hailstone is [1]
test hailstone-2? = 2 hailstone is [1, 2]
test hailstone-3? = 3 hailstone is [1, 2, 4, 8, 16, 5, 10, 3]
test hailstone-6? = 6 hailstone is [1, 2, 4, 8, 16, 5, 10, 3, 6]export { hailstone }
```See the `test/` folder for many more examples of Boba syntactic and semantic features.
## Building from source
The Boba compiler is currently implemented in F#. Recommended to have both .NET 6 and Go language version 1.18 installed on the system before building. This repository is [Gitpod](https://gitpod.io/) compatible and will automatically create a container capable of building and running the compiler.
Example build-and-run command:
```
dotnet run --project Boba.Compiler compile test/while-expr
```This will build the compiler, then `compile` the `test/while-expr.boba` file in the tests directory into an executable and then run it.
To use Boba's inline testing features, simply replace `compile` with `test`:
```
dotnet run --project Boba.Compiler test test/ackermann
```This will run all the tests present in the `test/ackermann.boba` file and report on their success/failure.
To run a test or program without the current runtime debug trace, include a `release` flag:
```
dotnet run --project Boba.Compiler test test/hailstone release
```## Installation
Installers and binary packages are not yet available while the compiler CLI further stabilizes.
## License
Boba is available and distributed under the terms of the MIT license. See LICENSE for details.
## Roadmap
In no particular order, and missing some potential work that may take priority:
- Community feature: Better showcase examples
- Ecosystem feature: Flesh-out primitives library further
- Codegen feature: Compile some Boba functions to Go rather than byte-code