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 [Remote host closed the connection]
seninha has joined #picolisp
seninha has quit [Quit: Leaving]
m_mans has joined #picolisp
m_mans has quit [Ping timeout: 268 seconds]
seninha has joined #picolisp
m_mans has joined #picolisp
seninha has quit [Remote host closed the connection]
m_mans_ has joined #picolisp
m_mans has quit [Read error: Connection reset by peer]
m_mans_ has quit [Remote host closed the connection]
m_mans has joined #picolisp
<aw-> hi all
<abu[m]> Hi aw-!
m_mans has quit [Remote host closed the connection]
m_mans has joined #picolisp
m_mans has quit [Ping timeout: 268 seconds]
<aw-> I wrote my own Forth, in RISC-V Assembly
<aw-> there's still 2 small bugs i'm trying to fix now, otherwise it's fully functional
<abu[m]> Cool! Forth is really a lot of fun!
<aw-> assembly is hard.. not writing assembly, but keeping track of all the registers and operations on memory addresses is sometimes dizzying haha
<abu[m]> Yes. On 8-bit CPUs it was a lot easier.
m_mans has joined #picolisp
<aw-> next is to write mini-PicoLisp in risc-v assembly
<abu[m]> Do you use a 32-bit arch?
<aw-> yes 32-bit arch
<aw-> load/store, not as complex as x86
<abu[m]> yep
<abu[m]> How many instructions does your 'next' need?
<abu[m]> When Forthers meet, each asks the other about his 'next' ;)
<abu[m]> Direct- vs. indirect threading etc.
<abu[m]> For direct threading, 'next' can be a single instruction
<aw-> abu[m]: this is _exactly_ the bug i'm trying to fix, right now it's direct threading, NEXT is 3 instructions but... i'm thinking of switching to indirect
<tankf33der> Forth from abu
m_mans has quit [Remote host closed the connection]
<abu[m]> Unfortunately this Forth does not work on pil21, because of readline IIRC
<abu[m]> aw-, yes, I think I always settled for direct threading
<abu[m]> Looses a very little bit of flexibility but gains a lot of speed
<aw-> tankf33der: thanks
<aw-> wow that's short
<aw-> i could probably write a Forth in PicoLisp as well.. much quicker than in assembly haha
<abu[m]> I would like to do the opposite, write a PicoLisp in Forth
<aw-> that could be interesting
<aw-> perhaps miniPicoLisp?
<abu[m]> Yes, but then we have double interpretation and are thus rather slow
<abu[m]> Forth in general is relatively slow due to the permanent stack accesses
hrberg has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<aw-> yes, i only wrote it for 32-bit microcontroller, not for anything serious
hrberg has joined #picolisp
<tankf33der> i need to write a native call and have a struct for this.
<tankf33der> a struct to pass to native.
<tankf33der> write a struct call to set and to get in one call.
<abu[m]> OK, you mean pass a pointer to the struct with values, and have it returned with new values?
<tankf33der> yea
<tankf33der> i need more struct experience
<abu[m]> I think this case of 4 ints is not so difficult
<tankf33der> this is only the start.
<abu[m]> ok
<abu[m]> I think the above case is something like (X (16 I . 4) -1 -2 -3 -4)
<abu[m]> Returning 4 ints in 'X'
<tankf33der> insane.
<abu[m]> or (X (16 I I I I) -1 -2 -3 -4)
<abu[m]> I also have to look up the reference each time
<abu[m]> (I I I I) is 4 ints
<abu[m]> which need a struct of at least 16 bytes
<tankf33der> what is 16 ?
<abu[m]> The size to be allocated
<abu[m]> See the ref of 'native' after "structures, passed as lists"
<abu[m]> "a variable in the CAR" is 'X' here
<tankf33der> eh.
<abu[m]> The CADR has the size and result
<abu[m]> so it is (16 . <result>)
<abu[m]> If you want 4 ints, it is (16 . (I I I I)) or (16 . (I . 4))
<abu[m]> thus (16 I I I I) or (16 I . 4)
<abu[m]> It will fill 'X' with a list of 4 numbers, whatever it finds after the function returns
<abu[m]> "initialization items" are 4 ints
<abu[m]> "negative number ... unsigned integer"
clacke has joined #picolisp
seninha has joined #picolisp
beneroth_ has quit [Quit: Leaving]
beneroth has joined #picolisp
m_mans has joined #picolisp
m_mans has quit [Ping timeout: 272 seconds]
m_mans has joined #picolisp
beneroth has quit [Remote host closed the connection]
beneroth has joined #picolisp
<beneroth> cool project aw-!
m_mans has quit [Remote host closed the connection]
beneroth has quit [Remote host closed the connection]
beneroth has joined #picolisp
m_mans has joined #picolisp
m_mans has quit [Ping timeout: 272 seconds]
m_mans has joined #picolisp
m_mans has quit [Read error: Connection reset by peer]
m_mans has joined #picolisp
m_mans has quit [Remote host closed the connection]
m_mans has joined #picolisp
m_mans has quit [Remote host closed the connection]
m_mans has joined #picolisp
clacke has quit [Read error: Connection reset by peer]
m_mans has quit [Remote host closed the connection]
seninha has quit [Quit: Leaving]
seninha has joined #picolisp
Nistur has quit [Ping timeout: 268 seconds]
genpaku has quit [Read error: Connection reset by peer]
genpaku has joined #picolisp
Nistur has joined #picolisp