Skip to content

Commit f1ee763

Browse files
committed
update readme with project information
1 parent ab7ab0d commit f1ee763

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
11
# PSLox
2-
PowerShell Implementation of Lox programming language
2+
PowerShell Implementation of Lox programming language.
33

4-
# Requirements
4+
This is a PowerShell implementation of the Lox programming language, a language created by Bob Nystrom in his book [Crafting Interpreters](https://craftinginterpreters.com/).
5+
6+
The interpreter is fully completed and have several of the features of the original set plus some of the included challenges.
7+
8+
not implemented features:
9+
- **unused variables error**: I did not wanted to add this feature so some scripts can be debugged easily
10+
- **static methods**: I wanted to follow the original Inheritance path, but powershell does not allow multiple inheritance and has several class limitations, could be implemented differently though.
11+
12+
### Requirements
513

614
- [PowerShell 7+](https://microsoft.com/PowerShell)
15+
16+
## Usage
17+
18+
the most easy way to use this Lox interpreter is to use the PSLox.ps1 script file available in the releases
19+
without parameters it will start a REPL (Read Eval Print Loop) session, optionally you can pass the lox script file as a parameter to execute it.
20+
21+
22+
## Building
23+
24+
Even though powershell has support for modules I did not make the script files able to run out of the bugs due to current module quirks in powershell such as module reload, for this reason while creating this interpreter I made a tool to amalgamate all the files, it is not very complex but you can check it our here [PSAmalgamate](https://github.com/UnixY2K/PSAmalgamate) keep in mind that this tool has some limitations as I made it for this specific interpreter.
25+
26+
> for specific instructions of how to use PSAmalgamate check its repo
27+
28+
## hacking the interpreter
29+
30+
there is 2 directories which contain the following information
31+
32+
- Interpreter: Lox Interpreter related data such as the Resolver, Interpreter and main entry script
33+
- Lox: Core Lox language data such as the scanner common classes and the parser
34+
35+
### adding additional native functions
36+
37+
you can create new functions by defining them in the constructor of the interpreter, the only function implemented is the clock function which returns the current time in seconds.

0 commit comments

Comments
 (0)