You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Greg Shuflin 52b2426f30 Add note about macros 9 months ago
maaru Grand culling 4 years ago
robo Grand culling 4 years ago
rukka Grand culling 4 years ago
schala-lang Start work on typechecking 11 months ago
schala-repl Run cargo fmt 1 year ago
source_files Block syntax fixes 1 year ago
src Run cargo fmt 1 year ago
static Switch from request to superagent 4 years ago
.gitignore Cargo.lock should be version-controlled 3 years ago
Cargo.lock More updates, bump derivative version 1 year ago
Cargo.toml Flatten crate heirarchy 1 year ago
HindleyMilner.hs Consult these haskell programs from https://github.com/quchen/articles/tree/master/hindley-milner 4 years ago
Main.hs Consult these haskell programs from https://github.com/quchen/articles/tree/master/hindley-milner 4 years ago
README.md Update README 1 year ago
TODO.md Add note about macros 9 months ago
rustfmt.toml Unify u32-based identifiers into common code 1 year ago

README.md

Schala - a programming language meta-interpreter

Schala is a Rust framework written to make it easy to create and experiment with multiple toy programming languages. It provides a cross-language REPL and provisions for tokenizing text, parsing tokens, evaluating an abstract syntax tree, and other tasks that are common to all programming languages, as well as sharing state between multiple programming languages.

Schala is implemented as a Rust library schala-repl, which provides a Repl data structure that takes in a value implementing the ProgrammingLanguageInterface trait. Individual programming language implementations are Rust types that implement ProgrammingLanguageInterface and store whatever persistent state is relevant to that language.

Running

Run schala with the normal cargo run. This will drop you into a REPL environment. Type :help for more information, or type in text in any supported programming language (currently only schala-lang) to evaluate it in the REPL.

History

Schala started out life as an experiment in writing a Javascript-like programming language that would never encounter any kind of runtime value error, but rather always return null under any kind of error condition. I had seen one too many Javascript Uncaught TypeError: Cannot read property ___ of undefined messages, and I was a bit frustrated. Plus I had always wanted to write a programming langauge from scratch, and Rust is a fun language to program in. Over time I became interested in playing around with other sorts of programming languages as well, and wanted to make the process as general as possible.

The name of the project comes from Schala the Princess of Zeal from the 1995 SNES RPG Chrono Trigger. I like classic JRPGs and enjoyed the thought of creating a language name confusingly close to Scala. The naming scheme for languages implemented with the Schala meta-interpreter is Chrono Trigger characters.

Schala and languages implemented with it are incomplete alpha software and are not ready for public release.

Languages implemented using the meta-interpreter

  • The eponymous Schala language is a work-in-progress general purpose programming language with static typing and algebraic data types. Its design goals include having a very straightforward implemenation and being syntactically minimal.

  • Maaru is a very simple dynamically-typed scripting language, with the semantics that all runtime errors return a null value rather than fail.

  • Robo is an experiment in creating a lazy, functional, strongly-typed language much like Haskell

  • Rukka is a straightforward LISP implementation

Reference works

Here's a partial list of resources I've made use of in the process of learning how to write a programming language.

General

Type-checking

Evaluation

  • Understanding Computation, Tom Stuart, O'Reilly 2013
  • Basics of Compiler Design, Torben Mogensen

Parsing

LLVM