« first day (1498 days earlier)      last day (1155 days later) » 
01:00 - 22:0022:00 - 00:00

ngn
10:00 PM
@Marshall its performance is not an issue?
 
I know of a good vs-code extension that allows you to type an escape sequence to input whatever character you want by name
 
@ngn For the vast majority of applications, no.
@nathanrogers Any connections to things that aren't BQN. dzaima/BQN has a few things like file I/O but they're all pretty simple.
Depending on what you want to do, it may be good enough or not.
I'm talking about dzaima/BQN here as the self-hosted one definitely isn't fast enough to use seriously.
 
I think the main thing I want is a language which has full shell interactivity. I need to write programs to and from unix |, and most of what I do is reading streams/files/or sockets/REST
and these things seem like the least on the APL-like communities' list of priorities
or if they're pertinent, not really mentioned or emphasized anywhere
 
ngn
@nathanrogers are read()/write() with file descriptors ok? what is "full shell interactivity"?
 
considering dyalog APL is only just introducing scripting, definitely doesn't seem like it
 
10:04 PM
@nathanrogers dzaima/BQN does some of that. stdout works of course, command-line arguments are good, stdin might be kind of clunky. I don't think it does sockets but I never understood those.
 
@rak1507 wait. did that happen?
 
it's a work in progress so by dyalog timescales it'll be a thing in the next decade
 
ngn
it has been happening for at least 7 years
 
And everything's designed with #! scripting in mind, so that part at least is positive.
 
ngn
and shakti already has #!
 
10:05 PM
@ngn I need to be able to talk to my environment. start independent processes, introspect the environment, manipulate the environment as necessary
 
ngn
@nathanrogers start independent processes - check
"environment" as in "environment variables"? or more abstractly?
 
well, I would say in python I interact directly with the shell. I call unix programs, execute other scripts, start processes, divert data flow from open streams in the environment
I mean in the most general sense, interacting with the operating environment
 
Regarding project organization, I think BQN is fairly strong (compared to ordinary languages: J and Dyalog are clearly miles worse). It uses namespaces to organize things, which is very clean. They're not well documented yet though. See Exports.
 
like can I unix pipe a program written in a given language to and from other pipes, can I write a program which orchestrates the operating system to monitor and manage all manner of these kinds of tasks
can I SSH to another environment and do the same thing there
and of course, REST, and elegant JSON/Dictionary literal syntax
these are the things I do on the regular for work
 
ngn
@nathanrogers to include your program in a pipe, all you need is being able to read from stdin and write to stdout. dyalog can't do that. almost all programming languages can.
 
10:10 PM
that's what I'm saying
 
ngn
@nathanrogers pls, have a look at ngn/k one day when you're free, and tell me what's wrong with it
 
I'm not criticizing it... I'm asking which if any APL-like languages do this sort of thing
 
