All Projects → koto-lang → Koto

koto-lang / Koto

Licence: mit
A simple, expressive, embeddable programming language, made with Rust

Programming Languages

rust
11053 projects
language
365 projects

Labels

Projects that are alternatives of or similar to Koto

Impala
An imperative and functional programming language
Stars: ✭ 118 (-11.94%)
Mutual labels:  compiler
Grain
The Grain compiler toolchain and CLI. Home of the modern web staple. 🌾
Stars: ✭ 2,199 (+1541.04%)
Mutual labels:  compiler
Tinyscript
自制的一个编译器, 用于学习,完整实现了词法分析,语法分析,中间代码(SSA)生成,机器码生成,和基于寄存器的虚拟机
Stars: ✭ 132 (-1.49%)
Mutual labels:  compiler
Reading
A list of computer-science readings I recommend
Stars: ✭ 1,919 (+1332.09%)
Mutual labels:  compiler
Asterius
A Haskell to WebAssembly compiler
Stars: ✭ 1,799 (+1242.54%)
Mutual labels:  compiler
Pl0 Compiler
Compiler written for PL0 programming Language. Written in C, for COP3402 class from UCF.
Stars: ✭ 128 (-4.48%)
Mutual labels:  compiler
Coq Of Ocaml
Import OCaml programs to Coq 🐓 🐫
Stars: ✭ 117 (-12.69%)
Mutual labels:  compiler
Hivemind
a multi-syntax language
Stars: ✭ 133 (-0.75%)
Mutual labels:  compiler
Phplrt
PHP Language Recognition Tool
Stars: ✭ 127 (-5.22%)
Mutual labels:  compiler
Instapack
All-in-one TypeScript and Sass compiler for web applications! 📦 🚀
Stars: ✭ 131 (-2.24%)
Mutual labels:  compiler
Ghc Grin
GRIN backend for GHC
Stars: ✭ 123 (-8.21%)
Mutual labels:  compiler
Cperl
A perl5 with classes, types, compilable, company friendly, security
Stars: ✭ 125 (-6.72%)
Mutual labels:  compiler
Ocaml Protoc
A Protobuf Compiler for OCaml
Stars: ✭ 129 (-3.73%)
Mutual labels:  compiler
One
OneLang: The One System Programming Language. (release as soon)
Stars: ✭ 120 (-10.45%)
Mutual labels:  compiler
Naskah
Bahasa pemrograman dengan sintaks Bahasa Indonesia (Programming language with Indonesian syntax) 🇮🇩
Stars: ✭ 132 (-1.49%)
Mutual labels:  compiler
Serverless Layers
Serverless.js plugin that implements AWS Lambda Layers which reduces drastically lambda size, warm-up and deployment time.
Stars: ✭ 119 (-11.19%)
Mutual labels:  compiler
Md
A markdown parser and compiler. Built for speed.
Stars: ✭ 128 (-4.48%)
Mutual labels:  compiler
Lesscpy
Python LESS compiler
Stars: ✭ 133 (-0.75%)
Mutual labels:  compiler
Solang
First fully featured programming language for Stack Overflow Driven Development
Stars: ✭ 133 (-0.75%)
Mutual labels:  compiler
Jphp
JPHP - an implementation of PHP on Java VM
Stars: ✭ 1,665 (+1142.54%)
Mutual labels:  compiler

Koto

Docs Crates.io CI

Koto is an embeddable scripting language, written in Rust. It has been designed for ease of use and built for speed, with the goal of it being an ideal choice for adding scripting to Rust applications.

Koto is versatile enough to be useful in a variety of applications, although there has been a focus during development on interactive systems, such as rapid iteration during game development, or experimentation in creative coding.

Current State

The language itself is far enough along that I'm happy to share it with the wider world, although you should be warned that it's at a very early stage of development, and you can expect to find missing features, usability quirks, and bugs. Parts of the language are likely to change in response to it being used in more real-world contexts. We're some distance away from a stable 1.0 release.

That said, if you're curious and feeling adventurous then please give Koto a try, your early feedback will be invaluable.

Getting Started

A Quick Tour

import test.assert_eq

# Numbers
assert_eq (1 + 2.5), 3.5

# Strings
hello = "{}, {}!".format "Hello", "World"
hello.print()

# Functions
square = |n| n * n
assert_eq (square 8), 64

add_squares = |a, b| (square a) + (square b)
assert_eq (add_squares 2, 4), 20

# Iterators, ranges, and lists
fizz_buzz = (1..100)
  .keep |n| (10..=15).contains n
  .each |n|
    match n % 3, n % 5
      0, 0 then "Fizz Buzz"
      0, _ then "Fizz"
      _, 0 then "Buzz"
      else n
  .to_list()
assert_eq
  fizz_buzz,
  ["Buzz", 11, "Fizz", 13, 14, "Fizz Buzz"]

# Maps and tuples
x = {foo: 42, bar: "bar"}
assert_eq x.keys().to_tuple(), ("foo", "bar")

Learning the Language

While there's not yet a complete guide to Koto, there are some code examples that are a good starting point for getting to know the language.

Installation

The most recent release of the Koto CLI can be installed with Cargo:

cargo install koto_cli

REPL

A REPL is provided to allow for quick experimentation. Launching the koto CLI without providing a script enters the REPL.

» koto
Welcome to Koto v0.1.0
» 1 + 1
2
» "{}, {}!".print "Hello", "World"
Hello, World!
()

Language Goals

  • A clean, minimal syntax designed for coding in creative contexts.
  • Fast compilation.
    • The lexer, parser, and compiler are all written with speed in mind, enabling as-fast-as-possible iteration when working on an idea.
  • Fast and predictable runtime performance.
    • Memory allocations are reference counted.
    • Currently there's no tracing garbage collector (and no plan to add one) so memory leaks are possible if cyclic references are created.
  • Lightweight integration into host applications.
    • One of the primary use cases for Koto is for it to be embedded as a library in other applications, so it should be a good citizen and not introduce too much overhead.

Editor Support

Vim / Neovim

koto.vim

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].