Re: pil21, some progress
Hi! I was also able to build and run on windows 10 under wsl I also had the LLVM error and resolved it with this: https://solarianprogrammer.com/2017/12/13/linux-wsl-install-clang-libcpp-compile-cpp-17-programs/ sudo apt-get install make clang llvm lldb pkg-config joebo@JB0gner-T460:~/pil21/src$ make llvm-link: base.bc: error: Unknown attribute kind (60) (Producer: 'LLVM9.0.1' Reader: 'LLVM 6.0.0') llvm-link: error loading file 'base.bc' Makefile:22: recipe for target 'picolisp.bc' failed joebo@JB0gner-T460:~/pil21/src$ clang --version clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin joebo@JB0gner-T460:~/pil21/src$ sudo apt-get upgrade joebo@JB0gner-T460:~/pil21/src$ sudo apt-get update oebo@JB0gner-T460:~$ curl -SL http://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz | tar -xJC . % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 100 414M 100 414M0 0 4710k 0 0:01:30 0:01:30 --:--:-- 5233k joebo@JB0gner-T460:~$ mv clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04 clang_9.0.0 joebo@JB0gner-T460:~$ sudo mv clang_9.0.0 /usr/local joebo@JB0gner-T460:~$ export PATH=/usr/local/clang_9.0.0/bin:$PATH joebo@JB0gner-T460:~$ export LD_LIBRARY_PATH=/usr/local/clang_9.0.0/lib:$LD_LIBRARY_PATH joebo@JB0gner-T460:~/pil21$ cd src joebo@JB0gner-T460:~/pil21/src$ make .. joebo@JB0gner-T460:~/pil21/bin$ ls picolisp joebo@JB0gner-T460:~/pil21/bin$ ./picolisp : (+ 1 2) -> 3 Exciting!! On Wed, Feb 12, 2020 at 12:33 PM Alexander Burger wrote: > Hi Kashyap, > > > "libffi-dev" instead of libffi since apt complained that it could not > find > > libffi. > > Good to know! > > > > llvm-link: base.bc: error: Unknown attribute kind (60) (Producer: > > 'LLVM9.0.1' Reader: 'LLVM 6.0.0') > > Oh! LLVM 6 is extremely old, isn't it? I have no idea how much LLVM > changed over > time. > > ☺/ A!ex > > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
Re: Merry Christmas!!
Merry Christmas! (from Ohio, USA) Yes, thank you Alex! It's been almost a decade since I got into PicoLisp! Still one of my favorites! On Tue, Dec 24, 2019, 1:09 PM Mattias Sundblad wrote: > Just to add to the international flavour: > > God jul! > > // Mattias > > Priyadarshan skrev: (24 december 2019 18:40:57 CET) > >Tuesday, December 24, 2019, 3:01:45 PM, you wrote: > > > >> Hi Everyone! > >> Just want to greet you all a Merry Christmas and Happy New Year in > >advance! > >> More power to Pico Lisp community and once again, thank you Alex for > >> sharing your talents to us. > >> Cheers from Philippines, > >> Geo > > > >Buon Natale e Felice Anno Nuovo! > > > >I am discovering in PicoLisp such a joyful and powerful > >language. Thank you. > > > >Priyadarshan > > > > > >-- > >UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe > > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjectUnsubscribe >
Re: A possible way to build for windows
Hi Kashyap, I've been interested in a picolisp port to Windows for several years. I've tried a number of different options. My last effort was to use https://midipix.org/ as the POSIX layer. It worked OK but then midipix seemed to lose steam with Windows Subsystem for Linux (WSL) coming out. Now, I just use picolisp on WSL. Reading this thread, https://www.mail-archive.com/picolisp@software-lab.de/msg08551.html, I see that WSL isn't an option because you intend to use existing dlls. Have you considered hosting your DLLs in a HTTP service (e.g. golang) and then calling them from picoLisp running on WSL? That likely would be an easier path to integrate than rewriting the POSIX layer or porting to Windows APIs. It also looks like piping works https://docs.microsoft.com/en-us/windows/wsl/interop so perhaps you can avoid HTTP altogether. Regards, Joe On Sun, Feb 24, 2019 at 9:50 PM C K Kashyap wrote: > Hi, > I have been considering the idea of getting picolisp to run on windows > (without a heavy weight setup - cygwin/mingw) for a while now. What if I > try and target nasm instead of gnu assembler? That should work. Regarding > the POSIX dependency, I think it should be a matter of making all the > functions (do*) NOPs. I should be able to get a 64bit picolisp calculator > up and running. And then leisurely add the do* functions. > > Ofcourse, if this works, it would be a convenient way to build on mac too! > > Regards, > Kashyap >
Re: Wiki
Hi Arie - Thanks for the contribution and good suggestion on removing the flinux page. Can you do that for me? On Sun, May 20, 2018, 10:56 AM Arie van Wingerdenwrote: > Hi, > > Just added a Wiki page about new WSL install for Windows 10, which is > linked from the main page. > > Maybe the maintainer of the Flinux page should remove that, because it > seems invalid at the moment. > > BTW a very nice Wiki Alex!! > > Thx, > Arie >
Re: Question about tutorial ...
Arie, I followed your WSL steps on a newer machine and I don't see the db locking issue any more. Thanks! My other machine has the problem but its WSL is at least 6 months old - so maybe it was fixed in WSL since then or possibly something fixed/changed by following your instructions. Thanks, I'll do some additional testing later On Wed, Apr 18, 2018 at 6:23 AM, Arie van Wingerdenwrote: > Hi Alex, > > 1) root mode was because I tried a lot of different things, but missed the > obvious family64.tgz > 2) had a few problems with cd-ing into folders, because under Windows it > is a bit different > > So, after unpacking family64.tgz into a local folder in my home dir > everything works great! > > Now starting to really learn the PicoLisp language better. > > @Joe could you show me an example where db locking didn't work? > Maybe I can test this and see if it does work correctly in the way I > now set up PicoLisp in WSL? > > Thx. again! > /Arie > > 2018-04-18 11:50 GMT+02:00 Alexander Burger : > >> Hi Arie, >> >> > * root@HP-Arie:/usr/share/doc/picolisp/doc# **pil family.l -main -go >> +* >> > ... >> > *!? (pool "family/" *Dbs) "family/" -- Open error: No such file or >> > directory ?* >> >> This is probably because the "family/" directory does not exist yet. Or >> did you >> unpack the file "family64.tgz"? >> >> In general, I would recommend not to run all this as user root. Better >> log in as >> a normal user, and do in any of your local directories: >> >>$ tar xvfz /usr/share/doc/picolisp/doc/family64.tgz >>family.l >>family/ >>family/@ >>family/B >>family/C >>family/A >>$ pil /usr/share/doc/picolisp/doc/family.l -main -go + >> >> ♪♫ Alex >> >> -- >> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >> > >
Re: PicoLisp on Windows WSL first tryout fails ...
Arie, For WSL, you need to build picoLisp on a linux machine and then transfer it down. You can follow the download/install instructions, but here is generally what I did ON LINUX 1. wget https://software-lab.de/picoLisp.tgz 2. tar -zxvf picoLisp.tgz 3. cd picoLisp/src 4. make 5 cd ../src64 6. make ON WINDOWS BASH 1. wget https://software-lab.de/picoLisp.tgz 2. tar -zvxf picoLisp.tgz 3. cd picoLisp 4. scp user@domain:/path/to/bin/picoLisp bin/picoLisp You should be able to then run ./pil The key here is to build on linux and then transfer down to your windows bash install. I used SCP to do the transfer Hope this helps. If you do not have access to a linux machine, you may want to try out vagrant on windows. I can help with that if you'd like Also, several of us are active on #picoLisp -- if you are unfamiliar with irc you can try here: https://webchat.freenode.net/ NOTE: WSL has an issue with file locking with the picoLisp DB. I will look into that next Joe On Tue, Apr 17, 2018 at 7:25 AM, Alexander Burgerwrote: > Hi Philipp, Arie, > > > pil is just a wrapper around picolisp, it loads a few libraries etc as > > Yes, but > > > standard, but it relies on the intepreter being at /usr/bin/picolisp, > > This is not completely correct. > > > Note that there are two 'pil's in the distribution: One in bin/ > >#!/usr/bin/picolisp /usr/lib/picolisp/lib.l >(load "@lib/misc.l" "@lib/btree.l" "@lib/db.l" "@lib/pilog.l") > > which indeed calls #!/usr/bin/picolisp, but this is not meant to be called > here. > It is intended to be copied to - or linked from - /usr/bin. > > > The other 'pil' looks different: > >exec ${0%/*}/bin/picolisp ${0%/*}/lib.l @ext.l "$@" > > and it is the main workhorse. It can be called locally > >$ ./pil + > > or with a relative or absolute path from anywhere > >$ /foo/bar/pil + > > and will always load everything from its local environment. > > ♪♫ Alex > > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
Re: PicoLisp on Windows
Hi Arie, I would like to send a more detailed reply later. I'm the author of the flinux writeup. It's been a few years and things don't work as nicely as they did back then. I retested some the writeup today. I was unable to get the flinux static option working. I was able to get flinux dynamic working, but the archlinux distro is out of date and I wouldn't recommend going down that path any more. After the flinux experiment, I did do some work with a precusor to WSL, midipix[1], which seems to still work. The last time I tried WSL it had issues with database locking. I need to do some more experiments on WSL now that I have a Win-10 machine I have another option that I've used over the years, midipix, but it's out of date as well. Your best bet is probably to go with WSL or cygwin/msys for now. When I first put all this together, there was little interest. It sounds like there is more interest now so I'll see if I can dust it off and bring it up to date Thanks, Joe On Mon, Apr 16, 2018 at 11:06 AM, Philipp Geyerwrote: > Based on the instructions on the site, it looks like the next steps are > to build pil on Linux, and then run the linux binary on Windows through > flinux. > > I have not tried pil in WSL yet (my only Windows text machine is Win7), > and I don't think that's a solution for my specific problem (to have a > simple environment for an end user with no technical experience) but I > have had some luck building pil with mingw/msys which provide a POSIX > compatibility layer on top of Windows. I have not (yet) managed to get > anything 100% working, but I'm optimistic. Currently if I build with > msys2, I can get an executable which I believe passed the tests, but > requires msys2.dll to be in the library path (which includes the > executable directory of course) but I believe that if you build with > mingw without msys, it builds against msvcrt directly, and links in the > compatibility layer. This is what I haven't managed yet. > > As I said though, I'm optimistic, and it's something I need for my > project. > > Philipp Geyer/Nistur > > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
Re: Feed reader and bookmarker
Hi Henrik, thank you for your other contributions to date. I am also interested in reviewing it On Tue, Apr 10, 2018 at 9:52 AM, Manuel Canowrote: > Hi, > > Where can we find it? > > Kind regards, > Manu > > 2018-04-08 15:22 GMT+02:00 Henrik Sarvell : >> >> Hi list, >> >> Before the AI stuff Alex was helping me with some DB related stuff that >> was going into my new RSS and bookmarker combo of an app. >> >> The bookmarking part is a result of delicious deteriorating to such an >> extent that it was unusable. >> >> The feed reading I already had more or less completed in an earlier >> unpresentable app. >> >> It looks like I'm not going to manage to complete that last mile to get to >> a polished thing. I'm still using it though so it must be good enough. >> >> It might take me an hour or two to write an install tutorial in case there >> is interest in me uploading the project? >> >> It's a non-trivial example of a complete app using the standard PicoLisp >> DB after all, that could be used by beginners to explore without having to >> overload IRC and mailing list with questions. >> >> The database parts should be fairly solid (as they're made by Alex as much >> as by me) with progressively less clean code upwards in the stack so to >> speak, ie using jquery and more or less ad hoc Ajax requests. > > -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: anyone tried cygwin or mingw recently?
Hi Richard, I'm not sure about mingw/cygwin but I do have an unofficial port of pil-64 that runs on windows using midipix -- https://github.com/joebo/picoLisp-win-x86-64 My port has somewhat stalled as midipix is moving a bit slower than I expected. If I recall, most tests were passing and it worked reasonably well for prototyping on windows. I wouldn't use it for production apps Sockets and forking seemed to be stable and fast. Database locking does not work though. I started to look into using the windows api to lock (LockFile)... but stopped as midipix was going to be adding support for it "soon" as-of 6 months ago or so. It's not been added to midipix yet. If it was needed, I think it could be added to the shim and then incorporated into the assembly code https://github.com/joebo/picoLisp-win-x86-64/blob/master/src64/arch/win-x86-64-native_shim.c Aside from a proof of concept, I haven't moved forward on keeping this up to date with the latest pil or pushing it forward. If there was community interest, I'd be more motivated to push it forward Thanks, Joe On Sun, Jul 2, 2017 at 1:37 PM,wrote: > On Sun, 02 Jul 2017 19:07 +0200, Richard Z wrote: > > Did anyone test it recently? > > Hi Richard, > > Hopefully, joebo will comment on this. He is the one I know for sure > who has looked into mingw-type builds of picolisp this the past year. > > Best, --Rick > > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
Re: building picolisp in mobaxterm (cygwin)
unavailable > 0 [main] make 8052 child_info_fork::abort: > C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll: > Loaded to different address: parent(0xE3) != child(0x71) > make: Makefile:91: fork: Resource temporarily unavailable > 0 [main] make 6728 child_info_fork::abort: > C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll: > Loaded to different address: parent(0xE3) != child(0x6C) > make: Makefile:101: fork: Resource temporarily unavailable > 0 [main] make 7972 child_info_fork::abort: > C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll: > Loaded to different address: parent(0xE3) != child(0xDF) > make: Makefile:111: fork: Resource temporarily unavailable > 0 [main] make 6360 child_info_fork::abort: > C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll: > Loaded to different address: parent(0xE3) != child(0x6C) > make: Makefile:128: fork: Resource temporarily unavailable > cc -o sysdefs -D_FILE_OFFSET_BITS=64 sysdefs.c > 0 [main] make 7520 child_info_fork::abort: > C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll: > Loaded to different address: parent(0xE3) != child(0xE5) > make: fork: Resource temporarily unavailable > > > On Tue, Jun 13, 2017 at 9:49 PM, Joe Bogner <joebog...@gmail.com> wrote: > >> Hi pd, yes, this is a common issue with cygwin and fork. >> >> Are you on a 64-bit bit PC? If so, I have an experimental version of >> PicoLisp on 64-bit that might be useful - https://github.com/joebo/pic >> oLisp-win-x86-64 >> >> I can elaborate if so >> >> On Tue, Jun 13, 2017 at 3:22 PM, pd <eukel...@gmail.com> wrote: >> >>> Hi, >>> >>> I've tried to build picolisp in mobaxterm (a terminal program including >>> cygwin preinstalled) but I have a bunch of errors about foking and dll's >>> loading in different memory address >>> >>> ➤ make >>> 0 [main] make 14124 child_info_fork::abort: >>> C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll: >>> Loaded to different address: parent(0x6C) != child(0xDC) >>> make: Makefile:38: fork: Resource temporarily unavailable >>> 0 [main] make 852 child_info_fork::abort: >>> C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll: >>> Loaded to different address: parent(0x6C) != child(0xE4) >>> make: Makefile:58: fork: Resource temporarily unavailable >>> 0 [main] make 8692 child_info_fork::abort: >>> C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll: >>> Loaded to different address: parent(0x6C) != child(0x70) >>> make: Makefile:67: fork: Resource temporarily unavailable >>> 0 [main] make 11008 child_info_fork::abort: >>> C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll: >>> Loaded to different address: parent(0x6C) != child(0xE6) >>> make: Makefile:76: fork: Resource temporarily unavailable >>> 0 [main] make 5924 child_info_fork::abort: >>> C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll: >>> Loaded to different address: parent(0x6C) != child(0xE4) >>> make: Makefile:94: fork: Resource temporarily unavailable >>> gcc -c -O2 -pipe -falign-functions=32 -fomit-frame-pointer >>> -fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat >>> -Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 >>> -D_OS='"Windows_NT"' subr.c >>> 0 [main] make 14792 child_info_fork::abort: >>> C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll: >>> Loaded to different address: parent(0x6C) != child(0xE4) >>> make: fork: Resource temporarily unavailable >>> >>> >>> anyone have tried to build with mobaxterm or cygwin and had similar >>> problems? >>> >>> regards >>> >>> -- >>> Andrés >>> >>> *~ La mejor manera de librarse de la tentación es caer en ella**. ~ >>> Oscar Wilde* ~ >>> >> >> > > > -- > Andrés > > *~ La mejor manera de librarse de la tentación es caer en ella**. ~ Oscar > Wilde* ~ >
Re: building picolisp in mobaxterm (cygwin)
If you get stuck, jump on #picolisp on irc.freenode.net On Tue, Jun 13, 2017 at 5:19 PM, Joe Bogner <joebog...@gmail.com> wrote: > Building from my repo is complicated as it requires a different toolchain
Re: building picolisp in mobaxterm (cygwin)
Hi pd, yes, this is a common issue with cygwin and fork. Are you on a 64-bit bit PC? If so, I have an experimental version of PicoLisp on 64-bit that might be useful - https://github.com/joebo/picoLisp-win-x86-64 I can elaborate if so On Tue, Jun 13, 2017 at 3:22 PM, pdwrote: > Hi, > > I've tried to build picolisp in mobaxterm (a terminal program including > cygwin preinstalled) but I have a bunch of errors about foking and dll's > loading in different memory address > > ➤ make > 0 [main] make 14124 child_info_fork::abort: > C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll: > Loaded to different address: parent(0x6C) != child(0xDC) > make: Makefile:38: fork: Resource temporarily unavailable > 0 [main] make 852 child_info_fork::abort: > C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll: > Loaded to different address: parent(0x6C) != child(0xE4) > make: Makefile:58: fork: Resource temporarily unavailable > 0 [main] make 8692 child_info_fork::abort: > C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll: > Loaded to different address: parent(0x6C) != child(0x70) > make: Makefile:67: fork: Resource temporarily unavailable > 0 [main] make 11008 child_info_fork::abort: > C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll: > Loaded to different address: parent(0x6C) != child(0xE6) > make: Makefile:76: fork: Resource temporarily unavailable > 0 [main] make 5924 child_info_fork::abort: > C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll: > Loaded to different address: parent(0x6C) != child(0xE4) > make: Makefile:94: fork: Resource temporarily unavailable > gcc -c -O2 -pipe -falign-functions=32 -fomit-frame-pointer > -fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat > -Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 > -D_OS='"Windows_NT"' subr.c > 0 [main] make 14792 child_info_fork::abort: > C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll: > Loaded to different address: parent(0x6C) != child(0xE4) > make: fork: Resource temporarily unavailable > > > anyone have tried to build with mobaxterm or cygwin and had similar > problems? > > regards > > -- > Andrés > > *~ La mejor manera de librarse de la tentación es caer en ella**. ~ Oscar > Wilde* ~ >
Re: Method undefined - why?
Hi Thorsen, what about using (class) and (dm) instead? joebo@joebo:~/dev/picoLisp$ pil + : (class +Test) -> +Test : (dm T (Hi) (=: hi Hi)) -> T : (dm hi> (Nm) (or (text (: hi) Nm) "Dear Sir or Madam,")) -> hi> : (setq Foo (new '(+Test) "Hi @1")) -> $177463554467256 : (hi> Foo "Alex") -> "Hi Alex" On Thu, Mar 23, 2017 at 3:17 PM, Thorsten Jolitzwrote: > > Hi List, > > playing around a bit wih Pil classes/object, here is something I don't > understand: > > > #+BEGIN_SRC picolisp > > : (de +Test >(T (Hi) (=: hi Hi)) >(hi> (Nm) (or (text (: hi) Nm) "Dear Sir or Madam,")) ) > -> +Test > > : (setq Foo (new '(+Test) "Hi @1")) > -> $176777024346263 > > : (hi> Foo "Alex") > !? (hi> Foo "Alex") > hi> -- Undefined # => WHY? > ? > > : (getl Foo) > -> (("Hi @1" . hi)) > > : (can 'hi>) > -> ((hi> . +Test)) > > : (type Foo) > -> (+Test) > > : (show Foo) > $176777024346263 (+Test) >hi "Hi @1" > -> $176777024346263 > > : (methods Foo) > -> ((T . +Test) (hi> . +Test)) > > #+END_SRC > > > Is that strange, or is the problem sitting in front of the computer? > > -- > cheers, > Thorsten > > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
Re: in the spirit of RosettaCode...
Thanks Erik! I've updated app-persist To run it, I was also thinking heroku or hyper.sh is interesting (minimal expense). For either one, I was thinking of creating a docker container. I have a minimal, non-picolisp, example at: https://github.com/joebo/docker-tinycore-jhs There is also https://github.com/iprog4u/docker-tinycore-picolisp, although I might modify that to pull latest picolisp and compile Lastly, a free amazon micro instance could suffice I have a shell on digitalocean that I use, but I don't particularly want to maintain the app going forward I think heroku would probably be best as it's similar to how others in the todo-backend have done it. It would also be good to demonstrate how to deploy a picolisp app to heroku. I just don't have time at the moment to try it out. Thanks for the help! Joe On Fri, Mar 17, 2017 at 7:46 PM, Erik Gustafsonwrote: > Hi Joe, > > Thanks for your work on this! > > > Minor note - app-persist.l starts with > ># non-persistent version ... > > To get your implementation listed, we need it running live somewhere. Do > you have a favorite method for that? I'm happy to look into using Heroku > this weekend. > > It was a fun exercise. I would like to write a wiki article about it and > possibly even create a video to show my workflow > > > I would especially love to see this video if you make it! > > Cheers, > Erik > >
Re: in the spirit of RosettaCode...
I've completed this. I haven't yet contributed it to the todobackend.com site. If someone wants to do that I'd be grateful https://github.com/joebo/todo-backend-pil/ There are two versions - in-memory (non-persistent) and persistent using the picolisp db. All tests are passing. It was a fun exercise. I would like to write a wiki article about it and possibly even create a video to show my workflow On Wed, Mar 1, 2017 at 9:36 PM, Joe Bogner <joebog...@gmail.com> wrote: > Hi Dave, I am hoping to find some time over the next few days to work on > this and will send a note when I have some progress. It looks like an > interesting challenge and similar to the todo work I already did. Thanks > for sharing. > > Thanks, > Joe > > On Wed, Mar 1, 2017 at 11:13 AM, Loyall, David <david.loy...@nebraska.gov> > wrote: > >> >>>> In the spirit of RosettaCode, may I present >> http://www.todobackend.com/ ? >> >>> >> >>> Seems I should give it a try :) >> >>> >> >>> I don't understand the full extent of the task yet, but could it be >> >>> something >> >> >> >> To be correct, I don't understand it at all! >> >> >> >> Is the only "spec" a bunch of JavaScript sources? I don't feel like >> >> wanting to analyze that, sorry! >> > >> > Another clue could be to look at the server end: >> > >> > For instance one in Python >> > >> > https://github.com/KixPanganiban/todo-falcon/blob/master/todo.py >> > >> > >> > AFAIK the whole thing is like a "hello world" for persistence on the >> server and a very light GUI on the client. >> >> Visit http://www.todobackend.com/client/index.html?https://todo- >> backend-clojure.herokuapp.com/todos for example. >> >> This is a javascript client. It speaks to some backend. Which backend >> is actually configurable. The main site lists dozens. >> >> So the goal is to make a picolisp backend which is compatible with this >> client. >> >> For language learners, once they know a few of these backends... they >> will be able to learn about new languages by reading the source code of >> other backends. >> >> For daily grind developers, they can compare frameworks, I guess. :) >> >> I guess "backend" here means a RESTful API. (I'm probably misusing the >> term.) >> >> You don't have a read the javascript "spec", you can run this: >> http://www.todobackend.com/specs/index.html >> >> What it does is connect to any backend and attempt to perform actions >> that are expected to be implemented. (I wonder if anyone has used "machine >> learning" to implement a compliant backend...) >> >> Cheers, >> --Dave >> > >
Re: JavaCode with static class methods
Hi Thorsen, it looks like you were on the right path. I'm guessing there may be a bug or issue with the double signature This works: : (java (java "java.lang.Math" "abs" -4)) -> 4 : (java (java "java.lang.Math" "min" 10 5)) -> 5 But I'm just guessing On Thu, Mar 2, 2017 at 3:02 PM, Thorsten Jolitzwrote: > > Hi List, > > I'm experimenting a bit with the 'java' function, and the StringBuilder > and GregorianCalendar example from the JavaCode Wiki entry work fine, > but I wonder how to use a constructorless class like e.g. java.lang.Math > with its static class methods? > > #+NAME: JavaCode - none of these work > #+BEGIN_SRC picolisp > (java "java.lang.Math" 'sqrt 4) > (java java.lang.Math 'sqrt 4) > (java 'java.lang.Math 'sqrt 4) > > (setq M (java "java.lang.Math" T)) // returns null, no constructor > #+END_SRC > > Thanks for any hints. > > -- > cheers, > Thorsten > > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
Re: in the spirit of RosettaCode...
Hi Dave, I am hoping to find some time over the next few days to work on this and will send a note when I have some progress. It looks like an interesting challenge and similar to the todo work I already did. Thanks for sharing. Thanks, Joe On Wed, Mar 1, 2017 at 11:13 AM, Loyall, Davidwrote: > In the spirit of RosettaCode, may I present > http://www.todobackend.com/ ? > >>> > >>> Seems I should give it a try :) > >>> > >>> I don't understand the full extent of the task yet, but could it be > >>> something > >> > >> To be correct, I don't understand it at all! > >> > >> Is the only "spec" a bunch of JavaScript sources? I don't feel like > >> wanting to analyze that, sorry! > > > > Another clue could be to look at the server end: > > > > For instance one in Python > > > > https://github.com/KixPanganiban/todo-falcon/blob/master/todo.py > > > > > > AFAIK the whole thing is like a "hello world" for persistence on the > server and a very light GUI on the client. > > Visit http://www.todobackend.com/client/index.html?https:// > todo-backend-clojure.herokuapp.com/todos for example. > > This is a javascript client. It speaks to some backend. Which backend is > actually configurable. The main site lists dozens. > > So the goal is to make a picolisp backend which is compatible with this > client. > > For language learners, once they know a few of these backends... they will > be able to learn about new languages by reading the source code of other > backends. > > For daily grind developers, they can compare frameworks, I guess. :) > > I guess "backend" here means a RESTful API. (I'm probably misusing the > term.) > > You don't have a read the javascript "spec", you can run this: > http://www.todobackend.com/specs/index.html > > What it does is connect to any backend and attempt to perform actions that > are expected to be implemented. (I wonder if anyone has used "machine > learning" to implement a compliant backend...) > > Cheers, > --Dave >
Re: in the spirit of RosettaCode...
Hi David, Alex Not exactly the same thing (both front-end and back-end)... I created a todo example last year: https://github.com/joebo/pil-mithril-todo. This is not a pure pil way since it uses a javascript framework - so it could be a PicoLisp / Mithril.js combo. It would be nice to see a pure pil way. If someone else wants to take it on, they might be able to use what I have as a starting point (feel free!) To see my example: I restarted the example at http://csilo.com:8088/ username: admin , password: admin ... It takes a few seconds to log in due the bcrypt hashing Thanks, Joe On Tue, Feb 28, 2017 at 11:21 AM, Alexander Burgerwrote: > Hi Loyall, > > > In the spirit of RosettaCode, may I present http://www.todobackend.com/ > ? > > Seems I should give it a try :) > > I don't understand the full extent of the task yet, but could it be > something > similar to http://picolisp.com/wiki/?mindbgui with some modifications and > extensions? > > ♪♫ Alex > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
Re: Copy/Clone a 'job
Hi Lindsay, It looks like you are using job primarily to retain the value of N between invocations. Is that true? Just curious, why not move the loop inside of hexSpigot instead of looping outside of it? Another option to consider if you want the behavior of being able to increment the hexSpigot at any point - use a pil class (http://software-lab.de/doc/ref.html#oop) Thanks, Joe On Sun, Feb 26, 2017 at 5:03 AM, Lindsay John Lawrencewrote: > Thanks Alex, > > I'll have to play with your solution a bit. I don't quite follow how the > global is working there in conjunction with 'job and 'off. > > However, after banging around on this for a couple of hours, trying 'copy', > various auxillary functions to return the quoted 'job, etc I was at my wits > end...when just a few minutes ago, I remembered where the mail list had > discussed 'job most recently... over 'curry! > > This seems to do what I want as well... > > : (pp 'getHexSpigot) > (de getHexSpigot NIL >(curry > ((N)) > NIL > (default N '(0)) > (prog1 > (hex (% (car N) 16)) > (setq N (cons (+ 1 (car N)) N)) ) ) ) > -> getHexSpigot > > Now I can do this... > > : (def 'hexSpigot1 (getHexSpigot)) > -> hexSpigot1 > : (def 'hexSpigot2 (getHexSpigot)) > -> hexSpigot2 > > : (do 8 (prin (hexSpigot1))) > 01234567-> "7" > : (do 16 (prin (hexSpigot2))) > 0123456789ABCDEF-> "F" > > : hexSpigot1 > -> (NIL (job '((N 8 7 6 5 4 3 2 1 0)) (default N '(0)) (prog1 (hex (% (car > N) 16)) (setq N (cons (+ 1 (car N)) N) > : hexSpigot2 > -> (NIL (job '((N 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0)) (default N > '(0)) (prog1 (hex (% (car N) 16)) (setq N (cons (+ 1 (car N)) N) > > : (off hexSpigot1) > : (off hexSpigot2) > > > /Lindsay > > > > > On Sun, Feb 26, 2017 at 1:19 AM, Alexander Burger > wrote: >> >> Hi Lindsay, >> >> > (de hexSpigot NIL >> >(job '((N)) >> > ... >> > : (do 32 (prin (hexSpigot))) >> > ... >> > 0123456789ABCDEF0123456789ABCDEF-> "F" >> > ... >> > : (pp 'hexSpigot) >> > (de hexSpigot NIL >> >(job >> > '((N 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 >> > 12 >> > 11 10 9 8 7 6 5 4 3 2 1 0 ) ) >> > ... >> > The job vars are being modified and the list N is growing.. using ever >> > greater amounts of memory. If I want to reset the spigot, or even clone >> > it >> > to have more than one, how would I do that? >> >> The simplest is to use a global: >> >>(setq *HexSpigot '((N))) >> >>(de hexSpigot NIL >> (job *HexSpigot >> ... >> >> and later just do the 'setq' again. >> >> >> BTW, for an expression like >> >>(ifn N (setq N (0))) >> >> there is 'default' >> >>(default N (0)) >> >> So the above could be made a bit easier: >> >>(off *HexSpigot) >> >>(de hexSpigot NIL >> (job (default *HexSpigot '((N . (0 >> (prog1 >> (hex (% (car N) 16)) >> (setq N (cons (+ 1 (car N)) N)) ) ) ) >> >>(do 32 (prin (hexSpigot))) >>(off *HexSpigot) >>(do 32 (prin (hexSpigot))) >> >> i.e. just call 'off' to reset it :) >> >> ♪♫ Alex >> -- >> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe > > -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: help with global replace in text file/list of bytes
After trying to figure it out myself for a few minutes, I remembered to check rosettacode (wonderful resource). This is probably close to what you need: http://rosettacode.org/wiki/Globally_replace_text_in_several_files#PicoLisp On Tue, Feb 21, 2017 at 8:08 AM, Joe Bogner <joebog...@gmail.com> wrote: > Hi dean, > > I experimented with this problem for a few minutes and didn't come up with > anything worth posting. A few comments though: > > 1. Your picolisp code is becoming easier to read. Nice work! > 2. My initial thought was to split the input into words and replace > sublists, however it looks like you don't have a word delimiter (typically > a space)...Since you need to be able to substitute "fl ow" with "flow". As > a result, the best I came up with is something similar (looping through > characters and testing the replacement) > 3. Why do you need to work with bytes vs chars? (mapcar char (chop > Sfrom)) ? > > > > On Tue, Feb 21, 2017 at 3:37 AM, dean <deangwillia...@gmail.com> wrote: > >> I need to globally replace certain words in a text file and because >> I need to process it a byte at a time initially...I'm inputting >> processed list of bytes into the global replace function "lchg" >> (and others) like this. >> >> (lbytes_to_fl Cleaned_txt_pth >>(lchg "fl ow" "flow" >>(fltr2 >>(fltr1 >> (fl_to_lbytes Txt_pth) >> >> The other filters seem ok but this one is slow (most likely my >> algorithm/general approach :)) and any help to >> speed things up would be much appreciated. >> >> (de lchg (Sfrom Sto Lbytes) >>(make >> (let >> (X 0 >> B NIL >> Lfrom (mapcar char (chop Sfrom)) >> Lto (mapcar char (chop Sto)) >> First_from_ch (car Lfrom) >> Len_from-1 (- (length Lfrom) 1) >> Len_lbytes (length Lbytes) ) >> (until (<= (length Lbytes) X) >> (inc 'X) >> (setq B (get Lbytes X)) >> (if (= B First_from_ch) >>(prog >> (if (= (slice Lbytes X (+ X Len_from-1)) Lfrom) >> (prog >> (for MatchB Lto >>(link MatchB) ) >> (inc 'X Len_from-1) ) >> (link B) ) ) >>(link B) ) ) ) ) ) >> >>(de slice (Lst I K) (head (inc (- K I)) (nth Lst I)) ) #99 >> >> Here's "lchg" in action... >> >> : (setq L (chop "ab fl ow flow fl ow yz")) >> -> ("a" "b" " " "f" "l" " " "o" "w" " " "f" "l" "o" "w" " " "f" "l" " " >> "o" "w" " " "y" "z") >> : (pack (mapcar char (lchg "fl ow" "flow" (mapcar char L >> -> "ab flow flow flow yz" >> >> >
Re: help with global replace in text file/list of bytes
Hi dean, I experimented with this problem for a few minutes and didn't come up with anything worth posting. A few comments though: 1. Your picolisp code is becoming easier to read. Nice work! 2. My initial thought was to split the input into words and replace sublists, however it looks like you don't have a word delimiter (typically a space)...Since you need to be able to substitute "fl ow" with "flow". As a result, the best I came up with is something similar (looping through characters and testing the replacement) 3. Why do you need to work with bytes vs chars? (mapcar char (chop Sfrom)) ? On Tue, Feb 21, 2017 at 3:37 AM, deanwrote: > I need to globally replace certain words in a text file and because > I need to process it a byte at a time initially...I'm inputting > processed list of bytes into the global replace function "lchg" > (and others) like this. > > (lbytes_to_fl Cleaned_txt_pth >(lchg "fl ow" "flow" >(fltr2 >(fltr1 > (fl_to_lbytes Txt_pth) > > The other filters seem ok but this one is slow (most likely my > algorithm/general approach :)) and any help to > speed things up would be much appreciated. > > (de lchg (Sfrom Sto Lbytes) >(make > (let > (X 0 > B NIL > Lfrom (mapcar char (chop Sfrom)) > Lto (mapcar char (chop Sto)) > First_from_ch (car Lfrom) > Len_from-1 (- (length Lfrom) 1) > Len_lbytes (length Lbytes) ) > (until (<= (length Lbytes) X) > (inc 'X) > (setq B (get Lbytes X)) > (if (= B First_from_ch) >(prog > (if (= (slice Lbytes X (+ X Len_from-1)) Lfrom) > (prog > (for MatchB Lto >(link MatchB) ) > (inc 'X Len_from-1) ) > (link B) ) ) >(link B) ) ) ) ) ) > >(de slice (Lst I K) (head (inc (- K I)) (nth Lst I)) ) #99 > > Here's "lchg" in action... > > : (setq L (chop "ab fl ow flow fl ow yz")) > -> ("a" "b" " " "f" "l" " " "o" "w" " " "f" "l" "o" "w" " " "f" "l" " " > "o" "w" " " "y" "z") > : (pack (mapcar char (lchg "fl ow" "flow" (mapcar char L > -> "ab flow flow flow yz" > >
Re: clip and chop down consecutive "internal" white spaces to one space??
fun does this do it? (pack (mapcon '((X) (ifn (= '(" " " ") (head 2 X)) (cons (car X (chop S))) -> " this contains 2 consecutive spaces " On Feb 17, 2017 5:23 PM, "dean"wrote: > I've done this and it works but...is there a slicker way :) > > (setq S " this contains 2 consecutive spaces ") > > (de shrink (Str) >#can't clip before inner pack so need to pack, chop, clip and re-pack >(pack > (clip > (chop > (pack >(let (Last_ch " ") >(make > (for Ch (chop Str) > (if (<> Ch " ") > (if (= Last_ch " ") >(link (pack " " Ch)) >(link Ch))) > (setq Last_ch Ch) > > > (prinl "'" (shrink S) "'") > > #'this contains 2 consecutive spaces' > > >
Re: altering LOCAL list elements
dean, is this what you are describing? (let L (list 1 2 3) (setq L (append L (4))) (printsp L) ) (1 2 3 4) The key to this is understanding how let works. It restores the prior value after execution. See http://software-lab.de/doc/refL.html#let Defines local variables. The value of the symbol sym - or the values of the symbols sym in the list of the second form - ***are saved** and the symbols are bound to the evaluated any arguments. The 64-bit version also accepts lst arguments in the second form; they may consist only of symbols and sublists, and match the any argument (destructuring bind). prg is executed, then the symbols ***are restored to their original values***. On Fri, Feb 10, 2017 at 3:22 PM, deanwrote: > Hi > I've seen that I can alter local/let'd atoms? via inc/dec i.e. (inc > 'Some_atom) > which gets me a long way... > ...but what about list elements? > > > (setq L (0 0 0)) > (de doit () >#(let L (0 0 0) > (setq L (insert '1 (remove '1 L) 2)) > (prinl "L is " L) >#) > ) > > When I "setq" L this works but can I do it (somehow) when L is created > with "let"? >
Re: Segfault with huge list...?
It sounds like it's exceeding the stack size. Have you tried setting it to unlimited? ulimit -s unlimited http://www.mail-archive.com/picolisp@software-lab.de/msg01203.html On Fri, Feb 10, 2017 at 8:07 AM, Christopher Howard < christopher.how...@qlfiles.net> wrote: > Hi list. When I try to do > > (apply '+ (range 1 100) > > I get segfault. I thought maybe this was some kind of internal > limitation of the apply function, so I defined a foldl: > > (de foldl (Fn Acc Lst) > (if (== () Lst) Acc > (let Acc2 (Fn Acc (car Lst)) > (foldl Fn Acc2 (cdr Lst)) ) ) ) > > : (foldl '+ 0 (range 1 1000)) > (foldl '+ 0 (range 1 1000)) > -> 500500 > : (foldl '+ 0 (range 1 100)) > (foldl '+ 0 (range 1 100)) > > ..and again, a segfault. > > Am I doing something wrong? > > -- > https://qlfiles.net > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
Re: exit case body/prog/function
dean, I would use unless. See this control structure below as an alternative to the prog/if : (setq Test1 1) -> 1 : (case Test1 (1 (unless Test2 (prinl "true" true -> "true" : (setq Test2 "Nope") -> "Nope" : (case Test1 (1 (unless Test2 (prinl "true" -> NIL On Thu, Jan 19, 2017 at 7:55 AM, deanwrote: > I'd like to do this but am not sure if it's possible > > ( case >#= start of match clause >( >(prog >(if () (EXIT THIS MATCH CLAUSE/PROG)) >(otherwise you'll execute this statement) >) > ) > #= end of match clause > . > . > . > I also wonder if there's a similar... (if (T) (EXIT FUNCTION)) >
Re: help extracting number from string
This is probably better: : (extract format (split (mapcar format (chop "35fabc79")) NIL)) -> (35 79) On Thu, Dec 15, 2016 at 7:57 PM, Joe Bogner <joebog...@gmail.com> wrote: > OK, how about this this? > > : (mapcar format (extract pack (split (mapcar format (chop "35fabc79")) > NIL))) > -> (35 79) > > : (mapcar format (extract pack (split (mapcar format (chop "35f79")) NIL))) > -> (35 79) > > On Thu, Dec 15, 2016 at 7:36 PM, Joh-Tob Schäg <johtob...@gmail.com> > wrote: > >> If i understood it correctly he wants to get all groups of number. >> "35f79" -> (35 79) >> Am 16.12.2016 09:28 schrieb "Joe Bogner" <joebog...@gmail.com>: >> >>> how about >>> >>> : (extract format (chop 'ab33Cd)) >>> -> (3 3) >>> >>> or >>> >>> : (format (pack (extract format (chop 'ab33Cd >>> -> 33 >>> >>> >>> On Thu, Dec 15, 2016 at 4:16 PM, dean <deangwillia...@gmail.com> wrote: >>> >>>> I've seen num? and chop but think I need something in the middle to >>>> turn a character to a number >>>> >>>> Having said that I seem to have got close by accident...i.e. I was >>>> going to try and bend this...but it found a single integer as it was :) >>>> >>>> : (pick '((Ch) (and (= Ch (uppc Ch)) Ch)) (chop 'ab33Cd)) >>>> -> "3" >>>> >>>> I'd like this to detect 33 but see that chop precludes this. >>>> >>>> Any help much appreciated. >>>> >>>> >>> >
Re: help extracting number from string
OK, how about this this? : (mapcar format (extract pack (split (mapcar format (chop "35fabc79")) NIL))) -> (35 79) : (mapcar format (extract pack (split (mapcar format (chop "35f79")) NIL))) -> (35 79) On Thu, Dec 15, 2016 at 7:36 PM, Joh-Tob Schäg <johtob...@gmail.com> wrote: > If i understood it correctly he wants to get all groups of number. "35f79" > -> (35 79) > Am 16.12.2016 09:28 schrieb "Joe Bogner" <joebog...@gmail.com>: > >> how about >> >> : (extract format (chop 'ab33Cd)) >> -> (3 3) >> >> or >> >> : (format (pack (extract format (chop 'ab33Cd >> -> 33 >> >> >> On Thu, Dec 15, 2016 at 4:16 PM, dean <deangwillia...@gmail.com> wrote: >> >>> I've seen num? and chop but think I need something in the middle to turn >>> a character to a number >>> >>> Having said that I seem to have got close by accident...i.e. I was going >>> to try and bend this...but it found a single integer as it was :) >>> >>> : (pick '((Ch) (and (= Ch (uppc Ch)) Ch)) (chop 'ab33Cd)) >>> -> "3" >>> >>> I'd like this to detect 33 but see that chop precludes this. >>> >>> Any help much appreciated. >>> >>> >>
Re: help extracting number from string
how about : (extract format (chop 'ab33Cd)) -> (3 3) or : (format (pack (extract format (chop 'ab33Cd -> 33 On Thu, Dec 15, 2016 at 4:16 PM, deanwrote: > I've seen num? and chop but think I need something in the middle to turn a > character to a number. > > Having said that I seem to have got close by accident...i.e. I was going > to try and bend this...but it found a single integer as it was :) > > : (pick '((Ch) (and (= Ch (uppc Ch)) Ch)) (chop 'ab33Cd)) > -> "3" > > I'd like this to detect 33 but see that chop precludes this. > > Any help much appreciated. > >
Re: Incomplete documentation on 'need'
Hi Bruno, welcome! I agree the documentation is terse, but I think it's clear. "When lst is given, it is extended to the left (if cnt is positive) or (destructively) to the right (if cnt is negative) with any elements" Here's an example Perhaps an additional example would be useful in the docs, but it's easy enough to try in the repl # extend with NIL, same as (need 5) : (need 5 '(1 2)) -> (NIL NIL NIL 1 2) # extend with a (1 2) with 3 1s : (need 5 '(1 2) 1) -> (1 1 1 1 2) On Sat, Dec 3, 2016 at 5:59 PM, Joh-Tob Schägwrote: > You are welcome. But from my personal experience the documentation is rather > terse and changes happen not that often. > > Also (doc 'need) does state what it does do. Read the last two lines `second > form`. It is very unclear and i hope Regenaxer takes a look and clarifies > it. > > 2016-12-03 23:41 GMT+01:00 Bruno Franco : >> >> Thanks Chri! I'm relieved to hear you say that. I'll make sure to send any >> question I have. >> >> On Sat, Dec 3, 2016 at 5:12 PM, Christophe Gragnic >> wrote: >>> >>> On Sat, Dec 3, 2016 at 10:54 PM, Bruno Franco >>> wrote: >>> > I just wanted to point out that (doc 'need) for version 15.11.0 seems >>> > to >>> > miss something. >>> > […] >>> > I also wanted to ask if this kind of topic was appropriate for the >>> > mailing >>> > list. It seems so small that I wouldn't want to bother everyone just to >>> > point it out. >>> >>> I can't say anything about 'need, but I can answer the last question. >>> This list is very friendly, especially with newbies. >>> You can ask any question or point us to anything. >>> >>> >>> chri >>> -- >>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjectUnsubscribe >> >> > -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: solving for pilog variables
dean, does this help? I don't know pilog well but was just playing around : (prove (goal '( (equal @A 5) (equal @B 2) (^ @C (- (-> @A) (-> @B) ) -> ((@A . 5) (@B . 2) (@C . 3)) On Sun, Nov 27, 2016 at 12:42 PM, deanwrote: > (prove (goal '( (^ @X (- (-> @A) (-> @B) )) (equal @A 4) (equal @B 2) ))) > -> NIL > > -> wasn't the "one" in this case > > On 27 November 2016 at 17:34, dean wrote: >> >> Oopslet me try this >> >> (-> @X) in place of @X in the lisp clause >> >> >> On 27 November 2016 at 16:38, dean wrote: >>> >>> In preparation to do a predicate 'minus' I thought I see how to use lisp >>> '-' within pilog. >>> The first statement works re getting a 100% lisp calculation out to pilog >>> but >>> I think I need to pass in pilog variables and apply - to them...unless >>> pilog has a -. >>> Many apologies if I should know how to do this. >>> >>> >>> : (prove (goal '( (^ @X (- 4 2)) (equal @A 4) (equal @B 2) >>> ))) >>> -> ((@X . 2) (@A . 4) (@B . 2)) >>>: (prove (goal '( (^ @X (- @A @B)) (equal @A 4) (equal @B 2) >>> ))) >>> -> NIL >>> >>> >>> On 27 November 2016 at 08:46, dean wrote: Ok I'll keep trying and thank you for the pointers. Best Regardsd Dean On 27 November 2016 at 07:33, Alexander Burger wrote: > > Hi Dean, > > > #(prove (goal '(equal 3 @X) )) > > 'goal' needs a list of clauses: > >: (prove (goal '((equal 3 @X >-> ((@X . 3)) > > > > #: (prove (goal '( (equal 3 @X) (member @X (1 2 4)) ))) > > #-> NIL > > #: (prove (goal '( (equal 3 @X) (member @X (1 2 3)) ))) > > #-> ((@X . 3)) > > OK > > > > #(prove (goal '( > > #(equal @Profit (- @Sales @Cogs)) > > Did you define a '-' predicate? > > ♪♫ Alex > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >>> >> > -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: stuck re quote
On Tue, Nov 22, 2016 at 5:29 AM, dean <deangwillia...@gmail.com> wrote: > > Joe > My question came from that very documentation so I'm well aware of it. > > I've never used a lambda but your Javascipt example helps a lot and suggests > that 'quote' in > > > ((quote (X) (* X X)) 9) > > > transforms the statement into something like > > ( > (de anon (X) > (* X X) > ) > anon 9 > ) > > If that's right..great but the transformation isn't intuitive to me at > all i.e. I thought quote just stopped the evaluation of a symbol. > It looks like it's doing a lot more than that here. It's not a literal transformation. The phrasing is used to help the reader understand the execution of the statement. The statement is not transformed and can still be inspected : (setq f1 (quote (X) (* X X))) -> ((X) (* X X)) : (f1 9) -> 81 : (car f1) -> (X) : (cdr f1) -> ((* X X)) This is the same as : (setq f2 '((X) (* X X))) -> ((X) (* X X)) : (f2 9) -> 81 or : ('((X) (* X X)) 9) -> 81 The statements are equivalent : (= f1 f2) -> T > > Also I read that ' is a macro for quote but I couldn't produce a ' > equivalent of ((quote (X) (* X X)) 9) i.e. > See above I suggest reading through the 'Evaluation' section of http://software-lab.de/doc/ref.html. I've read it several times over the years. I probably read the reference 3 times before it really stuck. Often it needs to be re-read as new concepts that have been learned make it more clear. I'll paste some relevant sections that I think help explain the concept.. In the example above, f1 is a list, whose CAR is a is a list of symbols : (car f1) -> (X) -- start paste Otherwise, if the CAR is a symbol or a list, PicoLisp tries to obtain an executable function from that, by either using the symbol's value, or by evaluating the list. What is an executable function? Or, said in another way, what can be applied to a list of arguments, to result in a function call? A legal function in PicoLisp is .. or a lambda expression. A lambda expression is a list, whose CAR is either a symbol or a list of symbols, and whose CDR is a list of expressions. Note: In contrast to other Lisp implementations, the symbol LAMBDA itself does not exist in PicoLisp but is implied from context. . -- end paste Based on the above, we can also write the expression as ('(X (* 9 9)) 9) : (setq f3 '(X (* 9 9))) -> (X (* 9 9)) : (f3 9) -> 81 The statements aren't the same : (= f3 f2) -> NIL But the interpreter will execute them the same since the CAR of the list is a symbol (not a list of symbols as-is f2). A list of symbols is more common to see : (car f3) -> X Hope this helps. The key here is realizing that quote/' doesn't literally transform to a de, it just evaluates as if it did Joe On Tue, Nov 22, 2016 at 5:29 AM, dean <deangwillia...@gmail.com> wrote: > > Joe > My question came from that very documentation so I'm well aware of it. > > I've never used a lambda but your Javascipt example helps a lot and suggests > that 'quote' in > > > ((quote (X) (* X X)) 9) > > > transforms the statement into something like > > ( > (de anon (X) > (* X X) > ) > anon 9 > ) > > If that's right..great but the transformation isn't intuitive to me at > all i.e. I thought quote just stopped the evaluation of a symbol. > It looks like it's doing a lot more than that here. > > Also I read that ' is a macro for quote but I couldn't produce a ' > equivalent of ((quote (X) (* X X)) 9) i.e. > > : ((quote (X) (* X X)) 9) > -> 81 > : (('(X) (* X X)) 9) > !? (('(X) (* X X)) 9) > NIL -- Undefined > ? > : (('X (* X X)) 9) > !? ('X (* X X)) > X -- Undefined > > > Best Regards > Dean > > On 22 November 2016 at 04:16, Joe Bogner <joebog...@gmail.com> wrote: >> >> Hi dean, >> >> It's not clear what you're asking. Does this help explain it? >> >> http://software-lab.de/doc/tut.html >> >> --- from the page --- >> >> Anonymous functions without the lambda keyword >> >> There's no distinction between code and data in PicoLisp, quote will >> do what you want (see also this FAQ entry). >> >> : ((quote (X) (* X X)) 9) >> -> 81 >> >> : (setq f '((X) (* X X))) # This is equivalent to (de f (X) (* X X)) >> -> ((X) (* X X)) >> : f >> -> ((X) (* X X)) >> : (f 3) >> -> 9 >> >> --- end from the page --- >> >> And http://software-lab.de/doc/ref.html >> >> "The most prominent read-macro in Lisp is the single quote character >> "'", which expands to a call of the quote function. Note that the >> single quote character is also printed ins
Re: stuck re quote
Hi dean, It's not clear what you're asking. Does this help explain it? http://software-lab.de/doc/tut.html --- from the page --- Anonymous functions without the lambda keyword There's no distinction between code and data in PicoLisp, quote will do what you want (see also this FAQ entry). : ((quote (X) (* X X)) 9) -> 81 : (setq f '((X) (* X X))) # This is equivalent to (de f (X) (* X X)) -> ((X) (* X X)) : f -> ((X) (* X X)) : (f 3) -> 9 --- end from the page --- And http://software-lab.de/doc/ref.html "The most prominent read-macro in Lisp is the single quote character "'", which expands to a call of the quote function. Note that the single quote character is also printed instead of the full function name." --- In other words, quote is allowing you to define an anonymous function equivalent to (function(x) { return x*x })(9) (in javascript for example) On Mon, Nov 21, 2016 at 3:37 PM, deanwrote: > I could do with some help understanding step by step what's happening > here... > > Intuitively I can see that 9 squared is 81 but I can't really see, > precisely, what this was doing > > ((quote (X) (* X X)) 9) > -> 81 > > so I put it in a function in a file to trace it > > (de go () > ((quote (X) (* X X)) 9) > ) > > but it's not giving me the step by step explanation I was hoping for > > : (trace go) > !? (method "X" C) > (('((X) (* X X)) 9)) -- Symbol expected > ? > > Any help to understand what's happening at each stage would be very much > appreciated. > > Thank you in anticipation. -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: later vs. co
Great! To add to the dialog, I am not surprised by co/in-row being similar. I might have actually thought that co would be slightly slower. This task is CPU bound which won't get any benefit from switching coroutines, whereas later spawns new processes (workers) to take advantage of multi-core. Thanks for sharing. On Thu, Nov 17, 2016 at 10:01 AM, Mike Pechkinwrote: > hi, > > https://bitbucket.org/mihailp/tankfeeder/raw/43d62edb11d56b4ffada4f728ab59b5455c97fbc/pow.l > > https://bitmessage.org/wiki/Proof_of_work > > > I've implement more two versions for calculation Bitmessage POW on (later) > and (co) functions. It works. > environment: > o) DELL PowerEdge 430 (modern) > o) Centos 7 > o) pil64 > o) equal number (64) of workers for later and co. > > bench: > o) in-row ~10 secs > o) co ~10 secs > o) later ~2 secs > > p.s. I will add all this code to bundle of tests for future releases. > > Mike > -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Date query question
Henrik, thanks for sharing. Interesting question! > I can fairly trivially do a collect and then a filter on the results of the > collect as shown above. > > But how would the above problem be solved with Pilog and select if we have > more than "a couple of hundred objects" in the database? > For my own curiosity, should Pilog perform much better than a collect/filter? I would think that collect/filter should be nearly instant on upwards of a few thousand items (untested). When the data starts to get massive, indexes could theoretically help. Working through the logic, it seems like the various indexes would have to be hit a few times at least psuedocode: (let (Started (collect 'sDate '+Proj Sdate) # find project started after the S date Ended (collect 'eDate '+Proj "1900-01-01" Edate) # find projects ended before the end date StartedBefore (collect 'sDate '+Proj "1900-01-01" Sdate) # projects with start date before range EndedAfter (collect 'eDate '+Proj Edate) # projects with end date after the range With this approach, the various sets would be tested and duplicates removed maybe something like this (uniq Started Ended (sect StartedBefore EndedAfter)) .. I might have the logic wrong, but I would wonder if that's faster than just hitting all the entries and filtering with a typical use case -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: map-reduce
Thanks for sharing. This is an impressive example to show how to execute a computation in parallel The parallel magic seems to be here: (chain (mapcan '((F) (later (cons) (-file F))) *MAPFILES ) ) (wait NIL (full (made))) ) great work! On Mon, Nov 14, 2016 at 8:30 AM, Mike Pechkinwrote: > hi, > > My parallel-like map-reduce on (later) function: > https://goo.gl/S36x3N > > Besides more tests for build-in functions it opens the gate to implement > Blake2xP versions of SHA3 finalist which have parallel versions for speed > up. > > Mike > -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: (< @X 18) doesn't behave as expected with pilog
Hi Alex, range/3 seems to work as I expected. Should it not be used here? (be age (Paul 19) ) (be age (Kate 17) ) (be underage (@X) (age @X @Y) (range (0 . 18) @Y)) (? (underage @X) ) @X=Kate On Sat, Nov 12, 2016 at 10:44 AM, Alexander Burgerwrote: > Hi Joe, > >> Untested, but what about using range/3 ? >> http://software-lab.de/doc/refR.html#range/3 > > Thanks! However, range/3 is probably not useful here. It is a rather > specialized predicate for range checks in database queries. > > ♪♫ Alex > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: (< @X 18) doesn't behave as expected with pilog
Untested, but what about using range/3 ? http://software-lab.de/doc/refR.html#range/3 On Sat, Nov 12, 2016 at 9:59 AM, CILzwrote: > Hello, > > Let's say that I have those two facts in a pilog database: > > (be age (Paul 18)) > (be age (Vincent 17)) > > I'm looking for the guy under 18 with this rule: > > (be underage (@X) > (age @X @Y) > (< @Y 18)) > > If I ask (? (underage @X)) the result here is -> NIL where I expect to get > @X=Vincent. > > If I modify the above rule with: > > (be underage (@X) > (age @X @Y) > (equal @Y 18)) > > The same query (? (underage @X)) now gives @X=Paul which is the expected > result. > > I'm sure I'm missing something in the first case but I don't know what. Any > idea? > > Thanks, > > Eric > > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: First post
Hello Eric! Thanks for the introduction. Welcome! Looking forward to your questions! On Sat, Nov 12, 2016 at 9:45 AM, CILzwrote: > Dear list, > > I take the opportunity of this first post to introduce myself as well as the > reasons for which I come here. > > I am not a computer scientist nor a professional web developper but a kind > of "power user" who often gets its hands dirty to build some applications as > close as possible to what he wants... That being said, I have mostly built > some websites using off the shelf CMS ;-) > > However, my last "product" is a custom web application fully written from > scratch in R to access a graph database. And this is why I am here: I want > to rebuild it in order to add some "expert system" like capacity... > > So starting to digg around, I first came to Prolog a few weeks ago and I > started learning it from scratch. This very week, I discovered Picolisp. I > started exploring it, and so far, I am really impressed! It looks very > appealing: having at hand a powerful language, a built-in database system as > well as Prolog make me dream ... though I don't know if I am skilled enough > to be able to do anything useful! > > Any way, I have it up an running on my linux box ... so expect me to ask > very basic questions soon :) > > Best, > > Eric > > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Subscribe
Hi dean, Welcome! I would probably do this: : (in '(ls) (make (until (eof) (link (line T) -> ("app" "bin" "CHANGES" "COPYING" "CREDITS" "cygwin" "db2" "dbg" "dbg.l" "dev" "doc" "doc64" "ersatz" "ext.l" "games" "img" "INSTALL" "lib" "lib.css" "lib.l" "loc" "man" "misc" "picoblogorg" "pil" "plmod" "rcsim" "README" "simul" "src" "src64" "test") Some comments: pil makes it easy to experiment. I would first start with this experiment: : (in '(ls) (line T)) -> "app" We see that it returns a single item. So, we want to build a list of multiple items. An efficient way to do this is with make/link. We can loop until eof using (until (eof)) Hope this helps! Joe On Fri, Nov 11, 2016 at 8:07 AM, deanwrote: > I'm just wondering how you would capture the output from 'ls' to a list for > further processing. > I the first instance...I'd like to cd to a specified dir and caputure all > subdir names so that I can > cd to them in turn and process their pdf files, labelled 2005.pdf, 2006.pdf > etc > > I've been playing around with the examples > > > I tried to bend this > https://rosettacode.org/wiki/Get_system_command_output#PicoLisp > > : (in '(uname "-om") (line T)) > > to > > : (in (call 'ls) (line T)) > > but no-go > > Thank you in anticipation for your consideration and for > > creating and supporting such an interesting little language. > > BTW This is my very first lisp program let alone picolisp program. > > -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: bcrypt
perfect, thanks! On Mon, Sep 19, 2016 at 9:03 AM, Mike Pechkin <mike.pech...@gmail.com> wrote: > > all under CC0. > you are free to do you want. > > On Mon, Sep 19, 2016 at 3:12 PM, Joe Bogner <joebog...@gmail.com> wrote: > >> Mike, this looks great. What license covers this work - I see CC0 in the >> root LICENSE[1] but didn't want to assume? Can I redistribute the source >> with my example app? >> >> [1] - https://bitbucket.org/mihailp/tankfeeder/src/f9ad69ad2a6ec35 >> 941f50c4ec1160e7a53ea3e67/LICENSE?at=default=file-view-default >> >> On Sun, Sep 18, 2016 at 9:00 AM, Alexander Burger <a...@software-lab.de> >> wrote: >> >>> Hi Mike, >>> >>> > bcrypt is ready >>> >>> Cool! Thank you! >>> ♪♫ Alex >>> -- >>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >>> >> >> >
Re: bcrypt
Mike, this looks great. What license covers this work - I see CC0 in the root LICENSE[1] but didn't want to assume? Can I redistribute the source with my example app? [1] - https://bitbucket.org/mihailp/tankfeeder/src/f9ad69ad2a6ec35941f50c4ec1160e7a53ea3e67/LICENSE?at=default=file-view-default On Sun, Sep 18, 2016 at 9:00 AM, Alexander Burgerwrote: > Hi Mike, > > > bcrypt is ready > > Cool! Thank you! > ♪♫ Alex > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
creating a todo app in less than 2 minutes (pil-mithril-scaffold)
I've created a new demo of using PicoLisp with mithril to quickly prototype apps. The key feature is a scaffolding which generates crud operations and forms for any +ApiEntity https://github.com/joebo/pil-mithril-scaffold/blob/master/README.md Create a todo app in less than 2 minutes (cheated a bit by copy pasting), but the entire app should is less than 50 lines of application-specific code. It includes login, session management, a todo list and the ability to pick a tag for a todo. Next up I may create a blog or simple CRM app Not ready for production yet, but great for prototyping More to come! Joe
Re: web app example - todo w/mithril.js
rick, great suggestion and thanks for the feedback! Added and deployed! https://github.com/joebo/pil-mithril-todo/blob/master/app.js#L52 On Wed, Sep 14, 2016 at 8:37 PM, <r...@tamos.net> wrote: > Hi Joe! > > On Wed, 14 Sep 2016 00:14 -0400, Joe Bogner wrote: > > I've been working on an example of using PicoLisp to create as a > > single page web application (javascript / SPA). > > > > The code is available at https://github.com/joebo/pil-mithril-todo > > > > You can play with the example here (may be temporary): > > > > http://csilo.com:8088/ > > > > log in with admin/admin > > > > I welcome any feedback! > > This is very nice, i.e. a nice digestible, but non-trivial and coherent, > example that people can use to learn how to do such as this easily and > quickly. It also looks very professional, slick. > > A question: when you are done typing a task description in the text > field, is it possible to have the task added when you then press ENTER > there (i.e. without having to press the Add button)? Just wondering. > > Thanks for doing this! Best, --Rick > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjectUnsubscribe >
Re: web app example - todo w/mithril.js
On Wed, Sep 14, 2016 at 7:52 AM, Mike Pechkinwrote: > I will implement bcrypt in PicoLisp. > > Great! It will be nice to eliminate that dependency on bcrypt.so >
web app example - todo w/mithril.js
I've been working on an example of using PicoLisp to create as a single page web application (javascript / SPA). The code is available at https://github.com/joebo/pil-mithril-todo You can play with the example here (may be temporary): http://csilo.com:8088/ log in with admin/admin I welcome any feedback! Joe
Re: Article on fixed-point arithmetic in picolisp
Hey Rick, Thanks for the article! It was informative and interesting. It should make the scale operations less intimidating and awkward to a new user. I particularly like how it highlights the benefits over floating point math. What do you think about publishing some bits from the article on the wiki? On Tue, Sep 6, 2016 at 1:11 AM,wrote: > [Let's try this one more time. I screwed up the headers before. Sorry.] > > Hello list! > > Here is a blog post that I wrote about fixed-point number operations in > picolisp. > > http://the-m6.net/blog/fixed-point-arithmetic-in-picolisp.html > > It was fun to write and I hope you find it useful. It might be a bit > tedious for the veterans because it is written to inform a relative > newcomer to picolisp about such things. Anyway, as always, I'd > appreciate any comment upon it by all you sharp folks who regularly > teach me things here and on IRC. Thanks! > > All the best, --Rick (rick42) > > P. S. -- I thought that writing this would be fairly easy; then I got > into it. :/ When I thought I was finished, I didn't realize that I had > more work to do and consequently I delayed publishing for another week. > Wow. And that wringer was just *one* post! I don't think I could do > an *entire blog* on picolisp as some of you do -- that's for you > adventurous and energetic people. :D > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
Re: toy-forth-in-picolisp, and a 32-bit problem
Hi Jon - also works on windows 64bit version : : : ff 0 if 77 else 88 then ; -> +DefineWord Done defining ff as (0 $200243534) t -> tempStack: -> +DefineWord Done defining fac as (_dup_ 1 _>_ $200244051) 5 fac .s -> (120) On Fri, Aug 26, 2016 at 11:26 AM, Brian Walkerwrote: > Hi Jon, > > works great for me on linux 64bit version. > > /taj33n > > > Am 26.08.2016 um 15:53 schrieb Jon Kleiser: > >> Hi, >> >> This summer I have had some fun trying to figure out how to implement a >> super simple toy Forth. For a start, I chose PicoLisp as an implementation >> language. You may find it here: >> >> https://github.com/jkleiser/toy-forth-in-picolisp >> >> There is one problem, however, occurring quite regularly when I run this >> forth.l using 32-bit PicoLisp on Mac. As the README.md suggests, I start it >> by doing this >> >> pil path/to/forth.l + >> >> If I then enter “: ff 0 if 77 else 88 then ;” (without the quotes), which >> defines a new word “ff” (which when used always pushes 88 on the stack), >> and then enter “t”, which is a (non-standard) word just for checking the >> state of the “tempStack” field (probably empty), then I usually get a >> “Segmentation fault: 11”. >> >> I have not seen that problem when using 64-bit PicoLisp (in Docker). >> >> Is this Segmentation fault caused by a bug in 32-bit PicoLisp, or is it >> me doing something stupid? >> >> Have a nice weekend! >> >> /JonPԔ � )mX��� � �zV�u�.n7�� ���r��e=== >> >> -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
task db example
Some discussion on irc this morning prompted me to create a simple example showing how to interact with the db directly. I posted it to the wiki and am sharing it here in case anyone would benefit http://picolisp.com/wiki/?taskdb
picolisp windows update & other notes
I wrote up a few notes after working with the picolisp win-x86-x64 port today http://csilo.com/!article?2016/08/19/PicoLisp-win-x86-64-app/main-edit-workaround,-other-musings I figured others may be interested. Feel free to reply here with any comments. It's good to be working with pil again after a few years. My work today was using the win-x86-64 port to run a load test against a c# app. This load test ran with 50 works on my windows PC. Here's a gist of the load test: https://gist.github.com/joebo/fa91b263fece8adc3c18186fc1d6c50b It works great to simulate web traffic and capture the response time. Much easier than figuring out the latest and greatest stress test tool and learning how to program it. I needed to simulate a user from a random preconfigured list of users. Then make a request to get the person's list of customers. Then pick a random customer to get a list of that person's products. Then pick a product to view the details for that customer/product. Cheers!
Re: Windows x64 PicoLisp preview
Thanks for the feedback everyone. I resurveyed the options on Windows this morning for PicoLisp 1. pil32 compiled under mingw -- compiles but doesn't work due to issues with reading from stdin -- example (load "lib.l") is read as (load "lib.") .. similar failures when invoking from command line 2. pil32 compiled under cygwin - compiles and passes same tests as midipix pil64. However, when running the app/main.l it crashes with "DB read: Bad file descriptor". This has come up before ( https://www.mail-archive.com/picolisp@software-lab.de/msg03430.html) and still seems to be an issue 3. pil64 emu - compiles but fails on (wait) tests... seems to hang indefinitely. Possibly can be fixed with *C-params, but I don't particularly want to run emu 4. pil64 midipix-based preview port [this release] ... runs app/main.l and I can click around and view records. I noticed some instability when editing and will research further 5. pil64 running under windows 10 subsystem - not tested as I don't have windows 10 x64 >From my usage #4 is the best bet it seems On Wed, Aug 17, 2016 at 9:24 AM,wrote: > Great work Joe! > > As rick said, this will make windows work more bearable and open up > opportunities to deploy picolisp, especially for little scripts and glue > work. > > Many thanks to you, Alex, rick and the awesome guys from midipix :-) > > >
Re: flinuxpicolisp
Oleksandr, thank you for the report. Please confirm, what does *CPU report under the src64 version on the Win10/Windows Subsystem? If it is emu then it is running the emulated version of the 64-bit version, which is good but not optimal for performance I have a 32-bit windows 10 machine and the Windows Subsystem for Linux was not available on 32-bit as of a few months ago, which is one of the reasons I started working on the win-x86-64 port. If the native, assembly, version of PicoLisp 64 runs under Win10/x64 then that would be great. I will still continue to work on my port as I would like to support those without access to win10 (myself included). On Tue, Jul 5, 2016 at 2:14 AM, Oleksandr Nikitin <oleksa...@tvori.info> wrote: > Hi Rick, Thursten > > just FYI, both 32 and 64-bit PicoLisp compiles and runs pretty much > transparently on the new "Windows Subsystem for Linux". > > Haven't tried using database yet, though. > > On Tue, Jul 5, 2016 at 5:26 AM, Rick Hanson <cryptor...@gmail.com> wrote: > >> On Mon, Jul 4, 2016 at 2:17 PM, Thorsten wrote: >> > Hi List, >> >> Hi, Thorsten ! >> >> > I just discovered a nice article by Joe Bogner about FLINUX as an >> > alternative was to run PicoLisp under Windows >> > (http://picolisp.com/wiki/? flinuxpicolisp). >> > >> > I tried it out, and succeded to a certain point but not further. >> > >> > When installing necessary tools like wget, make etc. I often hit the >> > "could not change the root directory (No such file or directory)" >> > error, but it appeared after the last installation step, and after >> > an C-c installation appeared successful. >> > >> > But when trying to compile the 64bit version, Java is missing, and >> > when I try to install it, I get the above error in the middle of the >> > installation process that thus cannot finish. >> > >> > There is some info about this >> > (https://github.com/wishstudio/flinux/issues/63), but I could not >> > really find a solution. Did somebody on the list succeed with the >> > Flinux install of the 64bit version on Windows? >> >> I'm not aware. It looks as if his article >> >> http://picolisp.com/wiki/?flinuxpicolisp >> >> was only meant for 32-bit pil builds. >> >> On the other hand and on the topic of Windows 64-bit pil builds, Joe >> is currently working on and very close to a solution based on midipix. >> >> http://www.midipix.org/#sec-midipix >> >> He has been working closely with the midipix author for many weeks now >> (back and forth on IRC) to iron out particular problems with getting >> pil ported there. >> >> There is not much in the way of documentation yet, but Joe has >> cataloged some pil patches related to the midipix build here: >> >> https://github.com/joebo/picoLisp-win-x86-64 >> >> (and there might be more he has not pushed yet; not entirely sure.) >> >> At any rate, when we see Joe (joebo) on #picolisp let's remind >> ourselves to ask him to update us about it here on the ML. >> >> > Any hints would be welcome. >> > Cheers >> > Thorsten >> >> Best, --Rick >> -- >> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >> > > > > -- > With best wishes, Oleksandr Nikitin > > skype: wizzard0 >
Re: flinuxpicolisp
On Mon, Jul 4, 2016 at 2:17 PM, Thorsten <tjol...@gmail.com> wrote: > Hi List, > I just discovered a nice article by Joe Bogner about FLINUX as an > alternative was to run PicoLisp under Windows (http://picolisp.com/wiki/? > flinuxpicolisp). > > Hi Thorsten, glad you found it. > I tried it out, and succeded to a certain point but not further. > > When installing necessary tools like wget, make etc. I often hit the > "could not change the root directory (No such file or directory)" error, > but it appeared after the last installation step, and after an C-c > installation appeared successful. > > I had the same experience. I think it was a side effect of how bash runs within it and didn't affect the pil32 execution as far as I remember. > But when trying to compile the 64bit version, Java is missing, and when I > try to install it, I get the above error in the middle of the installation > process that thus cannot finish. > > Unfortunately, I don't think you'll be able to compile or run the 64bit version. I was unable to compile a x64 version of flinux and it seems like it is not implemented. For example, https://github.com/wishstudio/flinux/tree/7874a4ff9ba2fec4ad1c67b857c563288d5aa93e/src/dbt, does not have an x64 version and the assembly for x86_trampoline does not compile under visual c++ x64. This is the main motivation for working on the native x64 version of PicoLisp using midipix as the linux syscall interop layer. Thanks for the mention Rick! The x64 version is still in a draft status, most of the changes are here: https://github.com/joebo/picoLisp-win-x86-64/blob/master/src64/arch/win-x86-64.l, to support the different ABI calling convention. It relies on midipix which is still in alpha and hasn't yet been released which is why I haven't actively promoted it. There's a few workarounds still in the code too, for example dlopen isn't yet implemented in midipix so ht ext: code needs to be compiled into the picolisp binary, https://github.com/joebo/picoLisp-win-x86-64/blob/master/src64/Makefile#L129 The current x64 windows binary release can be found under Releases in the github repo linked above, https://github.com/joebo/picoLisp-win-x86-64/releases There is some info about this > (https://github.com/wishstudio/flinux/issues/63), but I could not really > find a solution. Did somebody on the list succeed with the Flinux install > of the 64bit version on Windows? > > Any hints would be welcome. > Cheers > Thorsten > > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
Re: Websockets now considered stable
Hi Henrik, Thanks for sharing. I get the following when running the ws-demo: ./pil pl-web/ws-demo/main.l -go .. !? (wsServer) wsServer -- Undefined I can't find the definition of wsServer anywhere. Is it missing from the repo? Thanks, Joe On Mon, Jan 4, 2016 at 4:27 PM, Henrik Sarvellwrote: > Update: > > The socketserver is now completely reliant on Redis, using Redis' pub > / sub functionality: http://redis.io/topics/pubsub > > The reason for this is that I was using the websocket server to handle > all websockets functionality for the site I'm being paid to work on > and it started running into problems as the site grew, the first issue > was an easy fix after Alex pointed me to it, increasing the amount of > file descriptors in src64/sys/x86-64.linux.defs.l, my line #115 now > looks like this: (equ FD_SET 1024) # 1024 bit > > After re-compiling I could easily handle more than 500 clients and all > was well for a while. > > Unfortunately the site is growing so fast that just some month(s) > later the parent / root process started intermittently running at 100% > CPU utilization and the service stopped working for perhaps 10-20 > minutes before resolving on its own. At this point peak usage involved > 2000 clients being connected at the same time. > > Alex suspects that the issue has got to do with how the internal logic > handles new processes being created when there are already a lot of > them present. In a normal HTTP server scenario this probably never > happens, imagine that every request takes on average 1 second to > perform before the socket closes, you would then need about 2000 > requests per second in order to trigger the CPU problem, you'll run > into many other issues long before that happens in a non-trivial > scenario (trust me I've tested). > > In the end we switched over to a node.js based solution that also > relies on Redis' pub / sub functionality (that's where I got the idea > from to make the PL based solution also use it). > > I have tried to replicate the real world situation load wise and > number of clients wise but not been able to trigger the CPU issue > (this also seems to imply that Alex's suspicion is not completely on > target), it's impossible for me to replicate the real world situation > since I can't commandeer hundreds of machines all over the world to > connect to my test server. What I did manage to trigger though was > fairly high CPU usage in the child processes though, a situation that > also involved loss of service. After the switch to using pub / sub I > haven't been able to trigger it, so that's a win at least. > > Now for the real improvement, actually making HTTP requests to publish > something becomes redundant when publishing from server to client > since it's just a matter of issuing a publish call directly to Redis > instead. That lowers the amount of process creation by more than 90% > in my use case. > > Even though I can't be 100% sure as it currently stands I believe that > if I had implemented the websocket server using Redis' pub / sub to > begin with the CPU issue would probably never have happened and there > would've been no need to switch over to node.js. > > That being said, this type of service / application is better suited > for threads since the cost in RAM etc is lower. > > Final note, my decision to use one socket per feature was poor, it > allowed me a simpler architecture but had I opted for one socket with > "routing" logic implemented in the browser instead I could have > lowered the amount of simultaneous sockets up to 8 times. Peak usage > would then have been 2000 / 8 = 250 processes. Not only that, it turns > out that IE (yes, even version 11 / edge) only allows 6 simultaneous > sockets (including in iframes) per page. We've therefore been forced > to turn off for instance the tournament functionality for IE users. > > > > On Fri, Jun 26, 2015 at 9:30 PM, Henrik Sarvell > wrote: > > Hi all, after over a month without any of the prior issues I now > > consider the websockets part of pl-web stable: > > https://bitbucket.org/hsarvell/pl-web Gone are the days of 100% CPU > > usage and zombie processes. > > > > With Alex's help the main web server is now more stable (he made me > > throw away a few throws in favour of a few byes). The throws were > > causing the zombies. > > > > I was also including dbg.l (it was causing hung processes at 100% > > CPU), it's basically been deprecated or something, I'll leave it up to > > him to elaborate. It's just something I've been including by habit > > since years ago when at some point I needed to include it to do some > > kind of debugging. > > > > Anyway atm the WS router is regularly routing up to 40 messages per > > second to upwards 300-500 clients which means that roughly 20,000 > > messages are being pushed out per second during peak hours. > > > > The PL processes show up with 0 CPU and 0 RAM usage when I run top, > > sometimes 1% CPU
Re: Single File Function Reference
This may be relevant: https://github.com/tj64/picolisp-by-example https://github.com/tj64/picolisp-works/blob/master/editor.pdf?raw=true https://github.com/tj64/picolisp-by-example/blob/master/book.pdf?raw=true PicoLisp By Example has a function reference Also documented here: http://picolisp.com/wiki/?Documentation On Tue, Oct 13, 2015 at 9:35 AM, František Fukawrote: > Is there Picolisp function reference available to download as a single file, > to put in in my EBook reader? I can only see it online, split to individual > files according to the first letter of the function name. > > -- > -- Frantisek Fuka > (yes, that IS my real name) > > -- My Personal homepage: www.fuxoft.cz > -- My Google+ profile: google.com/+fuxoft > -- My Telegram chat: telegram.fuxoft.cz > > -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: PilOS
Good to hear! Happy to help. On Thu, Jul 23, 2015 at 11:21 AM, Robert Herman rpjher...@gmail.com wrote: Joe, Thanks! That did it. I was trying different versions of Qemu sequentially, and hopping around, and could not get one past that 09 error. I have no regrets of jumping down the rabbit hole though, since I have learned heaps about DMA and qemu, and I have even started to look into Alex's code. Now, back to PilOS!!! Rob On Tue, Jul 21, 2015 at 7:18 PM, Joe Bogner joebog...@gmail.com wrote: Hi Rob, I'm using qemu-2.0.9.1 on win64 with pilos and it works fine I downloaded it from here: http://qemu.weilnetz.de/w64/qemu-w64-setup-20140715.exe Later versions, including qemu-w64-setup-20150503.exe did not run for me Hope that helps On Mon, Jul 20, 2015 at 6:10 AM, Robert Herman rpjher...@gmail.com wrote: I tried several, and when I finally tried version 2.2.90 for windows 64 bit, It went past that error and went to a 'READ ERROR 09' Is that a 09h Attempt to DMA over 64kb boundary using the same Wiki reference you supplied in a previous posting? How can I fix it or keep moving on? Where do I look in the source to troubleshoot this myself? Exciting fun anyhow, so no complaints here! Rob On Mon, Jul 20, 2015 at 1:32 PM, Alexander Burger a...@software-lab.de wrote: Hi Robert, First, I would like to donate some money anyway, seeing how much fun I have had with PicoLisp and PilOS. Thanks, that's very nice! But don't worry, that's not what I'm looking for. I need some stable, long-term project(s) ;) Second, I get a 'Guest has not initialized the display (yet).' when trying to run PilOS in qemu on my i5 Windows 8.1 64bit machine. Any steps I am missing? I am a qemu newbie, and PilOS newbie. I did a short search on the web, and it seems this error appears in qemu in other situations too. Not only on Windows, but also on other guest operating systems. I have no idea what might be the reason. PilOS simply uses the standard VIDEO memory (VGA) on hardware address 0xB8000. Can you try another version of qemu? ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjectUnsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: PilOS
Hi Rob, I'm using qemu-2.0.9.1 on win64 with pilos and it works fine I downloaded it from here: http://qemu.weilnetz.de/w64/qemu-w64-setup-20140715.exe Later versions, including qemu-w64-setup-20150503.exe did not run for me Hope that helps On Mon, Jul 20, 2015 at 6:10 AM, Robert Herman rpjher...@gmail.com wrote: I tried several, and when I finally tried version 2.2.90 for windows 64 bit, It went past that error and went to a 'READ ERROR 09' Is that a 09h Attempt to DMA over 64kb boundary using the same Wiki reference you supplied in a previous posting? How can I fix it or keep moving on? Where do I look in the source to troubleshoot this myself? Exciting fun anyhow, so no complaints here! Rob On Mon, Jul 20, 2015 at 1:32 PM, Alexander Burger a...@software-lab.de wrote: Hi Robert, First, I would like to donate some money anyway, seeing how much fun I have had with PicoLisp and PilOS. Thanks, that's very nice! But don't worry, that's not what I'm looking for. I need some stable, long-term project(s) ;) Second, I get a 'Guest has not initialized the display (yet).' when trying to run PilOS in qemu on my i5 Windows 8.1 64bit machine. Any steps I am missing? I am a qemu newbie, and PilOS newbie. I did a short search on the web, and it seems this error appears in qemu in other situations too. Not only on Windows, but also on other guest operating systems. I have no idea what might be the reason. PilOS simply uses the standard VIDEO memory (VGA) on hardware address 0xB8000. Can you try another version of qemu? ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: PilMCU is dead - Long live PilOS!
Alex, this is incredibly cool. It runs fine on win64 under qemu. This will be fun to play with. Are you considering adding networking support in the future? I imagine that would be quite difficult. On Fri, Jun 19, 2015 at 4:16 PM, Alexander Burger a...@software-lab.de wrote: Hi all, I'm happy to announce PilOS - The PicoLisp Operating System! It is a modification of the infamous PilMCU, which unfortunately doesn't seem to get off the ground. So in order not to have wasted all that effort, I decided to let it run on standard PC hardware, basically directly off the BIOS. In the future, we might think of utilizing it in embedded systems. I release it free to the public. It is currently just a toy project, which gave me lots of fun during the last two weeks. You can read more about it, watch a demo video, and download all at http://picolisp.com/wiki/?PilOS ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: PilMCU is dead - Long live PilOS!
I was so excited I didn't read close enough Also missing is - of course - networking (left as an exercise for the reader ;). On Fri, Jun 19, 2015 at 4:47 PM, Joe Bogner joebog...@gmail.com wrote: Alex, this is incredibly cool. It runs fine on win64 under qemu. This will be fun to play with. Are you considering adding networking support in the future? I imagine that would be quite difficult. On Fri, Jun 19, 2015 at 4:16 PM, Alexander Burger a...@software-lab.de wrote: Hi all, I'm happy to announce PilOS - The PicoLisp Operating System! It is a modification of the infamous PilMCU, which unfortunately doesn't seem to get off the ground. So in order not to have wasted all that effort, I decided to let it run on standard PC hardware, basically directly off the BIOS. In the future, we might think of utilizing it in embedded systems. I release it free to the public. It is currently just a toy project, which gave me lots of fun during the last two weeks. You can read more about it, watch a demo video, and download all at http://picolisp.com/wiki/?PilOS ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Static file server with Ersatz
Christophe, I wrote up an article a few years ago about creating a web app with ersatz and picoLisp: http://picolisp.com/wiki/?ersatzwebapp One of the subtle points of the article is that you need to modify the ersatz sources to remove the Static initialization of variables, otherwise it won't be thread safe. On Mon, Mar 16, 2015 at 3:51 AM, Christophe Gragnic christophegrag...@gmail.com wrote: Hi list, I'm investigating a way to be able to fire up a static file server like in Python: python -m http.server 8000 but with Ersatz. Has it been done ? If not, would it involve: 1) the use of the -server function in http.l 2) grab the path of the requested file 3) read the file and send it to the client 4) write a little file explorer when requesting a directory ? BTW, wouldn't it be more correct to say «Then the -server function is called» than «Then the server function is called» near the end of this section: http://software-lab.de/doc/app.html#server Thanks. -- http://profgra.org/lycee/ (site pro) http://delicious.com/profgraorg (liens, favoris) https://twitter.com/profgraorg http://microalg.info -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjectUnsubscribe
Re: PicoLisp roots
Hi Jerome, You might be interested in https://github.com/michelp/0pl as it's somewhat similar to what you are trying to accomplish. It's PicoLisp bindings for ZeroMQ It may give you some ideas on how to tackle the amqp port On Sun, Sep 21, 2014 at 12:32 PM, jerome moliere jer...@javaxpert.com wrote: Hi all, I do not intend to spam your mailing list , sorry if this question sounds stupid for many of you but I had a look to the PicoLisp language.I am not a Lisp expert but I can write Clojure code Emacs Lisp I'd like to know how far/close PicoLisp is from Common Lisp or other Lisp dialects. In fact I've seen that github hosts a Common Lisp AMQP client library and I'd like to estimate how much work I would need to port this library to PicoLisp. The project is hosted here : https://github.com/lisp/de.setf.amqp Thanks for precious help Kind regards -- JMOLIERE - Mentor/J
Re: Announce: PicoLisp in Hardware (PilMCU)
Hi Alex - congratulations... It's really inspiring to see picoLisp keep improving and branching out. It really has staying power This might be off base, but is it within the realm of possibility to run PilMCU on a raspberry pi now or in the future? That's an accessible piece of hardware that many people already have (myself included). These people may also be willing to fund the work My pi has been sitting powered off largely since I bought it. This could reinvigorate it. On Fri, Sep 19, 2014 at 9:05 AM, Alexander Burger a...@software-lab.de wrote: Hi Alabhya, Congratulations to both of you on this important feat! Thanks! Funds should flow in when picoLisp OS is seen running with all virtues, on existing hardware. Hmm, but this is a bit against the point, isn't it? This *is* a hardware project. On existing hardware you may be served better with a standard OS. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: try picolisp
Hi Mike, I would also be interested in minipicolisp running under Emscripten. In the meantime, have you seen Jon Kleiser's EmuLisp: http://folk.uio.no/jkleiser/pico/emuLisp/console.html ? On Thu, Aug 28, 2014 at 1:41 PM, Mike Pechkin mike.pech...@gmail.com wrote: hi, Is it hard to implement minimalist version of minipicolisp in browser ? Like http://tryclj.com/ ? Mike -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Implementation Education
Hi Alabhya, I would also suggest starting with miniPicoLisp.- http://software-lab.de/miniPicoLisp.tgz Check out the docs: http://picolisp.com/wiki/?Documentation Specifically, the reference: http://software-lab.de/doc/ref.html#vm You may need to read it over several times. I've probably read it 10+ times and learn something new after each reading. On Thu, Aug 7, 2014 at 5:59 AM, Henrik Sarvell hsarv...@gmail.com wrote: Perhaps not simpler but my thinking is that it's probably easier to find resources on C plus getting to know C better might have higher utility than assembly. On Thu, Aug 7, 2014 at 4:44 PM, Alabhya Singh alab...@yahoo.com wrote: Thanks Henrik. May be because pil32 and C are simpler than pil64 and assembly respectively. -- * From: * Henrik Sarvell hsarv...@gmail.com; * To: * picolisp@software-lab.de; * Subject: * Re: Implementation Education * Sent: * Thu, Aug 7, 2014 9:31:10 AM Hi Alabhya, if I were you I would learn enough C to understand the pil32 source and then go through it. On Thu, Aug 7, 2014 at 4:00 PM, Alabhya Singh alab...@yahoo.com wrote: To be able to use a language with utmost confidence one should be able to understand its implementation so much so as to be able to implement it and maintain it. This I am saying from my experience in maintaining my Porteus Linux system. PicoLisp matches Porteus in many ways, minimalist, easy to maintain, speed etc. PicoLisp philosophy of minimal orthogonal design makes it ideal for this down to bare metal approach. However I am just a novice lisp programmer who would love to invest significant effort into learning through using picoLisp. I shall be grateful if Alexander and/or other senior experienced people be kind enough to outline various components of implementing picoLisp. Such as: knowledge level of lisp, assembly and C (reference books, links etc). Kindly indicate steps to start learning how to implement and maintain picoLisp.
Re: Regarding the implementations of PicoLisp
On Mon, May 12, 2014 at 5:40 AM, Christophe Gragnic christophegrag...@gmail.com wrote: I'm interested by a clang compatible version, just to see what emscripten will make of it. For the sake of the experience I'm gonna try anyway. chri, I'm also interested in a emscripten compiled minPicoLisp. I've been itching to try out emscripten and I think having miniPicoLisp available on all platforms without building could help PicoLisp adoption. I was able to compile miniPicoLisp on windows under clang. I basically just replaced all instances of variable array initialization, such as: struct {any sym; any val;} bnd[length(x = car(expr))+3]; with //TODO struct {any sym; any val;} bnd[100]; It builds and runs. I don't see any obvious consequences yet. I would have assumed something like this would fail: (setq Z (make (for N 120 (link N I don't have emscripten geared up on this machine to try to compiling with it. I figure it's not that far off though as a proof of concept. Alex, is there a reasonably safe upper bounds that can be used instead of it being determined dynamically? (http://clang.llvm.org/compatibility.html#vla) 1. replace the variable length array with a fixed-size array if you can determine a reasonable upper bound at compile time; sometimes this is as simple as changing int size = ...; to const int size = ...; (if the initializer is a compile-time constant); I can envision a neat tool that lets us share snippets and even run code directly from rosettacode. GNU APL.js supports pasting code to it's emscripten compiled version of apl: http://baruchel.hd.free.fr/apps/apl/#code=5%205%20%E2%8D%B4%20%E2%8D%B310%0A
Re: Regarding the implementations of PicoLisp
Hi Alex, Thanks for the reply and the details. On Mon, May 12, 2014 at 9:56 AM, Alexander Burger a...@software-lab.dewrote: Alex, is there a reasonably safe upper bounds that can be used instead of it being determined dynamically? Hmm, what is safe? In any case you use the generality of the language, the Unlimited design objective of PicoLisp. You can never be sure that you don't exceed one of these fixed sizes. The Unlimited design of PicoLisp is incredibly powerful. To clarify, I was seeking some guidance on a reasonable upper limit on variable length arrays that doesn't significantly handicap the language for demoing in an emscripten environment. The proper solution is likely to use malloc/free but that would introduce additional effort/complexity that might be unnecessary for a proof of concept. I sometimes prefer hacking a small change just to see if it's possible before letting myself go down a rabbit hole. It sounds like the reasonable upper limit might depend on the function. I think I may have changed approximately 8 places that use the sym/val structure. I'll take a closer look. I was hopeful that there might have been a quick answer that will work the vast majority of use cases with little or no impact on run time and memory.
Re: Regarding the implementations of PicoLisp
I added my changes to this repo: https://github.com/joebo/miniPicoLisp This commit has everything needed to build on clang on windows: https://github.com/joebo/miniPicoLisp/commit/e34b052bc9c8bd8fa813833294a5830a69ffb56e I'm using: C:\Users\jbogner\Downloads\miniPicoLisp\srcclang -v clang version 3.4 (198054) Target: i686-pc-mingw32 Thread model: posix Selected GCC installation: And my make came from http://sourceforge.net/projects/win-bash/ I am happy to answer any questions/help further On Mon, May 12, 2014 at 11:50 AM, Christophe Gragnic christophegrag...@gmail.com wrote: On Mon, May 12, 2014 at 2:16 PM, Joe Bogner joebog...@gmail.com wrote: I was able to compile miniPicoLisp on windows under clang. I basically just replaced all instances of variable array initialization, such as: struct {any sym; any val;} bnd[length(x = car(expr))+3]; with //TODO struct {any sym; any val;} bnd[100]; It builds and runs. I didn't have this luck. I just set up a repository on github (Alex being OK) and reported my issue here: https://github.com/Grahack/minipicolisp/issues/1 Could you show me your source files? Could you try with my source files? Or tell me the differences? Would it be easy for you to be granted commit access? On Mon, May 12, 2014 at 4:31 PM, Joe Bogner joebog...@gmail.com wrote: […] The proper solution is likely to use malloc/free but that would introduce additional effort/complexity that might be unnecessary for a proof of concept. I sometimes prefer hacking a small change just to see if it's possible before letting myself go down a rabbit hole. The same for me. My goal being beyond the proof of concept, but not very far though. chri -- http://profgra.org/lycee/ (site pro) http://delicious.com/profgraorg (liens, favoris) https://twitter.com/profgraorg -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjectUnsubscribe
Re: Regarding the implementations of PicoLisp
On Mon, May 12, 2014 at 11:50 AM, Christophe Gragnic christophegrag...@gmail.com wrote: I just set up a repository on github (Alex being OK) and reported my issue here: https://github.com/Grahack/minipicolisp/issues/1 I think the main difference is your Makefile https://github.com/Grahack/minipicolisp/commit/15a72e16b097336c3a1d3b4092f3656509183308 Instead of: clang $*.c I'm doing this: $(CC) -w -c $*.c The -w suppresses warnings and then linking with: c:/Progra~2/LLVM/bin/clang.exe -o picolisp $(picoFiles:.c=.o)
Re: Regarding the implementations of PicoLisp
Hi Rick, Christophe, I was thinking the same thing. miniPicolisp might be a simpler first step to port On Fri, May 9, 2014 at 7:51 AM, Rick Lyman lyman.r...@gmail.com wrote: Christophe, How about porting the c version using: https://github.com/kripken/emscripten? -rl On Thu, May 8, 2014 at 5:08 PM, Christophe Gragnic christophegrag...@gmail.com wrote: Hi, I'm currently embedding a «pedagogical pseudo-code like language» in PicoLisp. As using plain browsers is a nice thing to have in front of students, I tried with EmuLisp (PicoLisp in JS, by Jon Kleiser, that I won't thank enough, with Alex), which proved to be a good solution for me. So I had some thoughts, ideas and questions. 1) EmuLisp lacks some functions. The first idea I had was to write them in the available functions (like 'glue' with 'pack'). It worked for some, but some others needed to be implemented in JS. Now my question: how far could be pushed the idea to write a maximal subset of Picolisp in a minimal subset of Picolisp? Like in the original paper of McCarthy or «the Jewel» in SICP? I'm not talking about performance here, just functions availability. 2) Since PicoLisp64 is written in a «generic assembly» embedded in PicoLisp, I was wondering (only wondering, since the concepts are a bit vague for me) if instead of building the .s files we could build some http://asmjs.org/file(s). 3) Regarding EmuLisp again, and for your information, I've created (and am using seriously!) a JS pil, that I named `piljs` which runs on node
Re: Regarding the implementations of PicoLisp
It works in chrome too and IE10 too Check out: http://pypyjs.org/demo/ On Fri, May 9, 2014 at 10:21 AM, Rick Lyman lyman.r...@gmail.com wrote: Joe, Christophe, A downside to asm.js is that it is Firefox only... http://www.infoworld.com/t/javascript/apple-has-its-own-javascript-accelerator-in-the-works-242042 -rl p.s.: anyone considering c directly via Chrome/NaCL? On Fri, May 9, 2014 at 8:19 AM, Joe Bogner joebog...@gmail.com wrote: Hi Rick, Christophe, I was thinking the same thing. miniPicolisp might be a simpler first step to port On Fri, May 9, 2014 at 7:51 AM, Rick Lyman lyman.r...@gmail.comlymanr...@gmail.com wrote: Christophe, How about porting the c version using: https://github.com/kripken/emscripten? -rl On Thu, May 8, 2014 at 5:08 PM, Christophe Gragnic christophegrag...@gmail.com wrote: Hi, I'm currently embedding a «pedagogical pseudo-code like language» in PicoLisp. As using plain browsers is a nice thing to have in front of students, I tried with EmuLisp (PicoLisp in JS, by Jon Kleiser, that I won't thank enough, with Alex), which proved to be a good solution for me. So I had some thoughts, ideas and questions. 1) EmuLisp lacks some functions. The first idea I had was to write them in the available functions (like 'glue' with 'pack'). It worked for some, but some others needed to be implemented in JS. Now my question: how far could be pushed the idea to write a maximal subset of Picolisp in a minimal subset of Picolisp? Like in the original paper of McCarthy or «the Jewel» in SICP? I'm not talking about performance here, just functions availability. 2) Since PicoLisp64 is written in a «generic assembly» embedded in PicoLisp, I was wondering (only wondering, since the concepts are a bit vague for me) if instead of building the .s files we could build some http://asmjs.org/file(s). 3) Regarding EmuLisp again, and for your information, I've created (and am using seriously!) a JS pil, that I named `piljs` which runs on node
Re: Regarding the implementations of PicoLisp
I bet it's the same problem as this: https://www.mail-archive.com/picolisp@software-lab.de/msg04411.html emscripten uses clang, right? On Fri, May 9, 2014 at 1:59 PM, Rick Lyman lyman.r...@gmail.com wrote: just a note: Downloaded miniPicoLisp. Building under Linux/gcc ok Downloaded Emscripten (for Windows) Using c files (from Linux re: above) I tried: emcc -O2 flow.c -o flow.bc below are a few of the errors generated: flow.c:41:62: warning: '' within '||' [-Wlogical-op-parentheses] if (isNum(x = EVAL(x)) || isNil(x) || x == T || isCell(x) isNum(car(x))) ~~ ~~^~~~ flow.c:41:62: note: place parentheses around the '' expression to silence this warning if (isNum(x = EVAL(x)) || isNil(x) || x == T || isCell(x) isNum(car(x))) ~~^~~~ flow.c:60:37: error: fields must have a constant size: 'variable length array in structure' extension will never be supported struct {any sym; any val;} bnd[length(x)]; ^ flow.c:77:18: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] } while (p = p-link); ~~^ ... On Fri, May 9, 2014 at 11:20 AM, Rick Lyman lyman.r...@gmail.com wrote: re: http://pypyjs.org/demo/ Success: Chrome: 34 Internet Explorer: 11 Failure: Safari: 5 On Fri, May 9, 2014 at 10:50 AM, Joe Bogner joebog...@gmail.com wrote: It works in chrome too and IE10 too Check out: http://pypyjs.org/demo/ On Fri, May 9, 2014 at 10:21 AM, Rick Lyman lyman.r...@gmail.comwrote: Joe, Christophe, A downside to asm.js is that it is Firefox only... http://www.infoworld.com/t/javascript/apple-has-its-own-javascript-accelerator-in-the-works-242042 -rl p.s.: anyone considering c directly via Chrome/NaCL? On Fri, May 9, 2014 at 8:19 AM, Joe Bogner joebog...@gmail.com wrote: Hi Rick, Christophe, I was thinking the same thing. miniPicolisp might be a simpler first step to port On Fri, May 9, 2014 at 7:51 AM, Rick Lyman lyman.r...@gmail.comlymanr...@gmail.com wrote: Christophe, How about porting the c version using: https://github.com/kripken/emscripten? -rl On Thu, May 8, 2014 at 5:08 PM, Christophe Gragnic christophegrag...@gmail.com wrote: Hi, I'm currently embedding a «pedagogical pseudo-code like language» in PicoLisp. As using plain browsers is a nice thing to have in front of students, I tried with EmuLisp (PicoLisp in JS, by Jon Kleiser, that I won't thank enough, with Alex), which proved to be a good solution for me. So I had some thoughts, ideas and questions. 1) EmuLisp lacks some functions. The first idea I had was to write them in the available functions (like 'glue' with 'pack'). It worked for some, but some others needed to be implemented in JS. Now my question: how far could be pushed the idea to write a maximal subset of Picolisp in a minimal subset of Picolisp? Like in the original paper of McCarthy or «the Jewel» in SICP? I'm not talking about performance here, just functions availability. 2) Since PicoLisp64 is written in a «generic assembly» embedded in PicoLisp, I was wondering (only wondering, since the concepts are a bit vague for me) if instead of building the .s files we could build some http://asmjs.org/ file(s). 3) Regarding EmuLisp again, and for your information, I've created (and am using seriously!) a JS pil, that I named `piljs` which runs on node
Re: Using OpenStreetMap Geo-Data with PicoLisp
Hi Alex, I look forward to reading the article. To load the videos only when needed, you could take a screenshot of video and use that as the image on the page. You could have a javascript click event that replaces the image HTML with the video tag. That's the first idea that came to mind. I don't know if javascript is an option On Tue, May 6, 2014 at 2:17 PM, Alexander Burger a...@software-lab.dewrote: Hi all, after a lot of procrastination, I crunched out today an article about PicoLisp canvas programming, and the handling of geographic data from the OpenStreetMap project: http://picolisp.com/wiki/?osmGeoData I incorporated some short video sequences for better illustration. Perhaps this was not a good idea, as the picolisp.com server doesn't have a good upstream connection. There are in total four videos embedded in the document, and it seems that whenever the page is opened or refreshed, all those videos get reloaded. Any ideas? Is there some other way, i.e. having the videos loaded only when really needed? Anyway, I hope the article is useful :) ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Would a logging framework make sense for PicoLisp
I like the idea of something simple and possibly built-in. However, would it be possible to implement as a function that wraps definitions with a redef and adds the logging? http://software-lab.de/doc/refR.html#redef On Tue, Feb 25, 2014 at 9:20 AM, Henrik Sarvell hsarv...@gmail.com wrote: Sometimes it's also nice to be able to get everything in a file, not just printed, would be nice if it could have that option. On Tue, Feb 25, 2014 at 6:50 PM, Thorsten Jolitz tjol...@gmail.com wrote: Hi List, sometimes I start putting a lot of (maybe too many) 'msg calls in my code for debugging purposes, what then triggers memories of logging frameworks for Java I once read about. Would it make sense to add such a logging framework to the language as a kind of third debugging tool (besides trace and debug)? I was thinking about something along the line of - a new global variable *Log - two new functions 'log and 'unlog - an equivalent to ! as debugging breakpoint (e.g. § or whatever as logging point) *Log would then be NIL or one of several logging levels (e.g. 1,2,3). (log func) would then put § before all expressions of a function, (unlog func) remove them. Depending on the logging level, § would do nothing or, e.g., print the expression and the results of what (e) and (d) do during debugging, and maybe all variables with their actual values in that expression. What do you think? -- cheers, Thorsten -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjectUnsubscribe
Re: Creation stamp
Hey Alex - On Mon, Feb 10, 2014 at 9:31 AM, Alexander Burger a...@software-lab.dewrote: Also, you can save quite some time if you pre-allocate memory, to avoid an increase with each garbage collection. I would call (gc 800) in the beginning, to allocate 800 MB, and (gc 0) in the end. Thanks for the reminder about gc I remember you mentioning it over a year ago: https://www.mail-archive.com/picolisp@software-lab.de/msg03308.html. I added the gc and completed 30 days of import in two minutes. I also switched to my i7 (under cygwin too) vs my xen virtual host. It ended up using 2.7 gig of disk so I had to stop it. Again, I'm reminded and impressed with the speed. Thanks Joe
Re: Pre-compiled picolisp for CentOS, Cygwin, OSX
Thanks Keith. The cygwin one is helpful. The last time I compiled it is a few years ago and haven't reconfigured cygwin on this machine to build On Fri, Nov 1, 2013 at 10:20 AM, Keith Kim keith...@gmail.com wrote: Hello, I've uploaded pre-compiled picolisp for CentOS6 (32 and 64bit), OSX and Cygwin: http://blog.keithkim.com/2013/11/pre-compiled-picolisp-for-centos-and.html Well, it's very easy and no trouble compiling them for anyone, but just for convenience. BR, Keith Kim -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
PicoLisp parsing example
Hello, In the interest of sharing PicoLisp related content, I recently wrote up a solution[1] to a problem[2] posted in a J forum. https://gist.github.com/joebo/6813083 I also ended up creating a J solution too[3] The PicoLisp solution was a joy to write and actually turned out to be a bit longer than I anticipated. I wanted a nice balance between clarity and being concise. Cheers, Joe [1] http://jsoftware.com/pipermail/chat/2013-October/005372.html [2] http://jsoftware.com/pipermail/chat/2013-October/005363.html [3] http://jsoftware.com/pipermail/chat/2013-October/005383.html
Re: Some initial questions
Hi Luis, I've built a proof of concept PicoLisp apk and ran it on a Droid X and my kindle fire. I wrote about it here: http://www.mail-archive.com/picolisp@software-lab.de/msg03114.html I was able to build the entire apk using terminal ide on my android (no android SDK). I'm happy to answer any questions about it. I didn't take it any farther than this. I don't know if it would pass Play Store policy or not. Joe On Thu, Sep 26, 2013 at 7:15 PM, Luis P. Mendes luisl...@gmail.com wrote: Thank you all for your messages! Henrik: It's good to know that database speed is compared to major RDBMs. PicoLisp having an integrated database is a big plus for the language. Alex: Thank you for providing the community such a powerful language that for sure has many many hours of hard work. As you say, the ones that come to PicoLisp are the ones who do the effort to find a programming language. As everything else in life, either people are satisfied with propaganda that others try to push, or people choose to find their own ways. I'm glad I'm between people who have the latter attitude. Enough of philosophy, I'll just ask you something more, since my searches in google were not conclusive. I've seen this: http://picolisp.com/5000/!wiki?AndroidWebServer and http://www.mail-archive.com/picolisp@software-lab.de/msg03081.html [-] Will .apk android applications be supported by PicoLisp in the future? Olaf: Nice to hear that you're also starting with PicoLisp. As recommended in the PicoLisp Reference, I'll start reading the book Lisp by Winston/Horn. Thorsten and Joe: Thank you for the links! Now it's time to start learning! Luis -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Some initial questions
I remember finding this reference very helpful as well: http://pleac.sourceforge.net/pleac_picolisp/index.html These quick guides have been cropping up lately on my news feeds - http://learnxinyminutes.com/ . Is anyone interested in doing one for PicoLisp? It's been on my maybe-someday list for awhile. Here is common lisp and elisp versions: http://learnxinyminutes.com/docs/common-lisp/ http://learnxinyminutes.com/docs/elisp/ On Wed, Sep 25, 2013 at 8:45 AM, Thorsten Jolitz tjol...@gmail.com wrote: O.Hamann o.ham...@gmx.net writes: Hi, There is not much help found by searching google (stackoverflow and similar) for best practices or 'oneliner' But there is ,--- | http://de.scribd.com/doc/103733857/PicoLisp-by-Example `--- easily searchable online with 'C-f', i.e. in total some 700 or so PicoLisp solutions for a wide range of Computer Science problems, all written by the master (Alex ;) himself. I don't think many non-mainstream languages offer such a huge pool of examples written on expert level and easily searchable online or in a local pdf. And of course there is ,-- | http://de.scribd.com/doc/103732688/PicoLisp-Works `-- too, another easy to search ressource with almost all documents written about PicoLisp until 2012. Have fun ... -- cheers, Thorsten -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Great canvas article and demo
Tomas, That is interesting! I was playing around with your demo and ran a little bookmarklet that would refresh the stepped version automatically. I first included jquery through a bookmarklet. Then, I pasted this into my javascript console window: var refresh = function(location) { $.get(location, function(x) { var $html = $(x); var url = $html.find('a:contains(step)').attr(href); console.log(url); var svg = $html.find('svg'); $('svg').replaceWith(svg.get(0)); setTimeout(function() { refresh(url) }, 500) }) } refresh($('a:contains(step)').attr(href)); I think this appears more seamless (like the iframe approach) instead of doing a full page refresh. It looks like Alex's approach is about 15x lighter on the wire. I ran fiddler and it looks like it transmits upwards of 639 bytes for a full chart whereas the svg is around 9500 bytes. Still, it's an neat alternative! On Sun, Sep 15, 2013 at 12:51 PM, Tomas Hlavaty t...@logand.com wrote: Hi Alex, as a proof of concept, I have implemented your zapper demo using svg and without any javascript, see http://logand.com:2234/ Tomas Hlavaty t...@logand.com writes: Another way of achieving the same result without any need for javascript would be using SVG. It works very well across browsers nowadays. Canvas could be an iframe with a refresh rate if required and SVG could be inlined in the HTML, generated in a similar way as the usual PicoLisp generated HTML. As an added bonus, SVG could contain links which could trigger picolisp actions without the need for calculating positions on server side (because the browser would do this work for us), should the users wish to inspect a point in the demo graph. 1) It uses svg instead of canvas, meaning that: - There is no javascript required for drawing stuff. The same approach to generating html can be used to generate svg. - It's easy to define parts of the picture to be clickable, so if you click on a point in the graph, the text clicked will be updated with the y axis value, as an example. Also it displays a buuble if you leave cursor above a point. - svg used to be slow, broken and non-portable across browsers a few years ago but these days, it's rather good for many use-cases. There are still some things broken on some browsers, but it's getting steadily better. - Graphics transformation can be easily specified in svg, so there is no need to do complicated coordinate calculations. e.g. g transform=translate(0 300) scale(1 -1) translate(0.5 150.5) changes the orientation and origin of the coordinate system, and also moves the centres of lines a bit so that 1px lines are sharp (which is what you discussed with Jon I guess, and which your example doesn't do for the horizontal axis I think). 2) The example doesn't use any javascript meaning that the maximum refresh speed is 1s. This is good enough for many use-cases. If not, a bit of javascript can be added in a similar way like the current picolisp refresh is implemented. As you mentioned, something like the +Auto class. If the automatic refresh is not desirable for the whole page, the whole svg graph could be put into an iframe which would refresh, but the surounding html would stay. But it's not critical for this demo. 3) Bug: If you click too fast or at the same time as refresh happens, the browser and session can get out of sync and it will stop reacting to click, unfortunately. I have to figure out why. If that happens, simply open the link again, or just discard the s query parameter. Generally I find svg much better than using canvas, which is too low level. In picolisp, one could write similar functions like for html, or use the 'xml' function to generate arbitrary svg. Enjoy:-) Tomas -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Ext library and file name indexer
Hi Henrik Thanks for sharing. I have a few picolisp repos on bitbucket too. https://bitbucket.org/joebo Includes my orgmode parser, mustache template implementation, and blog. All have been running flawlessly for 8 continuous months. I have read Alex's comments on the stability of picolisp over the years. It is neat to experience it myself - especially since I am no expert at the language. Joe Anything newer than Subversion is pretty much equal in my book, that includes both darcs, hg and git. They're all so simple that it doesn't make sense spending time shopping in that area once you've settled for one of them, at least not for my use case. I use hg at work so I use bitbucket, it's as simple as that. Would not dream of learning yet another vcs when hg just works for me. On Sat, Aug 31, 2013 at 7:52 PM, Tamas Herman hermanta...@gmail.com wrote: henrik, there is http://hub.darcs.net/ with no limitations whatsoever on anything. darcs is a lot more logical version control system. it's a lot easier to remember it's options. it's interactive by default. avoids tons of merge conflicts automatically. it doesn't try to invent branching/forking, since every clone of a repo IS A branch or fork naturally. it's is very easy to install, since it's just 1 static exe on any platform. for such small sources what picolisp has, it's an overkill to use anything else... it's really the kind of tool which doesn't get in the way, unlike git. you can see tons of pull requests are talking about git, instead of the patch itself. people are struggling with it for years and years now... i admire how much simplicity could you showcase with picolisp; it's makes me feel bad if you let such dirt as git or hg touch its source ;) -- tom -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Bitmessage Mailing List for PicoLisp
Got it! Thanks. I'm trying it out for the first time On Thu, Aug 29, 2013 at 10:02 AM, Alexander Burger a...@software-lab.dewrote: Hi Joe, Do we also need the chan name? I tried PicoLisp I didn't create a chan (Decentralized Mailing List), as this involves possible spam issues. Just a plain mailing list as described in https://bitmessage.org/wiki/Mailing_List As I understand it, you can simply send messages to the given address. I tried joining and the Bitmessage client says Although the Bitmessage address you entered was valid, it doesn't match the chan name. I think you can simply add the address to the Subscriptions tab in the client. Then you should receive all posted messages as broadcasts. ♪♫ -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: SEXP?
Hi Thorsten, I've used fun? to determine if an argument had the proper form of something that was executable or if it was data. It may not work in all cases, but it was sufficient for my use case. As Alex mentioned, it won't let you know whether it's actually executable or not. I think of it as having the potential to be executable. Joe On Mon, Jul 1, 2013 at 4:50 AM, Thorsten Jolitz tjol...@gmail.com wrote: dexen deVries dexen.devr...@gmail.com writes: On Monday 01 of July 2013 07:39:49 you wrote: Hi Thorsten, I wonder if there is a way in PicoLisp to check if some function argument is a SEXP, i.e. if something like a function 'sexp? exists that returns T if the argument is a SEXP. how about (pair 'any) ? basically the opposite of (atom 'any) thats probably what I was looking for, thanks, besides the fact that Alex is of course right about the difficulties with doing these kind of tests in a dynamic environment. -- cheers, Thorsten -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
picolisp org-mode blog
Hello all - Over the holiday I made some progress on the org-mode parser and rolled it into a blog engine. It's still very much a work in progress yet wanted to share it with the group for some early feedback. The cosmetics of the blog are last on my list. https://bitbucket.org/joebo/picoblogorg It still has a fair amount of debug code and cleanup left so it's not really ready yet for primetime. I figure it may be a useful example for someone wanting to build a picolisp web app using an alternative to the gui framework. A real app would likely also use the picolisp DB which I haven't needed to do in this app. I switched over my site to use it and am going to continue to post some updates as I go: http://csilo.com Cheers, Joe
Re: org mode parser
Alex - thank you as always for the code suggestions! Thorsten - I just added PROPERTIES parsing and preliminary tag parsing and now we're at 90 lines. I think it will take a bit more to get to 5000 ;) On Sat, Dec 15, 2012 at 9:01 AM, Thorsten Jolitz tjol...@googlemail.comwrote: Alexander Burger a...@software-lab.de writes: Hi Joe, https://bitbucket.org/joebo/pico-org/src Thanks for sharing! Thorsten will be delighted too ;-) Indead, delighted and surprised, I just talked about an Org-mode parser with Alex yesterday and recently had a look at the official Org-mode parser in Emacs Lisp (org-element.el) that is almost 5000 lines of code in contrast to your 50 lines ;) I think the combination of Org-mode and PicoLisp is quite interesting. -- cheers, Thorsten -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
org mode parser
Hello all, I've written a tiny org-mode parser and hooked it up with my mustache implementation to create a simple web page that dumps out the org structure. I'm not sure where I'm going to go next but figured I'd share it since I enjoy reading other's code as well. I'm amazed at what can be done in 42 lines of picolisp :-) (looking at org.l) https://bitbucket.org/joebo/pico-org/src I have it running with a random org mode file I found at http://csilo.com/org/ By the way - I like the new ref page look feel ( http://software-lab.de/doc/ref.html). The sort alphabetically is also handy. Joe
Re: New Emacs-style command-line editor
Hi Alex, Are the arrow keys usable on the phone? Both the vi- and the emacs-style command line in PicoLisp now also support arrow keys for navigating the history. Yes, they work great. One less keypress. Great! Thorsten, Alex - Would it be possible to add hooks to the emacs line editor? I came up with a rough patch to demonstrate what I mean. I wanted to minimize the number of changes to eled but had some problems due to needing to reference the transient symbols. Also, I'm still pretty basic when it comes to my understanding on the best way to do things. In any case: Change #1 - lib/eled.l add a hook to the front of the insMode case list (de insMode (C) (if (= C ^I) ... (case C ~(car (list *EmacsKeyHook)) (^? Change #2 - lib/eled.l add a method to wrap the transients and invoke a block (de EmacsHook Prg (let (_Line Line _chgLine chgLine) (eval (car Prg ))) ) From these two changes, I can inject my own functions such as this one to automatically close parens Let's say I have an init.l (de closeParens (Line) (let (Open (length (sect Line (list ( ))) Close (length (sect Line (list ) (make (for X Line (link X)) (for X (- Open Close) (link )) (setq *EmacsKeyHook '((^y (EmacsHook (let L (closeParens _Line) (_chgLine L (length L))) I can then run: /pil init.l -em + : '(a (b (c Ctrl-Y and have it automatically close my open parens I'm sure there's other ways to do this but wanted to share the concept Thanks again for the new feature Joe
Re: New Emacs-style command-line editor
Thanks Thorsten! I will give it a shot. This gives me a reason to try emacs again for picolisp. I installed everything the other day and then switched back to vi and vi mode in the repl after getting frustrated with not knowing how to cycle through my command history in inferior-picolisp. I am so used to esc k j After some googling tonight I found how to cycle using - M-p (comint-previous-input) Select the previous command in the input history. - M-n (comint-next-input) Select the next command in the input history. It might be nice to add this and any other tricks to your emacs style page. By the way, if no one has tried it yet, ConqueTerm makes a nice alternative to inferior-lisp when using vim. I typically run it in a split. I've found the paren matching to be somewhat slow when it copies in the text so sometimes I'll just skip ConqueTerm altogether and map a key to run pil on the file I'm working on. On Thu, Nov 29, 2012 at 5:27 PM, Thorsten Jolitz tjol...@googlemail.comwrote: Hi List, I just posted a reference article on the wiki (http://picolisp.com/5000/!wiki?emacsstyleled) that explains how to activate and use the new Emacs-style command-line editor developed by me (with some help from Alex). You can try it out with the new testing version 3.1.0.15 available on the download page. Feedback is welcome. The goal is that Emacs users feel right at home at the PicoLisp command-line - that its possible to switch between the REPL and Emacs almost without being aware of changing the application (like switching between Emacs and Conkeror). There is still some functionality to add, but it works already quite good, I use it all the time now. I would be highly appreciated if Emacs users could test it and report bugs. -- cheers, Thorsten -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: New Emacs-style command-line editor
Thorsten - Thanks for the reply. I tried it and it works great - just as expected. It works very well on my phone too which had some trouble with the terminal program switching in and out of vi mode due to the poor handling of Esc. I will definitely be using this On Thu, Nov 29, 2012 at 10:15 PM, Thorsten Jolitz tjol...@googlemail.comwrote: Joe Bogner joebog...@gmail.com writes: Hi Joe, I will give it a shot. This gives me a reason to try emacs again for picolisp. I installed everything the other day and then switched back to vi and vi mode in the repl after getting frustrated with not knowing how to cycle through my command history in inferior-picolisp. I am so used to esc k j there is something superior to inferior-picolisp out there: Tomas Hlavaty's slime/swank mode for PicoLisp. He recently posted the link to his git-repo on the mailing list. Thats a top point on my agenda to make that mode work for me and replace inferior-picolisp. I will have to look into that further. Thanks for the suggestion However, I found it very frustrating to be totally lost on the PicoLisp command-line (since I don't know nothing about vi). And I do think that the PicoLisp philosophy (live in the command-line, open an editor on demand) does have its merits sometimes. Therefore I wrote the Emacs-style editor. Its still alpha, but now I can use the PicoLisp line editor in a 'natural way' (for an Emacs user), just like I use the Bash command-line in Emacs mode without thinking. I have spent the last year learning emacs and what I've found is (my personal experience, not a flame war) that emacs can be more efficient and natural when creating new content - either code or text. Vim is more efficient for me when changing large amounts of code or refactoring. That may come with time in emacs. After some googling tonight I found how to cycle using * M-p (comint-previous-input) Select the previous command in the input history. * M-n (comint-next-input) Select the next command in the input history. It might be nice to add this and any other tricks to your emacs style page. Thats already implemented, but I used C-p and C-n instead of M-p and M-n since there is only only line in the REPL and and C-p and C-n can't server as line-up and line-down in a buffer. However, I could change that anytime. Works like a charm On Thu, Nov 29, 2012 at 5:27 PM, Thorsten Jolitz tjolitz@googlemailcom wrote: Hi List, I just posted a reference article on the wiki (http://picolisp.com/5000/!wiki?emacsstyleled) that explains how to activate and use the new Emacs-style command-line editor developed by me (with some help from Alex). You can try it out with the new testing version 3.1.0.15 available on the download page. Feedback is welcome. The goal is that Emacs users feel right at home at the PicoLisp command-line - that its possible to switch between the REPL and Emacs almost without being aware of changing the application (like switching between Emacs and Conkeror). There is still some functionality to add, but it works already quite good, I use it all the time now. I would be highly appreciated if Emacs users could test it and report bugs. -- cheers, Thorsten -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- cheers, Thorsten -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: making in a loop - or an sequentially building a nested list
Here's a naive implementation: (de list-make (Lst) (queue Lst ()) (de list-link (Lst Node) (queue Lst Node) (queue Lst )) (de list-close (Lst) (queue Lst ))) (de list-close-all (Lst) (let (Open (length (sect (val Lst) (list ( ))) Close (length (sect (val Lst) (list ) (for X (- Open Close) (queue Lst (car (str (pack (val Lst) (setq L NIL) (list-make 'L) (list-make 'L) (list-link 'L 'parent) (list-make 'L) (list-link 'L 'child) (list-link 'L 'child) (list-close-all 'L) - ((parent (child child))) I don't know how I feel about it... On Mon, Nov 26, 2012 at 1:11 PM, Joe Bogner joebog...@gmail.com wrote: I'm sure I'm making this harder than it is. I spent several hours tinkering around trying to find a way to sequentially build a nested list. make and link have spoiled me. Instead of this: : (make (link (make (link 'parent (make (link 'child 'child)) - ((parent (child child))) or : (list (list 'parent (list 'child 'child - ((parent (child child))) I would like to do (setq L NIL) (list-make 'L) (list-make 'L) (list-link 'L 'parent) (list-make 'L) (list-link 'L 'child) (list-link 'L 'child) Or something along those lines. The reason for the question is that I find myself building things in for loops and it seems like I would need to use some form of recursion to build it with make or list. I've had some success with push and queue but was wondering if there's a more elegant way.
pilog - using range
I'm having trouble figuring out how to use range in a simple pilog example. I can use member: (be add1-or-double (@X @Num) (member @X (1 2 3 4)) (@Ans + 1 (- @X)) (@Ans2 * 2 (- @X)) (or ((equal @Num @Ans)) ((equal @Num @Ans2 (? (add1-or-double @X 4)) @X=2 @X=3: If I try this: (be add1-or-double (@X @Num) # (member @X (1 2 3 4)) (@X range 1 100) (@Ans + 1 (- @X)) (@Ans2 * 2 (- @X)) (or ((equal @Num @Ans)) ((equal @Num @Ans2 (? (add1-or-double @X 100)) (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100) -- Number expected I've tried using (car (- @X)) and that didn't work either... I suspect I am approaching this wrong. I will gladly accept feedback that points to a different direction to take Thanks! Joe
Re: A few quick emu/pil timings
I ran a similar test the other day. Here are my timings with (fibo 33) and (cFibo 33) I'm including cFibo (since I can now run it on emu64) and ersatz. emu64: 21.632 sec emu64/cFibo: 0.111 sec pil32: 4.477 sec ersatz: 12.797 sec On Tue, Nov 6, 2012 at 11:04 AM, Alexander Burger a...@software-lab.dewrote: Hi Jon, I installed the latest ongoing (v3.1.0.12) on my iMac, and compared the timing results of (bench (fibo 33)). Not too useful, I was just curious. ;-) Yeah, interesting :) pil32: 0.804 sec emu64: 10.032 sec My EmuLisp in Safari: 5.82 sec My EmuLisp in Chrome: 8.102 sec My EmuLisp in Chromium: 8.261 sec The fibo used in all cases was this: (de fibo (N) (if (= 2 N) 1 (+ (fibo (dec N)) (fibo (- N 2) And the returned value was 3524578. ;-) If I try this on an x86-64 machine having all of them installed (pil32, pil64 and emu64), I get: pil32: 0.89 sec pil64: 0.42 sec emu64: 12.3 sec All quite similar (with the same result, 3524578). I did also tests with the chess program, getting similar relations. You can let play it against itself, with e.g.: $ time ./pil games/chess.l -main -'do 12 (msg (go))' -bye A database stress, however, running 40 concurrent processes hammering data into the database, showed a drop in speed for emu of only a factor of three. Here the bottleneck is in file I/O, locking etc. Cheers, - Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: pil64emu testing features
Hi Alex, pil64emu sounds very interesting. In case it helps, here is some output from running pil64emu joebo@joebo:~/tmp/picolisp$ ./pil + : *CPU - emu : (load misc/fibo.l) /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.5/libgcc.a when searching for -lgcc /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.5/libgcc.a when searching for -lgcc /usr/bin/ld: cannot find -lgcc collect2: ld returned 1 exit status - NIL : Here is my uname output: Linux 2.6.32-5-686-bigmem #1 SMP Wed Jan 12 04:40:25 UTC 2011 i686 GNU/Linux I'm running Debian 6.0 I tried some very basic picolisp operations and they worked fine. I haven't done any native work since I had been running 32bit and so I don't know if there's something broken on my install or if it's an issue with pil64emu. In any case, I wanted to share my findings. Thank you ! Joe On Fri, Nov 2, 2012 at 3:47 PM, Jon Kleiser jon.klei...@usit.uio.no wrote: Hi Alex, On Fri, Nov 02, 2012 at 05:38:40PM +0100, Alexander Burger wrote: For some reason, fcntl() doesn't work. It workes on pil32, I believe. Perhaps found the reason. I've changed the calling pattern of fcntl(). Please try once more. Cheers, - Alex At least something has changed during the make: MacBook-Air:picoLispEmu jkleiser$ (cd src64; make) emu.base.c: In function ‘run’: emu.base.c:42115: warning: format not a string literal and no format arguments emu.base.c:42170: warning: format not a string literal and no format arguments MacBook-Air:picoLispEmu jkleiser$ ./pil + [/Users/jkleiser/.pil/history:1] File lock: Invalid argument ? : (== 64 64) - T : *CPU - emu : (load misc/fibo.l) [misc/fibo.l:40] !? (here /**/) here -- Undefined ? : (bye) MacBook-Air:picoLispEmu jkleiser$ ./bin/picolisp : (load misc/fibo.l) [lib/native.l:31] !? (** 2 32) ** -- Undefined ? : (bye) MacBook-Air:picoLispEmu jkleiser$ ./bin/picolisp misc/fibo.l [misc/fibo.l:38] !? (load @lib/native.l) @lib/native.l -- Open error: No such file or directory ? : (bye) /Jon -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Android Demo
Hi Thorsten, Thanks for asking. I haven't done any work on the topic since I last posted about it. I haven't built any real apps using PicoLisp on Android. On the other hand, I haven't built any real apps for Android using any technology, so it's more a matter of not having a need vs it being the wrong choice. For those who are curious, here is the last wiki article about it: http://picolisp.com/5000/!wiki?AndroidWebServer I'd be interested in hearing if anyone has a need or has created a PicoLisp app on Android Joe On Tue, Oct 9, 2012 at 1:06 PM, Thorsten Jolitz tjol...@googlemail.com wrote: Doug Snead semaphore_2...@yahoo.com writes: Hi Joe and Doug, I read up your conversations about PicoLisp on Android in the mailing list and your articles in the Wiki about the topic: Ok, so now this means we can package some picolisp client/server applications as android apps, using the android browser. (I think.) I like that approach because it works with the android browser and app packaging scheme - and at the same time you're getting picolisp in all its glory and efficiency. I don't have an Android device to try out your code examples, but I would be interested in the 'status quo' of this topic - is full PicoLisp running on Android, have there been any real Apps implemented in PicoLisp by somebody? If so - are there any cons of using PicoLisp instead of Java to be considered? -- cheers, Thorsten -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: pilog solver
My interest also piqued when I saw the amb example in rosettacode. It seems like that could be combined with something to backtrack if a permutation goes out of bounds. http://www.randomhacks.net/articles/2005/10/11/amb-operator On Thu, Jul 26, 2012 at 12:21 PM, Joe Bogner joebog...@gmail.com wrote: Thank you. My researched suggested that it was possible with other prolog implementations so I wasn't sure if I was missing something simple in pilog. I also wasn't sure if with a simple problem space I could combine something like permute with a known range of possibilities. In the example below, I could generate a list of the whole numbers from 1-100 for the acreage and then have some helper functions to test for ranges. I wouldn't need to solve for a real number. It sounds like there are better ways to do it. I was hoping to come up with something as nicely declarative/expressive as pilog that didn't have a bunch of conditionals. I could probably use some dsl though. I have no experience with pilog and was interested in an application of it. Thanks again On Thu, Jul 26, 2012 at 11:31 AM, Alexander Burger a...@software-lab.dewrote: On Thu, Jul 26, 2012 at 04:02:07PM +0200, Henrik Sarvell wrote: I can't say for sure if prolog is a good fit or not. The problems seems a little bit too arithmetic maybe but do not trust my word on it. I also don't think that Prolog or Pilog are well suited for that. Linear programming is an optimization technique, often employing the simplex algorithm where you solve a number of linear equations by pivoting their terms. I think this can be easier solved in plain Lisp than in Pilog. Cheers, - Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: efficiently building a large list
Thank you. Very helpful. I was confused where the value was actually being stored. I was thinking that in my example it was being stored in the cell in the index. Then, I couldn't figure out how it retained it's value after I cleared out the index. Turns out that it actually stored it back on the original symbol that held the customer number string. I'm fairly clear now on it. Definitely an interesting deep dive On Sun, Jun 3, 2012 at 4:23 AM, Alexander Burger a...@software-lab.dewrote: On Sat, Jun 02, 2012 at 06:10:05PM -0400, Joe Bogner wrote: To be more clear, this is the call pattern that I'm referring to: : (for X (idx 'A) (set (car (idx 'A X)) 0)) (Sum) ... As you can see, clearing it before calling Sum gives the correct results. OK, so this makes sense (also the assumption in my last mail about the idx values). You clear the values of the payload items. Note that 'X' in the above loop already contains the payload items (symbols or cells). So looking them up again is not necessary. You can write (for X (idx 'A) (set X 0)) A second note: (idx 'A) collects all items in the _whole_ index tree into a list. This makes sense only for small trees, of course, and is not used often in production code. Cheers, - Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: efficiently building a large list
Hi Henrik - Thanks for sharing. I used your approach and it ran quickly after I built the index using balance. (bench (setq SL (by '((X) (get X 'CustNum)) sort L))) T) (bench (setq SLC (mapcar '((This) (: CustNum)) SL)) T) (off A) (bench (balance 'A SLC T)) I'm stumped one piece. If I run the below code multiple times then my total increases : (Sum) 4.466 sec - 495029119 : (Sum) 4.497 sec - 990058238 : (Sum) 4.507 sec - 1485087357 (de Sum () (zero Amount) (bench (for This SL (let (Key (: CustNum) Amt (: Amount) Idx (idx 'A Key)) (setq Amt (if Amt Amt 0)) (inc 'Amount Amt) #check figure to make sure it sums up # the val of the cell is by default a customer number, set it to be 0 if it's non-numeric (ifn (num? (val (car Idx))) (set (car Idx) 0)) (set (car Idx) (+ (val (car Idx)) Amt)) ) ) ) (sum '((X) (car X)) (idx 'A)) ) I don't know exactly how to phrase the question. I'm storing the total in the val of the cell (I think). I would have thought it was in the val of the cell stored in the index. However, if I (off A) (bench (balance 'A SLA T)) , it still duplicates. If I run this first, it clears it out: (for X (idx 'A) (set (car (idx 'A X)) 0)) Where is the value being stored such that I need to set each value of the cell to 0 regardless of rebuilding the index? Here's a simple example that I used to understand the concept: : (setq Z abc) - abc : (val Z) - abc : (set Z 0) - 0 : (val Z) - 0 : (set Z (+ (val Z) 1)) - 1 : (val Z) - 1 : Z - abc Like your example, I think I'm storing the number in the val of the symbol (cell). I apologize for the long winded question Thanks Joe On Fri, Jun 1, 2012 at 1:38 AM, Henrik Sarvell hsarv...@gmail.com wrote: I noticed you were talking about idx. The below code is from vizreader and was part of a system that counted and stored all the non-common words in every article: # We extract all words from the article without special characters and count them (dm words (L) (let Words NIL (for W L (and (setq W (lowc (pack W))) (not (common? This W)) (if (idx 'Words W T) (inc (car @)) (set W 1 (idx 'Words))) It is using idx and summing up the occurrences of each word and turned out to be the fastest way of solving that problem anyway, maybe it's helpful to you. On Fri, Jun 1, 2012 at 10:33 AM, Joe Bogner joebog...@gmail.com wrote: Thanks Tomas, I've started using nil now. This is what I came up with to aggregate the data. It actually runs reasonably well. I'm sharing because I always enjoy reading other people's picoLisp code so I figure others may as well. My source file has 4 million rows : (bench (pivot L 'CustNum)) 35.226 sec # outputs 31,000 rows. My approach is to load it in as follows: (class +Invoice) (rel CustNum (+String)) (rel ProdNum (+String)) (rel Amount (+Number)) (rel Quantity (+Number)) (de Load () (zero N) (setq L (make ( (in invoices.txt (until (eof) (setq Line (line) ) (setq D (mapcar pack (split Line ^I))) (link (new '(+Invoice) 'CustNum (car (nth D 1)) 'ProdNum (car (nth D 2)) 'Amount (format (car (nth D 3))) 'Quantity (format (car (nth D 4))) )) ) ) ) ) ) T ) I can probably clean this up. I tinkered around with various approaches and this was the best I could come up with in a few hours. At first I was using something like the group from lib.l but found it to be too slow. I think it was due to the fact that I optimize for a sorted list instead of scanning for a match in the made list (de sortedGroup (List Fld) (make (let (Last NIL LastSym NIL) (for This List (let Key (get This Fld) (if ( Last Key) (prog (if LastSym (link LastSym)) (off LastSym) (push 'LastSym Key)) ) (push 'LastSym This) (setq Last Key) ) ) (link LastSym)) ) ) And here's the piece that ties it all together: (de pivot (L Fld) (let (SL (by '((X) (get X Fld)) sort L) SG (sortedGroup SL Fld)) (out pivot.txt (for X SG (let (Amt 0) (mapc '((This) (inc 'Amt (: Amount))) (cdr (reverse X))) (setq Key (get (car X) Fld)) (prinl Key ^I Amt) ) ) ) ) ) (Load) : (bench (pivot L 'CustNum)) 35.226 sec : (bench (pivot L 'ProdNum)) 40.945 sec It seems the best performance was by sorting, then splitting and then summing the individual parts. It also makes for a nice report. Sidenote: At first I thought I was getting better performance by using a modified version of quicksort off rosetta code, but then I switched it to the built-in sort and saw considerably better speed. Thanks for the help everyone On Thu, May 31, 2012 at 3:37 PM
Re: efficiently building a large list
Thanks Tomas, I've started using nil now. This is what I came up with to aggregate the data. It actually runs reasonably well. I'm sharing because I always enjoy reading other people's picoLisp code so I figure others may as well. My source file has 4 million rows : (bench (pivot L 'CustNum)) 35.226 sec # outputs 31,000 rows. My approach is to load it in as follows: (class +Invoice) (rel CustNum (+String)) (rel ProdNum (+String)) (rel Amount (+Number)) (rel Quantity (+Number)) (de Load () (zero N) (setq L (make ( (in invoices.txt (until (eof) (setq Line (line) ) (setq D (mapcar pack (split Line ^I))) (link (new '(+Invoice) 'CustNum (car (nth D 1)) 'ProdNum (car (nth D 2)) 'Amount (format (car (nth D 3))) 'Quantity (format (car (nth D 4))) )) ) ) ) ) ) T ) I can probably clean this up. I tinkered around with various approaches and this was the best I could come up with in a few hours. At first I was using something like the group from lib.l but found it to be too slow. I think it was due to the fact that I optimize for a sorted list instead of scanning for a match in the made list (de sortedGroup (List Fld) (make (let (Last NIL LastSym NIL) (for This List (let Key (get This Fld) (if ( Last Key) (prog (if LastSym (link LastSym)) (off LastSym) (push 'LastSym Key)) ) (push 'LastSym This) (setq Last Key) ) ) (link LastSym)) ) ) And here's the piece that ties it all together: (de pivot (L Fld) (let (SL (by '((X) (get X Fld)) sort L) SG (sortedGroup SL Fld)) (out pivot.txt (for X SG (let (Amt 0) (mapc '((This) (inc 'Amt (: Amount))) (cdr (reverse X))) (setq Key (get (car X) Fld)) (prinl Key ^I Amt) ) ) ) ) ) (Load) : (bench (pivot L 'CustNum)) 35.226 sec : (bench (pivot L 'ProdNum)) 40.945 sec It seems the best performance was by sorting, then splitting and then summing the individual parts. It also makes for a nice report. Sidenote: At first I thought I was getting better performance by using a modified version of quicksort off rosetta code, but then I switched it to the built-in sort and saw considerably better speed. Thanks for the help everyone On Thu, May 31, 2012 at 3:37 PM, Tomas Hlavaty t...@logand.com wrote: Hi Joe, Sidebar: Is there a way to disable the interactive session from printing the return of a statement? For example, if I do a (setq ABC L) where L is a million items, I'd prefer the option of not having all million items print on my console. I've worked around this by wrapping it in a prog and returning NIL. Is there an easier way? you could also use http://software-lab.de/doc/refN.html#nil or http://software-lab.de/doc/refT.html#t Cheers, Tomas -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: db new! performance
Hi Alex, Thanks for the reply. Just for reference, using seq is actually considerably slower. It ran in 39 seconds vs. 4 seconds. I think it's because it has to look up every object from disk to get the value of 'id instead of using the index which is likely in memory. The index appears to be stored as a simple list of external symbols and the index value. I'm just guessing through. Thanks, Joe On Wed, May 30, 2012 at 9:36 AM, Alexander Burger a...@software-lab.dewrote: Hi Joe, Thank you. That sped it up. It's taking 69 seconds to insert 1M records (pool foo.db) (class +Invoice +Entity) (rel id (+Key +Number)) (zero N) (bench (do 100 (new (db: +Invoice) '(+Invoice) 'id (inc 'N)) )) (commit) You can further speed it up if you distribute objects and indices across separate files. For the above example: (class +Invoice +Entity) (rel id (+Key +Number)) (dbs (3 )# First file, 512 byte blocks (2 +Invoice)# Second file, 256 byte blocks (4 (+Invoice id)) ) # Third file, 1024 byte blocks This puts the '+Invoice' objects into the second file (with a block size of 256), and the 'id' index into the third (with a block size of 1024). The first file (with a block size of 512) is not specified to hold any entities here, so it contains only the administrative data (root and base objects). Then you must pass a directory (instead of a file name) and the database size specifications to 'pool': (pool foo.db/ *Dbs) If you have really large indexes (more than, say, 10 or 100 million entries), the you might experiment with an even larger block size (e.g. 6, giving 4096 byte blocks). In my experience performance goes down again if you use too large block sizes. I can work with that. Now I am testing out queries. ? (bench (iter (tree 'id '+Invoice) '((This) (inc 'Z (: id) )) ))) 11.822 sec ? (bench (scan (tree 'id '+Invoice) '((Val Key) (inc 'Z Val )) ))) 4.430 sec It makes sense that scan would be fastest because I can use the index directly. Is that likely the fastest query to sum up a number relation? Yes, it is surely faster than a Pilog query (though less powerful). The absolutely fastest, though, would be to use 'seq', i.e. avoid completely to use an index. This can be used occasionally, when (as in the above case) a file consists mainly of objects of a single type: (bench (for (This (seq (db: +Invoice)) This (seq This)) (inc 'Z (: id)) ) ) If the file also might contain other objects, use this as the last line: (and (isa '+Invoice This) (inc 'Z (: id)) Cheers, - Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
db new! performance
I'm evaluating the use of picolisp for analyzing large datasets. Is it surprising that inserting a million rows into a simple db would take 5+ minutes on modern hardware? I killed it after that after about 500K were inserted. I checked by ctrl+c and then inspecting N. It seems to progressively get slower after about 100K records. (pool foo.db) (class +Invoice +Entity) (rel nr (+Key +Number)) (zero N) (do 100 (new! '(+Invoice) 'nr (inc 'N))) I have just testing out the concept. My input data will be a flat file of invoice data (12 million rows+) Thanks Joe
Re: Google Summer of Code (GSoC) 2012
Hi José - I've been thoroughly impressed with everything I've seen from you and even more so if you're a student. Wow! Related to your proposal below, if I can replay back what I am understanding, it sounds like there are three aspects to it: 1.) A more robust interface between a web server and a picolisp app. Something that can work in a variety of situations (e.g.VPS or dedicated hosting). This should enable more adoption of picolisp as a language for building web applicationss. [Sidenote: I've used your SCGI.l with nginx with and it would benefit others to document how that could work] 2.) A routing framework (does this follow the REST framework discussions we've had on IRC?) to simplify web app development - again it seems like you are close here based on what I've seen in scgi.l 3.) Provide some of the same functionality as XHTML without tying it to the session IDs. In other words, enable the general purpose GUI framework to be agnostic of the 'server' it's running in I think these are all wonderful ideas. If I was sitting on the committee evaluating proposals for the GSoC I would be evaluating projects based on their ability to have a broad impact or solves an unsolved problem. Since picoLisp is fairly niche, I like that what you're suggesting could open it up to more developers. I am no expert in this area though. I am not sure how this would stand out against framework XYZ aiming for broader appeal. I spent a minute looking for some more context on GSoC related to languages. I found a retrospective on haskell: http://www.gwern.net/Haskell%20Summer%20of%20Code I guess for someone with no knowledge of picoLisp, as it relates to your proposal, why is picoLisp a good choice for web development? What would the successful completion of the proposal enable? I have some perspective but would be interested in hearing what you think. Thanks for sharing it! Joe 2012/3/3 José Romero jose.cyb...@gmail.com: On Sat, 03 Mar 2012 21:10:25 +0100 Thorsten quintf...@googlemail.com wrote: Alexander Burger a...@software-lab.de writes: Hi List, On Mon, Feb 27, 2012 at 01:40:16PM +0100, Thorsten wrote: We prepared a GSoC 2012 page in the PicoLisp wiki (http://picolisp.com/5000/!wiki?gsoc), where you can find more information. ... For now (till 2012-03-09) the most important task is to collect ideas and find out who would like to be a mentor for his (or other peoples) project ideas. Then, if PicoLisp is accepted by Google, we need to spread the word and make students apply for a project. Any thoughts or ideas how to make the PicoLisp application for the GSoC 2012 a success are welcome. I would suggest to add at least 2 or 3 more project ideas to the ideas page (http://picolisp.com/5000/!wiki?ideasPage) to raise the odds of PicoLisp being accepted as mentoring organisation. The best case would be if anybody is interested to participate as a student and has a project idea (and a possible mentor in mind). However, if you would like to see some new feature in PicoLisp and to mentor the related project, it would be very helpfull too. A third (viable) option is to think about a project idea that is beneficial for the PicoLisp community and doesn't require special background (domain) knowledge from a (potential) mentor, but might be interesting for students in general. That way, you can propose an idea without being the student or mentor for that proposal. As an example, I would propose the project Build a web-shop for PicoLisp. Would that make sense? Any other ideas? If somebody has an idea but doesn't want to get involved with the wiki, he can just post it here on the list, I put it on the wiki then. Thanks If I can make it to participate as a student I'd like to make a more generic and portable web framework (in the sense of being able to deploy it in more kinds of servers than a dedicated/VPS with permission to run a server on a public port) Right now I have some work done in that direction with my scgi.l simple framework that is capable of running as a SCGI service, a CGI script and writing an HTTP backend it can also run as a standalone server (or actually, any protocol that has a CGI/HTTP-like interface can be adapted writing a backend) sharing most of the code (I have some code for that but i haven't published it yet because it's not complete/useful for anyone else than me at the moment). I have a formed idea for the low level design of the framework, as the internal protocol all backends dump into the app using a consistent interface (a set of global variables and functions). If you are allowed to run persistent processes in your server you would have at least these options for connecting the web application to the web (or a caching reverse proxy). +---+ ++ +--+--++ | | -| Web |-| SCGI | | I | | Server | +--+
Re: Google Summer of Code (GSoC) 2012
Hi Alex, Android porting may be a good candidate. It depends on how it would be scoped. Unfortunately I don't have much time to put towards leading it or being a mentor. However, off the top of my head this is what I think is needed: 1. Add Makefile changes and source code changes (e.g. making it so ht:Pack can be called - however its needed) to the main source repository 2. Create some utility that packages up a picoLisp web app into a java APK 3. Create an example app that demonstrates the full stack (db, web) and power of picoLisp. Maybe also demonstrate a java bridge and bindings (either by using call or something more native) so we can interact with the device (e.g. capture QR code) 4. Create documentation I'd be glad to be a contributor/reviewer though. Thanks, Joe On Tue, Feb 28, 2012 at 5:26 AM, Alexander Burger a...@software-lab.de wrote: Hi Joe, Doug, and anyone interested! On Mon, Feb 27, 2012 at 01:40:16PM +0100, Thorsten wrote: We prepared a GSoC 2012 page in the PicoLisp wiki (http://picolisp.com/5000/!wiki?gsoc), where you can find more information. ... For now (till 2012-03-09) the most important task is to collect ideas and find out who would like to be a mentor for his (or other peoples) project ideas. Then, if PicoLisp is accepted by Google, we need to spread the word and make students apply for a project. Any thoughts or ideas how to make the PicoLisp application for the GSoC 2012 a success are welcome. Wouldn't be the Android porting project a good candidate for the Summer of Code? Does anybody have contact to students who might be interested (and able) to do such a project? And would perhaps Joe and/or Doug be interested to support them as mentors? Cheers, - Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe