Re: Pil21 can bootstrap

2020-05-17 Thread Alfonso Villén
Hello Alex,
congratulations! That's great news. I can't wait to try out the first
production-ready release. I hope you'll get it soon.
Regards
Alfonso Villén

Alexander Burger  schrieb am So., 17. Mai 2020, 13:13:

> Hi all,
>
> a short note about the Pil21 status:
>
> It can now bootstrap by itself, meaning that it does no longer need another
> PicoLisp to build the *.ll and *.bc files from the sources.
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: Do free Open Source Foundation's Software Stacks fall under US Export Law?

2020-05-06 Thread Alfonso Villén

Hello Guido,

> Alex, go on using LLVM. See you in Guantanamo. (Remember: Meng 
Wanzhou > was caught in Canada with US warrant).

>
> Unbelievable ignorance

I don't understand what makes you think that Alex is an ignorant.

First of all, I want to thank Alex as John already did. I don't know 
Alex and I'm only a hobby programmer (with limited experience in several 
languages), but from his work and from the experience and savoir-faire 
that that work emits, I can see that he made (and is still making) wise 
decisions.


Picolisp is useful for me, but for Alex, it's a way of life. So if he 
has choosen LLVM, he must have good reasons for this. Not a random or 
ignorant choice.


If you think another way to develop pil21 will be better and Picolisp 
really means that much to you, then please, be constructive and help. 
You have experience with DynASM, Web Assembly or whatever? You know 
Picolisp so deeply that you can build it from scratch using other 
toolchains? Then show how *you* would do it, give directions, show some 
code and offer your collaboration. Unless you go that way, all you say 
is blah blah and you're saying it in a quite unrespectful and selfish 
manner, by the way. For now, I'll trust Alex more than I trust you.


Regards,

Alfonso

On 6/5/20 15:35, Guido Stepken wrote:
I don't discourage him. I present facts. LLVM contains plenty of AI 
code, especially for generating code for NVIDIA chips.


Since January 1st there are export restrictions for AI code to China now.

https://www.reuters.com/article/us-usa-artificial-intelligence/u-s-government-limits-exports-of-artificial-intelligence-software-idUSKBN1Z21PT

Means: No use of LLVM within China any longer. No use of pil21 with 
LLVM JIT in China. Same for many other countries.


Whole world now is rethinking use of US software stacks in general.

Again: "Keep away from US Software Stacks!!!"

Alex, go on using LLVM. See you in Guantanamo. (Remember: Meng Wanzhou 
was caught in Canada with US warrant).


Unbelievable ignorance

Am Mittwoch, 6. Mai 2020 schrieb George-Phillip Orais 
mailto:orais.georgephil...@gmail.com>>:

> Hi Guido,
> Thank you for sharing your insights here, I have fun reading them.
> But please respect Alex decision in using LLVM for pil21, its his 
choice and its his programming language, so please stop discouraging him.

>
> BR,
> Geo
>
>
>
> On Wed, May 6, 2020 at 10:12 PM John Duncan > wrote:

>>
>> Hey Alex,
>> Just wanted to tell you how much I appreciate your work. I hope you 
find a blowhard like Guido amusing and not too irritating. I get the 
impression he’s hardly written a line of code in his life, and that 
was probably in Java.

>> Take care!
>> John
>> On Wed, May 6, 2020 at 07:59 Alexander Burger > wrote:

>>>
>>> On Wed, May 06, 2020 at 12:51:33PM +0200, Guido Stepken wrote:
>>> > Use Mike's DYNASM JIT Engine. Better, faster, smaller (tiny, in 
comparison

>>> > to LLVM), more portable. He's from Munich.
>>>
>>> Useless.
>>>
>>> Sigh! How often have I told here that the main purpose of pil21 is 
portability?
>>> I need it to build PilBox on iOS, and to support RISC-V 
architectures. In fact

>>> *all* 64-bit architectures, as I got tired of porting pil64.
>>>
>>> And I need it NOW!! Not *perhaps* in ten years.
>>>
>>> Also, please shut up with WebAssembly. I need something running on 
POSIX for
>>> server side applications. Something in the browser is as useful 
for me as

>>> chewing gum for my cat.
>>>
>>> — Alex
>>>
>>> --
>>> UNSUBSCRIBE: mailto:picolisp@software-lab.de 
?subject=Unsubscribe

>>
>> --
>> John Duncan 


Re: picoLisp 19.12: variable length array in structure fixes

2020-04-18 Thread Alfonso Villén
Hello,

with your patches, I've compiled Picolisp on 32-bit Termux + Clang without
any problems.

Thanks a lot! Great job!

Greetings
Alfonso V.

Andras Pahi  schrieb am Sa., 18. Apr. 2020, 20:00:

> Hello,
>
> If you are interested I have patched the 19.12 32bit sources to compile
> without GCC.
> I have attached the changed files: pico.h, main.c, apply.c and flow.c
>
> Since clang does not support variable length array in structures I
> allocate the bindFrame
> with alloca() and provided a macro in pico.h to ease this: allocFrame().
>
> I know that the 32bit version is not the mainstream version, but feel free
> to
> abuse the patches.
>
> Regards,
> Andras Pahi
>
>


Turtle graphics

2020-03-30 Thread Alfonso Villén

Hello,

during the last months I've been writing a small library for drawing 
graphics using commands like in Logo's turtle graphics. I'm glad to 
share it with you all. It's hosted in the following Bitbucket 
repository: https://bitbucket.org/alfonsovillen/turtle/src/master/


Have a nice week and stay safe

Alfonso V.


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



Bug in rand

2020-03-25 Thread Alfonso Villén

Hello,

I've noticed that the "rand" function doesn't work with negative arguments:

Version 20.3.16

: (rand -10 10)

-> 1152921504606846966

Version 19.12.28

: (rand -10 10)

-> -5

I don't know in which exact version the bug appeared.

Regards,

Alfonso V.


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



Re: Proposal: PilCon 2020

2019-12-29 Thread Alfonso Villén

Hello,

although I won't attend the conference, I want to say thank you for 
organizing this event. It is a lot of work and I hope it is a great success.


I also join the recording proposal. It would be very inspiring to see 
the sessions on video.


Best regards,

Alfonso Villén


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


Re: SDL2 and OpenGL 3.0+ on Picolisp 64bit (Linux)

2019-03-17 Thread Alfonso Villén
Hello Kashyap,

you're doing some serious work to make everything run under Docker, thank
you!

The problem still seems to be OpenGL. You said that only demos 1 to 3 run.
Demo 1-3 tell SDL2 to open a window with an associated renderer
(+RenderWindow from sdlutil.l), but from demo 4 onwards a window with an
OpenGL context is requested (+OpenGLWindow from sdlopengl.l). The required
OpenGL version is 3.3 or higher. Otherwise the shaders won't compile.

I have updated the code of demo 4. Now the window is created with "(new
'(+OpenGLWindow) "SDL Test 4" 400 400 3 3)", so that SDL2 is free to choose
a valid visual without any requirements. The demo runs fine on my Linux PC.

Can you run a quick test with demo 4 and report if it works now, please?


Re: SDL2 and OpenGL 3.0+ on Picolisp 64bit (Linux)

2019-03-16 Thread Alfonso Villén
Hi Kashyap,

it's also possible that the OpenGL drivers simply don't support OpenGL 3.3
core profile, or that there's no OpenGL support at all...

Am Sa., 16. März 2019 um 05:25 Uhr schrieb C K Kashyap :

