Re: building on macos

2022-05-28 Thread Andras Pahi
Hi, I use the following Makefile to build pil21 on macOS Mojave (10.14.6) x86_64, libreadline, libffi and OpenSSL 3 is used from MacPorts. I have checked with picoLisp-22.3.tgz version 22.3.16 and pil21.tgz (the rolling release) version 22.5.26. Regards, Andras Pahi ~~ cut here

Re: quote form in picolisp

2021-12-16 Thread Andras Pahi
Hi, McCarthy’s "A micro-manual for Lisp" in 1978 lists 10 rules as the core of LISP. The first rule states the behavior of QUOTE. If you select a different set of rules, you get a different LISP. In picoLisp QUOTE is defined differently. Regards, Andras Pahi > On 2021. Dec 16.,

Re: Feature request - 'fill'

2021-12-13 Thread Andras Pahi
Hi Alex, What should (fill (1 ^ 7 9)) return ? Regards, Andras Pahi > On 2021. Dec 13., at 18:21, Alexander Burger wrote: > > So I went ahead and implemented the extended 'fill' behavior. > > : (fill (1 ^(+ 1 1) 3)) > -> (1 2 3) > > To make it more

Re: '(struct ...)' alignment issue

2021-12-07 Thread Andras Pahi
Hi, If you know, that struct does its job as if you specified packed in C, then you can pass packed or aligned structs to C functions, just you need to do the alignment yourself. I vaguely remember the pain, when I needed to process BMP graphics files on DEC Alpha processors... Andras Pahi

Re: Returning double results in pil21 ?

2021-09-29 Thread Andras Pahi
Hi Alex, My post is indicated by Mia’s blog entry ;) since I have cross-checked the results between pil21 and my 64bit pil32 fork. pil32 flawlessly converted double results to bignums, but I understand the efficiency consideration. Thanks, Andras Pahi > On 2021. Sep 29., at 16

Re: Returning double results in pil21 ?

2021-09-29 Thread Andras Pahi
Hi Alex, I understand that the result will be correct for 56bits only (as for every double FP number), but we lose the dynamic range. So pil21 will only return 60bits worth of doubles ;) Thanks, Andras Pahi > On 2021. Sep 29., at 16:16, Alexander Burger wrote: > > Ah, yes, that'

Re: Returning double results in pil21 ?

2021-09-29 Thread Andras Pahi
Hi Alex, Thanks. I mean that in pil21 src/lib.c boxFloat() and boxDouble() restricts the range of float/doubles to short numbers only… Thanks, Andras Pahi > On 2021. Sep 29., at 15:41, Alexander Burger wrote: > > Hi Andras, > >> As I see, the native function with t

Returning double results in pil21 ?

2021-09-29 Thread Andras Pahi
Hi, As I see, the native function with the scaled fixpoint specification can return only a short number ? Is it a bug or a feature ? Thanks, Andras Pahi -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Re: New blog - "PicoLisp for beginners"

2021-09-05 Thread Andras Pahi
Hi Jean-Christophe, If you succeeded to install pil21 on macOS and want the latest and greatest, you can ignore my fork entirely. I loosely track picoLisp v21 features on my fork, which only needs a C compiler to compile and can bootstrap pil21. Regards, pahihu > On 2021. Sep 5., at 8:18,

Re: New blog - "PicoLisp for beginners"

2021-09-04 Thread Andras Pahi
Hi Jean-Cristophe, I’ve built pil21 on macOS 10.14: 1) I use MacPorts, installed mp-llvm-10, readline, libffi, and openssl packages. Run ‘port select —set llvm mp-llvm-10’ to use the MacPorts version of LLVM. 2) I’ve modified the latest pil21 Makefile in the src directory: # 19aug21

Re: struct behavior in pil21

2021-05-19 Thread Andras Pahi
Hi Alex, I’ve replaced (model) in the old pil64 version of rcsim with your (model) function from the pil21 version, and it works with the old key assignments as expected. Thank you, pahihu > On 2021. May 19., at 18:52, Alexander Burger wrote: > > On Tue, May 18, 2021 at 08:27:14PM +0200,

Re: struct behavior in pil21

2021-05-18 Thread Andras Pahi
Hi Alex, Thank you for your explanation. I will check @doc/diff from now. pahihu > On 2021. May 18., at 19:59, Alexander Burger wrote: > > Hi Andras, > >> The example below is taken from the documentation of ‘struct’ in pil21. >> In this case ’struct’ no longer returns the address of the

struct behavior in pil21

2021-05-18 Thread Andras Pahi
Hi, The example below is taken from the documentation of ‘struct’ in pil21. In this case ’struct’ no longer returns the address of the memory region. With this change misc/rcsim.l no longer runs (I’ve learned it the hard way). I would like to ask, that this was intentional ? Thanks, pahihu ##

