Recent posts

#11
newLISP in the real world / Re: Can't load sqlite library ...
Last post by vetelko - January 22, 2025, 09:10:31 AM
Solved, libz and libpthread were missing. This is because these two needs libsqlite3 itself.

#12
newLISP in the real world / Re: Can't load sqlite library ...
Last post by vetelko - January 21, 2025, 12:11:41 AM
All required libs are available :( I can (import ...) any of them except libsqlite3 while newlisp runs in chroot

gringo: ~ $: ls /var/www/usr/lib/
total 31968
drwxr-xr-x  2 root  daemon   512B Jan 20 20:32 ./
drwxr-xr-x  7 root  daemon   512B Apr 10  2023 ../
-r--r--r--  1 root  daemon   3.6M Jan 15 10:24 libc.so.100.3
-r--r--r--  1 root  daemon   1.8M Jan 15 10:31 libcurses.so.15.0
-r--r--r--  1 root  daemon  43.1K Jan 15 10:24 libffi.so.2.1
-r--r--r--  1 root  daemon   584K Jan 15 10:22 libm.so.10.1
-r--r--r--  1 root  daemon   597K Jan 15 10:22 libreadline.so.5.0
-r--r--r--  1 root  daemon   7.0M Jan 20 18:51 libsqlite3.so.8.6
#13
newLISP in the real world / Re: Can't load sqlite library ...
Last post by rrq - January 20, 2025, 02:16:04 PM
At a guess libm is missing in the chroot. Check library dependencies with ldd.
#14
newLISP in the real world / Can't load sqlite library in c...
Last post by vetelko - January 20, 2025, 11:53:00 AM
Hi guys,

I can load libsqlite3 in normal environment but NOT while in chroot. It is interesting that other libraries like libc can be loaded as you can see in the following example:

gringo: ~ $: newlisp
newLISP v.10.7.6 64-bit on BSD IPv4/6 UTF-8 libffi, options: newlisp -h

> (import "/var/www/usr/lib/libsqlite3.so.8.6")
true

Now chroot, the same library file with different path of course:

gringo: ~ $: doas chroot -u www -g www /var/www /usr/bin/newlisp
newLISP v.10.7.6 64-bit on BSD IPv4/6 UTF-8 libffi, options: newlisp -h

> (import "/usr/lib/libsqlite3.so.8.6")

ERR: problem loading library in function import : "Cannot load specified object"

> (import "/usr/lib/libc.so.100.3" "printf")
printf@D5CDE4B7A40
>
gringo: ~ $:

ANY idea?
#15
newLISP in the real world / fuzzylisp
Last post by vashushpanov - January 19, 2025, 08:04:15 PM
At 2006 was alive site http://www.fuzzylisp.com where I may find file fuzzylisp.lsp. It was written on newlisp. And now it not working. I was search this file on internet, but find nothing. Anybody may help me? And send fuzzylisp.zip to vashushpanov@gmail.com. Thanks!
#16
newLISP in the real world / Re: How to compile static sing...
Last post by vetelko - January 17, 2025, 12:04:23 AM
Thank you rrq .. will try it :)
#17
newLISP in the real world / Re: How to compile static sing...
Last post by rrq - January 15, 2025, 02:22:19 AM
The steps I take are basically to
1. first create the makefile_build the normal way and then
2. copy that to a makefile_static file which I hand-edit:
3. remove -DFFI -DREADLINE (see below) from the CFLAGS setup
4. change the "default:" target action to be the two steps
  $(CC) $(OBJS) -m64 -o newlisp -static -Wl,-Bstatic -lm -lc
  strip newlisp

That's with gcc on a linux amd64 (devuan). I've got libc.a and libm.a from the libc6-dev package, and I don't include the FFI and READLINE options for it. Thoug I think you can find .a libraries for them too (libreadline-dev and libffi-dev packages)

EDIT: digging up that old project, I realized it needed musl-gcc as well; gcc doesn't seem to be capable of static binaries.

EDIT: maybe I confused myself; it seems gcc does it well too, and then you may also include ffi and readline (+termcap).
#18
newLISP in the real world / How to compile static single f...
Last post by vetelko - January 15, 2025, 01:51:33 AM
Hi guys, can anyone help me out? Is it possible to compile newlisp statically so I don't have to copy all dependency libraries from /usr/lib/... into the chroot? I need single big fat binary :)

I think Ted Walther mentioned in one of his posts that he managed to do it on OpenBSD (which is also my system). But he doesn't explain how :)
#19
newLISP in the real world / Re: replace help
Last post by joejoe - November 14, 2024, 04:49:02 PM
Ok roger that, rrq.

I did not realize the interactive mode would display differently.

And thanks for the println tip, makes it much prettier.

Thanks again for clarification and detailed explanation!

Much appreciated.
#20
newLISP in the real world / Re: replace help
Last post by rrq - November 13, 2024, 04:38:35 PM
Yes it can be a bit confusing. The string returned by replace does have single-quotes replaced by double-quotes, but the interactive result output presents the double-quotes prefixed by backslash.

Thus, when the string has a double quote, the result printing of that string shows \" so as to indicated that the double-quote is not ending the string. Likewise, the result printing adds the double-quotes before and after printing the string content, and those double-quotes are not characters in the string.

If you make it be
(print (replace ....))then the string will be printed without extras before double-quotes, but the interactive output coming after will still show the string with that meta-character wrapping.

In short, a string of a single double-quote characters is written "\"", and it will be taken as such if input and printed as such by the interactive output. The print function doesn't add meta-characters. Here's an illustration example:
> (println "\"")
"
"\""
>
The first line is what the println function prints (which is the "raw" string content with a newline added at end), and the second line is the interactive output of the value returned by the println function (the same string but with meta-characters to make it be the character sequence the input reader would need).