I'm so over it... you sit high atop your throne, with such ambi-valence, you sink to your lowest depths, and choose to pull rank... Do I need to repeat myself before or after I bind you under my boot
@Bubbler Works right for me now with a hard refresh. The issue is that (1+·) still evaluates 1 and + in case they have side effects, then drops them. I misplaced the drop instructions and it was dropping the right argument 4 instead of 1.
𝕨 didn't have the same problem as · because it's dynamically assigned a "nothing" value at runtime, which is not a good way to do it (the compiler should generate two functions to avoid runtime checks). Fixing that is my next thing to do with the compiler but I haven't worked on the compiler in a while.
@nathanrogers No, and if there was it would be completely unreliable. The spec gives the features that I plan to support and the ones not yet supported are namespaces, block headers and multiple bodies, and a few rare cases for inferred properties.
@nathanrogers implementing things is way easier & quicker than thinking of them and writing them down, so if there was such a list, it'd be empty most of the time
@ngn i'm waiting on myself to write my own java/c-like language to write an impl in. Unfortunately, that's quite difficult
@dzaima (maybe before that I'll write a new array model with refcounting and 8/16/32-bit ints and whatnot still in java, potentially integrating singeli when that's working, in such a way to transpile it to that lang later on. but who knows)
@Marshall what are your impressions from zig? i tried it once. it has some fresh useful ideas, but the syntax is too verbose (compared to atw c) and it bloats the binary with stuff that i never told it to, so i gave up.
@dzaima transpile - i've thought about something like that too, but most of the time i can get away with c macros and/or generated code
@ngn I haven't done much with it but I'm fairly sure I like it better than C. Just less weird stuff to account for. It's very quickly getting more stable. I think it still generates somewhat large binaries (nothing like Rust though), but there might be ways to avoid that now.
@ngn only if you're not sacrificing more comprehensibility than you gain of course. And I'd argue the amount you gain is little compared to what you lose in most cases
@ngn Some shortening is making things simpler, some isn't. Purely removing whitespace and renaming things to shorter names isn't what I'd call "simpler", but definitely shorter
@ngn sure, that's fine by me. But it isn't added just for verbosity, good whitespace can increase comprehensibility by a lot. So from my viewpoint, by removing whitespace, you're removing comprehensibility
if c had c++'s auto (or maybe even allowing omitting variable type altogether), would you use it?
@dzaima i had to look that up. i think typeof solves that problem well.
also, i don't need that many types. most of them are abbreviated to a single letter anyway. it's only a problem with function types in c, they can be verbose and confusing.
@dzaima whitespace can be annoying when it gives you a false impression of things being grouped or separated. for instance between a type and a variable: T v. i like abbreviating such commonly occurring pair as macros: Tv.
@dzaima of course
the less code, the better. so type inference would be good.
hmm, if you really wanted to, function argument types could be somewhat inferred too, going from the main method recursively adding types to functions you encounter
in that sense, dynamically-typed langs are better :)
@dzaima that's not always possible, as sometimes you pass a char but the function expects an int, and the compiler takes care of 0-extension or sign-extension as appropriate
@dzaima Function arguments and mutable variables. Those are pretty much the only variables I'd ever want a declared type for. For complex structures I want the type to be obvious but if there's a variable declaration nearby it's probably for creating or destructuring it anyway.
@Marshall yeah, i'm definitely not on the level of speed-writing where not typing the type is worth confusion. (and an IDE will write the type for me in many cases anyways)
@ngn the type of a new variable is as relevant/irrelevant as of the previous one
(and I wouldn't call types neither irrelevant, or noise. They serve as a reference point while reading, from which you can build knowledge of what's happening; the more info you have while reading, the better)
@dzaima Really depends on the code though. I've written plenty of stuff where every single value is a machine-word sized integer. I could mark them as values or indices but that's extremely obvious just from reading and usually from the names as well.
@ngn "information overload" - of course, you don't want to have your whole code be just pure information for reading, it's a balance. You though seem to prefer having like 0 information
@Marshall that's an interesting case. I think I'd still prefer confirmation that everything's a machine word over having to infer that myself. (though a type specification on every var is probably not the best way to achieve that)
@dzaima Yes, my thinking in a lot of cases is that I want to know what the variable is, and probably the best place to find that is the code to its right. Sometimes the type tells you enough; I don't think that's too common. Sometimes there should be a comment on that line, or in extreme cases a few lines of comments.
@Marshall I think in most of my code I rarely have 2 or more variables of the same type, so the type is often good for quick reading, and with the name it's hard to have any confusion
@ngn I don't mind verbosity when it's justified. There are of course cases when there is unneeded verbosity (I much prefer java's verbosity levels, but it's slower than C, so a mix of the two is best)
@dzaima ("I much prefer java's verbosity levels" is a bit stupid. I prefer java's type system & some syntax, but since the end goal is performance, i can't use actual java)
@Bubbler i've tried some. Kotlin and Rust lose on using name:Type, D has horribly slow compile times from what I've heard (and also has a weird relationship with garbage collection) but i should probably look into it more
yeah, it really is unfortunate. So many possibly good languages down the drain..
@dzaima (well, rust doesn't really have classes either. Whatever I want to implement BQN into must have classes of some sort, inheritance for the type system just works beautifully)
Why is everyone so keen on implementing a portion of a language and moving on to some other language? Wouldn't it be nice if we could have a production release of any one of them?
@nathanrogers for psychological reasons, i think: it's fun to implement languages (at least in the beginning) and it's too easy to get started and quickly put together something working, which gives people a sense of achievement and bragging rights before their peers. when they eventually run into difficulties, they move on to the next shiny thing.
@nathanrogers I mostly program things for fun. the current Java dzaima/BQN was never meant to be any candidate for a "production release" of any sort, but for me to make one, I need a language to implement it into first
That said, dzaima/BQN does pretty much everything I want it to. The things that would take it to "production release" are almost entirely things like FFI and other APIs that I have no experience with.
@Marshall right, that's unintentional. (it would probably be possible to add JNA to it to allow C interop or something, but i have approximately no reason to try to)
@nathanrogers there is the half-baked •JLoad to allow importing java code specifically made to interact with dzaima/BQN, but that, as i said, needs a manually written java side
@dzaima For music, resampling (that is, changing sample rate) is something that I really don't want to write myself and that's needed to use samples in a reasonable way, so I'd like to be able to call a C library for it.
@nathanrogers I would probably use a language like Zig. I'd like to see if I can keep a lot of the runtime self-hosted while improving the performance, as that makes it easier to implement advanced algorithms for primitives.
@nathanrogers clojure benefits from being directly on the JVM and presumably being compiled though. dzaima/BQN has its own everything and isn't statically compiled
@ngn that's the solution for me. whichever language manages to achieve that. I'm just not interested in learning languages or implementations if they're going to be abandoned because they were just a fun toy for the implementor
I think bqn is a really nice first user impression, once you actually decide to start reading through it, but it needs to be even slower if its to attract anyone but already avid array language users
I think it would be good for us to have examples of IRL programs and not golf or toy problem examples. nqueens is impressive and all, but can I write a webserver? Or a chat room, or something else... and people actually making IRL software applications. I haven't seen how to do that in any of the impls thus far. Maybe I'm missing it, and someone is doing that, but I don't know quite where to look even
@ngn I don't believe we'll be able to settle on a single language. So I think it's best to just accept that and try to just not do everything twice where possible
@dzaima (and if we do by some magical relevation, it's simple enough to abandon one side and put all efforts into the other; having more complete impls will help the decision too)
@nathanrogers APL as a notation has zero ways to interact with the outside world, and you need million ways to interact with the outside world to build real-world applications
@Bubbler what are those ways? read from stdin, write to stdout, start child processes (with full control over their i/o), tcp client/server, load libraries.. ?
@ngn BQN types plus n-ary functions is a superset of all of APL/BQN/k/J. Other than that, you'll want ascii, I'll want unicode, you'll want only rank 1, I'll want arbitrary rank
@dzaima i'm sure it's not a superset. i would make a compromise with non-ascii (as i already have in ngn/k). rank 0-or-1 would be ideal, but apl works too, it's just more effort for no good reason.
@nathanrogers if you removed the ⎕names, would that still be apl.. ?
It really just needs a side bar to get to any other page with a click, rather than having to find the home page again and starting over each time you want to cross reference @Marshall
@ngn full sentences in english that amount to usage
@ngn github.com/JohnEarnest/ok/blob/gh-pages/docs/Manual.md everything before the verb reference is documentation, but its extremely brief . I don't need humor or meandering story telling in the docs to read them, but I need to know what is happening in the language to a level which I deem sufficient to answer question
@ngn how many times I @ngn because I don't understand or know what to do
how many times I got to bed because you're in another time zone and there's not many others to ask?
that's what documentation is for
i shouldn't have to hound the implementer for information beause that's time consuming for both of us
not a criticism, so far I love the language, but... not some of the concepts
but I get some people are natural writers and others aren't... but around K, it seems that everyone prizes as few words as possible, rather than optimizing word count balanced with substance.
Further, I cannot stand the way corporate K is so secretive and cryptic
i see k as a great injustice. it's available only to those who can pay a lot to legally use it. i did my best to correct some of that, to the best of my abilities.
@nathanrogers you could certainly do your fair share of trying things yourself. i've often replied to you by just trying things and looking at the limited docs myself, originally not knowing anything about the question
That isn't the impression I get. K seems to be APL if you dramatically compress the number of primitives, and the number of symbols to represent those primitives, removing elegance, symmetry, entendre and even puns for spartan austerity
I have a hard time "thinking" in K primitives because they're so overloaded, its hard at my level to read it without considering every possible set of arguments, and even then there is minimal information about which arguments are getting passed to the functions themselves so its hard to infer what type of function we're calling
@ngn I don't believe elegance and shortness have anything to do with one another. They may be parallel, but they aren't similar goals
Like you can be elegant and short, or you can be elegant and not strive for the shortest version.
@nathanrogers i didn't say shortness. k code is usually ~1/8-1/4 longer than apl, as one would expect from the number of bits actually used per character.
@nathanrogers no, it's not a word game. k has 26 verbs (iirc), apl has how many? k has 6 adverbs, apl(dyalog) has recently added all possible combinators of two args and two operands..
I really think the main purpose of the array language community should be around the pursuit of "the universal notation for computing" and less on which other language needs a 15th implementation.
which I can't understand, array programming was an extension of the notation
I think APL is a strong foundation for that, but its the legacy and all the noise surrounding the notation, and even the dichotomy between the "primitives" and the rest of the system interaction stuff.
and apparently some APLers think the core APL and the rest of the code (from control structures to OOP to interfacing) should be visually very different
I think so too. There really should be a literal notation as nice as the function primitives
@ngn documentation will include detailed scope rules, limitations, along with mentioning anywhere that a blank line feed is required at the end of a file
I didn't log into this chat for the longest time because it doesn't accept github authentication unlike the rest of stackoverflow. But I've read it occasionally
great. J seems pretty similar to APL in terms of primitives, like having /. (⌸), and I've been long interested in some of the dyalog.tv talks like Aaron Hsu's one on doing trees "the APL" way, so I don't mind an APL focus at all. Gotta get literate so I can follow such talks at least.
or, pretty similar to DyalogAPL. I guess ⌸ isn't in some of them.
The hint being the discussion of rank in the last paragraph of "History". J's > is really more like ⊂⍣¯1 except that it's defined with function rank 0. The function rank is what unifies all the results.
@rak1507 I usually use "dictionaries" for that: defaultsClone←⎕NS defaults ⋄ 'defaultsClone'⎕NS mysettings ⋄ 'mysettings'⎕NS defaultsClone ― a bit awkward because ⎕NS still doesn't like a ref larg.