Re: Compiling for containers

2016-12-12 Thread Alexander Burger
Hi David,

> w.l sym.l subr.l big.l io.l db.l net.l err.l sys/x86-64.linux.code.l
> ./ersatz/pil: exec: line 5: java: not found
> Makefile:159: recipe for target 'x86-64.linux.base.s' failed
> make: *** [x86-64.linux.base.s] Error 2

This is an indication that script 'src64/mkAsm' cannot find an executable
picolisp binary to bootstrap the build.

The solutions are either to build 32 bit first, install Java or download
pre-built *.s files. See the 'INSTALL' file.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Compiling for containers

2016-12-12 Thread David Bloom
Hi Alexander and thanks for getting back to me so quickly.  In a 64-bit
Tinycore container  "tatsushid/tinycore 7.2-x86_64"
 I edited the Makefile line and tried without success.  Even after trying a
fresh download of the source and adding the "-nopie" to the appropriate
line (#71) I get:

/tmp $ cd picoLisp/src64/
/tmp/picoLisp/src64 $ vi Makefile
/tmp/picoLisp/src64 $ make
/mkAsm x86-64 ".linux" .s Linux base "" ../lib/map  version.l glob.l
main.l gc.l apply.l flo
w.l sym.l subr.l big.l io.l db.l net.l err.l sys/x86-64.linux.code.l
./ersatz/pil: exec: line 5: java: not found
Makefile:159: recipe for target 'x86-64.linux.base.s' failed
make: *** [x86-64.linux.base.s] Error 2

What do you make of this?

On Mon, Dec 12, 2016 at 6:35 AM, Alexander Williams 
wrote:

> Hi David,
>
> For the stubs-32.h thing.. typically on Debian you would need libc6-i386,
> but that isn't available for 64-bit TinyCore.
>
> For Alpine Linux, you should know that it uses musl not libc, so the
> PicoLisp binary will NOT run on TinyCore if you build it on Alpine (unless
> you have musl.so on Debian..ugh?). To compile/link on Alpine with musl,
> similarly to TinyCore, you'll need to use the 64-bit OS (it exists) for the
> 64-bit binary, and the 32-bit OS for the 32-bit binary.
>
> Anyways for musl (Alpine Linux), just add '-nopie' option to the build
> options in src64/Makefile, ex:
>
> LD-MAIN = -Wl,--no-as-needed -rdynamic -lc -lm -ldl -nopie
>
> That's literally all I changed to compile picoLisp 64-bit on Alpine Linux
> 64-bit. Probably the same option for 32-bit.. let me know ;)
>
> Good luck!
>
>
> AW
> *https://aw.github.io/picolisp *
>
>
> On Sun, Dec 11, 2016 at 5:41 PM, David Bloom  wrote:
>
>> Hello list.  I should have come here sooner looking for someone with more
>> C compiling experience than I have.  I used to compile picoLisp in a
>> Tinycore linux container with ease following these steps:
>>
>> - tce-load compiletc  (this adds gcc, make, etc. so we can compile)
>> - copy picolisp source tarball into container
>> - compile PicoLisp
>> - remove build files
>> - tce-audit builddb
>> - tce-audit delete compiletc
>>
>> A Dockerfile would then copy in the pre-compiled picolisp, add
>> appropriate links for global installation resulting in a tidy, small image.
>>
>> For some time now, following the same process I get this:
>>
>> /tmp/picoLisp/src $ cd ../src64/
>> /tmp/picoLisp/src64 $ make
>> ./mkAsm x86-64 ".linux" .s Linux base "" ../lib/map  version.l glob.l
>> main.l gc.l apply.l flow.l sym.l subr.l big.l io.l db.l net.l err.l
>> sys/x86-64.linux.code.l
>> ../ersatz/pil: exec: line 5: java: not found
>> Makefile:159: recipe for target 'x86-64.linux.base.s' failed
>> make: *** [x86-64.linux.base.s] Error 2
>>
>> And this
>>
>> /tmp $ cd picoLisp/src
>> /tmp/picoLisp/src $ make
>> 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_OFFS
>> ET_BITS=64 -m32 -D_OS='"Linux"' main.c
>> In file included from /usr/include/features.h:389:0,
>> from /usr/include/stdio.h:27,
>> from pico.h:5,
>> from main.c:5:
>> /usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file
>> or directory
>> compilation terminated.
>> Makefile:129: recipe for target 'main.o' failed
>> make: *** [main.o] Error 1
>> /tmp/picoLisp/src $
>>
>> A cursory search led to missing 32-bit libraries in the 64-bit Tinycore
>> image.  No big deal, what if I tried in a Alpine linux container (only
>> 32-bit but small and gaining popularity) similarly:
>>
>> https://jpst.it/QgPQ (Using a paste service due to verbose output)
>>
>> picolisp compiles easily on Netrunner (based on Manjaro based on Arch)
>> which I'm typing this from.  Any C gurus that can make more sense of this
>> is greatly appreciated.  Thanks for reading my short novel and any pointers.
>>
>> -David
>>
>
>


