Commit Graph

122 Commits

Author SHA1 Message Date
Benjamin Vedder 19a0a7cc3f Squashed 'lispBM/lispBM/' changes from 1dd732d9..418272ad
418272ad added a way to load flattened environments into the heap on startup as a library. And added a library for cleaning of closure environments for future experimentation
74eefd1e bugfix in progn variables related to recursive binginds
93536f76 added a member function for list membership checks

git-subtree-dir: lispBM/lispBM
git-subtree-split: 418272ad1454ee414739fe0aef1b30aa9b56002c
2024-03-31 19:00:36 +02:00
Benjamin Vedder e772ad589f Squashed 'lispBM/lispBM/' changes from 6d9ca101..1dd732d9
1dd732d9 update lbmref.mb
704cb982 added rotate function for lists

git-subtree-dir: lispBM/lispBM
git-subtree-split: 1dd732d966d8b68e105fefa1dad973480bc8cd90
2024-03-30 09:17:19 +01:00
Benjamin Vedder 250f6934ec Squashed 'lispBM/lispBM/' changes from eb2a4cff..6d9ca101
6d9ca101 update to lbmref.lisp when it comes to let and var deconstruction of composite values while binidng
bf8cb49b consolidated some create_binding_location code
8a208269 added another progn var test
799b7a38 update some commentary around eval_var
231c07dc added more tests of progn_var changes.
1d74968a generalized var bindings to behave like Let when it comes to composite value deconstruction
a804e4fc flash error on const symbol strings should now report as flash error and not read error
85e6b624 small rearrangement
0e463e7d starting to clean out very old and definitely broken code examples that have not been touched for years
6ea44eff added is-nan and is-inf tests
6bd66bbd added generated images for the lbmref
d2e9092c Merge branch 'master' of github.com:svenssonjoel/lispbm
35d353b5 added updates to lbmref

git-subtree-dir: lispBM/lispBM
git-subtree-split: 6d9ca101e0064fdb5d0a27e67167cfc256e0275d
2024-03-27 20:27:34 +01:00
Benjamin Vedder a61f2e55f1 Squashed 'lispBM/lispBM/' changes from 0eee7a53..eb2a4cff
eb2a4cff Update added gitattributes
2f2c1ca0 Update README.md
2fad8119 added release script to repo
960998b3 Upped version to 0.23.0 and first time tests_report has been generated and included

git-subtree-dir: lispBM/lispBM
git-subtree-split: eb2a4cff8a08bc8f4483c3c26af1615505045405
2024-03-10 12:58:00 +01:00
Benjamin Vedder 009da692a8 Squashed 'lispBM/lispBM/' changes from fbc2d92b..a03e2756
a03e2756 Removal of fatal error generation where nothing fatal is going on
2472e632 Report a certain function application in a better way than just fatal error
1e3cab6c refactor
b345361f rest-args takes an optional numerical argument that is used as an index into the list of rest-args
18b152d4 adding tests to see if rest-args behaves as expected scope-wise
21166396 added a rest-args function that retreives extra arguments passed to a closure (lambda )
7b4f689a update to REPL and integration of dot->png into lbmref.lisp
6a6b39c0 added dot (graph rendering) functionality to lbmref.lisp and added exec extension to repl
51223814 planning section about evaluation rules
8d1b4bd6 lbmref.md is now generated from lbmref.lisp
672117e4 lbmref.lisp
5bf75e45 added more ref-entries to lbmref-lisp
00bdc8f2 additions to lbmref.lisp
3946725a added ref-entries to lbmref.lisp
1f8c0372 added a bunch of ref-entries to the lbmref.lisp
11bfa1e2 added more to lbmref.lisp
e337cc5e added a simplistic pretty printer to lbmref.lisp and a few more ref-entries
a7763e28 added new optional arguments to eval and eval-program for providing an environment to evaluate within
693420d3 added some ref-entries to lbmref.lisp, and some todos
43a2dc62 additions to lbmref.lisp
e91cf72e added to lbmref.lisp
447e1f7b fwrite and fwrite-str now flushes the filehandle after writing an array to file
b8e972a4 additions to lbmref.lisp and test output for github markdown viewer test
5cba626f Additions to lbmref.lisp
2eb8361f added fopen and fwrite extensions to REPL
23a74220 additions lbmref.lisp
86360788 added a ref-entry command to lbmref.lisp
229914ba small additions to lbmref.lisp
100ea80e towards LBM generated lbmref

git-subtree-dir: lispBM/lispBM
git-subtree-split: a03e2756fde8986711e34e9f403b6921d0be9bc4
2024-03-08 10:35:46 +01:00
Benjamin Vedder 3c051b179a Squashed 'lispBM/lispBM/' changes from 610c2d2a..520fde1a
520fde1a fix promotion bug when converting i32 to u64
1ea55e8a fixes related to LBM BYTE type
fba7e9a9 bugfix related to subtraction of byte values
baab84c3 update lbmref with information about numbers
4a7ac41f addition of tests and changes to type promotion and flat values
7a7cf54a updates to type promotion and some changes to flat value encoding for 64 bit
0e30b53a remove some args from flatten_value_size

