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
rob_w has joined #picolisp
rob_w has quit [Ping timeout: 256 seconds]
rob_w has joined #picolisp
<tankf33der> ready
<tankf33der> http://ix.io/47Vl
<abu[m]> Supi!
<tankf33der> setup s390x linux on qemu, big-endian
<tankf33der> will run pil21 to test
<abu[m]> ok
<tankf33der> s390x:~/pil21# ./pil @lib/test.l +
<tankf33der> ((byte (adr (1))))
<tankf33der> [test/src/main.l:45] 18 -- 'test' failed
<tankf33der> byte returns 0
<abu[m]> This must be a big-endian machine
<abu[m]> The test is not good
<tankf33der> yeap, as i wrote above
<abu[m]> ah, sorry, did not see
<abu[m]> We must find out endianess
<abu[m]> (byte (+ 8 (adr (1)))) works, right?
<tankf33der> the same 0
<abu[m]> sorry, 7 of course
<abu[m]> hmm, I think we have the endianess somewhere. sysdef etc. ?
<abu[m]> I forgot
<tankf33der> now returns 18
<abu[m]> correct
<abu[m]> 18 is (hex "12") which is short number 1
<tankf33der> sysdefs
<abu[m]> Yes, but it does not hold the endianess
<abu[m]> We could check it with a 'byte' call ;)
<abu[m]> But I'm still not sure if we don't already have that info during the build process
<abu[m]> Or, shall we change the test to something symmetrical?
<tankf33der> i do not have a answer now
<abu[m]> (let A (adr (32)) (list (byte A) (byte (inc A)))) -> (2 2)
<abu[m]> This works regardless of endianess :)
<tankf33der> i will disable test for now
<abu[m]> I release
<tankf33der> afk.
<abu[m]> But can you check if there are more cases?
<abu[m]> oops, the above test is nonsense. I change it
<abu[m]> Released
<tankf33der> Doing
<tankf33der> s390x:~/pil21# ./pil @lib/test.l +
<tankf33der> [test/src/flow.l:407] !? (mist)
<tankf33der> mist -- :
<tankf33der> ==========
<tankf33der> : (catch '("Undefined") (mist))
<tankf33der> !? (mist)
<tankf33der> mist -- :
<abu[m]> hmm, so catching errors is also endian-sensitive?
<tankf33der> maybe.
<abu[m]> The secon example is manually on the TTY?
<tankf33der> yeap
<abu[m]> It seems that not the test failed, but the error exited the whole run?
<tankf33der> 14:06 <tankf33der> s390x:~/pil21# ./pil @lib/test.l +
<tankf33der> yeap
<abu[m]> Normal behavior would be
<abu[m]> (catch '("Undefined") (mist))
<abu[m]> -> "Undefined"
<abu[m]> But you get an error prompt
<abu[m]> !? (mist)
<abu[m]> So indeed the catch failed, righ?
<abu[m]> I dig into it later
rob_w has quit [Remote host closed the connection]
<tankf33der> s390x:~/pil21# ./pil +
<tankf33der> : (1)
<tankf33der> -> (1)
<tankf33der> -> "mike"
<tankf33der> : "mike"
<tankf33der> : 'mike
<tankf33der> -> mike
<tankf33der> : mike
<tankf33der> -> NIL
<tankf33der> : (mike)
<tankf33der> !? (mike)
<tankf33der> mike -- :
<tankf33der> ========
<abu[m]> I do not understand this output. Completely messed up it seems (?)
<abu[m]> e.g. where does "mike-:" come from?
<tankf33der> i showed different behaviour
<tankf33der> everything is working except (mike)_
<abu[m]> (mike) is an undefined symbol?
<tankf33der> yeap
<tankf33der> maybe intern traversal is broken?
<abu[m]> Are the first two lines exchanged?
<abu[m]> "mike" -> "mike"
<tankf33der> excahnged?
<tankf33der> i did copy-paste from terminal
<tankf33der> as is.
<abu[m]> I see first -> "mike" and then "mike"
<tankf33der> correct.
<tankf33der> as is.
<abu[m]> How can "->" come before you entered "mike"?
<abu[m]> Perhaps copy/paste went wrong
<abu[m]> Can you check thi irclog?
<tankf33der> entered "mike" and returned "mike"
<abu[m]> The lines appeared in IRC in wrong order
<abu[m]> Anyway, the point is "mike -- :"
<abu[m]> it does not say "undefined"
<tankf33der> s390x:~/pil21# ./pil
<tankf33der> : "mike"
<tankf33der> :
<tankf33der> : *CPU
<tankf33der> -> "mike"
<tankf33der> -> "s390x"
<tankf33der> i boot again and try
<abu[m]> ok
<abu[m]> (in irclog some lines are exchanged again. Copy/Past goes wrong)
<tankf33der> Screen shot
<abu[m]> Yes, I thought so. Butl your IRC client messes up the lines when pasting.
<abu[m]> So a little confusing ☺
<abu[m]> Anyway, I have no idea ATM what goes wrong with error handling
<abu[m]> e.g. if it is also an endianess issue
<abu[m]> Wow, the 390 architecture is more than 30 years old
<tankf33der> this is s390
<tankf33der> this is s390x
<abu[m]> Yes, Linux
<abu[m]> but the arch is 3090 right?
<abu[m]> s/3090/309/
<abu[m]> The text "undefined" is lost in error handling. How about other errors?
<abu[m]> : (/ 3 0)
<tankf33der> s390x:~/pil21# ./pil
<tankf33der> : (/ 3 0)
<tankf33der> !? (/ 3 0)
<tankf33der> ?
<tankf33der> Div/0
<abu[m]> ok, works
<abu[m]> Perhaps the string length? More than 7 chars like in "undefined"
<abu[m]> (+ 'a) a -- Number expected
<tankf33der> : (+ 'a)
<tankf33der> !? (+ 'a)
<tankf33der> s390x:~/pil21# ./pil
<tankf33der> a -- :
<abu[m]> ha!
<abu[m]> Long symbols
<abu[m]> : (rollback)
<tankf33der> s390x:~/pil21# ./pil
<tankf33der> : (rollback)
<tankf33der> :
<tankf33der> -> NIL
<abu[m]> : "abc def ghi"
<abu[m]> ok, so it works
<abu[m]> But not in errors
<tankf33der> : "abc ddd ccc zzz"
<tankf33der> -> "abc ddd ccc zzz"
<tankf33der> :
<abu[m]> good
<abu[m]> Can you look into @src/base.ll?
<abu[m]> @$27 = private constant [10 x i8] c"Undefined\00"
<abu[m]> Does this exist?
<abu[m]> hmm, must be, unless you rebuilt it
<tankf33der> I rebuilt as is.
<tankf33der> Afk.
<tankf33der> keep disable failed test and run again
<tankf33der> ext:Snx and Co
<abu[m]> Is this the first system we have with big endian?
<tankf33der> ht:Prin broken too.
<abu[m]> I think something fundamental is broken
<abu[m]> We must find the reason first
<tankf33der> it was solaris sparc before
<tankf33der> riscv is little endian.
<abu[m]> Yes, lots of things are broken if constant strings are wrong
<abu[m]> ok
<tankf33der> rest are working
<tankf33der> and all passed.
<abu[m]> good to know
<tankf33der> now running my tests
<abu[m]> But the byte test should have failed on solaris. It was pil64?
<tankf33der> no, it was pil21
<abu[m]> and big endian?
<tankf33der> yeap
<tankf33der> i can try to compile tomorrow again
<abu[m]> Perhaps the byte test was added after that
<abu[m]> Good idea
<abu[m]> Now the byte test is fixed though
<tankf33der> yes, passed
<tankf33der> (cos pi) failed
<abu[m]> We must first find out what goes wrong
<tankf33der> i just listing
<abu[m]> good
<abu[m]> Probably the long digit string
<abu[m]> Something is wrong with strings with more than 7 bytes
<tankf33der> compiling pil21 on solaris sparc
<abu[m]> good, and then use the old @test/src/main.l
<abu[m]> i.e.without the changed 'byte' test from today
<abu[m]> Should fail if big endian
<tankf33der> $ ./pil
<tankf33der> ? (catch '("Undefined") (mist))
<tankf33der> !? (in "ddddd" (read))
<tankf33der> : (in "ddddd" (read))
<tankf33der> "ddddd" -- Open error: No such file or directory
<tankf33der> -> "Undefined"
<tankf33der> ? *CPU
<tankf33der> ? *OS
<tankf33der> -> "Sparc"
<tankf33der> -> "Solaris"
<tankf33der> ?
<tankf33der> strings works here
<tankf33der> llvm11
<tankf33der> s390x llvm13
<abu[m]> messed up
<abu[m]> And the 'byte' test?
<abu[m]> (byte (adr (1)))
<tankf33der> 0
<tankf33der> i did not revers today's patch
<abu[m]> Good, so indeed big endian
<abu[m]> that's ok
<abu[m]> The old one would definitely fail
<abu[m]> as it tested for 18
<tankf33der> (cos pi) the same error
<abu[m]> What does (cos pi) return?
<tankf33der> 1000000
<abu[m]> Must be -1000000
<tankf33der> afk.
v_m_v has joined #picolisp
v_m_v has quit [Quit: Client closed]
<abu[m]> I think I found one reason
<abu[m]> Seme globals like 'Fsign' or 'Tio' are "i1" in PilSrc but "int" in src/lib.c
<abu[m]> "i1" is an 8-bit int and "int" is 32-bit
<abu[m]> So this breaks in big endian
<abu[m]> I released a change. @tankf33der when you are back please test.
<abu[m]> This might fix the sign in 'cos'. Not sure about the strings.
_whitelogger has joined #picolisp
<lagash> Some good news: I was able to run PicoLisp apps in a VM with BlissOS. The bad news is, it's still frustratingly hard to get it to load anything from the filesystem.