Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/terahlunah/fox
Work in progress concatenative language interpreter, expect breakages and api changes
https://github.com/terahlunah/fox
compiler concatenative design language
Last synced: 1 day ago
JSON representation
Work in progress concatenative language interpreter, expect breakages and api changes
- Host: GitHub
- URL: https://github.com/terahlunah/fox
- Owner: terahlunah
- Created: 2022-06-26T16:49:13.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-06-22T08:55:16.000Z (over 1 year ago)
- Last Synced: 2024-10-31T20:28:12.632Z (7 days ago)
- Topics: compiler, concatenative, design, language
- Language: Rust
- Homepage:
- Size: 35.2 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fox 🦊
_Warning: this is a WIP language_
Fox is a statically typed, stack-based, concatenative programming language.
It is designed to balance minimalism and ergonomics.Design was inspired by Kitten, Rust, Haskell and F#.
---
## Features
- ### Concatenative
The main operation in Fox is function composition.
This makes refactoring program an easy task.- ### Stack Based
Functions work by operating on the stack.
Code is mostly written in point free style, but Fox also support named binding.- ### Statically Typed
Type checking happens at compile time. This ensures code correctness.- ### Standalone Interpreter
The standalone interpreter allows `.fox` files to be run directly from the command line
```$> fox my_script.fox```- ### Rust Interface
Being built with rust, Fox (will) come with a simple-to-use interface to embed Fox scripts in your programs.---
## [Language overview](language.md)
An overview of the language.
---
## Examples
- Hello world
```
"Hello world!" print # `print` consume a `String` from the top of the stack and prints it
```- Greeter
```
def greet =
-> name # pop the top stack value and store it in `name`
["Hello, ", name, "!"] concat # concat convert a `String List` to a `String`
print # `print` consume a `String` from the top of the stack and prints it"What is your name? " prompt # `prompt` push a `String` on the stack from user input
greet # `greet` consume a `String` from the stack and greets the user
```- [Factorial](examples/fact.fox)