ngn
rest - no (that would an external web server's responsibility, at least for now). json parsing - yes. dicts - yes.
 
if I can interact with the shell, I can curl
 
ngn
\ls does that in the repl
 
10:13 PM
rest doesn't have to be native, but I do consume a lot of REST API
 
ngn
."\\ls" does the same from k code, returns list of strings
 
Yeah, ngn/k sounds pretty usable for what you want, if the lack of documentation isn't a problem for you. BQN doesn't have a dictionary type, and you probably shouldn't try to use namespaces to replace it. I've been thinking it should provide a dictionary class with a probably system-backed implementation, so it creates an object (namespace) that has functions like Set and Get exposed.
 
ngn
@nathanrogers so, something like curl can handle the communication
 
yes, curl is used quite a bit to make rest calls
you sure make people chase repos
 
@Marshall so you'd literally use something called Set/Get in BQN?
 
ngn
10:17 PM
@nathanrogers just curious: do you ever need things like starting a process and read()-ing and write()-ing to its stdin stdout in small chunks? or is k's \ returning list of strings sufficient?
@nathanrogers click on my avatar
 
@rak1507 Yes, you'd write key map.Set val or map.Get key (there would be array versions too).
 
:(
 
Maps don't really fit into the APL model because they only have one key. I think it's better to handle them as objects.
 
ngn
@Marshall why Get and Set instead of dict[key] and dict[key]←..?
 
@ngn proper streams, as in getting chunks of data in real time
 
10:19 PM
They do fit into the K model, so if you want to use maps heavily then K is probably better.
 
have to say the unification of dicts/arrays/functions is one of the nicest things about K imo
 
@Marshall so no immutable dictionaries?
 
I'm a convert to that having found it very weird before
 
@rak1507 Q with its first class tables is really nice
Kinda wish everyone had those
 
ngn
@nathanrogers you know, Q is k(interpreter + some k code)
 
10:21 PM
yes
 
Everything should be first class
 
@ngn I don't have special syntax for array indexing, so I definitely wouldn't add it for dictionaries.
 
why not use the same syntax you use for array indexing for dictionaries?
 
ngn
yeah, ^that's a better way to put it
 
@rak1507 They are not the same operation. One key versus many. If you try to work out the details, you'll find that they just don't work.
 
10:23 PM
what is an array if not a 'mapping' from indices to values?
 
@rak1507 array indices can be vectors
 
sure, didn't say they couldn't be
 
ngn
@dzaima you can enclo.. enbox them or whatever it's called
 
@ngn right, but that's incredibly ugly
 
@dzaima Usually the reason you'd use a dictionary is for performance, and in that case you probably want it to be mutable. But I haven't though too much about the system-provided class idea and maybe there are other strategies that are better.
 
ngn
10:26 PM
@Marshall "for performance .. you probably want it to be mutable" - wouldn't same logic would apply to arrays too?
 
Obviously you can have a class that makes an immutable dictionary, but it could be hard to allow modifying that dictionary (to make a different dictionary) with good performance.
 
@rak1507 getting item of a scalar currently always is equal to . That doesn't work if is a valid map key. Solvable by enclosing the key as ngn said, but that's ugly
 
ngn
@Marshall just represent it as 2-vec of keys and values and reuse the infrustructure for arrays
 
@ngn I think practically speaking the use case for mutable arrays is much smaller relative to immutable ones.
 
@dzaima who cares, conceptually they are the same thing and writing .Get and .Set in an array language doesn't feel good
 
ngn
10:27 PM
@Marshall users wouldn't know
 
@ngn making that allow for ±O(1) insertion while still having ±O(1) reads is complicated
 
ngn
@dzaima yes. i've been through it. once you're done, it's simpler.
 
I never thought I'd say this but this is something PHP (!!) does right
 
@rak1507 I think a lot of the reason for that is that existing array languages don't do objects well. It's starting to feel natural to me to write BQN code that mixes arrays and OOP.
 
Array languages shouldn't do objects
 
10:30 PM
what about a generic data-in/out notation
that'd be useful
 
@ngn do you really have O(1) read & write performance? (or O(1) cache misses for a very big dict i guess)
 
ngn
@nathanrogers what would that look like?
 
It's not really that different from variables versus primitives. Generally the variables (including functions) are the important parts of the program that show what's being done where, while the primitives are glue that shuffles all the data around. There are more primitives than variables but they take up less weight in the program.
 
ngn
@dzaima as long as the refcount of an array is 1, an amend operation reuses the same chunk of memory, no copying
 
hmm, maybe ► for out ◄ for in with a left argument that specifies what kind of external communication you're interested in
 
10:33 PM
is this reading/writing from/to stdin/stdout?
 
@rak1507 But why is mixing objects with array programming inherently bad? They shore up a lot of the weaknesses of the (particularly tacit) array style. They give you well-controlled access to mutability and help organize code.
I think they are a good fit but array programmers historically haven't understood how to use objects. Or closures for that matter.
 
@Marshall imo a functional approach is more suited to array and parallel programming
 
@nathanrogers Once you're taking an argument to specify the format, which is presumably a string, I think it stops making sense to use a primitive, and it should be a system or library function.
 
'GET'◄ 'url'
'stdout'◄ 'line'
'PUT' ► json
sure
I'm just saying that communication with the outside world doesn't seem to be a focus of the entire history of array languages
 
in more than 1 way
 
ngn
10:37 PM
@nathanrogers how does this sound? for read 0:"urlOrFilename" or 0:fd. for write "urlOrFilename" 0: "data" and fd 0: "data".
0: reads/writes lines, 1: reads/writes bytes
 
@ngn this doesn't look very O(1) to me
 
I'll take a look when I can get it to build
 
@rak1507 Yes, I use a pure functional style for programs that work with a few large arrays. But why should an array language only be good for array programming?
 
no one wants another language that is second best at everything
 
ngn
@dzaima that's a recent ngn/k (not: shakti), right?
 
10:40 PM
I think the pithy lisp quip "better to have 100 functions for 1 data structure, than 10 functions for 10" is applicable here. writing functions that operate on a singular data representation is a strong approach. The strength of array languages is it makes this point all too obvious... the weakness of array languages is that there is no other way
 
@ngn december 15 ngn/k it seems
 
ngn
@dzaima it looks more like the effect of introducing 16bit ints, not something about dicts
 
But there's also the idea that functions are an antipattern because you can just directly interact with your data. so should you write functions, or whole programs instead... then it gets all kinds of abstract and nobody is having that conversation anyway
 
ngn
@dzaima and damn.. your computer is fast :)
 
@ngn got latest from sr.ht, the first test went 1500ms→8400ms
 
10:45 PM
@rak1507 I don't think that applies here. Namespaces are a feature I added for structuring programs before I ever tried OOP with them. So BQN supports OOP with literally no design effort.
 
ngn
@dzaima sounds bad. i'll have to take a look at that tomorrow.
 
@ngn what is FD?
 
ngn
@nathanrogers file descriptor
 
@Marshall I was responding to 'But why should an array language only be good for array programming?', to me the answer is 'because that's the only sane reason anyone would ever use one for'
 
@dzaima for reference, dzaima/APL with stringifying keys and using a regular mutable java HashMap
 
10:47 PM
@rak1507 That's a feature of existing array languages. I think my experience with BQN shows it's not a necessary one.
 
@Marshall Why would anyone use BQN (or any other array language) over well established languages if not for a niche purpose best suited for array programming?
 
@rak1507 the alternative being what, never being able to use array-oriented programming in any of your code? (unless you're happy with mixing multiple languages together i guess)
 
where can I find the language spec? @ngn
 
You can do array programming in basically any language that has an array library (which is most of them)
 
ngn
@dzaima what is a⌸?
 
10:50 PM
@rak1507 BQN essentially embeds Lisp minus macros, so similar reasons apply. It's combinators are really nice as well. And nearly every program is going to use arrays a fair amount so having array operations is great even if you're not working with arrays exclusively.
 
@rak1507 I don't consider it array programming unless there a literal syntax for it
 
@ngn x(a⌸)y is a[x]←y (which is invalid in dzaima/APL, so it is)
 
@ngn I don't know what anything does, or how things are defined
 
@Marshall Which are all great, so why clog it up with OOP?
 
@rak1507 I didn't. It just happened!
 
10:51 PM
'file.txt' 0: 'sometext' I would have expected to work. and I'm not really sure where to look for definitions
 
I'm not convinced but if you can pull it off that will certainly be interesting
 
ngn
@dzaima ok, definitely needs investigation. thanks.
 
Objects are very closely related to closures if you're not aware.
 
Overusing closures feels like abuse as well
 
ngn
@nathanrogers double quotes
 
10:53 PM
but still, I don't know what anything is defined as
 
@rak1507 That's correct, you should use them the exact right amount.
 
or is it all in the repl?
 
ngn
@nathanrogers pls use the "reply" button. was this for me?
 
@Marshall Do you have any OOP example code?
 
10:54 PM
@dzaima (if BQN didn't have such harsh restrictions on modifier characters, I'd definitely go for something equivalent in BQN. ((m⌸)x also reads key x from m))
 
ngn
@nathanrogers "file.txt" is a string (list of chars). 0: is a verb, like + etc, in this case applied dyadically.
 
@ngn no you're missing my question. where are the definitions
 
@rak1507 I'm writing up a document on how you can use OOP in BQN; should be done in a few days. The in-progress Singeli compiler uses objects a lot; here is a stack class.
 
ngn
@nathanrogers the source code?
 
10:56 PM
@Marshall thank you, that sounds interesting
 
ngn
@nathanrogers definitions of what?
 
the language
or am I just supposed to guess at how to use it
 
@nathanrogers nowhere. You have \h and oK docs (though those differ from ngn's impl somewhat), and reading ngn's c source
 
ngn
@nathanrogers ah, documentation.. as dzaima said^
 
@ngn that's what I asked when I said are the definitions all in the repl
 
ngn
10:57 PM
(except you're not expected to read the source)
@nathanrogers if you're running it with ./k repl.k, you can type \h for a one-page summary
though i'm not convinced in the usefulness of \h
 
are there any definitions for the words used?
 
ngn
@nathanrogers oK's docs not good enough?
 
what does amend mean
 
ngn
@rak1507 "if you're running it with ./k repl.k"
 
10:59 PM
@ngn probably shouldn't spam you with alerts if you do it in there though
 
and how do I know what the expected form of the arguments is?
 
ngn
@nathanrogers to set an item or items in a list, thus producing a new list (which might happen to be in the same place in memory as the old one)
@nathanrogers like apl's @
 
I see
^ fill|w/o null?
like what does this mean?
 
ngn
@rak1507 noted
@nathanrogers k has a concept of typed nulls, e.g. 0N for ints, " " for chars, etc
if a is a list containing nulls, x^a will replace them with x (x is an atom, i.e. scalar)
@nathanrogers w/o is an abbreviation of "without", like apl's ~
"null?" is a description of monadic ^ - it tests which items are nulls and returns a list of bools
 
ah, so fill is a fill item for any kind of null, or for only the kind of nulls that share type of the fill item?
 
ngn
11:05 PM
@nathanrogers tbh, i hadn't tried with a different type before :)
 
what is the argument to 0: that writes to stdout?
or reads from stdin
 
ngn
@nathanrogers i give you one guess :)
 
"stdout" 0: "blah"
 
ngn
@nathanrogers well, i've broken it :(
use the old way: fd@"blah"
 
`"stdout"@ "hello fresh"`
`" "`
 
ngn
11:09 PM
1@"hello fresh"
 
so it also returns the value?
 
ngn
it's printed to stdout, and then the returned result is the same string, so it's printed a second time in quotes
 
or that's just an effect of @
 
ngn
@nathanrogers yep - it returns the value. a trailing ; should disable that
 
; ←→ ⋄ ?
 
ngn
11:12 PM
@nathanrogers yes, and more. ; is the universal separator. in ( ) it separates list items. in [ ] it separates indices or arguments. in { } it separates statements.
also, it's equivalent to a newline
@nathanrogers @ is just the verb form of application. x@y ←→ x[y] ←→ x y
 
so when I save 1@"yo dawg" to my.k and invoke ./k my.k it still evaluates and prints the evaluation to the screen, along with writing to stdout?
 
ngn
function application, array indexing, dict lookup (and more..) share the same syntax. f[x;y] a[i;j] d[k]
 
this is something to do with : being broken?
 
ngn
@nathanrogers yeah, just put a ; at the end of the line to suppress that
 
ok
so 1 is a function
 
ngn
11:16 PM
that puts a final empty statement at the end of the line, which evaluates to ::, which doesn't print
@nathanrogers no. but you can apply many different things to many different things meaningfully in k.
int@data is "write to file descriptor" (the old way)
the new way is fd 0:data but i'm not quite there yet
 
1 "blah"; has the same effect as 1@"blah";
are the file descriptors described anywhere?
 
ngn
@nathanrogers yes. juxtaposition of nouns (some people prefer to say "putting nouns next to one another") is equivalent to application.
@nathanrogers in unixy operating systems, 0 1 2 are standard file descriptors for stdin stdout stderr
@nathanrogers there are ways to open() a file.. monadic < if i remember correctly
hang on..
 f:<`:data.txt
 f
3
 f"asdf";
 \cat data.txt
,"asdf"
@nathanrogers the `:data.txt thing is a "symbol" (an immutable scalar string)
it can also be produced from an ordinary string with `$":data.txt"
there's also a way to open a socket. then you can read and write to it as if it's an ordinary file.
 
string vectors don't work the same as int vectors?
 
ngn
@nathanrogers in what context?
 
"a" "b" "c"
'rnk
"a" "b" "c"
^
"abc" "def"
" "
 
ngn
11:30 PM
@nathanrogers unlike apl, there's no stranding in k. juxtaposition is application. you need ( ; ) to make a list.
 
1 2 3 4
1 2 3 4
 
ngn
@nathanrogers .. is parsed as a single token
 
that's not a vector of numbers?
+/1 2 3 4
10
 
ngn
x:3; 1 2 x 4 /doesn't work
@nathanrogers it is, but it's a vector literal of numbers
 
so its syntax sugar
that only works for numbers
 
ngn
11:33 PM
@nathanrogers i would call it a single token
 
oh you mean in the parsing sense
 
ngn
yeah
@nathanrogers characters have a similar thing with "abc"
it's a single token, a char list literal, equivalent to ("a";"b";"c")
 
brrrr
 
ngn
well, just like in apl 'abc' is a single token, a char vec literal, equivalent to 'a' 'b' 'c'
btw, k is very sensitive to whitespace. 0 1 2 is not the same as 0 1 2
the latter means 0 1@2
 
bah... I could really use some documentation specifying the argumenst
 
11:40 PM
getting docs for K is like squeezing blood out of a stone
 
\ scan|split|enc
","\"a,b,c,d"
<no response>
I mean at the very least the types of the arguments for each contextual definition
 
ngn
i'm hoping someone somewhere writes ngn/k-specific docs one day
until then oK's manual is closest
 
if only there was someone who was intimately familiar with ngn/k even to the point of having written it!
 
so is \ broken
or am I doing it wrong
 
ngn
11:42 PM
i'm no good at docs. i can't write long prose and i can't english. also: busy working on the actual code.
 
I'd really just use oK solely because of the helpful documentation
 
fair enough but a brief description of each thing would suffice
2
 
it seems that all the educational progress of the past... idk, century, has bred an entire generation of people incapable of articulating their thoughts. Brilliant!
and that isn't a dig, that's just an observation that, like "i hate math", "I can't write" has become almost... a humble-brag
@rak1507 or example usage
just 1 example of how to use each definition
1 for each of its forms
like what are the arguments for \ enclose
idfkwtfbbqroflmao
 
@nathanrogers agreed there
 
@nathanrogers "I hate math" has evolved into "I gave up math entirely" where i live
 
11:45 PM
I mean, you have to have tested it
@Bubbler yeah. Here its, "i don't even know how to count change, beause what is cash even?"
"you silly boomer, you use cash?"
 
ngn
@Bubbler it also has a pleasant graphics api and interactive editor. i made one of the examples (long ago) and it was fun.
 
what are we talking about now?
@ngn I'm still wondering why ","\"a,b,c" produces no result
oh, now it does? idk
 
ngn
i was just about to post a link proving it does :)
 
I mean... I evaluated it several different times in the repl
it didn't
but now it does, idk
rlwrap let me know k crashed afterwards
so something was wrong
 
ngn
@nathanrogers oh.. i'm interested in those (if you can repro it)
0 tolerance for segfaults
 
11:51 PM
@ngn its happened 2 or 3 times now
I'll see if I can tell what's causing it
honestly I think it was from idling?
I'm not sure
 
ngn
@nathanrogers idling - unlikely. what did you type before ","\"a,b,c"?
 
@ngn Have you tried afl? Very easy to run (but can be sped up with more setup) and it finds a lot of segfaults.
 
AFL is sooo cool
 
ngn
@Marshall i've heard about that one but haven't tried it yet. thanks.
 
@ngn here's my suggestion for docs. just have \<char> return the unit tests for that particular thing
or \'<char> or some thing parseable and not ambiguous
looking at the unit tests was very helpful
finding them, not so much
 
ngn
11:54 PM
@nathanrogers not a bad idea, actually
 
or \word
so I could do \amend or \split
so I can get the form of what I'm interested in
 
ngn
\word generally forks an external processes and prints its output
there are only a few single-letter overloads like \h for help or "\t:n expr" for time
 
I see, perhaps some other syntax like \h word
or \h-word
\h-amend \h-split \h-where
or something along those lines
 
ngn
@nathanrogers yeah, that could work, or \h word
 
last question for now, got other stuff burning, is there a way to output defs to file?
still haven't gotten "file.txt" 0@"sometext" to write correctly
 
ngn
11:58 PM
@nathanrogers defs? like the definition of a function?
 
@ngn yes
 
ngn
@nathanrogers it's 0:, not 0@
@nathanrogers a function can be converted to string with monadic $ and evaluated back with monadic .
 
@ngn no that doesn't work I'm saying
 
01:00 - 22:0022:00 - 00:00

« first day (1498 days earlier)      last day (1155 days later) »