> Quick report -
> 1. WSL  + XMing - demo1.l worked just fine!  I get a mix of * !? (native
> NIL "IMG_Init" 'I IFlag) *and *"Could not create GL context" -- Error
> creating OpenGL context:* for the other demos.
> 2. Docker on windows + XMing - same as WSL
> 3. Docker + XQuartz on Mac - none of the demos run - libGL error: No
> matching fbConfigs or visuals found and libGL error: failed to load
> driver: swrast
>
> Since it runs on Docker + XMing on windows, I am guessing it must be the
> XQuartz that has some quirks that it causes not to work.
>
> Regards,
> Kashyap
>
>
>
>
> On Fri, Mar 15, 2019 at 7:49 PM C K Kashyap  wrote:
>
>> Great news ... cant wait to try it out on docker + xserver
>>
>> On Fri, Mar 15, 2019 at 7:41 PM  wrote:
>>
>>> Works on FreeBSD too, if I make this change:
>>>
>>> $ git diff | cat
>>> diff --git a/sdl/findlib.l b/sdl/findlib.l
>>> index 20371af..f532cb8 100644
>>> --- a/sdl/findlib.l
>>> +++ b/sdl/findlib.l
>>> @@ -5,7 +5,7 @@
>>>
>>>  (de findlib (Lib)
>>> (let Matches
>>> -  (in '(ldconfig "-p")
>>> +  (in '(ldconfig "-r")
>>>   (filter
>>>  '((F) (sub? Lib F))
>>>  (make (while (line T) (link @))) ) )
>>>
>>> Thanks!  (I just found out that I'm terrible at pong :)
>>>
>>> Best, Rick
>>>
>>> On Fri, 15 Mar 2019 18:58 -04:00, alfonso.vil...@gmail.com wrote:
>>> > Hello,
>>> >
>>> > I want to share with you my progresses on the following Bitbucket
>>> > repository:
>>> >
>>> > https://bitbucket.org/alfonsovillen/picolispffi/src/master/
>>> >
>>> > I would be thankful if someone could take some time to try the demos
>>> > and tell me whether they run well.
>>> >
>>> > Best regards,
>>> > Alfonso Villén
>>>
>>> --
>>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjectUnsubscribe
>>>
>>


Re: SDL2 and OpenGL 3.0+ on Picolisp 64bit (Linux)

2019-03-16 Thread Alfonso Villén
Hello Kashyap!

First of all, thanks for testing.

The first demo doesn't use SDL2_image, but the others do (to load images
and make textures from them). The line "!? (native NIL "IMG_Init" 'I
IFlag)" shows that SDL2_image either isn't installed or the shared library
couldn't be found by the "findlib" function in the "findlib.l" file.

I don't know exactly why SDL2 fails to get a valid OpenGL context under WSL
and Mac. It might be related to the requests when the windows are created
(8 bits for red, green and blue channels, no alpha, double buffer and 24
bit depth buffer). Neither the demos nor the bindings make any check to see
if the requested framebuffer formats are supported by the hardware or the
libraries. XQuartz seems to try to fall back to a software rasterizer,
without success.

I'd be satisfied enough if the examples ran well on machines with different
Linux distros and I think it's too early to try to fix anything not working
outside of Linux.

Am Sa., 16. März 2019 um 05:25 Uhr schrieb C K Kashyap :

> Quick report -
> 1. WSL  + XMing - demo1.l worked just fine!  I get a mix of * !? (native
> NIL "IMG_Init" 'I IFlag) *and *"Could not create GL context" -- Error
> creating OpenGL context:* for the other demos.
> 2. Docker on windows + XMing - same as WSL
> 3. Docker + XQuartz on Mac - none of the demos run - libGL error: No
> matching fbConfigs or visuals found and libGL error: failed to load
> driver: swrast
>
> Since it runs on Docker + XMing on windows, I am guessing it must be the
> XQuartz that has some quirks that it causes not to work.
>
> Regards,
> Kashyap
>
>
>
>
> On Fri, Mar 15, 2019 at 7:49 PM C K Kashyap  wrote:
>
>> Great news ... cant wait to try it out on docker + xserver
>>
>> On Fri, Mar 15, 2019 at 7:41 PM  wrote:
>>
>>> Works on FreeBSD too, if I make this change:
>>>
>>> $ git diff | cat
>>> diff --git a/sdl/findlib.l b/sdl/findlib.l
>>> index 20371af..f532cb8 100644
>>> --- a/sdl/findlib.l
>>> +++ b/sdl/findlib.l
>>> @@ -5,7 +5,7 @@
>>>
>>>  (de findlib (Lib)
>>> (let Matches
>>> -  (in '(ldconfig "-p")
>>> +  (in '(ldconfig "-r")
>>>   (filter
>>>  '((F) (sub? Lib F))
>>>  (make (while (line T) (link @))) ) )
>>>
>>> Thanks!  (I just found out that I'm terrible at pong :)
>>>
>>> Best, Rick
>>>
>>> On Fri, 15 Mar 2019 18:58 -04:00, alfonso.vil...@gmail.com wrote:
>>> > Hello,
>>> >
>>> > I want to share with you my progresses on the following Bitbucket
>>> > repository:
>>> >
>>> > https://bitbucket.org/alfonsovillen/picolispffi/src/master/
>>> >
>>> > I would be thankful if someone could take some time to try the demos
>>> > and tell me whether they run well.
>>> >
>>> > Best regards,
>>> > Alfonso Villén
>>>
>>> --
>>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjectUnsubscribe
>>>
>>


Re: [SOLVED]: PilBox IOException "No such file"

2018-04-20 Thread Alfonso Villén
Hello,

I'm glad to confirm that I had the same problem on a Samsung A5 and PilBox
is running fine now.

I had believed that I was the only one who had that problem... but nobody
had complained about it before, so I was thinking there was just something
wrong with my phone.

Thanks
Alfonso V.

Alexander Burger  schrieb am Fr., 20. Apr. 2018, 16:00:

> Hi all,
>
> On Wed, Apr 18, 2018 at 02:30:35PM +0200, Alexander Burger wrote:
> > I have a customer with Samsung Xcover 4 devices, and they get an
> IOException
> > 'Cannot run program "bin/picolisp" ... No such file'.
>
> Now I received an Xcover 4 and could take a closer look.
>
> The reason was that - despite that the device has a 64-bit CPU
> (Cortex-A53) -
> the OS is only 32-bit :(
>
> PilBox checked for the right CPU, but not for the OS.
>
> Now I've changed it to query Build.SUPPORTED_ABIS[0] instead of
> System.getProperty("os.arch"), and the Xcover 4 can be used with emu (by
> installing the arm32.zip plugin).
>
> I've released a new PilBox to Google Play, and the plugin(s) to
> https://software-lab.de/arm32.zip
>
> Thanks for all the input and feedback!
> ♪♫ Alex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: Two questions regarding 'native'

2017-10-24 Thread Alfonso Villén
Hello Mike,

I've just made the Reddit post:
https://www.reddit.com/r/lisp/comments/78iy7w/sdl2_and_opengl_33_on_picolisp_64bit/

2017-10-24 13:35 GMT+02:00 Mike Pechkin :

> ​Alfonso,
>
> Make a post on reddit.com/r/lisp​
>
>
>
>
>> I've created a public Bitbucket repository with my work so far, including
>> some examples.
>> https://bitbucket.org/alfonsovillen/picolispffi
>>
>> I don't know if someone will be interested in it, but I'm having fun
>> doing it.
>>
>
>


Re: Two questions regarding 'native'

2017-10-24 Thread Alfonso Villén
Hello,

finally, I could display a triangle using OpenGL 3.3. I translated the code
from the C tutorial at:
https://learnopengl.com/#!Getting-started/Hello-Triangle.

Thanks again for your help, Alex.

Unfortunately I'm running into difficulties again because after translating
the next tutorial, nothing is rendered. Maybe I'll post a question about it
later.

I've created a public Bitbucket repository with my work so far, including
some examples.
https://bitbucket.org/alfonsovillen/picolispffi

I don't know if someone will be interested in it, but I'm having fun doing
it.

Bye,
Alfonso V.

2017-10-21 15:34 GMT+02:00 Alexander Burger :

> On Sat, Oct 21, 2017 at 02:38:18PM +0200, Alfonso Villén wrote:
> > The function arguments don't work as you expected. That C function needs
> > some weird information such as an array of integers giving the length of
> > the strings in the other array if those don't end with null bytes...
>
> Ah, I see. Didn't know that. Then it is probably something like:
>
>
>(de glShaderSource (Shader Strings)
>   (let
>  (Lst
> (mapcar
>'((Str) (cons (native "@" "strdup" 'N Str) 8))
>Strings )
> Len (length Strings) )
>  (native `*GlutLib "glShaderSource" NIL
> Shader
> Len
> (cons NIL (list (* 8 Len)) Lst)
> (cons NIL (list (* 8 Len))
>(mapcar
>   '((Str) (- (length Str)))
>   Strings ) ) )
>  (mapc '((X) (native "@" "free" NIL (car X))) Lst) ) )
>
>
> > I'm also having problems with other function, and in all of them there
> are
> > pointer arguments involved. But I hope I'll be able to figure the
> solution
> > myself.
> >
> > When I get some examples working I'd like to share the code with you all.
>
> Great, thanks! Perhaps we can add them to @lib/openGl.l then.
>
> ♪♫ Alex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: Two questions regarding 'native'

2017-10-21 Thread Alfonso Villén
Hello,

thank you very much, Alex. It seems to work, but I have to test more
thoroughly.

The function arguments don't work as you expected. That C function needs
some weird information such as an array of integers giving the length of
the strings in the other array if those don't end with null bytes...

I'm also having problems with other function, and in all of them there are
pointer arguments involved. But I hope I'll be able to figure the solution
myself.

When I get some examples working I'd like to share the code with you all.

Alfonso Villén

Am 21.10.2017 10:08 schrieb "Alexander Burger" :

> Hi Alfonso,
>
> > I'm exploring Picolisp as a hobby for a while now, and I find it
> absolutely
> > amazing. I'm experimenting with 'native', trying to make some bindings
> for
> > SDL2 and OpenGL.
>
> I assume you found the OpenGL library in the distribution too, right? Just
> for
> the records, it is in "@lib/openGl.l".
>
>
> > I want to call this OpenGL function with 'native':
> >
> > void glShaderSource(
> > GLuint shader,
> > GLsizei count,
> > const GLchar **string,
> > const GLint *length)
> >
> > I have a problem with the third argument. I can't figure out if and how a
> > pointer to an array of string pointers can be passed to the function
> using
> > 'native'.
>
> An array of string pointers basically boils down to a structure in C.
>
> However, this case is indeed tricky, because the string array must first be
> created. I would call strdup() to get a list of pointers.
>
> Assuming you have {"abc", "def", "ghi"), this would be
>
>(mapcar
>   '((Str) (cons (native "@" "strdup" 'N Str) 8))
>   '("abc" "def" "ghi") )
>
> That is, it creates a list (( . 8) ( . 8) ( .
> 8)).
> The '8' values are needed for the 'native' struct definition (as the
> reference
> says "a pair (num . cnt) where 'num' is stored in a field of 'cnt' bytes").
>
> Note that you must also call free() on the results of strdup() when done.
>
>
> > My other question is about the fourth argument. Is there a way (other
> than
> > allocating some memory with 'malloc') so you can pass a C pointer to a
> > Picolisp symbol's value using 'native'?
>
> You can pass a pointer simply as a number. But this doesn't make sense
> here,
> because where should that pointer come from?
>
> So one way is to call 'malloc' as you said, but you can better let
> 'native' do
> the alloction for you, as another structure which holds a single pointer
> and
> which returns its value. The following passes the number 3 in a
> single-element
> 'int' array, receiving the possibly modified value in the variable 'Len':
>
>(Len (8 . I) -3)
>
> If you are not interested in a return value, and just want to pass 3:
>
>(NIL (8) -3)
>
>
> With all that, your function would be:
>
>(de glShaderSource (Shader Count Strings)
>   (let
>  (Lst
> (mapcar
>'((Str) (cons (native "@" "strdup" 'N Str) 8))
>Strings )
> Len (length Lst) )
>  (native `*GlutLib "glShaderSource" NIL
> Shader
> Count
> (cons NIL (list (* 8 Len)) Lst)
> (list 'Len (8 . I) (- Len)) )
>  (mapc '((X) (native "@" "free" NIL (car X))) Lst)
>  Len ) )
>
> You call it as (glShaderSource 3 4 '("abc" "def" "ghi")).
>
> I haven't checked the OpenGL docs if this makes sense, and haven't tested
> the
> above. It assumes that 'length' holds the number of strings in 'string'
> (and not
> 'count'!). And it assumes that you want to return the length in 'Len'. So
> the
> above must perhaps be modified.
>
> Indeed rather messy ;)
>
> ♪♫ Alex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Two questions regarding 'native'

2017-10-20 Thread Alfonso Villén
Hello,

I'm exploring Picolisp as a hobby for a while now, and I find it absolutely
amazing. I'm experimenting with 'native', trying to make some bindings for
SDL2 and OpenGL.

I want to call this OpenGL function with 'native':

void glShaderSource(
GLuint shader,
GLsizei count,
const GLchar **string,
const GLint *length)

I have a problem with the third argument. I can't figure out if and how a
pointer to an array of string pointers can be passed to the function using
'native'.

My other question is about the fourth argument. Is there a way (other than
allocating some memory with 'malloc') so you can pass a C pointer to a
Picolisp symbol's value using 'native'?

I'd be very glad if someone could answer.

Alfonso Villén


Subscribe

2017-07-15 Thread Alfonso Villén