You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-2
Original file line number
Diff line number
Diff line change
@@ -105,14 +105,31 @@ The process of adding additional native functions to the Lox interpreter has fou
105
105
106
106
Doing these steps correctly and in order ensures that the project should remain compilable at all times. Look out for both compilation and linker errors.
107
107
108
+
## Additions to the Lox Language
109
+
110
+
A number of native functions not specified in the book "Crafting Interpreters" have been added to the base language, as well as hetrogeneous list syntax using `[` and `]`:
111
+
112
+
```javascript
113
+
var list = [ 1, "abc", 2.2 ];
114
+
print length(list); // "3"
115
+
list[2] =3.3; // list is now [ 1, "abc", 3.3 ];
116
+
delete(list, 1); // list is now [ 1, 3.3 ];
117
+
print length(list); // "2"
118
+
append(list, "xyz"); // list is now [ 1, 3.3, "xyz" ];
119
+
print list[2]; // "xyz"
120
+
var s1 =tostring(2.2); // s1 is "2.2"
121
+
var s2 ="abcde";
122
+
var s3 =substring(s2, 2, 3); // s3 is "cd"
123
+
```
124
+
108
125
## Future Developments
109
126
110
127
There are a number of ideas for the future direction of this library:
111
128
112
-
* Stability: likely to be many bugs in non-core library code, and faulty Lox input can crash the board (fixed)
129
+
* Stability: likely to be many bugs in non-core library. Faulty Lox input can crash the board (fixed). Errors generated in native functions cause the interpreter to crash (fixed). Loading from USB is not stable.
113
130
* Complete support for more "Arduino.h" functions
114
131
* Support for Arduino_GigaDisplayTouch
115
-
* Support for running scripts via a web interface (console-in-a-web-page) (#define CLOX_WEB_CONSOLE 1)
132
+
* Support for running scripts via a web interface (console-in-a-web-page) (use #define CLOX_WEB_CONSOLE 1 in "clox_gfx_config.h")
116
133
* Use of the M4 co-processor as a graphics accelerator
117
134
* Changing the Lox interpreter language (not the JIT backend) to something less like JavaScript (GFX-Basic?)
118
135
* Adding to the ArduinoGraphics library (filled triangles, more fonts etc.)
Copy file name to clipboardExpand all lines: library.properties
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
name=clox_gfx
2
-
version=0.0.4
2
+
version=0.0.5
3
3
author=Richard Spencer <cpptutor@outlook.com>
4
4
maintainer=Richard Spencer <cpptutor@outlook.com>
5
5
sentence=Port of the Lox interpreted programming language to Arduino
6
-
paragraph=(Experimental) Very early alpha code, please check the repository for a more recent version. Intended for Giga R1 WiFi and Display with USB storage, most of the functionality can be disabled for other boards.
6
+
paragraph=(Experimental) Library code is stable, but please check the repository for a more recent version. Intended for GIGA R1 WiFi and Display with USB storage, most of the functionality can be disabled for other boards.
0 commit comments