14 Commits

Author SHA1 Message Date
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
a9b08d3a11 Add printer for SV's that provides debug information 2025-08-29 20:04:35 +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
0f68afd9a0 Make nicer primitive functions for car/cdr
If it isn't a CONS, we return NIL instead of failing.  This way, we
can use it in our general iteration functions.  Eventually the actual
runtime would use this as well.  The macros are mostly for internal
use to do assignment etc.
2025-08-21 14:55:54 +01:00
Aryadev Chavali
59946c8831 Made some tests to go through 2025-08-21 00:06:57 +01:00
Aryadev Chavali
847eb1a69b Refactor vectors to SBO, removing inlined entirely.
Avoid 2 levels of indirection, and having to allocate twice for small
payloads, by having an inlined array on the vector directly!
Beautiful and simple.

Required a bit of refactoring around the board, but overall the result
makes me feel happier.
2025-08-20 23:37:08 +01:00
Aryadev Chavali
13142dc7f3 refactor lisp runtime to use vec_t* instead of ivec_t*
bit nicer to look at, should have about the same painful performance
hit anyway.
2025-08-20 22:43:23 +01:00
Aryadev Chavali
6e2db6825d Stable vector implementation
Stable vectors will be used in the lisp runtime to implement actual
vectors, instead of using the disgusting lvec trick.  This way we at
least can get attributes about the vector through one pointer hop.
2025-08-20 22:33:40 +01:00
Aryadev Chavali
2369185b26 remove parameter names in header 2025-08-20 22:33:31 +01:00
Aryadev Chavali
e1294a28cd ivec_ensure_remaining -> ivec_ensure_free 2025-08-20 22:32:45 +01:00
Aryadev Chavali
55293ae396 vec -> ivec
I'm going to implement a normal stable vector instead of an inline
vector so we have both options for use.  I think that's smarter than
just sticking to one.
2025-08-20 22:19:14 +01:00
Aryadev Chavali
df558da7e1 Use sv_t instead of raw char*
We're storing them as sv_t's anyway, we're fucked with regards to
indirection.  Thus, let's be nice to ourselves, and deal with the
structures.  We get the size of the structure for free anyway!
2025-08-20 21:50:58 +01:00
Aryadev Chavali
643896e2c8 rename base.h -> alisp.h
Makes more sense when you think about including it as an external
library
2025-08-20 21:24:07 +01:00