From 0c753dcc000232489208a88b16bf0beed2ec1340 Mon Sep 17 00:00:00 2001 From: prod2 <95874442+prod2@users.noreply.github.com> Date: Thu, 3 Feb 2022 05:13:02 +0100 Subject: [PATCH] update readme --- README.md | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 51bc0b3..7a7acc7 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,35 @@ # nondescript -Nondescript is a nim implementation of lox (see https://craftinginterpreters.com) with large deviations. +Nondescript started as a nim implementation of clox (see https://craftinginterpreters.com) but has acquired large deviations. ## Deviations from lox -- NOT SOURCE COMPATIBLE WITH LOX +- closures, gc not implemented yet +- classes will not be implemented + + + - Everything is an expression, except variable declarations and break statements - hence expressions can contain statements, so the stack is tracked inside the compiler, using compiler.stackCount - uses different local representation than lox inside the compiler - compiler.addLocal also has a delta argument - check it out if interested - 1 file = 1 chunk - - function objects are just a pointer to an instruction to jump to (right now instruction index, but this will change) -- constant indexes, local indexes have 2 bytes as arguments -- no object orientation -- closures are not implemented yet -- block expressions can be labelled and break takes a label to break out of -- set block expression results using ^, ^label -- set the return value of functions using ^result -- plans for the far future: defer, tables, lists + - function objects are just a pointer to an instruction to jump to +- constant indexes, local indexes have 2 bytes as arguments - no 256 limit on locals/constants +- block expressions can be labelled (@label) and the break statement takes a label to break out of +- set block expression results using :label +- set the return value of functions using :result +- lists (example: @[1, 4, 5]) +- tables (example: @{ "hello" = "world"}) +- length operator # +- ampersand operator to chain binary operators to finished expressions ## Examples -benchmarks/fib.nds +See the following folders in the source tree, look for the extension .nds: +- benchmarks/ +- examples/ +- tests/ ## Building @@ -33,6 +41,6 @@ The 4 steps to a REPL: ``` git clone https://github.com/prod2/nondescript cd nondescript -./build.sh -./nds +nimble build +bin/nds ``` \ No newline at end of file