A PicoLisp native library tutorial
Hi list, Some of you might know me from IRC @aw-Unscramble. I've written my first PicoLisp library, a native C binding for Nanomsg (picolisp-nanomsg) - as an experiment for myself to learn this language. In doing so, I ran into a few difficulties (mostly noob stuff) but Regenaxer has been very helpful and patient. I also wrote a tutorial explaining the code, to help other newbies understand some useful features of PicoLisp: https://github.com/aw/picolisp-nanomsg/blob/master/EXPLAIN.md And of course, the library: https://github.com/aw/picolisp-nanomsg Thanks!
Re: A PicoLisp native library tutorial
Nice! On Tue, Mar 3, 2015 at 5:36 PM, Alexander Williams a...@unscramble.co.jp wrote: Hi list, Some of you might know me from IRC @aw-Unscramble. I've written my first PicoLisp library, a native C binding for Nanomsg (picolisp-nanomsg) - as an experiment for myself to learn this language. In doing so, I ran into a few difficulties (mostly noob stuff) but Regenaxer has been very helpful and patient. I also wrote a tutorial explaining the code, to help other newbies understand some useful features of PicoLisp: https://github.com/aw/picolisp-nanomsg/blob/master/EXPLAIN.md And of course, the library: https://github.com/aw/picolisp-nanomsg Thanks! -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Solaris 10 picolisp 64 build
Sorry in advance if you’ve already covered this issue in the past. I’m on Solaris 10; I can build the 32-bit picolisp (3.1.9) with no problem. Then, I go do a (cd src64; make) (which is GNU make btw); this builds the x86-64.sunOS.base.s file via mkAsm, but it fails in the next step on gas --64 (which reads the .s file) with a bunch of errors of the form Error: Unknown opcode: `$OP' where $OP is any one of several opcodes, e.g. adc, addq, clc, ja, jbe, jz, movb, mul, etc. FIrst, I thought that a very old version of gas might be causing the issue (i.e. maybe it was not able to understand some of the new (?) opcodes; yes, I was very optimistic :); so I downloaded, built and installed binutils (2.24.51) which gave me a new gas. The new gas was of no avail — the same types of errors occurred. So, I then downloaded the .s files for Solaris from here: http://software-lab.de/x86-64.sunOs.tgz and unarced them in the picoLisp directory. As you can imagine, this didn’t work either — the same Unknown opcode messages were appearing. I suspect that I’m making a very fundamental mistake here, but I can’t quite put my finger on it. Am I using gas wrongly, or do I have the wrong assembler? Thanks for any help. —Rick rick42 on #picolisp
Re: A PicoLisp native library tutorial
This is great stuff. Nice writing style and very useful for me as a n00b. If Alexander is a n00b, by his own self-profession, then I'm a sub-sub-sub-n00b, because this is good stuff. Thanks! On Tue, Mar 3, 2015 at 11:36 AM, Alexander Williams a...@unscramble.co.jp wrote: Hi list, Some of you might know me from IRC @aw-Unscramble. I've written my first PicoLisp library, a native C binding for Nanomsg (picolisp-nanomsg) - as an experiment for myself to learn this language. In doing so, I ran into a few difficulties (mostly noob stuff) but Regenaxer has been very helpful and patient. I also wrote a tutorial explaining the code, to help other newbies understand some useful features of PicoLisp: https://github.com/aw/picolisp-nanomsg/blob/master/EXPLAIN.md https://githubcom/aw/picolisp-nanomsg/blob/master/EXPLAIN.md And of course, the library: https://github.com/aw/picolisp-nanomsg Thanks!
Re: A PicoLisp native library tutorial
Yep. Definitely interesting. On 03/03/15 18:50, Joe Bogner wrote: Nicely done. Thanks for sharing On Tue, Mar 3, 2015 at 12:16 PM, Henrik Sarvell hsarv...@gmail.com wrote: Nice! On Tue, Mar 3, 2015 at 5:36 PM, Alexander Williams a...@unscramble.co.jp wrote: Hi list, Some of you might know me from IRC @aw-Unscramble. I've written my first PicoLisp library, a native C binding for Nanomsg (picolisp-nanomsg) - as an experiment for myself to learn this language. In doing so, I ran into a few difficulties (mostly noob stuff) but Regenaxer has been very helpful and patient. I also wrote a tutorial explaining the code, to help other newbies understand some useful features of PicoLisp: https://github.com/aw/picolisp-nanomsg/blob/master/EXPLAIN.md And of course, the library: https://github.com/aw/picolisp-nanomsg Thanks! -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
RE: A PicoLisp native library tutorial
From: Alexander Williams [...] I also wrote a tutorial explaining the code, to help other newbies understand some useful features of PicoLisp: https://github.com/aw/picolisp-nanomsg/blob/master/EXPLAIN.md This is great, Alexander! I really like this part: (setq Result (12 104 101 108 108 111 0 0 8 0 0 0 0 0 0 0)) - (12 104 101 108 108 111 0 0 8 0 0 0 0 0 0 0) : (head (car Result) (cdr Result)) - (104 101 108 108 111 0 0 8 0 0 0 0) [...] : (pack (mapcar char (head (car Result) (cdr Result - hello^H **Note:** What this means is it receives the 8K buffer which contains a bunch of zeros at the end (assuming you didn't fill the buffer), it maps over the list, sets the zeros to NIL, packs it and you end up with a nice friendly string. Now, I can go back to some (failed) hobby code I made to interface with https://www.gnu.org/software/libc/manual/html_node/Regular-Expressions.html. In my first attempt, I got stuck at the point where I need to handle the Result struct... Thank you, --Dave PԔ � j)mX�����zV�u�.n7�
Re: A PicoLisp native library tutorial
Awesome! On Tue, Mar 3, 2015 at 11:49 AM, Jakob Eriksson ja...@aurorasystems.eu wrote: Yep. Definitely interesting. On 03/03/15 18:50, Joe Bogner wrote: Nicely done. Thanks for sharing On Tue, Mar 3, 2015 at 12:16 PM, Henrik Sarvell hsarv...@gmail.com wrote: Nice! On Tue, Mar 3, 2015 at 5:36 PM, Alexander Williams a...@unscramble.co.jp wrote: Hi list, Some of you might know me from IRC @aw-Unscramble. I've written my first PicoLisp library, a native C binding for Nanomsg (picolisp-nanomsg) - as an experiment for myself to learn this language. In doing so, I ran into a few difficulties (mostly noob stuff) but Regenaxer has been very helpful and patient. I also wrote a tutorial explaining the code, to help other newbies understand some useful features of PicoLisp: https://github.com/aw/picolisp-nanomsg/blob/master/EXPLAIN.md And of course, the library: https://github.com/aw/picolisp-nanomsg Thanks! -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Solaris 10 picolisp 64 build
Duh! That's it! And it even says x86 in the name!!! (e.g. `x86-64.sunOs.tgz`) I hereby turn in any computing creds I've garnered over the years to be thrown into burning inferno where they belong, and I'll go live in a box down my the river. :) Thanks! On Tue, Mar 3, 2015 at 4:50 PM, Jakob Eriksson ja...@aurorasystems.eu wrote: You are not by any chance on a Sparc platform? On 03/03/15 20:57, Rick Hanson wrote: Sorry in advance if you’ve already covered this issue in the past. I’m on Solaris 10; I can build the 32-bit picolisp (3.1.9) with no problem. Then, I go do a (cd src64; make) (which is GNU make btw); this builds the x86-64.sunOS.base.s file via mkAsm, but it fails in the next step on gas --64 (which reads the .s file) with a bunch of errors of the form Error: Unknown opcode: `$OP' where $OP is any one of several opcodes, e.g. adc, addq, clc, ja, jbe, jz, movb, mul, etc. FIrst, I thought that a very old version of gas might be causing the issue (i.e. maybe it was not able to understand some of the new (?) opcodes; yes, I was very optimistic :); so I downloaded, built and installed binutils (2.24.51) which gave me a new gas. The new gas was of no avail — the same types of errors occurred. So, I then downloaded the .s files for Solaris from here: http://software-lab.de/x86-64.sunOs.tgz and unarced them in the picoLisp directory. As you can imagine, this didn’t work either — the same Unknown opcode messages were appearing. I suspect that I’m making a very fundamental mistake here, but I can’t quite put my finger on it. Am I using gas wrongly, or do I have the wrong assembler? Thanks for any help. —Rick rick42 on #picolisp -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Solaris 10 picolisp 64 build
down *by* the river. (I can't even get *that* right.) Cheers! On Tue, Mar 3, 2015 at 5:00 PM, Rick Hanson cryptor...@gmail.com wrote: Duh! That's it! And it even says x86 in the name!!! (e.g. `x86-64.sunOs.tgz`) I hereby turn in any computing creds I've garnered over the years to be thrown into burning inferno where they belong, and I'll go live in a box down my the river. :) Thanks! On Tue, Mar 3, 2015 at 4:50 PM, Jakob Eriksson ja...@aurorasystems.eu wrote: You are not by any chance on a Sparc platform? On 03/03/15 20:57, Rick Hanson wrote: Sorry in advance if you’ve already covered this issue in the past. I’m on Solaris 10; I can build the 32-bit picolisp (3.1.9) with no problem. Then, I go do a (cd src64; make) (which is GNU make btw); this builds the x86-64.sunOS.base.s file via mkAsm, but it fails in the next step on gas --64 (which reads the .s file) with a bunch of errors of the form Error: Unknown opcode: `$OP' where $OP is any one of several opcodes, e.g. adc, addq, clc, ja, jbe, jz, movb, mul, etc. FIrst, I thought that a very old version of gas might be causing the issue (i.e. maybe it was not able to understand some of the new (?) opcodes; yes, I was very optimistic :); so I downloaded, built and installed binutils (2.24.51) which gave me a new gas. The new gas was of no avail — the same types of errors occurred. So, I then downloaded the .s files for Solaris from here: http://software-lab.de/x86-64.sunOs.tgz and unarced them in the picoLisp directory. As you can imagine, this didn’t work either — the same Unknown opcode messages were appearing. I suspect that I’m making a very fundamental mistake here, but I can’t quite put my finger on it. Am I using gas wrongly, or do I have the wrong assembler? Thanks for any help. —Rick rick42 on #picolisp -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Solaris 10 picolisp 64 build
You are not by any chance on a Sparc platform? On 03/03/15 20:57, Rick Hanson wrote: Sorry in advance if you’ve already covered this issue in the past. I’m on Solaris 10; I can build the 32-bit picolisp (3.1.9) with no problem. Then, I go do a (cd src64; make) (which is GNU make btw); this builds the x86-64.sunOS.base.s file via mkAsm, but it fails in the next step on gas --64 (which reads the .s file) with a bunch of errors of the form Error: Unknown opcode: `$OP' where $OP is any one of several opcodes, e.g. adc, addq, clc, ja, jbe, jz, movb, mul, etc. FIrst, I thought that a very old version of gas might be causing the issue (i.e. maybe it was not able to understand some of the new (?) opcodes; yes, I was very optimistic :); so I downloaded, built and installed binutils (2.24.51) which gave me a new gas. The new gas was of no avail — the same types of errors occurred. So, I then downloaded the .s files for Solaris from here: http://software-lab.de/x86-64.sunOs.tgz and unarced them in the picoLisp directory. As you can imagine, this didn’t work either — the same Unknown opcode messages were appearing. I suspect that I’m making a very fundamental mistake here, but I can’t quite put my finger on it. Am I using gas wrongly, or do I have the wrong assembler? Thanks for any help. —Rick rick42 on #picolisp -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: A PicoLisp native library tutorial
Thanks Dave. That looks painful, but I look forward to seeing your implementation. On Tue, Mar 3, 2015 at 6:29 PM, Loyall, David david.loy...@nebraska.gov wrote: From: Alexander Williams [...] I also wrote a tutorial explaining the code, to help other newbies understand some useful features of PicoLisp: https://github.com/aw/picolisp-nanomsg/blob/master/EXPLAIN.md This is great, Alexander! I really like this part: (setq Result (12 104 101 108 108 111 0 0 8 0 0 0 0 0 0 0)) - (12 104 101 108 108 111 0 0 8 0 0 0 0 0 0 0) : (head (car Result) (cdr Result)) - (104 101 108 108 111 0 0 8 0 0 0 0) [...] : (pack (mapcar char (head (car Result) (cdr Result - hello^H **Note:** What this means is it receives the 8K buffer which contains a bunch of zeros at the end (assuming you didn't fill the buffer), it maps over the list, sets the zeros to NIL, packs it and you end up with a nice friendly string. Now, I can go back to some (failed) hobby code I made to interface with https://www.gnu.org/software/libc/manual/html_node/Regular-Expressions.html . In my first attempt, I got stuck at the point where I need to handle the Result struct... Thank you, --Dave
Re: Solaris 10 picolisp 64 build
Hi Rick, All, does this mean that picoLisp64 cannot be built on a Solaris 10 sparc64 box? Unfortunately yes. I should write the sparc9 support into src64/arch/, which I have in my to-do list since several years. But it is a lot of work for probably too few use cases. And I still did not manage to get Debian running in qemu for sparc64. This is a kind of prerequisite for me to make a new port (ppc64 does run meanwhile in qemu). box? (That's what I have.) If not, no worries; I can, and will be happy to, still use picoLisp32 there. Thanks! As pil32 is more limited, you might also consider to build the emulator with (cd src64; make emu). It is a lot slower, but may be sufficient for some applications. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: A PicoLisp native library tutorial
Thank you all for your nice comments. On Tue, Mar 3, 2015 at 7:58 PM, Michel Pelletier pelletier.mic...@gmail.com wrote: Awesome! On Tue, Mar 3, 2015 at 11:49 AM, Jakob Eriksson ja...@aurorasystems.eu wrote: Yep. Definitely interesting. On 03/03/15 18:50, Joe Bogner wrote: Nicely done. Thanks for sharing On Tue, Mar 3, 2015 at 12:16 PM, Henrik Sarvell hsarv...@gmail.com wrote: Nice! On Tue, Mar 3, 2015 at 5:36 PM, Alexander Williams a...@unscramble.co.jp wrote: Hi list, Some of you might know me from IRC @aw-Unscramble. I've written my first PicoLisp library, a native C binding for Nanomsg (picolisp-nanomsg) - as an experiment for myself to learn this language. In doing so, I ran into a few difficulties (mostly noob stuff) but Regenaxer has been very helpful and patient. I also wrote a tutorial explaining the code, to help other newbies understand some useful features of PicoLisp: https://github.com/aw/picolisp-nanomsg/blob/master/EXPLAIN.md And of course, the library: https://github.com/aw/picolisp-nanomsg Thanks! -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Solaris 10 picolisp 64 build
At this time, that's true. That said, it's not a herculean effort apparently, to port it, given that (correct me Alex or other if I'm wrong) Solaris uses ELF. Uses gas (not sure if it matters) You or the person doing the porting knows Sparc assembler. But of course not simple to do either... On 03/03/15 23:27, Rick Hanson wrote: All, does this mean that picoLisp64 cannot be built on a Solaris 10 sparc64 box? (That's what I have.) If not, no worries; I can, and will be happy to, still use picoLisp32 there. Thanks! On Tue, Mar 3, 2015 at 5:01 PM, Rick Hanson cryptor...@gmail.com wrote: down *by* the river. (I can't even get *that* right.) Cheers! On Tue, Mar 3, 2015 at 5:00 PM, Rick Hanson cryptor...@gmail.com wrote: Duh! That's it! And it even says x86 in the name!!! (e.g. `x86-64.sunOs.tgz`) I hereby turn in any computing creds I've garnered over the years to be thrown into burning inferno where they belong, and I'll go live in a box down my the river. :) Thanks! On Tue, Mar 3, 2015 at 4:50 PM, Jakob Eriksson ja...@aurorasystems.eu wrote: You are not by any chance on a Sparc platform? On 03/03/15 20:57, Rick Hanson wrote: Sorry in advance if you’ve already covered this issue in the past. I’m on Solaris 10; I can build the 32-bit picolisp (3.1.9) with no problem. Then, I go do a (cd src64; make) (which is GNU make btw); this builds the x86-64.sunOS.base.s file via mkAsm, but it fails in the next step on gas --64 (which reads the .s file) with a bunch of errors of the form Error: Unknown opcode: `$OP' where $OP is any one of several opcodes, e.g. adc, addq, clc, ja, jbe, jz, movb, mul, etc. FIrst, I thought that a very old version of gas might be causing the issue (i.e. maybe it was not able to understand some of the new (?) opcodes; yes, I was very optimistic :); so I downloaded, built and installed binutils (2.24.51) which gave me a new gas. The new gas was of no avail — the same types of errors occurred. So, I then downloaded the .s files for Solaris from here: http://software-lab.de/x86-64.sunOs.tgz and unarced them in the picoLisp directory. As you can imagine, this didn’t work either — the same Unknown opcode messages were appearing. I suspect that I’m making a very fundamental mistake here, but I can’t quite put my finger on it. Am I using gas wrongly, or do I have the wrong assembler? Thanks for any help. —Rick rick42 on #picolisp -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Solaris 10 picolisp 64 build
Hi Jakob, At this time, that's true. That said, it's not a herculean effort apparently, to port it, given that (correct me Alex or other if I'm wrong) Solaris uses ELF. Uses gas (not sure if it matters) That's true, and this is good. You or the person doing the porting knows Sparc assembler. That's also not a big problem. It is not so easy either. As I said, I investigated it a few years ago, and read the SPARC-V9 Application Binary Interface etc. Sparc is a RISC architecture, so some things are more tedious to implement. In that regard it is similar to Ppc64 (stack and CPU flag issues, not 128-bit mul/div). ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Solaris 10 picolisp 64 build
All, does this mean that picoLisp64 cannot be built on a Solaris 10 sparc64 box? (That's what I have.) If not, no worries; I can, and will be happy to, still use picoLisp32 there. Thanks! On Tue, Mar 3, 2015 at 5:01 PM, Rick Hanson cryptor...@gmail.com wrote: down *by* the river. (I can't even get *that* right.) Cheers! On Tue, Mar 3, 2015 at 5:00 PM, Rick Hanson cryptor...@gmail.com wrote: Duh! That's it! And it even says x86 in the name!!! (e.g. `x86-64.sunOs.tgz`) I hereby turn in any computing creds I've garnered over the years to be thrown into burning inferno where they belong, and I'll go live in a box down my the river. :) Thanks! On Tue, Mar 3, 2015 at 4:50 PM, Jakob Eriksson ja...@aurorasystems.eu wrote: You are not by any chance on a Sparc platform? On 03/03/15 20:57, Rick Hanson wrote: Sorry in advance if you’ve already covered this issue in the past. I’m on Solaris 10; I can build the 32-bit picolisp (3.1.9) with no problem. Then, I go do a (cd src64; make) (which is GNU make btw); this builds the x86-64.sunOS.base.s file via mkAsm, but it fails in the next step on gas --64 (which reads the .s file) with a bunch of errors of the form Error: Unknown opcode: `$OP' where $OP is any one of several opcodes, e.g. adc, addq, clc, ja, jbe, jz, movb, mul, etc. FIrst, I thought that a very old version of gas might be causing the issue (i.e. maybe it was not able to understand some of the new (?) opcodes; yes, I was very optimistic :); so I downloaded, built and installed binutils (2.24.51) which gave me a new gas. The new gas was of no avail — the same types of errors occurred. So, I then downloaded the .s files for Solaris from here: http://software-lab.de/x86-64.sunOs.tgz and unarced them in the picoLisp directory. As you can imagine, this didn’t work either — the same Unknown opcode messages were appearing. I suspect that I’m making a very fundamental mistake here, but I can’t quite put my finger on it. Am I using gas wrongly, or do I have the wrong assembler? Thanks for any help. —Rick rick42 on #picolisp -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe