Commit Graph

79 Commits

Author SHA1 Message Date
Aryadev Chavali
010895331d examples: Added an example for hello world 2026-02-05 04:04:54 +00:00
Aryadev Chavali
6a75c1d9d4 Makefile: added VERBOSE_LOGS=1 declaration to DFLAGS for debug build 2026-02-05 04:04:54 +00:00
Aryadev Chavali
01b695eb6a base: implement LOG macro which only prints if VERBOSE_LOGS = 1
This allows us to make builds that don't have verbose logging, whether
they're debug or not.

We could have release builds that have verbose logging.
2026-02-05 04:04:54 +00:00
Aryadev Chavali
500661d68e LICENSE: Unlicense -> GPL Version 2 2026-02-05 04:04:54 +00:00
Aryadev Chavali
ea2f745f1e Split out tests a bit, made a stronger API for running the full test suite 2026-02-04 20:44:04 +00:00
Aryadev Chavali
0681bb4314 Not worth the trouble
You're telling me Ubuntu doesn't have a version of GCC with C23
standard?? Really???
2026-02-04 20:09:32 +00:00
Aryadev Chavali
2839da55db Update compiler choice in Makefile
Some checks failed
C/C++ CI / build (push) Has been cancelled
2026-02-04 20:08:28 +00:00
Aryadev Chavali
d4612fa0ef Merge remote-tracking branch 'github/master'
Some checks failed
C/C++ CI / build (push) Has been cancelled
2026-02-04 20:08:18 +00:00
oreodave
5de0e33fb3 Update C/C++ workflow to use debug and release modes 2026-02-04 20:07:10 +00:00
Aryadev Chavali
2d7adf595f Add testing to build system
Generate a testing executable, and provide a recipe for running it.
2026-02-04 20:06:38 +00:00
Aryadev Chavali
ce7185f923 Split off testing API into header, separate from source
This is so I could generate new test units using the same API.
2026-02-04 20:06:04 +00:00
Aryadev Chavali
52a56c27f6 Add tag.h to alisp.h 2026-02-04 20:05:53 +00:00
Aryadev Chavali
270d4a4d6a Adjust README 2026-02-04 19:40:48 +00:00
Aryadev Chavali
7892c03e35 Clean up buildsystem 2026-02-04 19:39:02 +00:00
Aryadev Chavali
7fe8576c05 Move sys.c into lisp.c 2026-02-04 19:38:09 +00:00
Aryadev Chavali
7aae45e9c4 Move everything to src/ folder 2026-02-04 19:31:11 +00:00
Aryadev Chavali
7f8412fe5a Split alisp.h into several header files, in /include folder. 2026-02-04 19:31:11 +00:00
Aryadev Chavali
27108aa811 Update license formats for all source code 2026-02-03 19:02:47 +00:00
Aryadev Chavali
698b2b96b1 vec: switch to pointer to u8 instead of void pointer for vec_data
No issues with indexing this by byte, right?
2026-02-03 18:55:46 +00:00
Aryadev Chavali
0162dcc709 Switch to Makefile for build system 2026-02-03 18:55:13 +00:00
Aryadev Chavali
6ec0108566 vec: is_inlined -> not_inlined
If you allocate a vector on the stack and default initialise
it (i.e. {0}), then by default "is_inlined" = 0.  This is bad, as
technically speaking we should expect the vector to attempt to use
it's small inline buffer for vector operations before going onto the
heap - this will mess up our functions.  So here I adjust the name to
make default stack based allocation a bit easier.
2026-01-22 16:37:58 +00:00
Aryadev Chavali
865ab22fdc Make VEC_GET take an index along with the type
Since most use cases require indexing the data directly, and the macro
implies you're retrieving data from it, may as well take the index.

If you wanted a pointer to that data, &VEC_GET(vec, index, type) works
just fine.
2026-01-21 09:48:29 +00:00
Aryadev Chavali
8c190e955d Make conses a vector, add VEC_SIZE macro
Easier to iterate through, O(1) amortized registering just like the
Linked List.

VEC_SIZE just makes it easier to iterate through a vector of specially
typed elements.
2026-01-21 09:45:36 +00:00
Aryadev Chavali
2ec1dfa083 Move some stuff around for cleanliness 2026-01-21 09:33:35 +00:00
Aryadev Chavali
bb55895e94 Test program to read all whitespace delimited tokens in a text file 2026-01-21 09:27:59 +00:00
Aryadev Chavali
eda23c8278 More comments and helpful explanations 2026-01-21 09:27:43 +00:00
Aryadev Chavali
dae6382f4b Added stream_till and stream_while helpers
Allows more abstract movement around the stream.
2026-01-21 09:27:12 +00:00
Aryadev Chavali
88c9d01677 stream: Copy on stream_init_string
Just safer!
2025-10-19 23:04:40 +01:00
Aryadev Chavali
66c5134eb5 Remove impl folder 2025-10-19 23:04:04 +01:00
Aryadev Chavali
913b34588f build: simplify looking for library files 2025-10-19 22:25:24 +01:00
Aryadev Chavali
10c391367d build: Add some more warning flags for compilation-based-refactoring 2025-10-19 22:25:13 +01:00
Aryadev Chavali
cbfcf24ca2 stream: Introduce PIPE type
Main reason to have this at all is to make char-by-char reading
feasible.  This occurs at `stream_chunk`, and previously if we passed
in STDIN for `stream_init_file`, STDIN will only terminate once
STREAM_DEFAULT_CHUNK number of characters have been fed into the pipe.

This isn't desirable for STDIN (we really want to read char-by-char
for expressions), nor would it necessarily be desirable in network
applications.  So any stream marked STREAM_TYPE_PIPE will only chunk
character-by-character rather than genuine chunks.
2025-10-19 22:25:10 +01:00
Aryadev Chavali
030a289497 Some changes to how streams work, clean up alisp.org 2025-09-01 21:47:25 +01:00
Aryadev Chavali
1aa01d2a89 Merge remote-tracking branch 'origin/master' 2025-09-01 21:45:18 +01:00
Aryadev Chavali
700c3b1d1b Move implementation files into their own folder
main.c and test.c generate binary executables so they can stay in the
main folder, but the rest can go into their own dedicated folder to
make it look nicer
2025-09-01 21:26:01 +01:00
Aryadev Chavali
a9b08d3a11 Add printer for SV's that provides debug information 2025-08-29 20:04:35 +01:00
Aryadev Chavali
d62a11bb35 Modify main.c to better test stream 2025-08-29 20:04:21 +01:00
Aryadev Chavali
4d01a66401 Read an initial chunk on initialising a stream 2025-08-29 20:04:00 +01:00
Aryadev Chavali
fadbbd8927 make eoc also check feof on STREAM_TYPE_FILE 2025-08-29 20:03:43 +01:00
Aryadev Chavali
b403368d11 More tests 2025-08-29 14:53:34 +01:00
Aryadev Chavali
7595c46f5c Fix bug where chunking overwrites previously cached results 2025-08-29 14:53:18 +01:00
Aryadev Chavali
73736cf77c New example text and another test 2025-08-29 08:42:18 +01:00
Aryadev Chavali
d73380035c Fixed some more issues with streams (stdin/pipe based)
substr didn't work properly, nor did seek.  Just use the same
principle as stream_next
2025-08-29 08:42:03 +01:00
Aryadev Chavali
29d2453288 Cleaned up bugs with stream implementation
Principle was that we may have read all the content from the
underlying pipe (s.t. it set the EoF flag) but we haven't actually
iterated the content.
2025-08-29 08:28:32 +01:00
Aryadev Chavali
cc56a2ee2b Still got some failures, but a basic stream implementation
Need to fix what's going on with the example in main.c using stdin.
2025-08-28 22:55:41 +01:00
Aryadev Chavali
66c6400731 Made a load of tasks for a reader system, also task for BigIntegers 2025-08-22 00:29:12 +01:00
Aryadev Chavali
bbb405fca9 Refactor testing system, and add more tests
Couple macros to make printing nicer, use assertions instead to fail
if a test doesn't work.
2025-08-21 23:21:15 +01:00
Aryadev Chavali
49a3302fd6 Split out tests into its own file
Also adjust the build system to do some more (cleaning, building,
testing, running).
2025-08-21 22:02:23 +01:00
Aryadev Chavali
89c77a796d Add the ability to run the executable after building it in build.sh 2025-08-21 21:57:10 +01:00
Aryadev Chavali
0da524f5a8 Clean up tests a bit 2025-08-21 21:54:22 +01:00