« first day (581 days earlier)      last day (954 days later) » 

ngn
ngn
00:24
@JeromeIbanes afaik wasm is supported in clang ≥8
@JeromeIbanes i'm on buster too! after two manual upgrades that luckily went well :) but i used this repo to install clang
haha, very cool.
does arch=native means i386 for you?
ngn
ngn
@JeromeIbanes yes :(
haha what machine is this
ngn
ngn
when i move back to town i'll try to find a service to repair my thinkpad, or buy another one
oh it's seriously busted?
ngn
ngn
00:29
@JeromeIbanes a 12-year-old asus eeepc
@JeromeIbanes just the power jack or the supply
hope just the supply they're easy to find
ngn
ngn
btw, the eeepc is actually a frankenstein made from two eeepc-s :)
it outlived 3 other laptops, iirc
those eee were never so great
but the price was right
apparently this site installed clang-11
ngn
ngn
@JeromeIbanes it has repos for 10, 11, and 12
cool
don't think I ever had 9 c compilers on one system before
ngn
ngn
00:38
@JeromeIbanes the eeepc-s had the perfect keyboard, i prefer it over modern laptop keyboards
oh, I like the lenovo's
and the glidepoint, or whatever this red thing is called
ngn
ngn
@JeromeIbanes its popular name is a dirty word :)
ngn
ngn
lenovo uses two kinds of keyboards now, if i'm not mistaken
one is the apple-like flat kbd - i can't stand it
the other one is tolerable, modern thinkpads and whatever-pads have it
but there was an older one with slightly deeper keys - that is the same as on the eeepc
they don't make it anymore
oh the flat one is horrible
the old one is good
it's not completely identical to the X301 keyboard, but not too far off either
ngn
ngn
00:45
@JeromeIbanes that one looks good
it's probably t's makefile that loops
ngn
ngn
wat
it's probably t's makefile that loops
ngn
ngn
@JeromeIbanes something important about the web server: the mime type of a .wasm file must be "application/wasm", otherwise browsers will reject it
you know that's probably why
let me see where I can add this
ngn
ngn
00:54
@JeromeIbanes what server do you use?
apache2 on that box
 
2 hours later…
03:20
back, oh neat it works with new mime
@ngn of course no read/write and such, but that's still cool, have you run the whole suite of tests on wasm?
ah no \t not sure why, probably removed all the \ things
hehe, it's a bit slower.
@ktye how difficult would be to implement read/write to websockets?
 
2 hours later…
05:44
from where to where do you want to use websockets? whatever you can do in js would work. k.js is the interface: env:{read,write,mmap,munmap:O,exit:O,hop:O,hcl:O,now:O,u0c:O,u1c:O,cmd:O,v0c:O,v1c:O,frk:O}
these are functions implemented in js which are called from k(wasm). you can provide implementations for hop/hcl e.g. to do ws connections.
@ngn very nice! we set the initial memory double the size k requests at init. there needs to be more because c needs some (for data and stack). everything below __heap_base is for c, above for k.
Your mmap (in js) needs to grow wasm memory, if the initial size if exceeded. this can be done with: K.exports.memory.grow(n) where n is in 64kb blocks.
@ngn i also have file drop: execute a .k file after dropping it. store other files in memory.
@ngn also nice would be to read files from the server, e.g. libraries or data. that could be with io verbs or \l file. i use this:
function load(s){fetch(s+".k").then(r=>{return r.text()}).then(s=>E(strip(s)))} // e.g. \lm
 
4 hours later…
10:12
@ngn if compiled with -Oz it's 93k which can be further reduced with wasm-opt to 77215
 
2 hours later…
ngn
ngn
12:08
@ktye my js mmap() is a golfed version of your mmap() from wasm.c :)
@ktye if possible, i'd prefer to use my original i.c (i/o verbs) and implement only the syscalls in js
@ktye file drop is an advanced feature :)
@ngn how do you read files? with mmap(addr..) ? we would implement this with a call to fetch.
ngn
ngn
@ktye why do you use function(x){..} in some cases and x=>.. in others? btw, r=>{return r.text()} is the same as r=>r.text()
@ktye by implementing syscalls related to files. i'd rather keep the exact same verb implementations in wasm k and ordinary k.
@ngn i don't know js very well. just learning. but i invented the shortest style of local declaration. no let no var.
ngn
ngn
@ktye no let or var makes it global though (unless it's a parameter name)
12:24
see here: https://github.com/ktye/i/blob/master/_/listbox/listbox#L65
n is a local. js does not project.
ngn
ngn
right. it is a parameter name.
parameters are locals. but generally if you do n=.. in a function that doesn't have an "n" in scope, it creates a global variable.
@ktye i put -Oz in "make wasm", thanks
ngn
ngn
12:50
@ktye when you .grow() the memory, does it replace the memory.buffer with a new instance?
@ngn it should be like realloc. wasm should just work. I'm not sure about M. You can reassign M after grow(). That is what i do.
ngn
ngn
i'll try to test it
ngn
ngn
13:18
@ktye yes, M needs reassignment
but growing too much can freeze the browser, pop up warnings, and create a bad first impression, so for psychological reasons it may be better not to grow, at least by default
@ngn or you set an upper limit. currently we have 32MB to start with.
 
1 hour later…
14:28
@ngn what is O? undefined?
ngn
ngn
@ktye a function that returns 0
i just wanted the simplest thing that works
otherwise, syscalls should return a negative result on error
15:07
ngn vs ktye: ktye.github.io/nk.html
3
ngn
ngn
16:07
@ktye haha :) fun
16:46
@ktye can k.wasm run headless (not in a browser or electron)?
@ktye haha nice indeed
ngn
ngn
@JeromeIbanes from what i gather, it can but you have to install an additional set of tools
@JeromeIbanes you were right about the tests, something's wrong there
@ngn cool, thanks for looking.
17:23
there are many interpreters for wasm, but we need to provide an import module, because some things need to be implemented by the embedder.
There is e.g. wasm3 which is a c program and provides a library that could be used.
I use a go library called wagon, that runs my test cases after compiling k.w to wasm: https://github.com/ktye/i/blob/master/_/w/wagon_test.go
ngn
ngn
17:42
does anybody understand the logic behind (0N;x)# and (x;0N)# in oK? i'm not sure what to do with #24
18:06
@ngn first calculate the number of rows, then fill by ravel order. the last row may be short or longer. k9 just discards, e.g. n^.. which you could do as well.
@ngn the q docs state that A null in x will cause that dimension to be maximal.
ngn
ngn
what about 4 0N#&10? - shouldn't the "extra" items all be in the last row?
or maybe the first two rows should be longer - that would also look consistent
@ngn this is what ok does. but it's surprising.
It looks like ok matches what k4 does as well; (0 1;2 3 4;5 6;7 8 9) ~ 4 0N#!10
18:30
Hmm, it looks like for 4 0N#10 ok does _(10*!4)%4, which are then used as the indices to pass to _/cut (i.e. change !10 into (0 1;2 3 4;5 6;7 8 9))
(Also I think 0N can only appear as the first or last value of the LHS argument to #)
ngn
ngn
@coltim that must be it. thanks!
 
4 hours later…
22:18
if it's any consolation I believe I originally had essentially what ngn did and then one day spent several hours trying to figure out what the hell arthur was doing to replicate his behavior
ngn
ngn
@JohnE it the same everywhere now :)
the prophesy is fulfilled

« first day (581 days earlier)      last day (954 days later) »