Re: help with list of capital letters as symbol property key

2016-12-12 Thread dean
Having thought about this I was intending to use the SAME list variable to
represent multiple property keys i.e. as I type keys (to traverse a menu
tree) I was hoping to use the key "trail" at any point (stored as a list)
as a unique key.

Having now realised what == means...it looks like pointer equivalence rules
this approach out and I'm just wondering if there is a way around this...

Any thoughts much appreciated
Best Regards
Dean

On 12 December 2016 at 08:51, dean  wrote:

> Thank you for the clarification.
>
> On 12 December 2016 at 06:19, Alexander Burger 
> wrote:
>
>> Hi Dean,
>>
>> > On 11 December 2016 at 20:06, Alexander Burger 
>> wrote:
>> >
>> > > On Sun, Dec 11, 2016 at 07:05:13PM +, dean wrote:
>> > > > but I'd like a list of letters to be a single key.
>> > > > Is this not possible?
>> > > Properties are handled (searched) by pointer-equality, the '=='
>> function.
>>
>> I should have mentioned that you can indeed use non-symbolic keys in other
>> contexts, like 'assoc', 'idx' (and 'cache') and of course database
>> indexes.
>>
>> - Alex
>> --
>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>>
>
>


Re: Date query question

2016-12-12 Thread Alexander Burger
On Mon, Dec 12, 2016 at 11:12:22AM +0100, Henrik Sarvell wrote:
> This looks like the one I need, I want all projects whose date range
> has any kind of overlap with the given date range.

How do you think about the '+UB' tree solution I suggested in my follow-up mail?

>(class +Proj +Macropisobj)
>...
>(rel sDate (+UB +Aux +Ref +Date) (eDate))
>(rel eDate (+Date))
> 
> Then a 'collect' would find the range directly:
> 
>(collect 'sDate '+Proj (list Sdate Sdate) (list Edate Edate))

I think that is much more elegant and efficient.

- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Compiling for containers

2016-12-12 Thread Alexander Williams
Hi David,

For the stubs-32.h thing.. typically on Debian you would need libc6-i386,
but that isn't available for 64-bit TinyCore.

For Alpine Linux, you should know that it uses musl not libc, so the
PicoLisp binary will NOT run on TinyCore if you build it on Alpine (unless
you have musl.so on Debian..ugh?). To compile/link on Alpine with musl,
similarly to TinyCore, you'll need to use the 64-bit OS (it exists) for the
64-bit binary, and the 32-bit OS for the 32-bit binary.

Anyways for musl (Alpine Linux), just add '-nopie' option to the build
options in src64/Makefile, ex:

LD-MAIN = -Wl,--no-as-needed -rdynamic -lc -lm -ldl -nopie

That's literally all I changed to compile picoLisp 64-bit on Alpine Linux
64-bit. Probably the same option for 32-bit.. let me know ;)

Good luck!


AW
*https://aw.github.io/picolisp *


On Sun, Dec 11, 2016 at 5:41 PM, David Bloom  wrote:

