you can write J in many different ways

you can do more or less anything in a very complex single line

you can also write a lot of lines doing one thing each line and write
comments

you can use single letters for names

you can omit names or use long telling names

you can do everything in the home base workspace or split it up in many
locales

as a you go along you will learn to use techniques that fits your style and
taste

I prefer to work in a script and send the lines to the execution window and
gradually collect them

also look up demos and examples

there usually are different times when you cross some milestones and begin
to understand what is going on

often it is best to just try out examples and if the results are what you
want then use it and you will eventually understand - or not....
On Jul 21, 2013 1:29 AM, "Tobia Conforto" <[email protected]> wrote:

> Hello
>
> I'm a J newbie, still going through the introductory material. It's a
> great language and I'm having a lot of fun learning it! But I cannot help
> comparing it to other languages I know.
>
> I find its features very interesting, especially its handling of rank, but
> at the same time I find its syntax very hard to read, compared to
> "ordinary" languages.
>
> After thinking about it a bit, I'm quite sure the reason is because you
> cannot make out the structure of a J sentence unless you know exactly which
> tokens are verbs, adverbs, and conjunctions, and even then it takes some
> mental work to put it all together. Otherwise it remains a flat list of
> symbols. In this regard it's not dissimilar from Assembly, where the entire
> code is a flat list of opcodes, unless you know how to see the structure in
> jumps and calls, and then apply yourself to the task. Maybe I'm wrong, but
> this does not strike me as a good thing.
>
> This, coupled with J's terse syntax (seriously… at least APL had some
> pretty symbols) made me wonder how much of its flexibility is dependent on
> its syntax; or conversely, how much of it could be ported to a different
> language with more static syntax rules, in the form of a library. I'm not
> thinking especially of Lisp, where you can build your own syntax, thus
> incurring in the same readability issues as J (as I see it.)
>
> Has anybody tried to port J's features to other languages? How did it go?
>
> Here is a tiny proof of concept, porting a couple of things (fork, adverb)
> over to CoffeeScript, in a very basic manner:
>
>
> div = (x, y) -> x/y
> add = (x, y) -> x+y
> tally = (y) -> y.length
> insert = (v) -> (y) -> y.reduce v
> fork = (a, f, b) -> (y) -> f (a y), (b y)
> integers = (y) -> [0..y-1]
>
> console.log (fork (insert add), div, tally) integers 10         # prints
> 4.5
>
>
> As I said, this is very basic. It lacks everything, including rank and
> arrays. It's just a few lines I put together to reason about syntax. Out of
> the few languages I know, I chose CoffeeScript for this exercise mainly for
> its un-parenthesized function application.
>
> What are your thoughts?
>
>
> PS. I know much of J's power comes from its engine and its optimized array
> operations. This post is strictly about syntax, or rather *opinions* about
> syntax :-)
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to