schala/README.md

72 lines
2.8 KiB
Markdown
Raw Normal View History

2017-04-10 00:56:55 -07:00
2017-08-29 00:28:19 -07:00
TODO:
-null-only language should be called Maaru
-haskell-ish langauge should be called Robo
-typeful scripting language should be called schala
rename accordingly!
2017-12-03 17:11:17 -08:00
-idea for Schala - scoped types - be able to define a quick enum type scoped to a function ro something, that only
is meant to be used as a quick bespoke interface between two other things
2017-08-29 00:28:19 -07:00
# Schala - a programming language meta-interpreter
2017-04-10 00:56:55 -07:00
Schala is a Rust-language framework written to make it easy to
create and experiment with toy programming languages. It provides
2017-04-10 00:58:32 -07:00
a common REPL, and a trait `ProgrammingLanguage` with methods
2017-04-10 00:56:55 -07:00
for tokenizing text, parsing tokens, evaluating an abstract syntax tree,
and other tasks that are common to all programming languages.
Schala started out life as an experiment in writing a Javascript-like
2017-08-29 00:28:19 -07:00
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.
## Languages implemented using the meta-interpreter
* The eponymous *Schala* language is an interpreted/compiled scripting langauge,
designed to be relatively simple, but with a reasonably sophisticated type
system.
2017-04-10 00:56:55 -07:00
2017-08-29 00:28:19 -07:00
* *Maaru* was the original Schala (since renamed to free up the name *Schala*
for the above language), a very simple dynamically-typed scripting language
such that all possible runtime errors result in null rather than program
failure.
2017-04-10 00:59:38 -07:00
2017-08-29 00:28:19 -07:00
* *Robo* is an experiment in creating a lazy, functional, strongly-typed language
much like Haskell
2017-04-10 00:56:55 -07:00
2017-08-29 00:28:19 -07:00
## Reference works
2017-04-10 00:56:55 -07:00
Here's a partial list of resources I've made use of in the process
of learning how to write a programming language.
2017-10-03 21:28:17 -07:00
### Type-checking
https://skillsmatter.com/skillscasts/10868-inside-the-rust-compiler
2017-08-29 00:28:19 -07:00
### Evaluation
2017-04-10 00:56:55 -07:00
*Understanding Computation*, Tom Stuart, O'Reilly 2013
2017-10-03 21:28:17 -07:00
*Basics of Compiler Design*, Torben Mogensen
2017-04-10 00:56:55 -07:00
2017-08-29 00:28:19 -07:00
### Parsing
2017-04-10 00:56:55 -07:00
http://journal.stuffwithstuff.com/2011/03/19/pratt-parsers-expression-parsing-made-easy/
2017-04-10 00:58:06 -07:00
2017-04-10 00:56:55 -07:00
[Crafting Interpreters](http://www.craftinginterpreters.com/)
2017-08-29 00:28:19 -07:00
### LLVM
2017-04-10 00:56:55 -07:00
http://blog.ulysse.io/2016/07/03/llvm-getting-started.html
###Rust resources
https://thefullsnack.com/en/rust-for-the-web.html
https://rocket.rs/guide/getting-started/