Re: [Jprogramming] Dictionaries WAS: Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Elijah Stone
I disagreed with 'symbols' in 1 Roger Hui writes: Premature optimization is said to be the root of all evil in programming [Knuth 1974, p.671], but premature generalization is worse. Premature optimizations can at least be backed off If we start with only symbols as dictionary keys, then i

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Raul Miller
Another model to think about here is K's implementation, where the symbol table is a tree, and thus supports contexts which do not have equal length columns. -- Raul On Mon, Jan 31, 2022 at 9:54 PM Ric Sherlock wrote: > > otoh, we already have a binding to R where you can deal > > with datafra

Re: [Jprogramming] Dictionaries WAS: Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Henry Rich
I think I agree with all your statements, but you are not responding to my questions, which will help focus the discussion: 1. What is a Dictionary, EXACTLY? 2. What operations can be performed on a Dictionary? Henry Rich On 2/1/2022 12:04 AM, 'Pascal Jasmin' via Programming wrote: The simp

Re: [Jprogramming] Dictionaries WAS: Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Henry Rich
I disagreed with 'symbols' in 1 and I didn't understand 2: >> At least: domain (new primitive) index transpose amend apply-at-rank filter indices.  From rank follows any rank-0 operation.  Maybe: key catenate shape reshape nub index-of tally reduce. Please: when I was younger, I might have sa

Re: [Jprogramming] Dictionaries WAS: Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread 'Pascal Jasmin' via Programming
The simplest dictionary is a table with 2 columns.  First named k(ey), other named v(alue) A J locale is also a simple dictionary.  Keys are limited to legal names, but values are independently typed.  It is difficult to find keys by value, whereas it is simpler in the 2 column table concept. 

Re: [Jprogramming] Dictionaries WAS: Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Elijah Stone
Can you clarify what you disagree with and what you don't understand? 1. A Dictionary is an array some of whose axes are indexed by non-numeric value; that is, the index is not an integer. 1. I assume fractional and complex numbers are allowed too? 2. Is the array still rectangular? [propose

Re: [Jprogramming] Dictionaries WAS: Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Henry Rich
A good start.  You give two sentences, one of which I disagree with and the other I can't understand at all.  I would say: 1. A Dictionary is an array some of whose axes are indexed by non-numeric value; that is, the index is not an integer. 2. The Dictionary supports the following operations

Re: [Jprogramming] Dictionaries WAS: Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Elijah Stone
On Mon, 31 Jan 2022, Henry Rich wrote: Many ideas have been aired.  But please, every now and again address the questions I need answers for: I gave one answer to this earlier: 1. What is a Dictionary, EXACTLY? An array some of whose axes are indexed by a set of symbols rather than a rang

Re: [Jprogramming] Dictionaries WAS: Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Henry Rich
Many ideas have been aired.  But please, every now and again address the questions I need answers for: 1. What is a Dictionary, EXACTLY? 2. What operations can be performed on a Dictionary? Henry Rich On 1/31/2022 11:09 PM, 'Pascal Jasmin' via Programming wrote: I forgot to mention that th