git-subtree-dir: lispBM/lispBM
git-subtree-split: 520fde1a9610ec05300d72a898dd477553c29624
2024-02-23 07:08:24 +01:00
Benjamin Vedder 957b720c41 Squashed 'lispBM/lispBM/' changes from 7ba933de..610c2d2a
610c2d2a added a silent mode to the REPL, --silent
79c69181 Fix bug in how errors happening inside of fundamentals are returned
de5c356b fix bug in addition that incorrectly promotes byte values to U type
64219f1b remove some printing in REPL
b24e4c39 fix bug in unflatten value related to 64bit int
baa5bfba fix bug in flatten_value related to the size of expressions that contain Byte sized data
5fc5a7df Merge branch 'master' of github.com:svenssonjoel/lispbm
52665236 minor changes to new repl
22070c29 update README
59b5144a update README
9e8c2a2a update README
582f2235 minor changes to new REPL
24d4b6e0 added storing of flattened result to the repl
412e6483 added a terminate option to the REPL
15af284f  enabled loading and storing of environment files from the new REPL
b5319ebe fix bug in 64bit version, added a NULL check after readline in the REPL
05b3eb61 fix missing include repl
300213b9 preparing for loading and storing of global environment
fc3d20b0 sequence loading and evaluation of multiple source files when using multiple instances of -s flag on repl
1370102c loading source files
4a2f1c3d preparing for accepting source files from command line to the repl
9b45e4da small changes to new repl
ba47441e promoted the experimental_repl to repl status, it is still work in progress but at a much nicer state
fe16c290 cleanup some unused code in repl.c
e6705251 adding general purpose functions from vesc_express to the REPL
a0955b93 fix to state change logic
cfbb6114 started a revamping of experiment_repl now depends on readline, more to do
41c142a3 small fixes to vesc_express hil test scripts
ee763c72 work on automated vesc express fw build with vesc_express from main and lbm from master
3a2884b5 some maintenance and clearning, removal of unused function
ade15e9d removing some unused code
e16a8598 added loging of failed tests to a unique log file for each instance of run_tests.sh
ce9bdcdd fix potential out of bounds writes found by Marcos. Also removed a few dead-writes
5e1bad69 Small tweaks to eval. Changes to test script, store failing tests to test.log and print way less during testing.
93d14889 remove a blank line
04e1dc62 small refactorings
dbadb211 Trying to make the vesc_express hil script slightly more robust
99b6540d added a TTY available check before attempting to launch the tests
fb7fbee7 Added a slightly longer running vesc_express hil test as an experiment. The run_tests scripts for hil tests needs to be made more robust
0dc4b25c vesc_express hil tests now use the new vesc_tool feature of stdout redirection, no uart needed
78781da2 Added framework for Vesc Express HIL tests

git-subtree-dir: lispBM/lispBM
git-subtree-split: 610c2d2a3b0b4724a31929150789cda70b5aacfc
2024-02-21 11:42:12 +01:00
Benjamin Vedder 38a42ba203 Squashed 'lispBM/lispBM/' changes from 2837aa33..7ba933de
7ba933de lbm_lookup_extension_id now returns the actual extension symbol ID instead of the index into extension table
1c5c8da6 fix typo
0fb03637 defining different kinds of built-in symbols in some specific ranges. Cleaning out some old code.
b14dbe32 refactor of stack_push operations
4d1f5fd9 cont_closure_application_args refactor
aeb7d4d9 small tweak
8aafd407 expanding on the thuroughness of the ALWAYS_GC test mode
6eb4f614 clean out comments in cont_qq_expand_list
0d1e92b2 Bugfix in quasiquote expansion
c9bb4005 Added an ALWAYS_GC testmode and improved on the feedback from the tester
ccc3560a small refactor of cont_match and addition of 2 tests of match with guards
34609e1b tweaks and typo-fixes in lbmref.md
eb4e7def merror at lbm_lift_array if header cannot be allocated

git-subtree-dir: lispBM/lispBM
git-subtree-split: 7ba933de6261d5b33092f320adfc07050973b007
2024-01-22 14:54:32 +01:00
Benjamin Vedder a7d18b0376 Squashed 'lispBM/lispBM/' changes from 6fc68bd8..2837aa33
2837aa33 attempting to fix issue related to restoring incremental read status after exiting a nested reader
c85d3e90 added a test for dynamically loaded extensions

git-subtree-dir: lispBM/lispBM
git-subtree-split: 2837aa336b743c41e6d4b4b91530ff0d13a6901a
2024-01-11 14:02:10 +01:00
Benjamin Vedder 6d53c08df0 Squashed 'lispBM/lispBM/' changes from 9c2023ac..2542797b
2542797b extension storage changed
055ec467 f_sym takes a symbol_id not an encoded symbol. f_sym_string takes a c string representing a symbol
1475b1a7 added functions for retrieving storage locations for symbols and symbol list entry
d234d21d Added functions for accessing the data in array, ro and rw kinds
5e009396 re-enabling the callcc gc bugfix with a modification to rule out following non-pointers into memory

