Crates.io | mica |
lib.rs | mica |
version | 0.7.1 |
source | src |
created_at | 2022-03-13 11:40:03.021211 |
updated_at | 2023-01-29 14:18:27.52682 |
description | A simple, user-friendly, embeddable scripting language |
homepage | |
repository | https://github.com/liquidev/mica |
max_upload_size | |
id | 549177 |
size | 597,377 |
A simple, human-friendly scripting language, developed one feature at a time. Its goals are:
# Hello, Mica!
struct Counter impl
func new(start, increment) constructor = do
@value = start
@increment = increment
end
func value() = @value
func increment() = do
@value = @value + @increment
end
end
c = Counter.new(1, 1)
while c.value < 100 do
print(c.value)
if c.value.mod(2) == 0 do
print("even!")
end
c.increment()
end
At its current stage, it can be embedded into existing programs, but bugs may arise and certain parts may be cumbersome to use. The performance is also not even close to where I'd like it to be. But I want you to try it out and share your thoughts!
To compile Mica, use one of the following commands:
# To install the latest stable release:
$ cargo install mica-cli
# To compile the latest revision:
$ git clone https://github.com/mica-lang/mica
$ cd mica
$ cargo build -p mica-cli --release
Then you can try it out interactively, or run a file:
# To open the REPL:
$ mica
# To run a file:
$ mica filename.mi
Check out the language reference for a detailed look at the language!
The Rust ecosystem has plenty of existing scripting languages, but none of them quite cuts it for me.
There's also a number of unfinished crates with bindings for more niche scripting languages that are written in C, but, well, they're unfinished.
I wanted a language that would take performance seriously. Be designed with specific goals in mind. Sugary, but not quite sweet enough to give you instant diabetes. And handmade by myself.
Designing and implementing a programming language has been one of my arch nemeses for the past few years with varying levels of success, but I feel like finally, this is it. This time I'm gonna do it.