Re: [Jprogramming] Code clarity

2014-01-17 Thread Don Kelly
find and worth far more than diamonds. On Wed, Jan 15, 2014 at 2:50 AM, Pascal Jasmin wrote: actually a documentation effort on the z profile names would be quite helpful. From: Don Guinn To: Programming forum Sent: Tuesday, January 14, 2014 4:15:08 PM Subjec

Re: [Jprogramming] Code clarity

2014-01-16 Thread Ian Clark
Sorry folx, I'm still with j602 when it comes to exploring J and explaining it to newcomers rather than working on leading-edge apps. I wasn't aware 'edit' hadn't made the leap. Suspect that's true of a lot of things I take for granted. On Thu, Jan 16, 2014 at 3:07 PM, Raul Miller wrote: > edit

Re: [Jprogramming] Code clarity

2014-01-16 Thread Raul Miller
edit 'verbname' works in j6, I use it there relatively often. I think I remember some discussion about making it work in jhs. A limitation of edit is that it needs an unambiguously defined editor for J to use to do the editing. A related issue is that we have a tradition of integrating the langua

Re: [Jprogramming] Code clarity

2014-01-16 Thread bill lam
jsoftware.com/jwiki/Guides > > > >>>http://www.jsoftware.com/jwiki/Guides#faqs > > > >>>http://www.jsoftware.com/jwiki/Guides/Getting%20Started > > > >>>http://www.jsoftware.com/help > > > >>>Perhaps the best of the Guides need

Re: [Jprogramming] Code clarity

2014-01-16 Thread Brian Schott
Ian, I have been using J for some time and was not aware of `edit`, so I wonder where it is promoted? My consternation at your message was continued when I only tried using `edit` in jconsole, and it did not work. Btw, thanks for this email contribution. 9!:14'' j701/2011-01-10/11:25 build: F

Re: [Jprogramming] Code clarity

2014-01-16 Thread Don Guinn
ides#faqs > > >>>http://www.jsoftware.com/jwiki/Guides/Getting%20Started > > >>>http://www.jsoftware.com/help > > >>>Perhaps the best of the Guides needs a link adding to the top line of > the > > >>>last of these? > > >>>

Re: [Jprogramming] Code clarity

2014-01-15 Thread bill lam
gt;>http://www.jsoftware.com/jwiki/Guides/Getting%20Started > >>>http://www.jsoftware.com/help > >>>Perhaps the best of the Guides needs a link adding to the top line of the > >>>last of these? > >>> > >>>There's no substitute for a good newbie who's thick-skinned enough to ask > &g

Re: [Jprogramming] Code clarity

2014-01-15 Thread Don Kelly
n diamonds. On Wed, Jan 15, 2014 at 2:50 AM, Pascal Jasmin wrote: actually a documentation effort on the z profile names would be quite helpful. From: Don Guinn To: Programming forum Sent: Tuesday, January 14, 2014 4:15:08 PM Subject: Re: [Jprogramming] Code clarity

Re: [Jprogramming] Code clarity

2014-01-15 Thread bill lam
the > >last of these? > > > >There's no substitute for a good newbie who's thick-skinned enough to ask > >the dumb questions. Hard to find and worth far more than diamonds. > > > >On Wed, Jan 15, 2014 at 2:50 AM, Pascal Jasmin wrote: > > > >&

Re: [Jprogramming] Code clarity

2014-01-15 Thread Don Kelly
actually a documentation effort on the z profile names would be quite helpful. From: Don Guinn To: Programming forum Sent: Tuesday, January 14, 2014 4:15:08 PM Subject: Re: [Jprogramming] Code clarity So many names in the z locale. I wonder what that looks li

Re: [Jprogramming] Code clarity

2014-01-15 Thread Don Kelly
: [Jprogramming] Code clarity So many names in the z locale. I wonder what that looks like to a newbe. Take a name like splitstring. Got a pretty good clue from its name. Where is it defined? Exactly how can one use it? Easy enough for someone familiar with J to just look at its definition then play

Re: [Jprogramming] Code clarity

2014-01-15 Thread Ian Clark
on the z profile names would be quite > helpful. > > > > From: Don Guinn > To: Programming forum > Sent: Tuesday, January 14, 2014 4:15:08 PM > Subject: Re: [Jprogramming] Code clarity > > > So many names in the z locale. I wonder what that looks like to a n

Re: [Jprogramming] Code clarity

2014-01-14 Thread Pascal Jasmin
actually a documentation effort on the z profile names would be quite helpful. From: Don Guinn To: Programming forum Sent: Tuesday, January 14, 2014 4:15:08 PM Subject: Re: [Jprogramming] Code clarity So many names in the z locale. I wonder what that looks

Re: [Jprogramming] Code clarity

2014-01-14 Thread John Baker
Oops the link I meant to post is: https://github.com/bakerjd99/joddumps On Tue, Jan 14, 2014 at 3:28 PM, John Baker wrote: > This was one of the motivations behind JOD. Here's a quick snapshot of > something I am working on right now. The dictionary tracks and displays > appropriate "documenta

Re: [Jprogramming] Code clarity

2014-01-14 Thread John Baker
This was one of the motivations behind JOD. Here's a quick snapshot of something I am working on right now. The dictionary tracks and displays appropriate "documentation" on demand. Of course you still have to do a little work - entering a brief statement of what a particular word is about. The ad

Re: [Jprogramming] Code clarity

2014-01-14 Thread Don Guinn
So many names in the z locale. I wonder what that looks like to a newbe. Take a name like splitstring. Got a pretty good clue from its name. Where is it defined? Exactly how can one use it? Easy enough for someone familiar with J to just look at its definition then play with it a little. Maybe go f

Re: [Jprogramming] Code clarity

2014-01-14 Thread Raul Miller
I neglected the part that reads the variables and saves the configuration. Here's one way loadConfig=: 3 :0 'nm val'=. |: readConf file ConfNames=: nm ConfValues=: 'T' (I.a:=val)} val,<'F' ) This extra step should be a part of the benchmarked time. Once a configuration has been loaded: g

Re: [Jprogramming] Code clarity

2014-01-14 Thread Joe Bogner
Raul - in my basic benchmarking that sped it up about 5% (200ms) Here's my implementation - trying to be more explicit. It takes about 5891 ms to run 1 iterations as compared to 4000 for the other J implementations (43% slower). I'm sure it might be able to be improved. There's more boxing an

Re: [Jprogramming] Code clarity

2014-01-14 Thread Raul Miller
Sometimes? I often feel lost without audience feedback. I do not necessarily need a big audience, but when it shrinks to zero I feel like I am off track. Thanks, -- Raul On Tue, Jan 14, 2014 at 10:33 AM, wrote: > > > The difficult part in my experience is describing the structure and > cont

Re: [Jprogramming] Code clarity

2014-01-14 Thread jph . butler
The difficult part in my experience is describing the structure and contents of my inputs and outputs. Usually, I provide sample datasets, and show what verbs to run on them. But I don't have too many readers of my code so I am not sure how practical that really is. I was wondering whether n

Re: [Jprogramming] Code clarity

2014-01-14 Thread Raul Miller
I have also struggled with documentation, and not only in the context of apl and/or j. I sometimes wonder, though, how important it really is. So much of the skill of computer programming comes through seeing the code through experimentation and seeing both the code and its variants in action. Qu

Re: [Jprogramming] Code clarity

2014-01-14 Thread Raul Miller
It might be interesting to try it on a large file. Here's another state machine implementation that might perform better: StateMachine=: 2 :0 (m;(0 10#:10*".;._2]0 :0); wrote: > I was curious to do some basic benchmarking. Posting here if others > are interested. Not sure if this should be move

Re: [Jprogramming] Code clarity

2014-01-14 Thread Don Guinn
It's always been a mystery to me why it is OK to spend several hours (or sometimes days) analyzing several pages of FORTRAN or C but when reading a few lines of APL or J which do the same thing I must grasp it in a few minutes or I start feeling overwhelmed. But I have written similar "run-ons". Wh

Re: [Jprogramming] Code clarity

2014-01-14 Thread Ian Clark
The problem of human vs computer readability resurfaced for me recently when planning a J paper for MagPi, the how-to journal for the Raspberry Pi. http://www.themagpi.com It took no imagination to predict the response of the average (computer-literate) reader on seeing J code for the first time.

Re: [Jprogramming] Code clarity

2014-01-14 Thread Joe Bogner
I was curious to do some basic benchmarking. Posting here if others are interested. Not sure if this should be moved to another thread. If someone replies please do what is appropriate (same thread or new one) https://gist.github.com/joebo/61e0841fbf511e1aab4d The state machine implementation run

Re: [Jprogramming] Code clarity

2014-01-13 Thread Roger Hui
I find that it helps to describe the J or APL code as if you are writing a paper about it for the expert. For example, see the essays in the J wiki. If carried to the extreme, it becomes the Literate Programmingof Knuth. In such writing it is u

Re: [Jprogramming] Code clarity

2014-01-13 Thread Don Kelly
I have had considerable experience with APL What I have found is that it is important, more than with many other languages, to document the code. With J it is even more important. This is a consequence of the power involved in a statement combined with what the hell did I mean when I wrote it

Re: [Jprogramming] Code clarity

2014-01-13 Thread Raul Miller
Ok, I think I understand. The basic issue, here, seems to be that PicoLisp is stream oriented and this is a stream oriented task. No one in the J community has cared enough to build a stream oriented library for J. J has enough to do stream oriented design for academic purposes, but ... Consider x

Re: [Jprogramming] Code clarity