git-subtree-dir: lispBM/lispBM
git-subtree-split: 2542797b8124eac6dc2a9d0671c7d9c9711b6968
2024-01-10 21:15:00 +01:00
Benjamin Vedder f71d005d03 Squashed 'lispBM/lispBM/' changes from 4a176b04..9c2023ac
9c2023ac revert callcc gc fix and make the env hashmap static
e091c36c added tests of sort and one for callcc
eb164666 small tweak to make static analysis more happy

git-subtree-dir: lispBM/lispBM
git-subtree-split: 9c2023acd81fc12ebdc276b58a5bee6e11c18770
2024-01-09 23:14:11 +01:00
Benjamin Vedder 070e5cde9b Squashed 'lispBM/lispBM/' changes from 55553f58..d2f9c684
d2f9c684 removed the variable memory as the new hash-env seems to perform well enough
128813bf coercing all 64bit tests to pass
fc62e27a adding an nfibs example in experiment_repl
ecdb2720 extensions table outside of lbm memory, rearrange of lbm_init arguments
a95f3c94 moved variable storage to lbm memory
6d3af68d tiny tweak
c789fcc4 Work in progress moving stacks into lbm_memory

git-subtree-dir: lispBM/lispBM
git-subtree-split: d2f9c68466cc0cb19446bc3a9a06e5855b1690b0
2024-01-08 21:54:33 +01:00
Benjamin Vedder 999e87e80d Squashed 'lispBM/lispBM/' changes from 202b5763..55553f58
55553f58 hash table of environments for faster lookups
4c559b1f small tweak to env lookup
ef9dead0 A fix to a bug in GC handling of callcc continuations. Temporary, may change fix approach later
63868a8f closed a waring in array extensions
3135b7ec update of benchmarking with a sort benchmark that runs sort 10 times on 500 elt
44ec82cd remove a file that is nolonger in use
123717aa upped version

git-subtree-dir: lispBM/lispBM
git-subtree-split: 55553f580b75dfd66ab00491ed4ff234daf31b0b
2024-01-08 20:40:17 +01:00
Benjamin Vedder 34a6d59e73 Squashed 'lispBM/lispBM/' changes from 1405c6a8..acf53419
acf53419 added another sorting test
05b72f26 first attempt at a built-in merge-sort operation.
1f5504f4 added a built in merge primitive operation. needs more testing.

git-subtree-dir: lispBM/lispBM
git-subtree-split: acf5341938e4929202da1128678ce2592300be1a
2023-12-22 10:44:30 +01:00
Benjamin Vedder c686f07ec1 Squashed 'lispBM/lispBM/' changes from d3da43bf..1405c6a8
1405c6a8 bugfix in setq related to saving the environment
1b4f84df added gc tests

git-subtree-dir: lispBM/lispBM
git-subtree-split: 1405c6a8d857c6af55606902b5a52ce64d712c2f
2023-12-10 14:07:56 +01:00
Benjamin Vedder 6a30c998a6 Squashed 'lispBM/lispBM/' changes from d005f690..d3da43bf
d3da43bf changes to shrink
2274ac39 fix bug in recent special character tokenization
70b27aba added literal forms for special characters. for example \#\n for newline
b4c26ff1 small teweaks to fundamentals
c141b053 removed partial application and upped to version 0.21.0

git-subtree-dir: lispBM/lispBM
git-subtree-split: d3da43bf05cb34ccf622afaa8461781ad8395e5f
2023-12-04 11:46:11 +01:00
Benjamin Vedder 69aa99bbde Squashed 'lispBM/lispBM/' changes from 093a6a88..d005f690
d005f690 sleep is now built-in
0d1a9574 sharing more code between let and loop
59a713c3 updated benchmarks with 2 new additions
b891468a added a loop form that borrows a lot from LET. it may be possible to turn let into a special case of loop later
eb02f779 some organising and comment type fix
6a64d8ae fix bug that snuck in while consolidating MAP
414eb2f6 consolidating MAP_FIRST and MAP_REST into a single MAP continuation.
67b4e2a2 update readme

