Tweaked README.md, and some comments

I have an idea for the data structures...
This commit is contained in:
2024-10-01 15:56:40 +10:00
parent a9759384cd
commit 53b0fc158c
2 changed files with 25 additions and 28 deletions

View File

@@ -13,47 +13,44 @@ This repository holds the reference implementation for Toy version 2.x, written
# Nifty Features # Nifty Features
* Simple C-like syntax * Simple C-like syntax
* Intermediate AST and bytecode * Intermediate AST representation and bytecode formats
* Strong, but optional type system * Strong, but optional type system
* First-class and higher-order functions * First-class and higher-order functions
* Extensible via external libraries * Extensible via external libraries
* Can re-direct output, error and assertion failure messages * Can re-direct output, error and assertion failure messages
* Open source under the zlib license * Open source under the zlib license
## Syntax # Syntax
*Omitted for review.* *Coming Soon.*
## Building # Building
Supported platforms are: `linux-latest`, `windows-latest`, `macos-latest`, using [GitHub's standard runners](https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories). Supported platforms are: `linux-latest`, `windows-latest`, `macos-latest`, using [GitHub's standard runners](https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories).
To build the library, run `make source`. 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`.
To build the library and repl, run `make repl`. # Tools
To build and run the test cases, run `make tests`. *Coming Soon.*
To build and run the test cases under gdb, run `make tests-gdb`.
## Tools
*Omitted for review.*
# License # License
This source code is covered by the zlib license (see [LICENSE](LICENSE)). This source code is covered by the zlib license (see [LICENSE](LICENSE)).
# Past and Current Contributors # Contributors and Special Thanks
@hiperiondev - Disassembler, porting support and feedback @hiperiondev - v1 Disassembler, v1 porting support and feedback
@add00 - Library support @add00 - v1 Library support
@gruelingpine185 - Unofficial MacOS support @gruelingpine185 - Unofficial v1 MacOS support
@solar-mist - Minor bugfixes @solar-mist - v1 Minor bugfixes
Unnamed Individuals - Feedback The Ratbags - Feedback
@munificent - For [writing the book](http://craftinginterpreters.com/) that sparked my interest in langdev
# Patrons via Patreon # Patreon Contributors
* Seth A. Robinson * Seth A. Robinson
Special thanks to Robert Nystrom of http://craftinginterpreters.com/ for their fantastic book that set me on this path.

View File

@@ -15,20 +15,20 @@ typedef enum Toy_ValueType {
} Toy_ValueType; } Toy_ValueType;
//8 bytes in size //8 bytes in size
typedef struct Toy_Value { typedef struct Toy_Value { //32 | 64 BITNESS
union { union {
bool boolean; //1 bool boolean; //1 | 1
int integer; //4 int integer; //4 | 4
float number; //4 float number; //4 | 4
//TODO: strings //TODO: strings
//TODO: arrays //TODO: arrays
//TODO: dictonaries //TODO: dictonaries
//TODO: functions //TODO: functions
//TODO: opaque //TODO: opaque
} as; //4 } as; //4 | 4
Toy_ValueType type; //4 Toy_ValueType type; //4 | 4
} Toy_Value; //8 } Toy_Value; //8 | 8
#define TOY_VALUE_IS_NULL(value) ((value).type == TOY_VALUE_NULL) #define TOY_VALUE_IS_NULL(value) ((value).type == TOY_VALUE_NULL)
#define TOY_VALUE_IS_BOOLEAN(value) ((value).type == TOY_VALUE_BOOLEAN) #define TOY_VALUE_IS_BOOLEAN(value) ((value).type == TOY_VALUE_BOOLEAN)