Re: math.l library in picoLisp

2021-05-17 Thread Andras Pahi
Hi Alex, Yesterday SJain asked about namespaces in 32bit picoLisp and I assumed he is using the 32bit version. Sorry, I am living in a combined picoLisp world ( pil/pil64/pil21 ;) My 32bit version calls the math functions directly too, since (== 64 64) is true. pahihu > On 2021. May 17., at

Re: math.l library in picoLisp

2021-05-17 Thread Andras Pahi
Hi, The src/ directory contains the source (ext.c or ext.l), the lib/ directory contains the shared lib (ext or ext.so). pahihu > On 2021. May 17., at 7:27, SJain wrote: > > I use fixed point math quite a bit and have the following question about the > default math.l library of picoLisp: >

Re: Why do waitFd and gPoll use 292MY for timeout?

2021-04-17 Thread Andras Pahi
Hi Alex, Perfect, it works as expected on macOS. Finally I’ve got demoApp working: the culprit was the Safari browser. With Firefox it works! Regards, Andras Pahi > On 2021. Apr 17., at 16:54, Alexander Burger wrote: > > On Sat, Apr 17, 2021 at 04:35:09PM +0200, Alexander Burger wro

Re: Why do waitFd and gPoll use 292MY for timeout?

2021-04-17 Thread Andras Pahi
Hi Alex, Just one remark, ppoll(2) is Linux-specific. I know there is a perfectly portable API - Linux. Regards, Andras Pahi > On 2021. Apr 17., at 15:53, Alexander Burger wrote: > > On Sat, Apr 17, 2021 at 02:15:42PM +0200, Alexander Burger wrote: >> But as you saw in my last

Re: Why do waitFd and gPoll use 292MY for timeout?

2021-04-17 Thread Andras Pahi
Hi Alex, Maybe the definition of #define __INT_MAX__ 2147483647 could be used ? It is predefined by the clang/gcc preprocessor. Regards, Andras Pahi > On 2021. Apr 17., at 13:02, Alexander Burger wrote: > Unfortunately, "#if sizeof(int) == 4" is not allowed in C, t

Re: Why do waitFd and gPoll use 292MY for timeout?

2021-04-17 Thread Andras Pahi
program prints “false”: #include #include int main(int argc, char*argv[]) { #if (int)-1 == 0x printf("true"); #else printf("false"); #endif return 0; } Regards, Andras Pahi > On 2021. Apr 17., at 11:42, Alexander Burger wrote: > > Hi Andras, > >&g

Re: Why do waitFd and gPoll use 292MY for timeout?

2021-04-17 Thread Andras Pahi
in the demo app. Entering eg. “ben”, “ben” results in dropping the connection. The task handling the connection is forked, as I see in the process list. Any ideas how to get further ? Thanks, Andras Pahi > On 2021. Apr 16., at 7:43, Andras Pahi wrote: > > Hi Alex, > > Tha

Re: Why do waitFd and gPoll use 292MY for timeout?

2021-04-15 Thread Andras Pahi
Hi Alex, Thank you for your suggestions, I have traced listen and wait and both have The parameters are as expected (Ms is NIL, Sd is 17). As Mike tested on macOS Big Sur and it worked, the problem is in my setup. Regards, Andras > On 2021. Apr 15., at 19:11, Alexander Burger wrote: > > Hi

Re: Why do waitFd and gPoll use 292MY for timeout?

2021-04-15 Thread Andras Pahi
s my try on latest big sur > > > > April 15, 2021 7:53 PM, "Andras Pahi" wrote: > >> Hi, >> >> I grabbed the latest pil21.tgz and demoApp.tgz. >> >> "pil @lib/test.l +" runs without errors. >> >> On macOS I've got

Re: Why do waitFd and gPoll use 292MY for timeout?

2021-04-15 Thread Andras Pahi
ent ap? Select error: Invalid argument … ap? Select error: Invalid argument ap? Segmentation fault: 11 It has the same behavior as the previous version of pil21. Regards, Andras Pahi > On 2021. Apr 15., at 12:51, Alexander Burger wrote: > > On Thu, Apr 15, 2021 at 09:34:50AM +0200, Alexander

Re: Why do waitFd and gPoll use 292MY for timeout?

2021-04-15 Thread Andras Pahi
Hi, Yes, ‘int’ is 32bit on macOS, even when compiling to 64bit. The pil21 demoApp does not work on macOS. pahihu sizeof(char) = 1 sizeof(short) = 2 sizeof(int) = 4 sizeof(long) = 8 sizeof(long long) = 8 sizeof(float) = 4 sizeof(double) = 8 sizeof(long double) = 16 sizeof(void*) = 8 > On 2021.