2014-01-13 Thread Joe Bogner
Yes, it is complete. I didn't write it or test it as it was already posted to rosettacode. I will explain how it works assuming there is interest It uses some uncommon tricks. It leverages the read function which is the same function used in the repl to read input characters. So the goal is to ta

Re: [Jprogramming] Code clarity

2014-01-13 Thread Raul Miller
On Mon, Jan 13, 2014 at 8:32 PM, Joe Bogner wrote: > PicoLisp > > (de rdConf (File) >(pipe (in File (while (echo "#" ";") (till "^J"))) > (while (read) > (skip) > (set @ (or (line T) T)) ) ) ) Is that complete? I learned lisp back in highschool, and I've used drracket

Re: [Jprogramming] Code clarity

2014-01-13 Thread Devon McCormick
Dan's question is relevant and, for me, very timely as I am preparing a talk for a week from now and am wrestling with how to convey the notion of J as a tool of thought. It's hard because what Dan wrote, for instance, looks like gibberish unless you know enough J to make sense of it but who would

Re: [Jprogramming] Code clarity

2014-01-13 Thread Pascal Jasmin
 deb L:0@:(({.~ ; [: < [: ;^:(1=#) ',' cut (}.~>:)) i.&1@:e.&' =')&>@(#~ > a:&~: > ';#'e.~{.&>)@:(dlb&.>)@:(LF&cut) completely untested if the following is equivalent, but: 3 : ' deb leaf (({.~ ; [: < [: ;^:(1=#) ',' cut (}.~>:)) i.&1@:e.&' =')&>@(#~ > a:&~: > ';#' e.~ {.&>) dlb each LF cut y'

Re: [Jprogramming] Code clarity

2014-01-13 Thread Joe Bogner
Great question! > So, how would you write an configuration file parser in J, if clarity were > an important concern? I find it helpful to identify the audience when writing - code or non-code. I then try to write for the audience. If there won't be an audience other than a computer and I will nev

Re: [Jprogramming] Code clarity

2014-01-13 Thread William Tanksley, Jr
Raul Miller wrote: > I'll counter your suggestion that it's easier to write unreadable code > in APL derivatives with an observation that looks to me like a social > issue rather than anything intrinsic in the language. Fascinating and very plausible. But I wasn't intending to talk about ease of

Re: [Jprogramming] Code clarity

2014-01-13 Thread Raul Miller
I'll counter your suggestion that it's easier to write unreadable code in APL derivatives with an observation that looks to me like a social issue rather than anything intrinsic in the language. I say this because with minimal training (one class in APL at a community college, and occasional use i

Re: [Jprogramming] Code clarity

2014-01-13 Thread William Tanksley, Jr
Dan Bron wrote: > We often say the APL family of languages allow us to use language as a tool > of thought. How does this play out in practice? Do we approach reading J > programs differently from those written in other languages? If so, how? I think this is a fantastic question. I completely

Re: [Jprogramming] Code clarity

2014-01-13 Thread Björn Helgason
I often write something clear and commented. Then try to make it look smart -sort of looking compiled - and stop understanding it. Ok maybe not often... On 13 Jan 2014 19:31, "km" wrote: > An important consideration is, "clarity for who"? I want the code to be > clear to me when I come ba

Re: [Jprogramming] Code clarity

2014-01-13 Thread km
An important consideration is, "clarity for who"? I want the code to be clear to me when I come back to it later. For that reason I usually code explicitly, calling explicit helper verbs, although many of the lines are "tacit in spirit". Suggestive names help. --Kip Murray Sent from my iPad

Re: [Jprogramming] Code clarity

2014-01-13 Thread Dan Bron
al Message --- Subject: Re: [Jprogramming] Code clarity From: Björn Helgason Date: Mon, 13 Jan 2014 18:57:27 + To: Programming forum If you try to read compiled executable code from C it would not be very readable. On 13.1.2014 18:45, "Dan Bron" wrote: > We often say the

Re: [Jprogramming] Code clarity

2014-01-13 Thread Raul Miller
I find that my experiences and insights from working with J transport to other languages (often with some frustrations, but life is full of frustrations) in a useful fashion. It would take some time, but I imagine you could translate that code you wrote into another language (perhaps paraphrasing

Re: [Jprogramming] Code clarity

2014-01-13 Thread Björn Helgason
If you try to read compiled executable code from C it would not be very readable. On 13.1.2014 18:45, "Dan Bron" wrote: > We often say the APL family of languages allow us to use language as a tool > of thought. How does this play out in practice? Do we approach reading J > programs differently

[Jprogramming] Code clarity

2014-01-13 Thread Dan Bron
We often say the APL family of languages allow us to use language as a tool of thought. How does this play out in practice? Do we approach reading J programs differently from those written in other languages? If so, how? These questions occurred to me today while I was knocking together an imple