beneroth changed the topic of #picolisp to: PicoLisp language | The scalpel of software development | Channel Log: https://libera.irclog.whitequark.org/picolisp | Check www.picolisp.com for more information
seninha has quit [Quit: Leaving]
msavoritias has joined #picolisp
bjorkintosh has quit [Ping timeout: 240 seconds]
<tankf33der> Watched all bignum implementation videos on russian on youtube. Now i know the subject.
<abu[7]> cool
<tankf33der> Then i need to understand the subject, and then I can write the code." :)
<abu[7]> Important is how to implement the carry bit, depending on what is available
<abu[7]> Higxx level langs don't directly support carry
<tankf33der> Aha
<abu[7]> That's the advantage of assembly, you usually have a hardware carry bit
<abu[7]> LLVM also supports it (kind of)
<fbytez> What was the motivation for choosing LLVM as a dependency for pil?
<abu[7]> It is not a dependeniy, but the base for the implementation
<abu[7]> LLVM-IR is a portable assembly language
<fbytez> How does that not mean that LLVM isn't a dependency?
<fbytez> *is
<abu[7]> It is much more than a dependency
<abu[7]> Do you think it was a bad choive?
<abu[7]> Before it was asm, then C, then Java, then asm again, and now llvm
<fbytez> Sort of. For me, one of the things that most attractive things about pil is simplicity, which I think LLVM hugely detracts from.
<abu[7]> The final motivation was that RISC-V has no flag register
<abu[7]> so pil64 could not be supported in a clean way
<abu[7]> llvm is as powerful as an assembler, but abstracts the hardware
<fbytez> And is huge.
<abu[7]> I use only the backend
<abu[7]> Doesn't matter if it is huge, it is installed everywhere anyway
<fbytez> No, it's not. I've had to install it specifically for pil anywhere I've used it.
<abu[7]> I see
<abu[7]> Do you think that GCC is smaller?
<abu[7]> or Java?
<fbytez> No, but C and ASM have small options.
<abu[7]> Asm is not portable, and C is not powerful enough
<fbytez> Yeah, well, I figured portability was the main reason for ditching ASM. What obstacles were there with C?
<abu[7]> I wrote them up somewhere
<abu[7]> Main was no condition codes and no stack control
<abu[7]> It was in the docs of pil64
<abu[7]> "Reasons for the Use of Assembly Language"
<abu[7]> LLVM supports 1, 2, 3 and 5 at least partially
<abu[7]> 4 is handled by the backend in a nearly optimal way
<abu[7]> And the SSA architecture is very beautiful and quite easy to generate from Lisp code
<tankf33der> fbytez: i have touched every platform i could imagine
<abu[7]> The original meaning of "LLVM" was "low level virtual machine", and that is what I needed
<tankf33der> yea
<abu[7]> tankf33der, indeed, very portable
<abu[7]> I loved the idea of the SSA architecture, being a virtual CPU with an infinite number of registers
<abu[7]> "Static Single Assignment"
<abu[7]> very pure
<abu[7]> LLVM-IR is horrible though. Never saw such an ugly and verbose syntax
<abu[7]> But it is not necessary to program in it directly, no reason to care about it
<abu[7]> So in summary, I think the decision to use llvm was the best implementation choice for PicoLisp so far
<abu[7]> @src/lib/llvm.l makes all that compiler frontend stuff obsolete. We need only the target-specific backend to translate BC files to assembly and then binary
seninha has joined #picolisp
seninha has quit [Remote host closed the connection]
seninha has joined #picolisp
mario-goulart has quit [Quit: ERC (IRC client for Emacs 27.1)]
mario-goulart has joined #picolisp
mario-goulart has quit [Remote host closed the connection]
mario-goulart has joined #picolisp
mario-goulart has quit [Remote host closed the connection]
mario-goulart has joined #picolisp
seninha has quit [Ping timeout: 276 seconds]
bjorkintosh has joined #picolisp
mario-goulart has quit [Remote host closed the connection]
abu[7] has left #picolisp [#picolisp]
abu[7] has joined #picolisp
mario-goulart has joined #picolisp
<fbytez> abu[7], I don't know much about it but have you ever checked out QBE? https://c9x.me/compile/
<abu[7]> I did not know it. Looks interesting, and is also SSA-based.
<tankf33der> Qbe is small, right, less maintained. And every language it uses must use modified version or use workarounds against bug(s). Hare or myrrdin as example. Small number of platform backends. So there are only two choices llvm and qbe.
<tankf33der> llvm won.
<abu[7]> QBE seems to have a slightly friendlier syntax (ref. to what I said above about llvm-ir)
<tankf33der> Only three platforms, 64 bit only too
<tankf33der> arm, x64, riscv
<tankf33der> status of last unknown
<abu[7]> yeah ;(
<fbytez> tankf33der, Could you expand on “And every language it uses must use modified version or use workarounds against bug(s).”
<tankf33der> I was on irc server for a long of myrddin language when they every time discussed qbe bugs and issues.
<tankf33der> Qbe is not perfect.
<tankf33der> picolisp is perfect :)
<tankf33der> This is a line from installation of hare language -
<tankf33der> QBE (the latest version on the git master branch, not the latest versioned released)
<tankf33der> They fixing qbe.
<tankf33der> If you do not like llvm use asm or c versions.
<tankf33der> of picolisp.
<abu[7]> The C and Asm versions are outdated though
<tankf33der> But they live in time.
msavoritias has quit [Ping timeout: 256 seconds]
<taleon> I am currently trying to get PicoLisp to run on FreeBSD 14. Unfortunately I get a lot of error messages. Do any of you have any ideas? https://termbin.com/q05m
<tankf33der> taleon: hi, it works on FreeBSD 14, all tests passed.
<tankf33der> it compiles out of box, why you modify Makefile ? :/
<tankf33der> checking
<taleon> hm strange :)
<taleon> With the original Makefile I get the following message: https://termbin.com/h4bk
<tankf33der> did you install llvm ?
<tankf33der> pkg install llvm
<taleon> llvm-15,1
<tankf33der> compiled pil21 on freebsd 14
<tankf33der> read this
<tankf33der> so i was wrong it needs two steps
<tankf33der> 1. add -L/usr/local/lib to MAIN in Makefile
<tankf33der> 2. execute gmake CC=clang15
<tankf33der> done
<taleon> Doesn't work. Same errors
<taleon> MAIN = -rdynamic -lc -lutil -lm -ldl -lreadline -lffi -L/usr/local/lib
<tankf33der> correct
<taleon> I changed only this
<tankf33der> yeap
<tankf33der> gmake CC=clang15
<tankf33der> reading you error
<tankf33der> llvm-config --version
<taleon> 15.0.7
<tankf33der> ok
<tankf33der> clang -v
<taleon> FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152)
<tankf33der> correct. ok.
<tankf33der> clang15 -v
<taleon> clang version 15.0.7
<tankf33der> corect. ok.
<taleon> Are there any $PATH or packages missing?
<taleon> Is there anything else that needs to be defined?
<tankf33der> nope.
<taleon> I installed git gmake llvm pkgconf
<tankf33der> did you clone repo over git ?
<tankf33der> correct.
<tankf33der> did you clone repo over git ?
<tankf33der> double line. ok.
<tankf33der> ok
<taleon> cd pil21/src
<taleon> added `-L/usr/local/lib` to MAIN in Makefile
<taleon> gmake CC=clang15
<tankf33der> correct.
<tankf33der> git status
<tankf33der> only Makefile ?
<tankf33der> git reset --hard
<taleon> Yes only Makefile
<tankf33der> gmake -f Makefile.freebsd CC=clang15
<taleon> cr@thor:~/mystuff/src/pil21/src % gmake CC=clang15
<taleon> ld: error: unable to find library -lreadline
<taleon> ld: error: unable to find library -lffi
<taleon> clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
<taleon> gmake: *** [Makefile:38: ../bin/picolisp] Error 1
<tankf33der> add -f Maekefile.freebsd
<taleon> Oh yes, you are right. :)
<taleon> No it builds :)
<tankf33der> :)
<tankf33der> now it builds ?
<taleon> cr@thor:~/mystuff/src/pil21 % ./pil @lib/test.l +
<taleon> OK
<taleon> \o/
<tankf33der> ok
<tankf33der> now type:
<tankf33der> pkg install llvm16
<tankf33der> next:
<tankf33der> gmake clean
<tankf33der> gmake -f Makefile.freebsd
<taleon> Slow network...
<tankf33der> aha. ok.
<taleon> works :)
<tankf33der> compiled ?
<taleon> yes
<taleon> cr@thor:~/mystuff/src/pil21/src % ../pil +
<taleon> : (version)
<taleon> 24.1.21
<tankf33der> strings bin/picolisp | grep clang
<taleon> nothing
<tankf33der> ok
<tankf33der> forget.
<tankf33der> so
<tankf33der> now you have picolisp on freebsd14.
<taleon> Yes. Thank you very much for your help. Now I'm happy. ;-)
<tankf33der> :)
<tankf33der> afk.
<taleon> Ok, me too.
msavoritias has joined #picolisp
msavoritias has quit [Remote host closed the connection]
seninha has joined #picolisp
casaca has quit [Remote host closed the connection]
cpli has quit [Write error: Connection reset by peer]
payphone has quit [Read error: Connection reset by peer]
casaca has joined #picolisp
payphone has joined #picolisp
cpli has joined #picolisp
seninha has quit [Ping timeout: 264 seconds]