ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Check also http://www.picolisp.com for more information
mmmattyx has quit [Quit: Connection closed for inactivity]
_whitelogger has joined #picolisp
aw- has joined #picolisp
peterhil has quit [*.net *.split]
anddam has quit [*.net *.split]
peterhil has joined #picolisp
anddam has joined #picolisp
casaca has quit [Ping timeout: 264 seconds]
<tankf33der> morning
<tankf33der> i see new dots, so this is not hang. ok
_whitelogger has joined #picolisp
<Regenaxer> Hi tankf33der
_whitelogger has joined #picolisp
viaken has quit [Ping timeout: 240 seconds]
viaken has joined #picolisp
<Regenaxer> I wonder how to implement *OS and *CPU in pil21
<Regenaxer> Maybe *CPU makes no sense and is not needed
<tankf33der> ok, I cound find CPU myself.
rob_w has joined #picolisp
<Regenaxer> with uname?
<Regenaxer> *CPU is not as meaningful as in pil64, cause LLVM is by definition intended to be architecture-independent
<Regenaxer> But *OS is needed
<Regenaxer> Could be obtained by parsing uname
<Regenaxer> But I would like to have it at compile-time
<Regenaxer> resulting in a constant
<Regenaxer> The compiler knows all that
rob_w has quit [Quit: Leaving]
rob_w has joined #picolisp
<Regenaxer> you can ask with #ifdef in C
<Regenaxer> but this does not return a general value
<Regenaxer> you'd have to check for all possibilities, which is ugly
mtsd has joined #picolisp
<aw-> hi Regenaxer tankf33der
<tankf33der> o/
<aw-> uname works imo
<aw-> or
<aw-> in /proc/version if it's linux
<aw-> sysctl
<aw-> syscall
<aw-> i don't think it's the same on linux/bsd
<aw-> perhaps 'uname' is more reliable
<Regenaxer> Hi aw-
<Regenaxer> I know of these ways
<Regenaxer> but I want to set a global at build time
<Regenaxer> like in pil64
<Regenaxer> Otherwise better omit these two globals
<Regenaxer> I do *not* want to set it at startup time
<Regenaxer> that would be an absolute startup killer
<Regenaxer> $ time picolisp -bye
<Regenaxer> real 0m0.022s
<Regenaxer> user 0m0.000s
<Regenaxer> sys 0m0.020s
<Regenaxer>
<Regenaxer> : (bench (in '("uname") (line T)))
<Regenaxer> 0.022 sec
<Regenaxer> -> "Linux"
<Regenaxer> So same time as the whole startup
<Regenaxer> The parameters are known at compile time already
<aw-> i see
<aw-> so in this case, can you just make a lib/os.l or something?
<Regenaxer> Not an own file
<Regenaxer> in pil64 it is in src64/glob.l
<aw-> so one can (load "@os.l") which defines *CPU and *OS ?
<aw-> oh ok
<Regenaxer> ah
<Regenaxer> I see
<aw-> well i was thinking of having it external
<Regenaxer> yes, but that is overkill
<aw-> maybe you do pil + it also loads os.l
<Regenaxer> Then just do (when (= "Linux" (in ...
<Regenaxer> these two constants are seldom used
<Regenaxer> No, the point is that it is known at *compile* time
<aw-> ok
<Regenaxer> If not possiple at compile time, I would omit them
<Regenaxer> in the rare cases use (case (in '(uname) (line T)) ("Linux" ...) ...
<Regenaxer> As I said above: *CPU is not as meaningful as in pil64, cause LLVM is by definition intended to be architecture-independent
<Regenaxer> And I have only one single case where I used it
<Regenaxer> in PilBox checking for "emu"
<Regenaxer> to decide where to check for updates
<Regenaxer> That use case is obsolete now
<Regenaxer> None of these customers still have 32-bit phones
<Regenaxer> Does anybody else have a use case for *CPU?
<Regenaxer> I think we can omit it in pil21
<Regenaxer> So what is left is *OS
<Regenaxer> Any objections to omitting *CPU?
<aw-> i don't need it
<mtsd> Me neither
<Regenaxer> ok :)
<Nistur> mornin'
<Regenaxer> Hi Nistur
<Regenaxer> Anyway can be obtained by parsing "uname -a" or so
<Regenaxer> But a quick global *OS would be nice
<Regenaxer> For conditional 'load's
<aw-> right
<aw-> that's why i suggest @lib/os.l
<aw-> and load it by default in debug mode
<Regenaxer> No, overkill
<Regenaxer> In that case a check of uname is easier
<Regenaxer> instead of (load some lib) and calling it
<Regenaxer> As I said, it is *known* at compile time!
<aw-> but can't you automatically (setq *OS (in '(uname ..)) ?
<aw-> oh ok
<aw-> never mind ;)
<Regenaxer> It is ugly
<Regenaxer> a constant
<Regenaxer> never changes while picolisp runs
<Regenaxer> So calling a function for that is ugly
<Regenaxer> and a system call or even external program a lot more ugly!
<Regenaxer> The constant *could* be defined at compile time with #ifdef __Linux ... #else ...
<Regenaxer> But then we must cover all possibilities
<Regenaxer> And this breaks the principle that with pil21 I want to keep all assumptions about the platform out
<Regenaxer> This is the main reason why I took all the trouble with pil21
<Regenaxer> run everywhere without knowing in advance
<Regenaxer> I do not want to touch the sources or the Makefile for every new future platform
<Regenaxer> I think there must be some string constant defined in one of the C include files
<Regenaxer> That's what I'm looking for
<Regenaxer> Ha!!
<Regenaxer> Not C, but Makefile?
<Regenaxer> -D ... ?
peterhil has quit [Ping timeout: 256 seconds]
<Regenaxer> If not in some *.h -> #define OS "Linux"
<Regenaxer> I'm stupid. Makefile is the easiest
<Regenaxer> Same as in src64/Makefile now
<Regenaxer> $(shell uname) right?
<Regenaxer> haha, *CPU can be set too with $(shell uname -m)
<aw-> hmmm
<aw-> ok if you do it in the Makefile and the OS is not Linux, then what?
<Regenaxer> We all did not see that! :)
<Regenaxer> pil64 Makefile works everywhere too
<Regenaxer> Linux is not needed
<Regenaxer> we need POSIX anyway
<Regenaxer> so basically Unix
<aw-> ok good thing
<Regenaxer> yeah :)
<Regenaxer> The obvious way to do it
<aw-> wait wait
<aw-> Regenaxer:
<aw-> ok just checking
<aw-> on my computer i get aarch64
<Regenaxer> yeah
<Regenaxer> here too
<Regenaxer> uname -m
<aw-> just wondering if I copy the binary to a different hardware device (also arm64), it will also be aarch64, right?
<aw-> uname -m can't change between different arm64 devices?
<Regenaxer> It can
<Regenaxer> but then you will probably need to rebuild, no?
<aw-> that's what i wonder..
<Regenaxer> Slightly different OS means other libs
<Regenaxer> I don't know a situation where the binary would work 100%
<aw-> right.. different version of libffi or libc
<Regenaxer> But anyway, pil32 and pil64 do the same now
<Regenaxer> rely on Makefile constants
<aw-> or actually yes, i see ldd in picolisp21: /lib/ld-linux-aarch64.so.1 (0x0000007f7d3d6000)
<aw-> so it wouldnt run if the system is not aarch64
<Regenaxer> I see, yes
<aw-> yes yes, so Makefile is the solution
<Regenaxer> Very good :)
<Regenaxer> I had a blackout
<Regenaxer> (we all had ;)
peterhil has joined #picolisp
<Regenaxer> Work
<Regenaxer> s
<Regenaxer> released
<aw-> ../pil +
<aw-> -> "aarch64"
<aw-> : *CPU
<aw-> : *OS
<aw-> -> "Linux"
<Regenaxer> 👍
orivej has quit [Ping timeout: 240 seconds]
rob_w has quit [Quit: Leaving]
aw- has quit [Quit: Leaving.]
aw- has joined #picolisp
<aw-> when using (server) is there a quick way to have every directory access loading index.html by default?
<aw-> same result?
<aw-> i always get a 404 Not Found when i omit index.html
<aw-> or.. how can I make 'index.html' the default file to load
<aw-> ?
<Regenaxer> There is a mechanism for that
<Regenaxer> Create a file named "default" in hat directory
<Regenaxer> It will be 'load'ed
<aw-> oh right
<aw-> there's no workaround?
<aw-> i plan to have many directories..
<Regenaxer> You can have an many directories as you like
<Regenaxer> s/an/as
<aw-> but each directory needs 'default' file?
<Regenaxer> yes
mtsd has quit [Ping timeout: 240 seconds]
<aw-> :(
<Regenaxer> What should happen if these directories are requested?
<aw-> index.html is sent to client
<aw-> i tried to symlink index.html -> default
<aw-> but it tries to load it as picolisp code
<Regenaxer> yes
<Regenaxer> it is executed
<Regenaxer> you can symlink default ../../something
<Regenaxer> same for all directories
<Regenaxer> are these directories under your control?
<aw-> yes
<Regenaxer> So you can replace all index.html with some equivalent default
<aw-> hmmm
<Regenaxer> the default can do much more
<aw-> no i can't do that
<aw-> i can't change the index.html files
<Regenaxer> do checks, mark up etc
<Regenaxer> so do (echo) on something with pack, file, index.html
<Regenaxer> ie use 'file' to get the pat
<Regenaxer> h
<Regenaxer> only one "default"
<Regenaxer> symlinked from each directory
<Regenaxer> or you patch 'http'
<aw-> ugh
<aw-> ok i made a symlink default to ../../default
<aw-> and in default i put '(httpEcho "index.html")'
<aw-> it kinda of works.. except it tries to send the file as a download/attachment
<Regenaxer> needs mime type argument perhaps
<Regenaxer> or just 'echo'
<aw-> oh i think this works
<Regenaxer> (httpGate "index.html" "text/html; charset=utf-8") ?
<Regenaxer> with proper path 'pack'ed I think
<Regenaxer> otherwise "index.html" is not found, right?
<aw-> (httpEcho (pack (car (file)) "index.html") "text/html")
<aw-> works perfectly
<Regenaxer> great
<aw-> but i need to put a 'default' symlink in each dir
<aw-> not so bad
<Regenaxer> yeah, I see no better way atm
<Regenaxer> tankf33der: I did some fixes to variable binding frames and (trail)
<Regenaxer> Should not crash any longer in breakpoints
<tankf33der> i will play with.
<Regenaxer> Thx
<tankf33der> # make
<tankf33der> llvm-as: base.ll:1508:26: error: expected type
<tankf33der> make: *** [Makefile:34: base.bc] Error 1
<tankf33der> ^
<tankf33der> declare i64 @pwrite(i32, i
<tankf33der> :)
<Regenaxer> how come?
<tankf33der> git pull
<tankf33der> make clean
<Regenaxer> pwrite is in db.l
<tankf33der> make
<Regenaxer> hmm
<tankf33der> [root@void src]# make clean
<tankf33der> [root@void src]# make
<tankf33der> rm -f *.ll *.bc *.s
<tankf33der> ../pil lib/llvm.l main.l -bye > base.ll
<tankf33der> Segmentation fault
<tankf33der> make: *** [Makefile:36: base.ll] Error 139
<Regenaxer> Must check
<Regenaxer> must hurry for the station
<Regenaxer> will check later
<tankf33der> ok
<Regenaxer> funny indeed
<Regenaxer> ok, soon
mtsd has joined #picolisp
orivej has joined #picolisp
aw- has quit [Quit: Leaving.]
beneroth has joined #picolisp
mtsd has quit [Quit: Leaving]
_whitelogger has joined #picolisp
<Regenaxer> ret
joncfoo has left #picolisp ["Leaving"]
<Regenaxer> Hmm, I can't find it :(
<Regenaxer> I added only *OS and *CPU today, and changed trail and breakpoint handling
<tankf33der> what if you remove all and added back one by one?
<tankf33der> btw, compilation failed on your side, right?
<Regenaxer> It kind of depends on each other
<tankf33der> afk
<tankf33der> i see
<Regenaxer> yes, but mostly it worked
<Regenaxer> I releaset *.ll files
<Regenaxer> It only fails if the .ll files are needed to build
<Regenaxer> Can you run some tests with the release from now?
<Regenaxer> using the .ll files in the tgz
<Regenaxer> Perhaps you get an error for some specific function
<Regenaxer> Strange thing is that I did all changes today and could build and test them
<Regenaxer> Seems I'm searching at the wrong place ;)
<Regenaxer> Strange, now it builds again
<Regenaxer> Perhaps this is already longer, and we just did not notice?
<Regenaxer> Another heisenbug
<tankf33der> i will try in hours.
<Regenaxer> great
<Regenaxer> I try to trace
<tankf33der> should i do it in gc+?
<Regenaxer> yes, best
<Regenaxer> or first all tests without, is faster
<Regenaxer> If no error, then gc+
<Regenaxer> I do a trace here in the build process
<Regenaxer> It is difficult, cause all functions are redefined
<Regenaxer> Think I found something
<Regenaxer> It must be 'up'
<Regenaxer> Found by single-stepping
<Regenaxer> Yes, it is 'up'
<Regenaxer> tankf33der, no need for these tests now
<tankf33der> ok
<Regenaxer> I did not think of 'up' cause I thought it is not used in building
<Regenaxer> but it is, for logging comments
<Regenaxer> Now works :)
<tankf33der> latest pil21 passed all.
<Regenaxer> Good
<beneroth> congrats :)
<tankf33der> also aw- should run tests on his aarch.
<Regenaxer> yes, good idea
<tankf33der> admin of envs.net allowed me run long tests on his server. will be faster and old laptop colder.
<beneroth> how great from them :D
<Regenaxer> yes, nice
orivej has quit [Ping timeout: 256 seconds]
<tankf33der> also nice time to learn and use byobu.
<tankf33der> afk.
libertas has joined #picolisp
orivej has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]