For tcc, I think you need the -rdynamic and -DWITH_C_LOADER
flags:
/home/bil/snd-22/ tcc -o s7 s7.c -I. -lm -DWITH_MAIN -ldl -rdynamic
-DWITH_C_LOADER
/home/bil/snd-22/ s7
s7: 13-May-2022
load /home/bil/snd-22/libc_s7.so failed: /home/bil/snd-22/libc_s7.so:
cannot open shared object file: No s
gcc s7.c -o repl -DWITH_MAIN -I. -O2 -g -ldl -lm -Wl,-export-dynamic
-Wno-stringop-overflow
fernando@linux:~/Builds/S7-scheme/s7> ./s7 r7rs.scm
You built the program "repl", then ran "s7". Try running repl.
___
Cmdist mailing list
Cmdist@ccrma.stanf
gcc -o s7 s7.c -I. -lm -DWITH_MAIN -ldl -pthread
I sent this is a previous message:
gcc -o s7 s7.c -I. -lm -DWITH_MAIN -DWITH_C_LOADER=0 -pthread -static
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinf
;unbound variable (symbol "\x7f;ELF\x02;\x01;\x01;")
This happens if you try to dynamically load an object file
but don't have the dynamic loading functions -- when you
build it without libdl (WITH_C_LOADER=0 probably). It treats
libc_s7.so as a scheme (text) file.
r7rs.scm needs the libc stuf
For gcc, use
gcc -o s7 s7.c -I. -lm -DWITH_MAIN -DWITH_C_LOADER=0 -pthread -static
libc_s7.so gives FFI bindings for a large portion of libc.
repl.scm needs it to get raw terminal handlers. The
WITH_C_LOADER switch is what you needed, I think.
___
C
Are setters portable?
Probably not -- I don't know of any other scheme that
has them.
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
By support for types, are you referring to srfi-9 or
srfi-99? That stuff is trivial; I'd use lets + methods
in s7, but r7rs.scm also has an implementation using vectors.
I thought you were referring to typed variables
like saying "int i" in C. You'd use a setter for that in s7.
__
That's an interesting project! To answer some of
your questions:
I think tcc can build s7 statically in linux. Here's an example
in Ubuntu:
tcc -o s7 s7.c -I. -lm -DWITH_MAIN
s7
s7: 9-May-2022
(+ 1 2)
3
The -DWITH_MAIN switch includes a minimal repl, so you don't need
repl.c or libc_s7.so.