> Hello list.  I should have come here sooner looking for someone with more
> C compiling experience than I have.  I used to compile picoLisp in a
> Tinycore linux container with ease following these steps:
>
> - tce-load compiletc  (this adds gcc, make, etc. so we can compile)
> - copy picolisp source tarball into container
> - compile PicoLisp
> - remove build files
> - tce-audit builddb
> - tce-audit delete compiletc
>
> A Dockerfile would then copy in the pre-compiled picolisp, add appropriate
> links for global installation resulting in a tidy, small image.
>
> For some time now, following the same process I get this:
>
> /tmp/picoLisp/src $ cd ../src64/
> /tmp/picoLisp/src64 $ make
> ./mkAsm x86-64 ".linux" .s Linux base "" ../lib/map  version.l glob.l
> main.l gc.l apply.l flow.l sym.l subr.l big.l io.l db.l net.l err.l
> sys/x86-64.linux.code.l
> ../ersatz/pil: exec: line 5: java: not found
> Makefile:159: recipe for target 'x86-64.linux.base.s' failed
> make: *** [x86-64.linux.base.s] Error 2
>
> And this
>
> /tmp $ cd picoLisp/src
> /tmp/picoLisp/src $ make
> 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_OFFS
> ET_BITS=64 -m32 -D_OS='"Linux"' main.c
> In file included from /usr/include/features.h:389:0,
> from /usr/include/stdio.h:27,
> from pico.h:5,
> from main.c:5:
> /usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file
> or directory
> compilation terminated.
> Makefile:129: recipe for target 'main.o' failed
> make: *** [main.o] Error 1
> /tmp/picoLisp/src $
>
> A cursory search led to missing 32-bit libraries in the 64-bit Tinycore
> image.  No big deal, what if I tried in a Alpine linux container (only
> 32-bit but small and gaining popularity) similarly:
>
> https://jpst.it/QgPQ (Using a paste service due to verbose output)
>
> picolisp compiles easily on Netrunner (based on Manjaro based on Arch)
> which I'm typing this from.  Any C gurus that can make more sense of this
> is greatly appreciated.  Thanks for reading my short novel and any pointers.
>
> -David
>


Re: Date query question

2016-12-12 Thread Henrik Sarvell
This looks like the one I need, I want all projects whose date range
has any kind of overlap with the given date range.

Thanks, will try it!

On Thu, Nov 17, 2016 at 4:10 PM, Alexander Burger  wrote:
> Hi Henrik,
>
>> (class +Proj +Macropisobj)
>> (rel id (+Key +Number))
>> (rel nm (+Ref +String))
>> (rel sDate (+Ref +String))
>> (rel eDate (+Ref +String))
>>
>> (dm getCurrent> (Sdate Edate)
>>(filter '((P) (or
>> (< Sdate (; P sDate) Edate)
>> (< Sdate (; P eDate) Edate)
>> (< Sdate (; P sDate) (; P eDate) Edate) ) )
>>   (collect 'id This) ) )
>> ...
>> 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?
>
> If you know that the *result* will be within a few hundred hits (not the
> total DB size), and the difference between start and end is less than
> e.g. 100 days, then you could first restrict the collection a bit
>
>(collect 'sDate '+Proj Sdate (+ Edate 100))
>
> (works of course only for +Date types), and then filter that further.
> This is surely the most efficient way for a small set of results.
>
>
> The same you can do in Pilog with the 'db' predicate for an larger
> result set, and if you want to avoid a 'select'
>
>(? @Rng (cons Sdate (+ Edate 100))
>   (db sDate +Proj @Rng @Proj) )
>
>
> But 'select' is the most general - and on big data sets perhaps the most
> efficient - way. You could try
>
>(?
>   @Sdate (cons Sdate T)  # Range with open end
>   @Edate (cons Edate NIL)# Reversed range with open start
>   (select (@Proj)
>  ((sDate +Proj @Sdate) (eDate +Proj @Edate))  # Search two indexes in 
> parallel
>  (range @Sdate @Proj sDate)   # Check ranges
>  (range @Edate @Proj eDate) ) )   # Check ranges
>
> I haven't tested this ;)
>
> ♪♫ Alex
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: help with list of capital letters as symbol property key

2016-12-12 Thread dean
Thank you for the clarification.

On 12 December 2016 at 06:19, Alexander Burger  wrote:

> Hi Dean,
>
> > On 11 December 2016 at 20:06, Alexander Burger 
> wrote:
> >
> > > On Sun, Dec 11, 2016 at 07:05:13PM +, dean wrote:
> > > > but I'd like a list of letters to be a single key.
> > > > Is this not possible?
> > > Properties are handled (searched) by pointer-equality, the '=='
> function.
>
> I should have mentioned that you can indeed use non-symbolic keys in other
> contexts, like 'assoc', 'idx' (and 'cache') and of course database indexes.
>
> - Alex
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>