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
beneroth_ has joined #picolisp
beneroth has quit [Read error: Connection reset by peer]
Core5519 has joined #picolisp
diogenes has quit [Read error: Connection reset by peer]
Core1278 has joined #picolisp
Core5519 has quit [Ping timeout: 248 seconds]
<Core1278> my local time is est
<Core1278> \nick diogenes
Core1278 is now known as diogenes
<diogenes> sigh
<diogenes> my local time is eastern standard time
<diogenes> I'm pretty new to irc
<tankf33der> diogenes: tankf33der@disroot.org
<tankf33der> write me, lets try via email
rob_w has joined #picolisp
rob_w has quit [Remote host closed the connection]
diogenes has quit [Remote host closed the connection]
beneroth_ has quit [Quit: Leaving]
beneroth has joined #picolisp
geri has joined #picolisp
<geri> こんばんわB)
<geri> question - how does tagging work exactly, if pointers occupy 64 bits?
<geri> like that's actually a C thing and what you do is limit maximum address to which pointer may point?
f8l has joined #picolisp
<abu[7]> Hi geri! It is depicted in @doc/structures
<abu[7]> The point is that the lowest 4 bits are free
<geri> yeah, i know the idea
<geri> my question is, don't pointers always occupy 64 bits?
<geri> it sounds to me like there's no space in that to store tag information
<geri> or maybe 64 bit pointers is a C thing
<abu[7]> Ah, no, they are always 64 bits
<abu[7]> ts
<abu[7]> It is the hardware
<geri> so like you just mangle the lowest bits of pointers? 🤔
<abu[7]> Not even that
<abu[7]> They point to the right *offset*
<abu[7]> eg. symbols 8 bytes
<geri> hmm
<geri> so pointers arent pointers? xd
<abu[7]> They are :)
<abu[7]> cells are aligned to 16 bytes
<abu[7]> so the 4 bits are zero
<abu[7]> syms are + 8
<abu[7]> etc.
<geri> hmmmm
<abu[7]> This is what @doc/structures tries to visualize
<geri> how do you actually do all those offsets?
<geri> like i have a number 8
<geri> in binary its 1000
<geri> you like, take the number and run << 4 on it to get the value?
<geri> the actual representation would be ...1000S010
<geri> (what does S stand for too :D)
<abu[7]> Yes, << 4 for a short num
<abu[7]> S is the sign
<geri> ah, + or -
<geri> okay
<abu[7]> Short nums are not pointers
<geri> yeah
<abu[7]> only they
<geri> you mean everything else is pointers?
<abu[7]> T
<geri> pointers are also just numbers, just with different tag bits, right?
<abu[7]> Yes, on the hardware all are 64 bit numbers
<abu[7]> Bit
<abu[7]> patterns
<geri> oh wait, what's the biggest short num you can represent in pil?
<geri> 2^60 or 59?
<beneroth> that's the correct question :)
<abu[7]> 60 bits plus sign
<geri> so about this much 2305843009213693952
<geri> :D
<abu[7]> (** 2 60) -> 1152921504606846976
<geri> and thats doubled because of sign
<abu[7]> T
<beneroth> so 4 bits are used for the tagging
<abu[7]> Right
<geri> (/ (** 2 60) 80000000000) # -> 14411518
<abu[7]> Externals also use 2 high bits on the name though
<geri> i guess thats how many gigabytes of ram you can have with pil
<geri> :D
<abu[7]> No, RAM is 2**64
<geri> i mean
<geri> thats how much ram you can point to with pil?
<abu[7]> Yes, the full space
<geri> okay, secondary question
<geri> can i have 32 bit pointers on 64 bit system?
<geri> it'll limit how much ram i can use, but overall
<geri> s/use/point to/
<beneroth> yes
<beneroth> but not the other way round
<abu[7]> Depends on the hardware
<abu[7]> segmentation
<geri> okay
<geri> so secretly, everything in picolisp is a number :D
<geri> just like everything else in computing though
<beneroth> on every computer
<beneroth> yeah
<beneroth> well dunno about lisp machines
<abu[7]> Yes ☺
<abu[7]> There too, must be
<geri> i wish lisp machines were a thing
<geri> gotta settle for emacs atm xd
<bjorkintosh> geri: why?
<geri> why what
<bjorkintosh> not build a lisp machine? :-D
<geri> i can write a lisp interpreter (which will suck), but im not very good with hardware overall
<geri> drivers are still black magic for me
<bjorkintosh> well. remember, there are only two things in software. data and instructions to transform that data.
<bjorkintosh> what is data? things that sit in memory. what's memory? a large map.
<bjorkintosh> or table.
<bjorkintosh> everything is a map.
<geri> just a bunch of bits!
<bjorkintosh> that's it!!
<bjorkintosh> blanks and non blanks.
<bjorkintosh> in the beginning, it's just zero.
<bjorkintosh> and then a wink appears. we call the wink a 1.
<geri> yeah
<geri> ik that like, drivers are just about handling whatever the sensors from periphery and such emit
<bjorkintosh> so a driver really is software. which we have determined is data and instructions to do something to the data.
<bjorkintosh> in lisp, both data and instructions are the exact same.
<bjorkintosh> geri: yeah!
<geri> (same only if its interpreted 👽)
<bjorkintosh> If.
<bjorkintosh> you're right.
<geri> you do gotta know what to treat as data and what to treat as code though
<geri> also which data to get, which can you ignore
<geri> and what operations should be done
<geri> :D
<beneroth> it's all just interpretation
<bjorkintosh> and what is interpretation? contextualizing!
<geri> and what's that?
<bjorkintosh> interpretation.
<geri> if its just a synonym that's not a very good explanation :/
<bjorkintosh> :-D
<bjorkintosh> sometimes, it helps a lot.
<bjorkintosh> I only speak english, but the other day I looked up the word node as in (nodes and edges in graphs)
<beneroth> the problem is gödel
<bjorkintosh> and the word node simply means 'knot'!
<beneroth> you need a metalanguage to describe the context
<bjorkintosh> similarly, I looked up the etymology of Raster. what's raster? simply the german word for Grid!
<bjorkintosh> and then Vertex. you know, the peak. top of something vertical.
<bjorkintosh> so seeing synonyms helps a lot.
<bjorkintosh> at least, it helps me.
<geri> it helps if you know the other meaning
<geri> so in my case, i know what interpretation is, but contextualizing is kinda confusing
<bjorkintosh> well if someone had told me several years ago that node simply meant 'knot', it would have been more obvious.
<bjorkintosh> you're right. my word is the wrong technical word.
<bjorkintosh> I also wish the idea of linked datastructures had been more obviously described.
<bjorkintosh> there're two kinds of datastructures: contiguous or linked. that's it!
<bjorkintosh> how simple and thoroughly obvious an idea.
<geri> i think lisp has taught me about linked lists more than any vids ive watched on data structures
<geri> bjorkintosh: hash tables are kinda both
<geri> well, if you have a string to pointer hash map
<bjorkintosh> right. linked lists contain both data and addresses for other bits of memory containing data ... ad nauseum until it gets to ()
<bjorkintosh> I simply wasn't paying attention in class.
<bjorkintosh> now, I see 'everything is a map'. and then other things are derived from that.
<geri> hash map is just a fancy array too
<geri> strings are arrays of characters (usually)
<geri> all that stuff
<bjorkintosh> yes. and arrays are just ... maps with numerical indexes.
<bjorkintosh> dictionaries? maps with indexes that can be numerical if you insist.
<geri> and cons cells are basically an array of 2 elements where car/cdr is either a pointer or an element
<bjorkintosh> 'xactly.
<bjorkintosh> and a pointer? just a variable containing a memory address.
<geri> which is just a bunch of numbers
<bjorkintosh> yes.
<bjorkintosh> it's recursive in nature.
<geri> is it?
<bjorkintosh> it can contain other pointers can't it?
<geri> technically it just points to a single bit, what's in there isnt pointer's responsibility
<geri> the exact address
<geri> but yeah, it can be recursive in that definition
<bjorkintosh> right. all depends on the context.
<bjorkintosh> it's either a number or an address.
<bjorkintosh> so I suspect the complexity of writing driver software boils down to the fact that it has to compensate for bad peripheral design.
<bjorkintosh> and that, is not necessarily predictable.
<geri> ahaha
<geri> thats probably true
<beneroth> interesting discussion
<beneroth> when will you leave computer science and go into philosophy?
<bjorkintosh> beneroth: that's debatable.
<beneroth> have you realized that reality might be just information and computing?
<beneroth> T
<bjorkintosh> I think it's all just data. and the act of interpretation turns it into information.
<bjorkintosh> or garbage.
<beneroth> T
<bjorkintosh> GIGO and so on.
<beneroth> data is a specific 0 or 1, or a specific number
<beneroth> information is what it means
<beneroth> some data can mean many things
<bjorkintosh> yes it's implied by the fact that interpretation contextualizes it.
<beneroth> good illustration
<bjorkintosh> beneroth: have you seen this btw? https://www.youtube.com/watch?v=XYugyhoohhY
<beneroth> nope
<geri> beneroth: data is raw bits, information is what those bits mean
<geri> something useful extracted from data
<bjorkintosh> yes. that is the definition. it's in the name. 'formation'
<geri> bjorkintosh: about the 6/9 thing: proper answer is "7.5+-1.5"
<geri> )
<bjorkintosh> hahaha
<bjorkintosh> very clever.
<geri> very stolen too
<bjorkintosh> sauce?
<geri> just a meme i saw some time ago, wont find it now sadly
<geri> if i could id be sending the link
<skyjuice> Hello all
skyjuice has joined #picolisp
<bjorkintosh> hello rain
_whitelogger has quit [Ping timeout: 252 seconds]
_whitelogger has joined #picolisp
<abu[7]> Hi skyjuice! Än URI of the form "!foo" is called as a function on the server (if 'allow'ed of course)
<skyjuice> Hi abu thx, let me give that a try
<abu[7]> OK
<abu[7]> For example:
<abu[7]> : (<href> "Test" (pack "!foo!" (ht:Fmt 123 "abc")))
<abu[7]> <a href="!foo!+123&abc">Test</a>
<abu[7]> oops
<abu[7]> better
<abu[7]> (pack "!foo?" ...
<skyjuice> thx abu, it works
<abu[7]> Great ☺
<skyjuice> is there a way to dynamically parse properties of external objects in the page title via (html) e.g  (html 0 (prinl (: nm))...?
<abu[7]> What do you mean with "parse"? print?
<abu[7]> hmm, ok, extract
<abu[7]> ht:Fmt will pack valuer properly
<abu[7]> values
<abu[7]> +num $sym etc.
<skyjuice> yep print/extract
<skyjuice> got it, thx
<abu[7]> (a b c) is encoded as _a_b_c iirc
<abu[7]> : (ht:Fmt 123 "abc")
<abu[7]> -> "+123&abc"
<abu[7]> : (ht:Fmt 123 '(a b c))
<abu[7]> -> "+123&_$a_$b_$c"
<abu[7]> (ht:Fmt 123 '("a" "b" "c"))
<abu[7]> -> "+123&_a_b_c"
<skyjuice> thx all working as intended, and more importantly for me its simple 😁
<abu[7]> 👍😎
f8l has quit [Ping timeout: 272 seconds]
bjorkintosh has quit [Ping timeout: 260 seconds]
bjorkintosh has joined #picolisp
skyjuice has quit [Quit: Client closed]