https://github.com/bsgbryan/bs
BryanScript - my little language ☺️
https://github.com/bsgbryan/bs
Last synced: 9 months ago
JSON representation
BryanScript - my little language ☺️
- Host: GitHub
- URL: https://github.com/bsgbryan/bs
- Owner: bsgbryan
- License: mit
- Created: 2023-04-19T03:15:57.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-26T00:05:07.000Z (over 2 years ago)
- Last Synced: 2025-02-10T03:46:16.360Z (11 months ago)
- Language: Rust
- Size: 43.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Welcome to BryanScript! ❤️
BryanScript (bs for short 🤭) is the little language I'm working on for fun (... and profit 🧐)
It's just a little baby right now but, soon I'd like to have syntax looking something like what's below compiling down to the WebAssembly binary format:
```bs
use RuntimeError from core::error
struct GreetingError
const message: String
expose struct Person
const name: String
mut age: i32
decorate Person(Debug, PartialEq, Hash)
fun greet(stranger: Person) -> Result
when stranger.name
nil => return GreetingError("No one to greet! 🙃")
otherwise =>
console.log `Well hello there, $stranger.name!`
return Ok
fun main(args: List) -> Result
const me = Person
name: "Bryan"
age: 44
return when me.greet stranger: Person(name: "Jumpy", age: 42)
GreetingError(ge) => RuntimeError(...ge)
otherwise => Ok(0)
```