-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathCHANGELIST
707 lines (577 loc) · 33.6 KB
/
CHANGELIST
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
6.0.18 ---------------------------------------------------------------------------------
- added WRValue* wr_instanceStruct( WRValue* val, WRContext* context, const char* name, const WRValue* argv =0, const int argn =0 );
which creates a struct (which must be defined in the given context) passing the args to the
constructor.
- autmoatically export all 'struct' declarations
6.0.17 ---------------------------------------------------------------------------------
- optimized constant-load negating
- added indexStruct() to get the values from a struct passed back to c++
- added isStruct() to support checking if indexStruct() will work
- added some more consts in methods
6.0.16 ---------------------------------------------------------------------------------
- fixed comparing +0.0 with -0.0 in ieee float land
- fixed '-' sign parsing
- fixed possible failure-to-init inside array class
6.0.15 ---------------------------------------------------------------------------------
- fleshed out test code for container lib
6.0.14 ---------------------------------------------------------------------------------
- platformIO push
- fixed build options
6.0.13 ---------------------------------------------------------------------------------
- string with a non-string element now converts the non-string element
- gc hint now global to a state rather than the context so it can be set before
the first run
- fixed gc error where it could possibly clean up user args before using them
- added a container lib with the following functionality:
array::clear( array, [size] ); // clear/create an array the specified size (default 0)
// returns: the array
array::count( array ); // returns: elements
array::remove( array, where, [count] ); // remove count items (default 1)
// from where (items shifted down)
// returns: the array
array::insert( array, where, [count] ); // add count blank items (default 1)
// at where (items shifted up)
// returns: the array
array::truncate( array, size ); // chop off this array at the given size
// returns: the array
hash::clear( hash ); // clear/create a hash table
// returns: the table
hash::count( hash ); // number of items in the hash table
// return: number
hash::add( hash, item, key ); // add item as location key,
// clobbering/creating as necessary
// returns: the item
hash::remove( hash, key ); // remove this key from the hash table
// returns: 1 if the key was found,
// otherwise 0
hash::exists( hash, key ); // return 1 if this key is found otherwise 0
list::clear( list ); // clear/create a list
// returns: the list
list::count( list ); // returns: elements
list::peek( list ); // return the first element of the list without
// changing it
list::pop( list ); // return and remove the first element of the list
list::pop_front( list ); // return and remove the first element of the list
list::pop_back( list ); // return and remove the last element of the list
list::push( list, item ); // push item to front of the list
list::push_front( list, item ); // push item to front of list
list::push_back( list, item ); // push item to back(end) of list
queue::clear( queue ); // clear/create a queue (filo)
queue::count( queue ); // returns: elements
queue::push( queue, item ); // push item onto the queue
queue::pop( queue ); // pop an item off the queue
queue::peek( queue ); // return the first element of the queue without
// changing it
stack::clear( stack ); // clear/create a stack (fifo)
stack::count( stack ); // return: elements
stack::push( stack, item ); // push item onto the stack
stack::pop( stack ); // pop an item off the stack
stack::peek( stack ); // return the first element of the stack without
// changing it
6.0.12 ---------------------------------------------------------------------------------
- compacted string concatenation
- added new test code for strings
- fixed ->r->va where ->va should have been, how did that pass everything?! examining
code coverage next pass.
- fixed float == float comparison to "close enough epsilon" comparison of floats which
fixes some unfixable rounding errors in double/float/IEEE land
6.0.11 ---------------------------------------------------------------------------------
- removed #define'd code for code coverage checks to work properly since I'm pretty
sure the implementation is stable now
- reworked arrays and EX/HASH/MEMBER semantics to fix some issues
- catching "if ()" error in compiler now, empty parenthesis never make sense
6.0.10 ---------------------------------------------------------------------------------
- soime code coverage and a pointer
6.0.9 ----------------------------------------------------------------------------------
- optimized common case of stack-swapping
- fixed a bug where argument space was allocated twice
- found/fixed a funny little bug where, if it happened in a single operation, a
loaded hash value might be invalidated by another load requiring the hash table to
be expanded. The problem with this is values might be stored for a long time, the way
arrays deal with this is "member of array" but not enough information exists in a WRValue
to make that work for hashes.. need the full hash AND ref to the table.
I have an idea to fix this.. maybe ref to a ref that gets garbage-collected? hmmm...
-- this required a retooling of hash containers and memory, now fixed
- indexing an array with a string turns it into a hash
- fixed tiny memory leak in compiler, crazy corner case (thanks valgrind!)
6.0.8 ----------------------------------------------------------------------------------
- fixed corner case in string formatting memory issue
6.0.7 ----------------------------------------------------------------------------------
- fixed { if() { return; } } case
- wired user-data test case back in
6.0.6 ----------------------------------------------------------------------------------
- added WRValue* wr_getValueFromContainer( WRValue const& container, const char* name )
6.0.5 ----------------------------------------------------------------------------------
- added protection from Divide-By-Zero
6.0.4 ----------------------------------------------------------------------------------
- fixed memory allocation for user data, also changed them to use regular
hash tables so the keys can be iterated
- tightened up string handling, removed extra byte at the end of internal array/strings
- added MallocStrScoped() to manage malloc'ed strings
- added TCP/IP functionality for windows/linux esp32 coming next on my radar
- added tcp/ip debugging in prep for wireless esp32 debugging
6.0.3 ----------------------------------------------------------------------------------
- version bump for lib
6.0.2 ----------------------------------------------------------------------------------
- adding time-sliced yield with WRENCH_TIME_SLICES
- adding simple round-robin scheduler
- adding ability to force yield based on instructions processed. only looping/conditional
instructions are "counted" for speed and simplicity
- stack is now allocated per context instead of per state, to make multi-threading/importing more
intuitive and scaleable (original state-wide stack was result of earlier GC implementation)
- looked into protecting the stack and the overhead is not all that terrible so added the
WRENCH_PROTECT_STACK_FROM_OVERFLOW option which will do that
- changed slicing function signatures, globals? really? what was I thinking.
- WRENCH_INCLUDE_DEBUG_CODE now works! basically! have not yet tested it thoroughly
over a serial link that's next.
- made sure g_free/g_malloc are used everywhere (I had missed a few cases)
- fixed leak in trapRunOutput() (thank you darksotmoon)
- adding to platformIO
6.0.1 ----------------------------------------------------------------------------------
- implementated WRENCH_HANDLE_MALLOC_FAIL:
for embedded systems that need to know if they have run out of memory,
WARNING: This imposes a small if() check on EVERY INSTRUCTION so the
malloc failure is detected the moment it happens, but guarantees
graceful exit if g_malloc() ever returns null
- sprintf rework to use much less stack and have effectively unlimited format/result size
- adding FASTCONTINUE that skips the malloc-fail check on opcodes that can't cause it
- added WRValue::asMallocString() so large stack alocations are unecessary
- fixed up some debug code implementation, still not ready for use!
- removed/relocated includes that were not actually needed globally, increasing compatibility
with standard c libs
6.0.0 ----------------------------------------------------------------------------------
- removed function declaration being an in-line process (which was to facilitate executing
serial streams, a feature dropped long ago) to place the table statically into ROM. this
reduces code and VM size a bit
- salted CRC to ensure valid-but-wrong-version images cannot be executed
- added struct-compare: structs equal each other iff they are the same type and have the
same value members.
- used WRENCH_NULL_HASH in code streams as well for consistency
- fixed size of hash tables so they properly report ._count now
- added iterator working on strings
- added stl-style iteration of array/hash values
// c++98 style:
for ( WRValue::Iterator it = argv->begin(); it != argv->end(); ++it )
{
WRIteratorEntry const& value = *it;
// ...
}
// c++11+ style:
for( WRIteratorEntry const& value : *argv )
{
// ...
}
- breaking up some files that have gotten out of hand to sub-files, particularly in cc.cpp!
- fixed obscure memory overrun with struct comparison (valgrind rides again)
5.0.2 ----------------------------------------------------------------------------------
- added isString() to WRValue
- fixed: bool isString() const;
bool isWrenchArray() const;
bool isRawArray() const;
bool isHashTable() const;
they were not properly dereferening their arguments
- added array length returns to isString() etc.
- fixed other cases where the value was not being properly dereferenced
- fixed arraySize() in WRValue
5.0.1 ----------------------------------------------------------------------------------
- nested container declarations now work:
var table = { 1, 2, 3, {"key":"value", "key2": 2} };
now works correctly, creating a 4 element array where the fourth is
a hash table
- fixed '._remove' to work for arrays as should be expected
- fixed key/value iteration
5.0.0 ----------------------------------------------------------------------------------
- import!
code can now be imported and made available to the running code ie:
sys::importCompile( "function f1() { return 10; }" );
print( f1() ); // output will be '10'
sys::importCompile(), sys::importByteCode() and from c wr_import( ... ) are
all supported with one caveat, structs must be explicitly exported so their namespace
maps (which are only generated when needed) are generated is:
--- file1.c:
struct S { var a = 10; var b = 20 };
--- file2.c:
export struct E { var a = 10; var b = 20 };
--- file3.c:
var f = io::readFile( "file1.c" );
sys::importCompile( f );
var s = new S; // this will NOT WORK
f = io::reasdFile( "file2.c" );
sys::importCompile( f );
var e = new E; // this WILL work
functions do NOT have this restriction.
also: imported global space is NOT accessible
sys::importCompile( "var g = 100;" );
print( ::g ); // error, 'g' has not been declared
this required a few byte-code changing changes:
- units can be "exported" which requires the namespace map to always be
appended rather than conditionally if a 'new' of them has been performed
- namespace map always occurs at the start of a unit offset so it can be found
when imported
- fixed some minor string based stuffs
- issue #25 fixed, requiring 'var' was not compatible with "foreach" because it was
creating a temporary incorrectly, fixed.
- added library call sys::halt(...) which allows a program to break the current execution
with a supplied err code, as long as its higher than
WR_USER = 10000, // user-defined below here
other
4.0.1 ----------------------------------------------------------------------------------
thx to: ohordiichuk <[email protected]> for the following:
- removed ALL new/delete from code except for in-place new used in the compiler. Since
I used templates and classes I had no choice.
- purusant to the above, th VM uses NO new/delete at all and should be free from needing
stdlibc++ at all
- added support for custom allocator at ohordiichuk's suggestion. It's set once
and used everywhere as a global but should get the job done:
// by default wrench uses malloc/free but if you want to use your own
// allocator it can be set up here
// NOTE: this becomes global for all wrench code!
typedef void* (*WR_ALLOC)(size_t size);
typedef void (*WR_FREE)(void* ptr);
void wr_setGlobalAllocator( WR_ALLOC wralloc, WR_FREE wrfree );
- reworked str.h to add a dynamic formatting option for format/appendFormat
to both handle small strings more effeciently and handle formats of unlimited
size
4.0.0 ----------------------------------------------------------------------------------
- !!! 'var' NOW REQUIRED to declare variables. This is to cut down on possible typos.
the non-strict version can still be used to compile older scripts. !!!
- debugger added, VM can now pause/restart and exposes function/line calls
- created debugger client
- created local/remote/in-core debug implementations
- changed the format of bytecode again, requiring a push to 4.*
- created a hierarchy in the discrete_src directory, it was getting cluttered
- added a memory counter to the GC so it won't run EVERY time, that was a
convenient hack for a first pass but time to fix it, added:
#define WRENCH_DEFAULT_ALLOCATED_MEMORY_GC_HINT 4000
void wr_setAllocatedMemoryGCHint( WRContext* context, const uint16_t bytes );
- pause_gc() opcode removed, tragic hack, especially in light of the above. That
should always have been library calls and if the need arises that
is where it will be ressurected
- added WRValue::technicalAsString(char* string, size_t maxLen, bool valuesInHex)
to support displaying debug values
- fixed up the hash to work for everything without a scrambler
- added delete to io:: lib
- implemented LittleFS for arduino
- changed calling function for function primitive to incluide context
- adding mult_event example for using multi-context
- added yield() functionality! always wanted it
3.2.6 ----------------------------------------------------------------------------------
- more code size optiomizations (thanks again Manfred)
- io/file refinements for win32
- made all text files cr/lf consistent (unix style)
- added roadmap file
3.2.5 ----------------------------------------------------------------------------------
- fixed esp/embedded issue with unaligned 16/32 bit reads
- added a serializer! this will encode/decode WRValue including int, float, string, array,
hash tables in any combination, refer to /tests/019_serialize.c for intended usage
- pursuant to the above, it is also possible to write/read serialized WRValues in a
single operation
3.2.4 ----------------------------------------------------------------------------------
- added directives to compile for the esp8266 toolchain
- integrated code optimization from Manfred, thank you!
- force the open in std::open to use the O_BINARY flag in all cases
- added array init function so they are exactly the right size
- specifically added array-handling functionality for returned values
3.2.3 ----------------------------------------------------------------------------------
- wr_compile(...) now returns a WRError type
- streamlined and fixed EX_REFARRAY resolution so it will properly recurse/descend
- Deprecated file::read and file::write, now io::readFile and io::writeFile
- added:
io::open( name, [flags, mode] );
io::close( fd );
io::read( fd, [max_count] );
io::write( fd, data, [count] );
io::seek( fd, offset, [whence] );
- also added support for SPIFFS, LittleFS, Win32 and linux-ish io with:
#define WRENCH_WIN32_FILE_IO
#define WRENCH_LINUX_FILE_IO
#define WRENCH_SPIFFS_FILE_IO
#define WRENCH_LITTLEFS_FILE_IO
#define WRENCH_CUSTOM_FILE_IO
just defined the one you need in wrench.h
- wrench now understands octal as C: 023 == 19
- added macros for reading data from the code stream, including 8-bit for the case of
it being specially addressed ROM:
READ_32_FROM_PC( P )
READ_16_FROM_PC( P )
READ_8_FROM_PC( P )
- changed function signatures to make a bit friendlier to use:
WRValue& wr_makeInt( WRValue* val, int i );
WRValue& wr_makeFloat( WRValue* val, float f );
WRValue& wr_makeString( WRContext* context, WRValue* val, const unsigned char* data, const int len );
- added Library constants! So the concept of constant values that can be loaded at
runtime when they weren't compiled in to begin with, this is accomplished with the new opcode:
O_LoadLibConstant
Which is appended to the instruction set, so it remains backward-compatible. Along with this the
function:
void wr_registerLibraryConstant( WRState* w, const char* signature, const WRValue& value );
Has been added, which is called to load consts into the VM for access via code. The constants
MUST be of the form: "A::B" and it is a run-time error if one is not found when called for:
WR_ERR_library_constant_not_loaded
- refactored index/hashing functions to be more robust and take far less space, by combining
the index operations into a single call. runs a touch faster and saved more than 10% code
size
- fixed struct extra function call when parsing a trailing comma
- fixed crashing bug when you accessed a non-hash as if it were one
3.2.2 ----------------------------------------------------------------------------------
- fixed parse error where control chars are quoted f(")"); for example would fail
- calling a function that does not exist is now an execution error
- fixed spurious dereference from new struct code
3.2.1 ----------------------------------------------------------------------------------
- bugfix release for negative array reference
- debug features are DORMANT and not meant for release yet
3.2.0 ----------------------------------------------------------------------------------
- removed DEPRECATED call-function signatures
- added sys:: library and calls to set garbage-collector states and check for functions existence
sys::functionExists
sys::gcPause
- fixed bug in function calling where it was possible for the return vector to set the
garbage-collect flag on the return frame.
- these names had been bothering and I finnaly came up with better ones:
These are now !!DEPRECATED!!:
WRContext* wr_allocateNewScript( WRState* w, const unsigned char* block, const int blockSize );
bool wr_executeFunctionZero( WRContext* context );
And have been replaced with:
WRContext* wr_newContext( WRState* w, const unsigned char* block, const int blockSize );
WRValue* wr_executeContext( WRContext* context );
3.1.1 ----------------------------------------------------------------------------------
- added functionality so string + string and string += string work!!
its a teeny bit hack-ish but overall not that bad, and does not impact normal
performance at all, it's only engaged if you actually use the strings functionality
3.1.0 ----------------------------------------------------------------------------------
- Trying to figure out how to add this-> ish functionalit
- Added new string functions:
str::concat
str::left
str::trunc
str::right
str::substr
str::trimright
str::trimleft
str::trim
str::insert
3.0.0 ----------------------------------------------------------------------------------
!!NOTE: Code generated on 3.* is NOT compatible with 2.* and verse-visa !!
- new version sub-type added "build"
- Actually ran wrench on a big-endian machine and it blew chow. short version:
I THOUGHT I had been testing on big-endian using Raspberry-Pi since it's ARM but
turns out (stop snickering!) That I was wrong about that
So using Qemu and a PPC debian image I actually tested it on an [emulated] big-endian box
and shook out all the bugs.
This led me the conclusion that storing data natively as big-endian, a habit
from my netork progamming, is stupid. It requires byte-swapping on every architechitecture
this is likely to be used on, including embedded. So the "native" format of data in
wrench is now Little-Endian,
tl;dr:
this:
((int32_t)*(P+3) | ((int32_t)*(P+2))<<8 | ((int32_t)*(P+1))<<16 | ((int32_t)*(P))<<24)
becoms this:
(*(int32_t *)(P))
with a pickup in speed and decrease of code size. so yay.
bad news is this means pushing the major version since it is no longer binary compatible
- Taking advantage of non-binary-compatible to clean up the opcode order a bit and group
some likes together.
- Added PPC (qemu/G4/debian) to test-platforms required to pass before release. It's
slow at 266mhz single-core (wow.. there was a time...) but is big-endian so actually
ensures cross-compatibility.
- fixed opcode error in corner-case of keyhole optimizer in index
- added opcode for indexed members into function call, they need to be dereferenced
in order to work as expected
2.2 ----------------------------------------------------------------------------------
- Major API change to wr_callfunction(...) !!!!!!!
No longer takes a "WRState*" since that is inside the context, this change was
made some time ago and the API never caught up with it.
The old calls are still in but deprecated, please update if you are using them
it no longer returns an integer 'err' it now returns the WRValue* that is the
return-value of the function. This means error-checks on it need to be
inverted.
- WRValue::setInt( const int i )
- WRValue::setFloat( const float i )
- WrenchValue::operator int*()
- int* WrenchValue::asInt()
- WrenchValue::operator float*()
- float* WrenchValue::asFloat()
- WRValue& WrenchValue::operator[]( const int index )
- WRValue* WrenchValue::asArrayMember( const int index )
- int* WrenchValue::makeInt()
- float* WrenchValue::makeFloat();
- fixed warning with int/int32_t pointer confusion in 64 bit land
- fixed command-line strip/symbols flag to work properly
2.12 ----------------------------------------------------------------------------------
- added global function symbols and method to access them via c:
WRValue* wr_getGlobalRef( WRContext* context, const char* label );
- added Helper object WrenchInt and WrenchFloat to facilitate handling
wrench values in c
- fixed err strings
- added 'strip' options cs, cas, chs to cli to support removal of globals
- updated website, added some docs
2.11.1 (trivial release) --------------------------------------------------------------
- fixed len checking in asString() for char arrays
2.11 ----------------------------------------------------------------------------------
- added ESP32 libraries to track some work I'm doing with that platform
- fixed up arduino compile chain to be a bit more sensible
- thought I'd seen the last of the global/local variable issues but another one cropped up
2.10 ----------------------------------------------------------------------------------
- Improving Arduino support
- Adding Esp32 support
- Updated the win32 build to VS2022
- separated the wr_run function into it's two parts: allocating the script
then initializing it by running "function 0" with:
// wr_run actually calls these two functions back-to back. If you want
// to separate the process you can call them on your own.
WRContext* wr_allocateNewScript( WRState* w, const unsigned char* block, const int blockSize );
bool wr_executeFunctionZero( WRState* w, WRContext* context );
- Fixed null switch-body crash (who does that? well.. if you comment them ALL out...)
- Rewrote switch to properly handle local space, major bug that it wasn't before. This
Represents a difference in the way the switch VM functions but actually _is_ reverse compatible,
...almost... the (Switch) case has a (uint16_t) cast which prevents it from functioning, so
I do need to bump the major version darnit.
2.09 ----------------------------------------------------------------------------------
- removed 'const' from a few return types Arduino 2.x complained about
- fixed compiler error around indexing arrays with variables (oof)
- fixed "asString" for user-data arrays to be less stupid finding the values
- added enum types supported by c++11 for ease of debugging but made sure
it is still fully compile-able under c++98
2.08 ----------------------------------------------------------------------------------
- added more debugging tools
- added WRENCH_FLOAT_SPRINTF to grant full floating-point format support to str::sprintf
- removed leading '0' from wrench version macro
2.07 ----------------------------------------------------------------------------------
- fixed order-of-operations problem with global/local division and subtraction
2.06 ----------------------------------------------------------------------------------
- bugfixes
2.05 ----------------------------------------------------------------------------------
- small gc optimization
- fixed issue #9 with the optimizer
2.04 ----------------------------------------------------------------------------------
- Adding CallLibFunctionAndPop since it's coming up a lot (appended so major version same)
- fixed corner case where iterators did not hold references to their arrays so they
could be gc'ed while being iterated! hard to induce this case, you have to do
something silly like erasing the array while iterating but now it will just
be sill instead of segfaulting :)
- Added string operation for constructing strings to call into wrench with
2.03 ----------------------------------------------------------------------------------
- added .isFloat() and .isInt() to WRValue
- fixed some array-centered pre/post inc/dec corners
- wrench now understands "userdata.b" to be equivilant to "userdata.b[0]" for the
purposes of a raw array and wr_addArrayToContainer(...)
- fixed some raw array compares
- fixed small leak with re-opening multiple contexts, the fix
- added std_msg a messaging lib for sending/receiving messages across contexts
a message is a key/value where the key can be anything but the value is only stored
numerically, if a complex type is given the hash will be stored, the implications for
passing allocated memory around is just too whacky
msg::read -- read a message, optionally clear
msg::write -- write a message
msg::clear -- clear
msg::peek -- returns true if a message exists
load this with wr_loadMessageLib(...) and it is included with wr_loadAllLibs(...)
2.02 ----------------------------------------------------------------------------------
- added bounds checking for raw arrays
- fixed RAW_ARRAY access from c-side value lib
- fixed error where "negate" operation changed the target value permemantly
- added more RAW_ARRAY support
2.01 ----------------------------------------------------------------------------------
- fixed nasty optimization bug around not forgetting opcodes deep enough
2.00 ----------------------------------------------------------------------------------
- wrench bytecode now expects a 32-bit CRC footer, this bytecode is checksummed before
run to prevent crashes by bad/garbage data
- wr_run now requires a size, so it can locate the CRC at the end and check the bytecode
- found a bunch of space optimizations, knocked almost 3k off the flash size!
- added (int) and (float) casting operators
1.82 ----------------------------------------------------------------------------------
- changing release format to y.xx instead of y.x.z
1.8.1 ----------------------------------------------------------------------------------
- RAM on small devices is precious, and fragmentation is really a problem. wrench's
hash tables are bad for this becuase they are very flat, grow-on-collide. So I added
a 'linear retry' semantic of size (mod / 8) which will attempt to find empty entries
NEAR a collision. This has dramatically reduced ram use and fragmentation on modest
size tables, at the cost of the occasional iteration on hit. The only real penalty is
felt on a miss, and it's not large.
- Initial addition of an arduino library
1.8.0 ----------------------------------------------------------------------------------
- fixed value-to-array semantics for asInt() and asFloat()
- removed c++ constructor/destructor semantics from interpretrer, this saves a
few cycles and at the same time allows large chunks of memory to be allocated
simultaneously so should reduce RAM usage a bit too
1.7.1 ----------------------------------------------------------------------------------
- reduced memory footprint a tad by shrinking data types in WRState
- fixed some compiler warnings from newer compilers
- fixed major bug in not preserving return values correctly
- removed "create globals" instruction in favor of always-init to save space
- allocate context and globals all in one go and removing constructor/destructor
this should save a teeny bit of overhead and code space
1.7.0 -------------------------------------------------------------------------
- removed WRENCH_JUMPTABLE_INTERPRETER from top-level, really not a user-visible
thing
- added switch, linear and arbitrary flavors
- added WRENCH_REALLY_COMPACT to allow small-but-almost-full-speed WRENCH_COMPACT
1.6.0 -------------------------------------------------------------------------
- fixed error in compare logic surrounding GE/LE/GT/LT in keyhole optimizer
10/26/22 1.5.0 -------------------------------------------------------------------------
- added goto. sometimes it's just the right solution
- added optimized int/float to string so no more dependency on std/sprintf
- added optimized sprintf for string library
- added gc_pause( counts ) to pause the garbage collector 'x' counts when a large
number of allocations is about to happen. The gc is hyper-aggressive which works
great for small-memory embedded systems but slows down larger allocations
- fixed parsing of \0 -style escape sequences in single and double-quotes
- added struct array initting
- tranlate "null" into 0 wherever it is encountered
- added "compact" flag which will trade unrolled speed for very compact code,
reduces compiler-only build to 21k on arduino, now it fits into everything!
10/15/22 1.4.0 -------------------------------------------------------------------------
- removed unnused opcode
- fixed struct/param bug
- broke out a few other .h files
fixing:
- #2 Can't build due to possibly uninitialized value
- #3 ISO C++ 17 does not allow register storage class specifier
- objs_linux/ dir not part of repo by default
- fixed failure to recognize missing semicolon parse error
- added Hash tables, initted with { k:v, k:v }
- added enums, they are free to the interpreter just cost some compiling overhead
- added single char recognition with ''
- adding string lib
- adding io lib
- partial-code execution removed
10/6/22 1.3.0 -------------------------------------------------------------------------
- added more compare optimizations
- changed function calling to be lower overhead by making "no return" the default,
so now instead of always returning and then cancelling the return, the return
value is ignored unless it's actually going to be used
arduino compiles the interpreter (sans compiler) to 41k
- added array initialization
- added structures
- added "new" instances
- added inline initialization
- added optimized LL/GG/LG/GL loading for uncoimmon binary operations without
blowing the opcodes up the way add/sub/mul/div did. Those can be back-converted
if necessary
- optimized gc passes
- added ._count meta
9/27/22 1.2.1 ---------------------------------------------------------------------------
- added 0b prefix for parsing binary numbers
- added catch for two label/literals in a row
- changed the 6x6 arrays to 4x4 so the operands could be left-shifted instead of
multiplied. This shows measureable gains on the embedded systems, no change to
Intel and a slight loss on Ryzen
- added 16-bit loads for integers and indexes, reduces bytecode size considerably
- added super-instructions for binary operation + store so it never touches stack
pretty big speed boost on all platforms
- require 1 less stack ewntry (from 3 to 2) to call a function
- added optimized inc/dec functions for faster [typical] for loops
- added optimized compareL/G instructions for common (x < 0) -ish cases
- optimized if conditionals more with a compare/jump combination instruction
9/11/22 1.2.0 -------------------------------------------------------------------
- removed need for context ID and just track the object directly
- added function to call a pre-indexed function
9/8/22 1.1.0 -------------------------------------------------------------------
- added jumptable interpreter
- added some "super" opcodes for more compressed bytecode:
O_LiteralInt8ToGlobal
O_LiteralInt32ToLocal
O_LiteralInt8ToLocal
O_LiteralFloatToGlobal
O_LiteralFloatToLocal
O_LiteralInt32ToGlobal