git-subtree-dir: lispBM/lispBM
git-subtree-split: d005f690c4d753ddb625898c21a56b0f3f7dcc38
2023-11-22 14:53:49 +01:00
Benjamin Vedder e2a96ddc9a Squashed 'lispBM/lispBM/' changes from 5bc9cc72..1bf58d0a
1bf58d0a added a mutex that locks the GC mark phase when using pointer reversal. When accessing the heap randomly this lock should be obtained first as the heap is not traversible while pointer reversal is in play
e02c783d Merge branch 'master' of github.com:svenssonjoel/lispbm
bf060a9f warning when using ptr_rev gc (needs more testing
4b827db3 added tests

git-subtree-dir: lispBM/lispBM
git-subtree-split: 1bf58d0a654f10e1992edfccda1eea6e6d201a3a
2023-11-06 11:44:18 +01:00
Benjamin Vedder 9417ed7f38 Squashed 'lispBM/lispBM/' changes from ae675bb2..5bc9cc72
5bc9cc72 update readme
20763667 added a number of GC tests. all of which pass under both garbage collection principles.
8f0f9f04 first attempt at pointer-reversal mark phase. This mark implementation is disabled per default and can be tried out by building with -DUSE_GC_PTR_REV
6f4b7899 refactor closure application and addition of several error-suspects in fundamental operations
34942ef9 undo some changes related to error_reason and some cleaning
f046c967 added lbm_set_error_suspect to allow setting a more relevant expression likely to be guilty of an error to an error message

git-subtree-dir: lispBM/lispBM
git-subtree-split: 5bc9cc726803bc65c8853ccd1c99a44bc5de5063
2023-11-06 09:41:15 +01:00
Benjamin Vedder 27f5bb5b32 Squashed 'lispBM/lispBM/' changes from c99bf0f6..ae675bb2
ae675bb2 improvement to a number of error messages
c8b0f6a9 Improved a number of error messages
b9334921 changed behavior of set family of functions when setting an unbound variable. Now set of unbound results in an error
b373817a removing some now dead code

git-subtree-dir: lispBM/lispBM
git-subtree-split: ae675bb2f61aa99f09a42e3a687979beb1b4712e
2023-11-01 08:37:18 +01:00
Benjamin Vedder badbe615c6 Squashed 'lispBM/lispBM/' changes from 9e5d4044..93b566b8
93b566b8 removed a call to lbm_free from unflatten
68635765 removal of dead code, removal of pointless conditional in lbm_memory_shrink and switch to structural equality in comma-qualified symbol matching
9470f8ba small update to flatten_value that removes an superfluous call to finish_flatten
f8470b0f update cr note in lbm_memory
8b70f8ed added 0 check for malloc and malloc_reserve
87311c92 modification to how GC handles constant values. incremented version
344ce225 added a lbm_get_gc_stack_size function for easier access to this field

git-subtree-dir: lispBM/lispBM
git-subtree-split: 93b566b8a7c63f566c3408140bba01976163783b
2023-10-22 12:47:00 +02:00
Benjamin Vedder 7e82cff0b9 Squashed 'lispBM/lispBM/' changes from 948bb6bc..9e5d4044
9e5d4044 gc stack is allocated from lbm_memory, it is possible to resize the gc stack by allocating a new one and replace the old. see runtime_extensions for example
77561a9e added a function that returns maximum gc stack level and added an error message when GC stack exhausts
4dfcabf1 added a callback for when a critical unrecoverable error occurs so.
63919e22 Slight opmitmization of stack usage in GC mark phase
38c677e9 Merge branch 'master' of github.com:svenssonjoel/lispbm
fd88cd7e Small overlook of match machinery with minor changes to environment handling and gc roots
173e256b added test of match
0478d16c added 3 tests of match

git-subtree-dir: lispBM/lispBM
git-subtree-split: 9e5d4044c2d36efdd01b080d0db150186922a6d7
2023-10-06 15:54:52 +02:00
Benjamin Vedder 369b723a16 Squashed 'lispBM/lispBM/' changes from 3047e3a3..948bb6bc
948bb6bc fix example evaluator with resent changes
c1a4112b added test of var definition already existing overwrite
2bedc6fb added a test of setq and progn-var
cfe513eb added a test involving setq and closure environments
9eaef7e5 removing a plethora of needless assignments
f38f20bb fix bug related to incremental read having an incorrect flag
512acc16 merge
03727930  fix problem in assoc and cossa
46825aab fix concerning floats on 64bit version

git-subtree-dir: lispBM/lispBM
git-subtree-split: 948bb6bc44c60d63eed89de0aad100d9b281d17d
2023-09-26 16:21:00 +02:00
Benjamin Vedder ce6914364a Squashed 'lispBM/lispBM/' changes from fa3a730e..3047e3a3
3047e3a3 fix bug in unblock_unboxed when unblocking with an error value
0a87a87e extra name parameter to lbm_c_interop program evaluators
04ac2fd1 removed the wait-for flags for lack of use

git-subtree-dir: lispBM/lispBM
git-subtree-split: 3047e3a30e186c58d4f5461c98a4cbcd896c9455
2023-08-28 08:12:30 +02:00
Benjamin Vedder ba1bc1e669 Squashed 'lispBM/lispBM/' changes from 7ed5cc62..1c98f534
1c98f534 moving array variable in flatten_value toavoid being clobbered by longjmp

git-subtree-dir: lispBM/lispBM
git-subtree-split: 1c98f534bb2e1fb059175d0ceef407aa25a4e4b2
2023-08-03 10:24:13 +02:00
Benjamin Vedder bc8abddbc1 Squashed 'lispBM/lispBM/' changes from c1b12e9d..7ed5cc62
7ed5cc62 simplifying eval_symbol a small bit
a378c2e2 cleaning and streamlining with a small performance benefit as bonus
f4661119 removed unused statistics fields from heap_state (functionality kind of duplicates profiler). Small reorganization of eval_symbol
96a118e5 tightened up the run_eval loop a small amount
574309a6 Laptop charger just exploded so uploading what I have locally. Additions to profiler and tweaks to GC
0278230b Added arithmetic stress tests
b0ad9619 added additional arith stress tests
5cb11cdf update lbmref and lbm_version.h
04d8483b Unified sleep and blocked queue, added profiler. Needs documentation and additional testing (WiP)
4a709753 timeout functionality added and restructuring of queue handling in main loop. Much testing needed
e2605f7b flatten value calculates the size of the memory buffer needed to create a flat value. flatten now takes only one argument, the value to flatten.
b79455aa added match test for const block
df35d9a6 attempt fix of issue showing up in pattern matching from constant code.
0021d4c5 removed left over printf and fix in flatten that could leak memory
a7abb204 flat values are now part of the language. lisp values can be flattened and unflattened. Added kill function for termination of threads
ea58c616 Added a flat value constructor for symbol as string

git-subtree-dir: lispBM/lispBM
git-subtree-split: 7ed5cc621360d19577c5b14836c5ecd9fd608a1d
2023-08-03 09:53:38 +02:00
Benjamin Vedder 7bbb5e9f26 Squashed 'lispBM/lispBM/' changes from c53ee21f..c1b12e9d
c1b12e9d Fix bug: Attempt GC if creation of a symbol fails. Also added error reasons to string extensions and changed some eval_errors to type_error
141e7fb1 update lbmref
ae677d30 added a section about flash directives and functions in flash memory

git-subtree-dir: lispBM/lispBM
git-subtree-split: c1b12e9d2e30d6d6f611ed0edf905b067a43c9ac
2023-07-07 14:07:23 +02:00
Benjamin Vedder 4f511b67fa Squashed 'lispBM/lispBM/' changes from 64ec946a..48d50c69
48d50c69 Merge branch 'dev_gc_test'
77de6dbb tweak fundamental
3177a31f  fixes in reader and dynamic read.W
504c0c28 towards always gc debugging

git-subtree-dir: lispBM/lispBM
git-subtree-split: 48d50c695a577783379530c60f8942d76b142314
2023-06-18 14:58:29 +02:00
Benjamin Vedder f6eeba8336 Squashed 'lispBM/lispBM/' changes from 15fd3dea..02887bfd
02887bfd Change implementation of car family in evaluator for immediate termination on error
7517c2e1 bug fix in wait-for and addition of a few tests
275a8e46 removed pointless usage of WITH_GC
143d024c bumped version
a4836c7d closing a number of warnings when building 64bits. some still remain
e61c28e9 closing some warnings on 64bit build - lots to go
68a09916 a small amount of cleaning.
bd91e152 wait-for + trigger mechanism has been added, but is untested
70c82228 adding tests of undefine
003887d8 fix severe bug in undefine
bdc30576 Added two undefine tests
4e694bc8 experimental wake-up lbm task framework, work in progress
38068776 cleaning and refactoring
7e814674 cleaning and consolidating
b05615fa cleaning and consolidation of functionality
2b986f7c small refactor for
ce05734d removed dead code in evaluation of the progn continuation
9eeae272 made global env a static variable in env.c
1eacbf3f refactoring. may save a few cpu cycles in list allocation and GC

git-subtree-dir: lispBM/lispBM
git-subtree-split: 02887bfd12a8d98f2e6f73b3dbd38b9ec222358a
2023-06-12 11:49:07 +02:00
Benjamin Vedder 2e82399a2f Squashed 'lispBM/lispBM/' changes from c097f5c6..15fd3dea
15fd3dea change order of arguments in take and drop
14d19c68 added tests of spawn
476845e4 fix bug in spawn argument handling

git-subtree-dir: lispBM/lispBM
git-subtree-split: 15fd3dea56f361967ba69e69a8e37026f33dcd0b
2023-05-22 09:21:20 +02:00
Benjamin Vedder d664184ef8 Squashed 'lispBM/lispBM/' changes from 6a448aa3..c097f5c6
c097f5c6 cleaning pass and refactoring
5384d522 refactoring application experiment
087ede4e refactor: readability, clearity and in some places - to a small degree - correctness
89575d8b small change to one event test
ba6e7fa7 logged change
16ac6bd1 logged change
089468b3 removing make-env. in-env in the interest of keeping core language small
f18015f7 Merge branch 'master' of github.com:svenssonjoel/lispbm
5b19dfda simplification and readability refactoring.
8c492889 Update gotchas.md
754221b9 Update gotchas.md
a0931bac bump version
e49071dc Changed behavior closure application to zero args. Application of a continuation (call-cc) with 0 args still uses the old approach where 0 args is equivalent to application to nil
35f495f3 mini tweak readme
fdd01ff1 update README
b21a3fa7 Update gotchas.md
92d9f561 update gotchas
0d708de7 bugfix in incremental reader and addition of a gotchas.md file for edge-case behaviors
d9a38456 updated lbmref with take and drop
86b1cc1b take, drop, change to make-env returned result
ea29f5ec added take and drop as built-in primitives and change to result env for make-env
55a5b1f5 added some tests and  a small amount of doc
e2d2f745 tweaks
bccdee1f make-env and in-env
3a03232a added make-env and in-env for library-encapsulation
e5b5ba66 mini tweak
dce87812 removed extra ;
190b4d9e mini tweak
6864fa32 fix repl after removal of reading_done callback
ea3aba39 removed reading_done_callback and made the nonsense default variants for all remaining callback
427cb37c bugfix read-program, tightening up,  cleaning
119d9fd3 refactoring and tightening up
10573404 cleaning and readability
63b750b5 small tweaks
d44c8bdc bug fix related to row numbers in error messages while doing incremental read. Now more precise.
d0125bd1 refactoring for readability. setjmp/longjmp for escape from deeply nested errors.

git-subtree-dir: lispBM/lispBM
git-subtree-split: c097f5c66bd539442a48d41a66da1c657af502a1
2023-05-22 08:17:23 +02:00
Benjamin Vedder 8897516ade Squashed 'lispBM/lispBM/' changes from 95368f36..c9034e4a
c9034e4a fix bug related to incremental read-eval-program
018cc540 added one more const_array sharing test

git-subtree-dir: lispBM/lispBM
git-subtree-split: c9034e4aed0bb437c90c8e8d5dab14e7d6c14ab3
2023-04-14 12:39:14 +02:00
Benjamin Vedder eb0114b4dc Squashed 'lispBM/lispBM/' changes from aa1d5026..95368f36
95368f36 fix bugs in read program

git-subtree-dir: lispBM/lispBM
git-subtree-split: 95368f36e96d4a370ba6b00a01e2924187490823
2023-04-13 20:34:47 +02:00
Benjamin Vedder 54d22a9e44 Squashed 'lispBM/lispBM/' changes from 99c9dbf5..aa1d5026
aa1d5026 bug fix related to row numbering when doing incremental read
08138fd6 refactoring for readability and to a small degree code size-perhaps
b4a5306c adding another flash test2
ee03dc5e rough estimation of row-of-error if using the incremental reader
493c7a45 added a way to share a constant array from C to lbm in a way that lbm understands that it is constant
f973fb34 small tweak to evaluation_step
b2c136b4 removing a unused field from lbm_context_t
403a74b9 small tweaks to eval_cps
423aa39c small tweak lbmref
5a47f414 small tweak readme and small tweak lbmref
28bfb297 small tweak lbmref

git-subtree-dir: lispBM/lispBM
git-subtree-split: aa1d5026fbd01525c9511e6284447b60806d9a33
2023-04-13 17:01:12 +02:00
Benjamin Vedder 319bae781a Squashed 'lispBM/lispBM/' changes from 3fc70a5c..99c9dbf5
99c9dbf5 assoc/cossa fix and refactoring/renaming of  internal funktions

git-subtree-dir: lispBM/lispBM
git-subtree-split: 99c9dbf5c450eea8eeb6325bbdbfdf56929abc5e
2023-04-06 20:33:01 +02:00
Benjamin Vedder 9ef3986a97 Squashed 'lispBM/lispBM/' changes from d643c620..32ad511c
32ad511c fix bug in reverse that is triggered by reversing a constant list
4864ee9e fix bug showing up evaluating a cond from flash
2c228d19 bug fix related to arithmetic involving constant values
54ac82ce fix bug that shows up at the end of a parse stream when reading incrementally
35df6a53 tests of read-eval-program
fffdb7cb readability and perhaps to a small degree code size
17bde5c3 Check that in flash 0xFFFFFFFF is only over written with something other than that once in the tests

git-subtree-dir: lispBM/lispBM
git-subtree-split: 32ad511c3f7bddd25350557be2e4d081d61caece
2023-04-06 13:58:44 +02:00
Benjamin Vedder acbd360c00 Squashed 'lispBM/lispBM/' changes from 6ec57e70..463551a4
463551a4 added @const-start @const-end syntax to automatically apply move-to-flash to variables defined in such blocks
ebe7b66d slight refactoring of move-to-flash continuations
6a2a8c2d bugfix string-extensions and some cleaning
351bdea0 added read-eval-program for incremental read, keeping old meaning of read-program. Some cleaning and refactoring

git-subtree-dir: lispBM/lispBM
git-subtree-split: 463551a4d5cd42e7d19f5156913a020726a05088
2023-04-05 14:35:12 +02:00
Benjamin Vedder a2113852e9 Squashed 'lispBM/lispBM/' changes from 5659e40a..cb75bd53
cb75bd53 closing warnings
aac53389 repl modification and warning closing
0d7a3006 added array-create alias for bufcreate
5e2e1552 lbm_dec_str decodes both const and non-const arrays

git-subtree-dir: lispBM/lispBM
git-subtree-split: cb75bd53098fd61c453004681d36a1f00534f128
2023-04-04 16:53:18 +02:00
Benjamin Vedder a4cbec1843 Squashed 'lispBM/lispBM/' changes from f7c74492..5659e40a
5659e40a low-level flash errors propagate into the evaluator
cd881c01 tweak lbmref
db42aac7 tweak lbmref
d1033e98 tweak lbmref
77783470 tweak refman bufcreate
d9575830 incremental read-evaluate. Removed all types of arrays except for byte-arrays
d5d5fdf1 type checking in array-extensions
ca072954 buflen is ok on constant arrays
90614b33 bugfix in lbm_channel string_write
de62dbd7 only one is_closure func

git-subtree-dir: lispBM/lispBM
git-subtree-split: 5659e40aac7a1e43b158a978e4e633ef118afeeb
2023-04-04 12:36:41 +02:00
Benjamin Vedder 5a9ec0efd6 Squashed 'lispBM/lispBM/' changes from 4c2ea9e9..ac1d06ab
ac1d06ab removed unused flash writing function pointer
bb241166 merging in move-to-flash functionality into main. Expect there to be some issues
d136d3f8 added an initial attempt at move-to-flash functionality
a3ebb098 more const tests and tweaks. Quasiquotation is NOT expanded to flash at the moment
9a6ff0ec initial flash experimentation
1ec412b4 Append works for 0 and 1 arguments
9d2d79b7 refaktoring of lbm_print_value
eae002ef changed printing of char/byte and arrayes thereof
139eb03b refactoring
9b437892 code readability refactoring
c9701a87 Refactoring for readability and perhaps to a small degree code-size. All tests pass
d56014a3 test for usage of var within atomic block

git-subtree-dir: lispBM/lispBM
git-subtree-split: ac1d06ab20170e38edcd4b204c295240b9b9a739
2023-04-02 16:35:42 +02:00
Benjamin Vedder 49ac9afeef Squashed 'lispBM/lispBM/' changes from b7956e63..1250355d
1250355d added additional deconstruct_let test2
0fbcf207 added curly syntax
dd3af6dd added a curlybrackets syntax as sugar over progn
8f6df139 added setq
edb83b85 Improved rigour in continuation recognition

git-subtree-dir: lispBM/lispBM
git-subtree-split: 1250355dd61e87d56fb0978132b857d470e945e9
2023-03-21 16:25:25 +01:00
Benjamin Vedder 7e27031bb6 Squashed 'lispBM/lispBM/' changes from 07baa883..b7956e63
b7956e63 added deconstructive let bindings and local bindings within progn scope via var
7885f957 removed old extension no-longer needed from repl
c169cb8e output version number in lbm-repl
82baec1c Merge branch 'master' of github.com:svenssonjoel/lispbm
88787164 update chibios based benchmarking code
9d48ee29 Bugfix where lbm_memory_free is run twice in a row on custom-type upon gc
8bf35b4a tiny tweak readme
39c72751 update README
3b7bff88 mutex initialized check for buffered char channel
a2b1196c fix leaking mutex on tips from Benjamin
8cfa50dc Threads that are unblocked from C with an error status are terminated

git-subtree-dir: lispBM/lispBM
git-subtree-split: b7956e631b74587d5b4dd61e8b0fb51d53a149be
2023-03-20 19:49:33 +01:00
Benjamin Vedder 61f48a8fc6 Squashed 'lispBM/lispBM/' changes from 20e97c4b..07baa883
07baa883 small tweak to flatten/unflatten
3baa1619 flat values now contain a copy of arrays rather than a pointer to an array
c582416d improvement in lbm_lift_array
f4229a43 changes to find_receiver_and_send
d04a77dd switched to lbm_malloc in lbm_create_ctx
4e2e8ad4 fix buf in lbm_create_ctx thatcould potentially have allocated too little memory for a context
01f3c746 bux fix get_event_value, freed already freed lbm_memory array
2ed2560a bug in unflatten_value
7971a6eb change granularity of locks
51058b80 added an undo_block_ctx_from_extension function and resolved an issue with test_memory_3 on 64 bit platforms

git-subtree-dir: lispBM/lispBM
git-subtree-split: 07baa883ab18d2f12d69f36cf22aaf9f86954624
2023-02-18 10:54:32 +01:00
Benjamin Vedder 315770dc0a Squashed 'lispBM/lispBM/' changes from d8f12fb9..751af620
751af620 revamping of variout fundamental operations.

git-subtree-dir: lispBM/lispBM
git-subtree-split: 751af620c9ecf2c5a20f34e6ad60ea054596d63e
2023-02-15 23:26:27 +01:00
Benjamin Vedder 5eb89cfa25 Squashed 'lispBM/lispBM/' changes from 0b42837e..d8f12fb9
d8f12fb9 potentially some slight space improvements in regards to fundamentals

git-subtree-dir: lispBM/lispBM
git-subtree-split: d8f12fb93b4a8b00ef5edd37fdc884efe9550f61
2023-02-15 23:19:26 +01:00
Benjamin Vedder 5e7e4ff714 Squashed 'lispBM/lispBM/' changes from 0c731969..0b42837e
0b42837e Revamping of some of the fundamental operations

git-subtree-dir: lispBM/lispBM
git-subtree-split: 0b42837ee95f6ad230a33863940aa3956bdcbe49
2023-02-15 19:29:45 +01:00
Benjamin Vedder 267eb0a204 Squashed 'lispBM/lispBM/' changes from db4994ce..0c731969
0c731969 applied small fix to malloc_reserve
50e22063 bug fixes in malloc and malloc_reserve, rearragements in event processing
3ab6cba9 There is now an artificial memory use limit that prohibits lbm_malloc from allocating all lbm_memory. To allocate without regards for the artificial limit use lbm_malloc_reserve
19745d9e flat_values are freed if event delivery not possible (no event handler). Unblock event will unblock blocked process even if there is no memory to unpack the flat_value into.

git-subtree-dir: lispBM/lispBM
git-subtree-split: 0c7319699d1150c366c1322f3ff986f45b2e4c0d
2023-02-15 15:58:44 +01:00
Benjamin Vedder bf1387e648 Squashed 'lispBM/lispBM/' changes from 1267d006..8dc4c6d9
8dc4c6d9 added updated version of test_lisp_code.c that can produce events with lists of float
49dd1d31 added event tests to punish flat_values a bit.
9a2e004a fix flat_value bug, removed dead code and correctly labeled write_word static
c9ee2c2d actually adding the flat_value files
215f3ba1 flat value implementation. A lot of testing needed
24d5184e experimental alternative way to transport values from C to LBM safely and with no need to pause. Work in progress
6d98ff61 restructuring for readability of GC and added queue locks. blocked context unblocking is done by the evaluator in a safe state. Safe state unblocking makes a bit harder to relay information about wether or not it was successful back to the thread issuing the unblock. So it may be a bad idea. It also makes the event queue obligatory
55ca904d added another arith stress test
87d21426 added another arith stress test
f64d4c04 small tweaks to the runtime-extensions
ab055958 added an arithmetic stresstest2
a802ed13 fundamentals have been unified with apply_funs. All tests pass but probably a period of bugginess ahead
f00d6b46 added lbm-version extension to runtime extensions and changed return value on allocate_list_init in case there is not enough memory
2445974a preparations for unification of apply_fun and fundamentals
114b9a60 removed rot-vector function from Math extensions and added exp
6e1e7ee0 changed return value of define and added loop extensions from Benjamin BLDC
79622417 added loop extensions. todo: add tests

git-subtree-dir: lispBM/lispBM
git-subtree-split: 8dc4c6d9c16f7fce9753737423b8700f477f75f0
2023-02-11 10:20:37 +01:00
Benjamin Vedder 65a3ed7ca4 Squashed 'lispBM/lispBM/' changes from 1eceb43f..1267d006
1267d006 added one more memory test
a9782eda added two tests that try to be quite hard on the lbm_memory.
5c0841f8 small additions to matvec
bcb1ad7f added vector multiplication by scalar
ce5025cc small additions to matvec.
1758b335 renamed blas_extensions to matvec extensions as they wont provide the same set of operations as a blas library usually does
2e48e6b4 fix silly typo in lbm_memory.c
62154010 only initialized mutices 1 time
d1dbfd7c added a test of events
cb97d623 only add events to the event queue if there is an event handler
7a642222 removed usage of send_message in process_events
e3a68115 events are moving into the evaluator
64239a9b tweaks to random extensions
d61950d9 removed a print from sierpinski
f8a1d586 added sierpinski and flake examples to sdlrepl
72d8e4f4 added random number extensions to sdlrepl
ba9c449a changed constants involved in the pseudorandom generator.
8806e369 remove left over debug printing
10cc7fab added random number generator extensions
184c756b added memory leakage tests for string extensions
4373713d work in progress linear_algebra extensions
135591bd added str-merge test
7bff0e97 added a test. more to follow
e1aad339 added a small set of runtime system related extensions
5495b5da updates to custom type interface.
4e3b408a rename strnlen to strlen_max
03644f64 pulling in string extensions from vedderb\bldc into string_extensions.c
294f013b grabbed a few extra array-extensions into array_extensions.c from Vedderb/BLDC
87f95e67 adding all the Math extensions from Vedder/BLDC to math_extensions.c

git-subtree-dir: lispBM/lispBM
git-subtree-split: 1267d006e90085920a3de720480dc2d19d71c8ff
2023-01-24 09:19:05 +01:00
Benjamin Vedder 8b336eecd8 Squashed 'lispBM/lispBM/' changes from c94f3404..d77214e9
d77214e9 a cleaning pass that removes some now dead code and fixes some comments. Also removed a pointless clearing of gc mark bit in allocate_cell and allocate_list
115b38f5 adding closing of read channel in case of errors while reading
9a0fb3ca added some gc tormenting tests that also uses the new list allocator
a75c10a7 fix bug in heap_allocate_list and fix bug in reader (read channel not closed if reading fails)
ad8243d2 rewrote fundamental_range using heap_allocate_list.
b7320588 added lbm_heap_allocate_list and adapted fundamental_list to use it.
20906de7 Rearrangement of heap_allocate_cell. May make cons slightly more efficient

git-subtree-dir: lispBM/lispBM
git-subtree-split: d77214e93497506118add4ff6b3f63520239a445
2022-12-16 15:38:41 +01:00