2023-02-06 07:52:33 +11:00
2022-10-02 06:09:48 +11:00
2022-10-02 11:07:15 +11:00
2022-10-02 05:55:51 +11:00
2023-02-06 01:58:25 +11:00
2022-10-02 04:26:52 +11:00
2022-10-02 04:26:52 +11:00
2022-09-11 04:50:53 +10:00
2022-10-30 15:09:25 +11:00
2023-02-06 07:52:33 +11:00
2023-01-16 03:01:32 +11:00
2022-10-02 04:26:52 +11:00
2022-10-02 04:26:52 +11:00
2022-10-02 04:26:52 +11:00
2023-01-23 19:25:37 +11:00
2022-10-02 04:26:52 +11:00
2023-02-06 01:58:25 +11:00
2023-01-21 15:36:09 +11:00
2023-01-21 15:55:35 +11:00
2022-10-02 04:26:52 +11:00
2022-10-02 04:26:52 +11:00
2022-11-12 22:50:01 +11:00
2023-01-16 21:00:25 +11:00
2023-01-16 11:56:55 +00:00
2022-11-12 22:47:57 +11:00
2022-09-10 19:46:20 +01:00
2022-10-04 08:16:25 +11:00
2022-11-19 19:38:24 +11:00

Running Comprehensive Tests

Preamble

The Toy programming language is a procedural bytecode-intermediate interpreted language. It isn't intended to operate on its own, but rather as part of another program, the "host". This process is intended to allow a decent amount of easy customisation by the host's end user, by exposing logic in script files. Alternatively, binary files in a custom format can be used as well.

The host will provide all of the extensions needed on a case-by-case basis. Script files have the .toy file extension, while binary files have the .tb file extension.

fn makeCounter() { //declare a function like this
	var total: int = 0; //declare a variable with a type like this

	fn counter(): int { //declare a return type like this
		return ++total;
	}

	return counter; //closures are explicitly supported
}

var tally = makeCounter();

print tally(); //1
print tally(); //2
print tally(); //3

Nifty Features

  • Simple C-like syntax
  • Bytecode intermediate compilation
  • Optional, but robust type system (including opaque for arbitrary data)
  • Functions and types are first-class citizens
  • Import external libraries
  • Fancy slice notation for strings, arrays and dictionaries
  • Can re-direct output, error and assertion failure messages
  • Open source under the zlib license

Getting Started

Deep Dive

Version Differences

There have been a number of versions of Toy over the years, the current actively developed version is in the main branch for the time being. The best version to use is either the code in the main branch, or the latest tagged version.

Languages
C 97.7%
Makefile 2.2%