Re: Pil21 feature questions

2020-11-10 Thread Andras Pahi
Hi Alex, Thank you for the descriptions. Regards, Andras > On 2020. Nov 10., at 12:49, Alexander Burger wrote: > > Hi Andras, > >> I would like to ask some questions on Pil21 features. >> It is enough if you points to some examples where I could dig into the >> details... > > These are

Pil21 feature questions

2020-11-10 Thread Andras Pahi
Hi Alex, I would like to ask some questions on Pil21 features. It is enough if you points to some examples where I could dig into the details... - What is special in the ‘priv’ namespace handling? pil64 used it to store (private) symbols. - What is the purpose of the ‘~’ marker in the

Re: pil21 on Mac, some errors

2020-11-08 Thread Andras Pahi
Hi Alex, On Ubuntu only -D_GNU_SOURCE helps, -D__USE_GNU is not enough. It seems that the portability of the glibc API is gone as well… Regards, Andras PS: I found the following on stackoverflow: _GNU_SOURCE is the only one you should ever define yourself. __USE_GNU is defined internally

Re: pil21 on Mac, some errors

2020-11-08 Thread Andras Pahi
)) works also. Why do you reverted the sources ? It works perfectly on Darwin (macOS Mojave 10.14.6) and Ubuntu Linux 18.04.5 LTS. Regards, Andras > On 2020. Nov 8., at 9:51, Alexander Burger wrote: > > On Sun, Nov 08, 2020 at 08:46:23AM +0100, Andras Pahi wrote: >> SHARE

Re: pil21 on Mac, some errors

2020-11-07 Thread Andras Pahi
picolisp executable with itself. Regards, Andras > On 2020. Nov 8., at 7:14, Alexander Burger wrote: > > On Sat, Nov 07, 2020 at 09:22:48PM +0100, Alexander Burger wrote: >> On Sat, Nov 07, 2020 at 08:01:01PM +0100, Andras Pahi wrote: >> I revert for now > > Perhaps

Re: pil21 on Mac, some errors

2020-11-07 Thread Andras Pahi
Hi Alex, Yes, it works. Running @lib/test.l returns “OK” and all openGl examples are working on Darwin replacing glutMainLoopEvent with glutCheckLoop. As I see you’ve updated the documentation on pil21. So it’s time to include those changes in my fork as well. Regards, Andras > On 2020. Nov

Re: pil21 on Mac, some errors

2020-11-07 Thread Andras Pahi
Hi Alex, Nope, native does NOT work with “@“ on Darwin. The definition of RTLD_DEFAULT is dlfcn.h:#define RTLD_DEFAULT((void *) -2) So it seems that is the culprit. Regards, Andras > On 2020. Nov 7., at 18:37, Alexander Burger wrote: > > On Sat, Nov 07, 2020 at 06:17:30PM +0100,

Re: pil21 on Mac, some errors

