« first day (144 days earlier)      last day (1391 days later) » 

ngn
7:02 AM
hey @ktye have you thought about introducing tagged pointers?
 
 
6 hours later…
12:43 PM
@ngn did you mean to reference a particular message?
 
ngn
@chrispsn ugh... sorry, i meant to link to en.wikipedia.org/wiki/Tagged_pointer
 
 
5 hours later…
6:10 PM
I don't use real pointers at all. Memory is stored in the global variable m, which is indexed by an uint32 (which I call k). My addresses are indexes. As the smallest bucket is 16 bytes, so the indexes are multiples of 4. So yes, in theory I could store 3 additional states (x+1, x+2, x+3), not even 2 bits. But I had to remove them everywhere...
Do you use these? What for?
 
ngn
@ktye so your indexes i are like pointers to m+16*i
the point of tagging the pointers is to avoid memory access when it can be avoided
for some scalar types there could be enough bits within the "pointer" (which is no longer a pointer then...) to store the actual value
 
https://github.com/ktye/i/blob/master/k.go#L47
The index i accesses m.k[i] which is a uint32. It stores type and array size. m.k[1+i] is refcount and m.k[2+i...] is the data.
The data is accessed by m.c[8+i] for chars, or m.f[1+i] for float64. m.c, m.k, m.f share the same memory but are simply recasts.
What I currently miss, is a sorted or unique flag.
But i do not see which kind of value is small enough to be store in there...
 
ngn
6:27 PM
@ktye very similar to mine, except i reserved a whole word (64 bits in my case) for the length and less than a word for the refcount
@ktye isn't 32 bit too limiting? just 4GB
 
@ngn That was with wasm in mind.
 
ngn
@ktye example: suppose you reserve the first 8 bits of the pointer (or "index" if you prefer) for the type of thing it points to. if, for instance the type is a char, there would be no need to reserve space in m[] for it at all, as you could put the char's value in the lower bits of the "pointer"
thus avoiding memory access to m[]
 
@ngn But that would work only for atoms.
 
ngn
@ktye yes. many real-world k objects are atoms.
 
I was about to right a sixel image encoder: https://github.com/ktye/i/blob/master/k/six.k
The mandelbrot example runs very slowly. Maybe you have an idea.
But the last part is unfinished.
On that same topic: To implement run length encoding, what is the inverse of repeat? ?x
 
ngn
6:38 PM
@ktye i don't understand the question. "repeat" has 2 args, right? "inverse" with respect to which of them?
@ktye how does one view a sixel image?
 
@ngn on a DEC (or an xterm)
@ngn That's the point of it. No extra dependencies than the terminal that you have anyway.
 
ngn
@ktye so sixels have unicode code points?
 
@ngn It predates unicode by far. Everything is ascii.
If I have a vector 1 2 2 2 1, I would like to have two results, The value and the number of repetitions. e.g. (1 2 1;1 3 1).
I can see that there are repetitions with =':x
 
ngn
@ktye i tried the sample from wikipedia - put it in a file, replaced <ESC> with literal 0x1b-s, but when i cat it it only prints an empty line
 
@ngn Maybe you need a recent xterm (sixel support is new for xterms i think), or a TERM variable.
@ngn search for xterm on the site, it lists the requirements
 
ngn
6:51 PM
@ktye something like {(*:;#:)@'\:(&~=':x)_x}?
 
@ngn Thanks. That looks good. I'll use it for run-length encoding. I think that will speed up line graphics that does not need all pixels a lot.
 
ngn
 
I might have seen that before, I think you already pointed that out to me. But I forgot about it.
And do you have a faster version for the mandelbrot?
This is the go version, including the sixel part: https://github.com/ktye/i/blob/master/k/six.go
I use the while operator, but need to return the new state and the number of iterations. Maybe packing and unpacking makes it slow. Also you have to store the initial state.
If you increase w and h, it shows that it is too slow.
 
ngn
@ktye i can't even get past sixel rendering...
 
@ngn It does not work on you xterm?
 
ngn
7:01 PM
maybe rendering as ascii would be easier?
 
@ngn did you read the requirements on saitoha/libsixel? It needs to be compiled into, and you need to set the ti
 
ngn
@ktye too complicated
 
@ngn or you run windows and use mintty
 
ngn
7:30 PM
@ktye here's something that looks like the mandelbrot set
it runs instantly and doesn't require complex numbers
 
@ngn how many iterations does it do maximally, 9?
 
ngn
@ktye as many as you want. at some point doubles overflow so some pixels will get the wrong "colour"
this could be worked around with m&(-m)|... in the loop, where m is some large number
 
@ngn Thank you. I have to think through it.
 
 
1 hour later…
8:44 PM
Just figured I'd post this link, as it might be of interest to people here. clemenswinter.com/category/locustdb
 

« first day (144 days earlier)      last day (1391 days later) »