Kayne Ruse 7b453bc35f Reworked generic structures, read more
The following structures are now more independant:

- Toy_Array
- Toy_Stack
- Toy_Bucket
- Toy_String

I reworked a lot of the memory allocation, so now there are more direct
calls to malloc() or realloc(), rather than relying on the macros from
toy_memory.h.

I've also split toy_memory into proper array and bucket files, because
it makes more sense this way, rather than having them both jammed into
one file. This means the eventual hashtable structure can also stand on
its own.

Toy_Array is a new wrapper around raw array pointers, and all of the
structures have their metadata embedded into their allocated memory now,
using variable length array members.

A lot of 'capacity' and 'count' variables were changed to 'size_t'
types, but this doesn't seem to be a problem anywhere.

If the workflow fails, then I'll leave it for tonight - I'm too tired,
and I don't want to overdo myself.
2024-10-01 20:38:06 +10:00
2024-05-19 03:50:57 +10:00
2024-05-19 03:50:57 +10:00
2024-10-01 15:56:40 +10:00
2024-05-19 03:50:57 +10:00

For the feature complete version 1, click here.

Toy v2.x

The Toy programming language is an imperative, bytecode-interpreted, embeddable scripting language. Rather than functioning independently, it serves as part of another program, the "host". This design allows for straightforward customization by both the hosts developer and end users, achieved by exposing program logic through text files.

This repository holds the reference implementation for Toy version 2.x, written in C.

Nifty Features

  • Simple C-like syntax
  • Intermediate AST representation and bytecode formats
  • Strong, but optional type system
  • First-class and higher-order functions
  • Extensible via external libraries
  • Can re-direct output, error and assertion failure messages
  • Open source under the zlib license

Syntax

Coming Soon.

Building

Supported platforms are: linux-latest, windows-latest, macos-latest, using GitHub's standard runners.

To build the library, run make source.
To build the library and repl, run make repl.
To build and run the test cases, run make tests.
To build and run the test cases under gdb, run make tests-gdb.

Tools

Coming Soon.

License

This source code is covered by the zlib license (see LICENSE).

Contributors and Special Thanks

@hiperiondev - v1 Disassembler, v1 porting support and feedback
@add00 - v1 Library support
@gruelingpine185 - Unofficial v1 MacOS support
@solar-mist - v1 Minor bugfixes
The Ratbags - Feedback
@munificent - For writing the book that sparked my interest in langdev

Patreon Contributors

  • Seth A. Robinson
Languages
C 97.7%
Makefile 2.2%