Re: [Jprogramming] Dictionaries WAS: Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread 'Pascal Jasmin' via Programming
I forgot to mention that the GET/SET interface can be applied to basic arrays and matrices and would mirror functionality of primitives such as { i. Independently, of whether data structures have a backend that syncs them to disk for permanence, they all have get/set/append/delete processing fu

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Ric Sherlock
> otoh, we already have a binding to R where you can deal > with dataframes easily – do we want to “compete” here, too? > > In terms of whether to just adopt/use one of R's/Pandas'/Polars'/Julia's dataframes rather than reinventing the wheel - I think for me that if it were possible to use J primit

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Ric Sherlock
Yes that lines up with my thoughts on how this could work. As has already been suggested this is essentially the structure used by 'general/misc/inverted' which then already models how some of the J primitives would operate on it. The bit that is missing, as you point out is the toolset to elegantl

Re: [Jprogramming] Dictionaries WAS: Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Don Guinn
I hope you find me an idiot, but isn't that what a DBMS does? Maybe the DBMS in J could be extended a little to do all this. On Mon, Jan 31, 2022, 6:22 PM 'Pascal Jasmin' via Programming < programm...@jsoftware.com> wrote: > Beyond dictionaries is a "generic data structure" construct, and a large

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Elijah Stone
Here is my proposed semantics: currently an array is a function N_n0 * N_n1 * N_n2 ... -> A. A is some atomic type; n0 n1 n2 ... are the shape of the array; N_n denotes the set of non-negative numbers less than n. Adding dictionaries means extending the potential domain of an array to include

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Elijah Stone
On Mon, 31 Jan 2022, Raul Miller wrote: It was overtake along the dimension indexed by symbols that I anticipated problems. Ah, I see. I do not think take should be specified in such cases, let alone overtake. I do not think keys should be ordered, either. Really, there are two issues to

Re: [Jprogramming] Dictionaries WAS: Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread 'Pascal Jasmin' via Programming
Beyond dictionaries is a "generic data structure" construct, and a large extended family of data structures that can respond to the following commands GET SET UPSERT APPEND DELETE INSERTafter(item) INSERTbefore(item) WHEREget CONVERTtoJnativearray UPSERTfromJnativearray in addition to dictionar

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Elijah Stone
On Mon, 31 Jan 2022, Vanessa McHale wrote: q/k is faster, I think because it’s ordered by default - maybe something like ordered dataframes could be implemented in J? What do you mean by ordered? Sorted? I know some versions of k will track when an array is sorted. But at the volumes they

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Hauke Rehr
I also long time wanted to try it. I had no urgent need of it, so time just went by … boxed list of columns if we want mixed datatypes which would be necessary for a drop-in replacement of dataframes the list of column names imo should not be separated but those are implementation concerns otoh,

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Raul Miller
On Mon, Jan 31, 2022 at 4:26 PM Elijah Stone wrote: > Obviously such arrays would have to be rectangular, that is homogenous. > So for instance, if I have a rank 2 array where the first axis is integral > and the second is symbolic, every row will have the same set of keys. So > I think overtake

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Raul Miller
I think a dataframe, in J would basically be a boxed list of columns, and some associated list of column names. It's the toolset we would build up to work with such a thing that would make it useful. (And maybe Jd is such a toolset? I do not know -- I have not motivated myself to try Jd yet...)

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Raul Miller
I would not worry too much about "the J way of thinking" -- J is a tools, but it's not the only tool. Setting aside a bit of time -- maybe half an hour a day, several days a week -- is good for picking up the skills involved with using a tool. In the context of J that would be time spent working t

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Vanessa McHale
I’ve tried Jd, it’s equivalent to pandas I think (and about as performant) though it’s persistent (being a database). q/k is faster, I think because it’s ordered by default - maybe something like ordered dataframes could be implemented in J? Cheers, Vanessa McHale > On Jan 30, 2022, at 8:21 PM

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Hauke Rehr
I’d rather have the shape with respect to the topmost other kind. First axis numeric: the numeric shape below which the first symbolic one occurs first axis symbolic: vice versa you may need to check the return value of the adjusted implementation of the datatype primitive for those “other kind”

Re: [Jprogramming] Dictionaries WAS: Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Henry Rich
Let's talk about the spec, not the implementation. Henry Rich On 1/31/2022 4:49 PM, Raoul Schorer wrote: If I'm not mistaken though, J symbols are not garbage collected, are they? Wouldn't that be a problem for dictionaries with symbol keys doing a lot of insertions/deletions? Sorry if I misse

Re: [Jprogramming] Dictionaries WAS: Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Raoul Schorer
If I'm not mistaken though, J symbols are not garbage collected, are they? Wouldn't that be a problem for dictionaries with symbol keys doing a lot of insertions/deletions? Sorry if I missed something I. The docs about that. Cheers, Raoul Le lun. 31 janv. 2022 à 21:40, greg heil a écrit : > i

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Elijah Stone
On Mon, 31 Jan 2022, Elijah Stone wrote: I think it makes most sense to make symbolic axes positive, same as normal axes. Non-negative, of course! A question is what the shape of a partly symbolic array should be. (Or completely symbolic; I just meant not completely numeric.) -E ---

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Elijah Stone
https://www.jsoftware.com/papers/array1.htm#5 relevant. Permitting multidimensional dictionaries--or arrays some of whose axes are indexed by symbols--is interesting, and I had not thought of it (though it is somewhat obvious). Obviously such arrays would have to be rectangular, that is homo

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Steven Harris
Well Brian that is my motivation for J too, but so far I have not been able to make any significant progress into the J way of thinking. I'm nearly on the point of admission defeat here. Cheers Steven. On Tue, 1 Feb 2022 at 06:52, Brian Schott wrote: > One of the main reasons I have continued

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Raul Miller
That's a good point. Conceptually, a "dictionary" is an implementation which supports indexing along the lines of (ref i. names) { values And, an array where at least one dimension is symbols instead of integers would be in the right ballpark. That said, this would share some aspects with sparse

Re: [Jprogramming] Dictionaries WAS: Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread greg heil
i just want to reiterate the point Alex Shroyer made about k dictionaries i found them extremely useful and upon occasion groused about not having them in J i used them to represent an (English) dictionary very facile efficient and fast the fact is our world is (mostly) filled with ragged object

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Brian Schott
One of the main reasons I have continued to use J has been because of all the powerful primitives and because of the mental challenge of using the primitives effectively. For me I imagine J is almost like a video game for the younger generation: it is a challenge with great rewards and unmatched co

[Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Pawel Jakubas
Dear J enthusiasts, As a newly joint J enthusiast and the programmer that have worked in many environments/technologies I would say J should definitely not mimic python or compete with it directly (of course it could take good bits from it and learn hard lessons there) but focus even more on the n

[Jprogramming] Dictionaries WAS: Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Henry Rich
Quite right.  Jan-Pieter has at least a good start on the model.  What I am suggesting is that the 'more integrated implementation' might not need to be much more integrated than the J script.  Searching and sorting are already J primitives. The deficiency in J is that m&i. gives you a hashtab

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Eric Iverson
A good and complete model is the first step. Then it is a matter of how much it is used and what drawbacks it might have that would be addressed by a more integrated implementation. On Mon, Jan 31, 2022 at 1:27 PM Henry Rich wrote: > I have looked into this quite a bit. I am not convinced that

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Henry Rich
I have looked into this quite a bit.  I am not convinced that Dictionary is a fundamental datatype like number or letter, or that the current symbol support is deficient.  That makes the first questions What is a Dictionary? and Where can a Dictionary be used in J? The use case that would be i

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Elijah Stone
I agree with Eric regarding the challenges of adding dictionaries. One issue: I think a necessary prerequisite is improved symbols. On Mon, 31 Jan 2022, Alex Shroyer wrote: I agree with Raoul that competing with Python is not a good idea. But J can learn from Python's decisions (good and bad)

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Eric Iverson
It seems to me that the big distinction between J and python where J falls far short is not in the core language but in the addon libraries. I encourage J fans to work away at adding important addons to J! On Mon, Jan 31, 2022 at 11:27 AM Eric Iverson wrote: > A J dictionary type is a good idea

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Eric Iverson
A J dictionary type is a good idea and it has been kicked around many times before. The hard part is not implementing it, but doing a careful and thorough spec that is backed by a complete model written in J. Presented with a full spec that had community buy in, would probably be followed by imple

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Alex Shroyer
I agree with Raoul that competing with Python is not a good idea. But J can learn from Python's decisions (good and bad) to grow and improve. In my opinion, numpy is Python's "killer app" because it brings reasonable performance without much conceptual overhead. The feature of Python that enabled n

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Raul Miller
What does "competing with python" mean? (I suspect that we must "compete" in some contexts, but I also imagine that "competition" would be irrelevant in many, many contexts. But.. as a programming exercise, I don't know how to conceptualize these distinctions.) Thanks, -- Raul On Mon, Jan 31,

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Raoul Schorer
Just my 2c, but I think that competing with python in general is somewhat delusional. I think the key point for expanding J use to have a "killer J app". For example, an improved clone of or excellent plugin for VisiData ( https://www.visidata.org/) is my idea of a killer app. But someone here may