« first day (378 days earlier)      last day (1157 days later) » 

1:40 AM
If it was something that is hardly ever hand-written then it might be Ok
Problem with making null Unicode was that it comes up a lot (albeit less in k9 eg because cut now has I^ for greedy take)
 
 
5 hours later…
6:42 AM
@richie see above https://chat.stackexchange.com/transcript/message/53835279#53835279
we have already 12 adverb derived functions without counting overloads of non-function+adverb derivatives like "for".
How many more do you want? What's missing?
 
 
12 hours later…
6:52 PM
@yiyus lambdas in x,y,z are common in some contexts, rare in others. for example, when writing for a limited audience of k experts i prefer very short names and very compact code. when writing as part of a larger team with a large and complex code-base, i will use longer descriptive names (for the functions, not the locals) and an explicit argument list. and in that case i will adopt a style of short lines with at most a single assignment -- a:...
@ktye one or more recursive combinators, as developed by john earnest and i and presented in his vector paper of a few years ago.
 
7:07 PM
regarding how to map single symbolic characters to useful array ops, matters get simpler when designing a purely concatenative language on the model of Joy, or the even simpler language False. if you have any interest in this topic you can study the assignments i make in the two false-like languages F and G here: nsl.com/k/f/f.htm, especially section 9.
 
7:20 PM
@StevanApter thanks! I was asking specifically about expressions like :x+y, not functions like {x+y}. Is that what you meant?
 
ksi
8:12 PM
@ngn tring to port ngn/k to macos with nostdlib. now get only one test case left. n:#1:"t.k";(0<n)&n<10000000. which gives 'mmap1 error. i looked at the implementation of 1: what's the two-step mmap for? i don't i have enough knowledge to debug this...
 
ngn
Jan 12 at 23:35, by ngn
maybe two-phase freeing could work. first: decrement the refcount, test for 0, and reclaim ordinary memory, second: unmap it if it was a file.
in addition, allocations are not allowed beween the two steps (this is asserted in debug mode)
the purpose is to make memory access more sequential - the refcount is in the header, so better deal with it first instead "going back" after the vector's data is processed
oops.. ignore the above - that was about the two-step free()
@ksi the two-step mmap() works like this: the first call to mmap allocates memory for the array + 1 additional page. the additional page is for the header. even though the header is just 16 bytes, it must take a whole page, because mmap() can only work on page-aligned addresses.
the second mmap() puts the file content within the memory allocated by the first mmap(), leaving out the first page
did i explain it well enough? i'm not good at this.. i'll try to draw a diagram
    |       |       |       |       |       |
    |    hdr|content,content,content..      |
     \_____/
     1 page=4096 bytes

    ^       ^
    |       |
    |       second mmap is MAP_FIXED at this address
    |        and it puts file content there
    |
    first mmap returns this address as MAP_ANONYMOUS memory
 
ksi
8:34 PM
@ngn i think i got you, so we should expect the second mmap() return the same pointer as ZP+p, if the file is correctly mapped to that chunk of memory. so, error probably means the file is mapped to somewhere else or maybe error happened.
 
ngn
@ksi correct. unfortunately i don't have access to a mac to test on.
 
ksi
@ngn i am not sure how mmap works, why wouldn't the first mmap marks the whole chunk of memory taken, so the second mmap has to find another page?
 
ngn
@ksi i'm not sure what you mean. could you rephrase the question?
the first mmap makes sure there's enough room for header+content. the second mmap "fills in" the actual content. i don't think i can get away with a single mmap.
 
ksi
@ngn i thought mmap is used to allocate a new chunk of memory, is this true only when the second last parameter is -1?
 
ngn
8:50 PM
@ksi it's used for both: allocating memory (with MAP_ANONYMOUS and fd==-1) and mapping files (with fd!=-1)
 
u1c() reads from a file ma() allocates normal memory
not the first time this comes up in k-land: github.com/kevinlawler/kona/issues/162
 
ksi
@ngn okay i will look more into this. another strange thing is when i change the optimization flag from O0 to O3, three more json parser test cases fails, although i manually checked and found the results are correct.
 
ngn
@ksi huh. that's strange.
 
9:16 PM
@ktye I'd get rid of the overloads and promote function take and function drop to a bonafide adverb called filter instead of using overloads of # and _ which are verbs
 
@richie in apl/iv i experimented with functions within bracket indexing. see the last examples of github.com/ktye/iv/blob/master/TESTS.md#indexing-tables
 
 
2 hours later…
ngn
11:06 PM
offtopic: lol, i feel surrounded :)
 

« first day (378 days earlier)      last day (1157 days later) »