2020-11-07 Thread Andras Pahi
Hi Alex, Yes, it is the same issue as Mike pointed out: accessing the main binary with “@“ does not work. But with some cheating: ===> ./pil + : (de %@ @ (pass 'native "libSystem.B.dylib")) # %@ redefined -> %@ : (scl 6) -> 6 : (%@ "cos" 1.0 (1.0 . 1.0)) -> 540302 : (load "misc/pyramids.l")

Re: pil21 on Mac, some errors

2020-11-07 Thread Andras Pahi
ype" 0) Bad ffi ? The openGl examples cube.l and sphere.l works as expected. Running misc/pyramids.l produces: ===> ./pil @misc/pyramids.l + [misc/pyramids.l:182] !? (%@ "cos" 100 "Dbl1") Bad ffi openGl? Regards, Andras > On 2020. Nov 7., at 11:31, Alexander Burg

Re: pil21 on Mac, some errors

2020-11-07 Thread Andras Pahi
g some libglut.so? I have macOS Mojave 10.14.6. > > /Jon > >> On 5 Nov 2020, at 19:42, Andras Pahi > <mailto:pa...@t-online.hu>> wrote: >> >> Hi all, >> >> I’ve modified openGl.l as follows: >> >> (if (= *OS "Darwin&quo

Re: pil21 on Mac, some errors

2020-11-06 Thread Andras Pahi
Hi Alex, So you’ve found it yourself, that the types and the number of args should not change between invocations. So I’ve changed the native call syntax to mark variable-args functions, instead of using a fresh binding for every call. Regards, Andras > On 2020. Nov 6., at 8:07, Alexander

Re: pil21 on Mac, some errors

2020-11-05 Thread Andras Pahi
Hi all, On macOS Mojave 10.14 the system supplied GLUT.framework/GLUT does not contain glutMainLoopEvent, only glutCheckLoop. I’ve just made it work on my Mac. I use the pil21-version of @lib/openGl.l See the sources at https://github.com/pahihu/picoLisp/blob/master/lib/openGl.l

Re: pil21 on Mac, some errors

2020-11-05 Thread Andras Pahi
*GlutLib "libglut.so.3" *GlutCheckEvent "glutMainLoopEvent" ) ) .. (de glutMainLoopEvent () (native `*GlutLib `*GlutCheckEvent) ) Regards, Andras > On 2020. Nov 5., at 19:35, Andras Pahi wrote: > > Hi all, > > You need to change glutMainLoopEvent to glutChe

Re: pil21 on Mac, some errors

2020-11-05 Thread Andras Pahi
Hi Alex, Yes, I have some experience. I use libffi to implement native calls in my picoLisp fork (32bit/64bit) on MacOS. Andras > On 2020. Nov 5., at 17:47, Alexander Burger wrote: > > On Thu, Nov 05, 2020 at 05:14:03PM +0100, Alexander Burger wrote: >> So perhaps the output of strace tells

Re: pil21 on Mac, some errors

2020-11-05 Thread Andras Pahi
same mechanism. Yes. It works with emu under MacOS. Andras Pahi -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Re: picoLisp 19.12: variable length array in structure fixes

2020-05-22 Thread Andras Pahi
Hi all, The code at https://github.com/pahihu/picoLisp fulfils Mike’s super goal - all pil64 specific tests passed as well. It has namespaces, native C calls and coroutines and the documented features of pil64 - except the external symbol and database format.

Re: native/lisp in picolisp32

2020-05-15 Thread Andras Pahi
Hi, If you are still interested in native/lisp in picolisp32 then I am working to support the pil64 features in picolisp32. The development branch of https://github.com/pahihu/picoLisp just missing the coroutines (stay tuned), and builds on 64bit/32bit

Re: Structure sharing bignums in pil32

2020-05-04 Thread Andras Pahi
Thank you Alex. > On 2020. May 4., at 7:06, Alexander Burger wrote: > > Hi Andras, > >> I would like to ask that structure sharing is used in pil32 bigNums or not ? >> In doSub(), doAbs() it uses structure sharing, but otherwise in big.c >> it copies the argument then modifies it. > >

Structure sharing bignums in pil32

2020-05-03 Thread Andras Pahi
Hello all, I would like to ask that structure sharing is used in pil32 bigNums or not ? In doSub(), doAbs() it uses structure sharing, but otherwise in big.c it copies the argument then modifies it. Thanks, Andras -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Pil transformed

2020-04-23 Thread Andras Pahi
Hi all, I have changed the 32bit pil version written in C to compile in 64bit mode and to support short numbers encoded in the pointers themselves. That means that (== 64 64) is T for both the 32bit and the 64bit version. It passes the picoLisp test suite and tankf33der’ test suite as well. The

Re: picoLisp 19.12: variable length array in structure fixes

2020-04-21 Thread Andras Pahi
Hi, Maybe not related to this one, but on Mac OS X the heap size is limited to 65532KB. On startup picolisp fails to set the unlimited stack size, And use the actual ulimit so on the first run I’ve got a SIGSEGV running code2015.l Andras > On 2020. Apr 21., at 10:38, Mike wrote: > > hi all,

Re: picoLisp 19.12: variable length array in structure fixes

2020-04-20 Thread Andras Pahi
Hi Mike, pil32, x64 means you’ve built the contents of the src/ dir in x64 mode ? Thanks, Andras > There are more numbers for the only task "advent2015": > pil64, x64 - 1 min > pil32, x64 - 9 min > pil32, 686 - 9 min > pil32, 686, -O3 - 7 min > VLA patch, 686 - 10 min > > (mike) > > -- >

Re: picoLisp 19.12: variable length array in structure fixes

2020-04-19 Thread Andras Pahi
Hi Mike, You don’t need energy, you need some patience. Andras ===> time pil huge.l -bye OK-UTF8 OK-Montgomery OK-Leibniz OK-math OK-forth OK-parse2list OK-mapreduce OK-pow OK-destr OK-test-car OK-bitwise # reduce redefined # pow redefined OK-4clojure # pow redefined OK-AoC15 OK-SimplyScheme #

picoLisp 19.12: variable length array in structure fixes

2020-04-18 Thread Andras Pahi
in pico.h to ease this: allocFrame(). I know that the 32bit version is not the mainstream version, but feel free to abuse the patches. Regards, Andras Pahi srchanges.tgz Description: Binary data

Subscribe

2020-04-18 Thread Andras Pahi
Hello Andras Pahi :-) You are now subscribed -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe