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
logand``` has joined #picolisp
logand`` has quit [Ping timeout: 256 seconds]
aw- has joined #picolisp
aw- has quit [Quit: Leaving.]
aw- has joined #picolisp
razzy has joined #picolisp
beneroth has quit [Remote host closed the connection]
beneroth has joined #picolisp
orivej has joined #picolisp
rob_w has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
razzy has quit [Ping timeout: 264 seconds]
vikid has quit [Remote host closed the connection]
vikid has joined #picolisp
_whitelogger has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
rob_w has quit [Remote host closed the connection]
Seteeri has joined #picolisp
<Seteeri> in pil21 src, for glob.l, "(var $foobar 0)" is effectively equal to "void* foobar = NULL"?
<Regenaxer> No, it is i64
<Regenaxer> (var $foobar 0) is the same as (var $foobar i64 0)
<Regenaxer> I just see there are some superfluous i64's ;)
<Regenaxer> hmm, no
<Regenaxer> default is not i64 but 'any'
<Regenaxer> 'any' *compiles to i64 but is different internally
<Seteeri> ah ok
<Seteeri> So far the heap seems to be initializing correctly. I followed pilos heapAlloc fn; still need to do coroutines and replacing (re)alloc calls. I'm trying to get basic I/O out :)
<Regenaxer> Impressing! Sounds like a fast progress!
<Seteeri> The alignment issues were really slowing me down before
<Seteeri> I have a really simple boot in assembly which calls the main of pil21
<Regenaxer> Aren't the alignments an issue no more?
<Seteeri> doesn't seem like it so far fortunately
<Seteeri> last time it wouldn't even get past the heapAlloc call
<Regenaxer> ok
<Seteeri> this time I'm using LLVM instead of the gcc builds from linaro
<Seteeri> it's possible it was an issue with the compiler
<Regenaxer> right
<Seteeri> so to do a char ptr: "(var $Uart i8* null)"
<Regenaxer> yes
<Seteeri> then I defined the address: "(equ AUX_MU_IO (hex "3F215040"))"
<Seteeri> but this doesn't compile: "(var $Uart i8* AUX_MU_IO)"
<Regenaxer> 'equ' is now simply 'setq', but such global is probably also directly (var $Uart i8* (hex "3F215040")
<Regenaxer> sorry again ;)
<Regenaxer> there *is* equ
<Regenaxer> the thing is that 'var' does not evaluate
<Regenaxer> so you need (var $Uart i8* `(hex "3F215040"))
<Regenaxer> or (var $Uart i8* `AUX_MU_IO)
<Seteeri> im getting an err: opt: base.ll:23:21: error: integer constant must have integer type
<Seteeri> @$Uart = global i8* 1059147840
<Regenaxer> yes, addresses are determined at link time
<Regenaxer> You can declare it as i64
<Regenaxer> and cast when you use it
<Regenaxer> (i8* (val $Uart))
<Regenaxer> but 'val' is overhead
<Regenaxer> you need a constant, not a var, right?
<Seteeri> yes
<Regenaxer> just 'equ'
<Seteeri> techically dont need $Uart
<Regenaxer> yeah
<Seteeri> so (set (i8* (val $Uart)) 48)
<Regenaxer> when you need the address do (i8* AUX_MU_IO)
<Regenaxer> $Uart is constant, so no 'var' and no 'val' needed
<Regenaxer> Just (i8* AUX_MU_IO)
<Regenaxer> (set (i8* AUX_MU_IO) 48)
<Seteeri> im getting err: [main.l:1281] !? ("val" "X")
<Seteeri> 1059147840 -- Variable expected
<Regenaxer> true
<Regenaxer> constant addresses were not needed until now ;)
<Seteeri> mmm thats why i was trying the $Uart
<Seteeri> i figure if i can do the fn in pilsrc there are less chances of issues vs directly in asm
<Regenaxer> What if you use a local?
<Regenaxer> hmm, no
<Regenaxer> (let P AUX_MU_IO (set (i8* P) 48)) is the same I think
<Regenaxer> we need AUX_MU_IO in an ssa register first
<Regenaxer> There *must* be an easy way
<Seteeri> my understanding is you define the vars in picolisp then pass these to llvm to perform ssa and do its magic
<Regenaxer> But never ask me such things in the evening
<Seteeri> haha
<Regenaxer> half sleeping and with a beer :)
<Seteeri> it seems trivial
<Seteeri> right now the main fn is stuck at the file init
<Seteeri> my plan is to remove the file fns since pilos is not unix-like ;)
<Seteeri> no worries, i should take a break also
<Regenaxer> you need perhaps 2 casts
<Regenaxer> or extend ~i8* to accept a number directly
<Regenaxer> (+ AUX_MU_IO 0) gives an ssa
<Regenaxer> so (i8* (+ AUX_MU_IO 0))
<Regenaxer> or some similar trick
<Regenaxer> or (io* (any AUX_MU_IO))
<Regenaxer> (i8* (any AUX_MU_IO))
<Regenaxer> 'any' geneates an instruction
<Regenaxer> so it gives an ssa
<Seteeri> this seems to compile: (set (i8* (any AUX_MU_IO)) 48)
<Seteeri> lets see the asm
<Regenaxer> ok
<Regenaxer> I should extend i8*
<Regenaxer> to accept constant 64-
<Seteeri> works!
<Regenaxer> bit nums
<Regenaxer> Great!
<Seteeri> the asm matches what i was expecting
<Regenaxer> :)
<Seteeri> thanks!
<Regenaxer> welcome!
<Seteeri> i do like pilsrc more
<Seteeri> easier to think about variables rather than registers
<Regenaxer> easier at low levels
<Regenaxer> ah, I misunderstood
<Regenaxer> I though pilAsm is better for such low level access
<Seteeri> i wonder if a better language can be developed around SSA similar to how C is a thin layer over asm
<Regenaxer> s/better/easier
<Seteeri> yes
<Regenaxer> I think pilsrc is pretty close
<Regenaxer> the layer is very thin
<Seteeri> i look forward to studying the frontend
<Seteeri> alright time for my beer also :D
<Regenaxer> good :)
<Regenaxer> Have fun!
<Seteeri> cheers!
<Regenaxer> :)
orivej has quit [Ping timeout: 265 seconds]
Seteeri has quit [Remote host closed the connection]
logand``` has quit [Ping timeout: 272 seconds]
logand` has joined #picolisp
logand` has quit [Ping timeout: 246 seconds]
logand``` has joined #picolisp
logand``` has quit [Ping timeout: 246 seconds]