Dieter Ensslen wrote:
> so the J engine is something different from ijs and ijx so to speak
> i am just getting used to the ideas of scripts and ijs and ijx

You refer back to the "good old days" of BASIC, etc.  I started 
programming with a MITS Altair computer in 1975 and Altair BASIC (which 
later developed into Microsoft BASIC), and I've followed it up through 
VB6.  (I haven't attempted VB.NET yet because it was such a huge 
"backward" movement from VB6.)  Let me respond to your question in 
terms of BASIC, since you seem to understand that paradigm.  (This may 
be too simplistic and attract head wagging by some here, but I want to 
give you a "hook" to hang a new paradigm onto.)

J and BASIC (originally, that is) are BOTH interpreters--no compilation 
required.  You enter a program, and you can run it immediately.  If 
something's not quite right, you can change it on the spot and try 
again.

Here's the difference: whereas in BASIC, both the program editor and 
the interpreter are a single unit, in J they are separate entities: 
"ijs" (think "s" for "script") is the program/script editor, and "ijx" 
(think "x" for "execute") is the language interpreter.  Back in J's 
"good old days", my understanding is that "ijs" used to just be "js" 
(for "J script"), but the much more famous Javascript grabbed that 
extension for itself, and so J had to invent a different extension.

As was noted by a couple of posters, you can create/EDIT your program 
(script) in "ijs" and then RUN it while still in "ijs" by clicking in 
the "ijs" menu bar: "Run | Window" (or Ctl-W).

Frankly, as a newbie, that's not how I normally work with J--but, hey, 
"different strokes for different folks".  I will usually have BOTH 
"ijs" and "ijx" open at the same time and flip back and forth between 
them.  Since I'm not all that familiar with J off the top of my head, I 
need to do a lot of trial and error, in terms of testing out first if 
what I THINK will work actually DOES work in reality.  For this, I'm 
always working in the interpreter ("ijx"), NOT in "ijs".  When I 
finally get a line of code to do what I want (that it, it works) on my 
interpreter ("ijx") window, then I COPY it to my script ("ijs") window, 
gradually building up my program, working line by working line.  I 
should also note that I'm NOT into tacit programming yet, and so 
everything I'm copying to my script goes INSIDE of an explicit verb 
that I'm creating on my "ijs" page--that is, it has the verb heading 
line (monadic or dyadic) and the closing parenthesis, and all my copied 
code goes between these two lines.  It looks like this:

(monadic/ambivalent verb template)

   verbname=: 3 : 0
   
   )

(dyadic verb template)

   verbname=: 4 : 0
   
   )

I ALWAYS start with that beginning-ending explicit verb template or 
structure.  But that's me and not necessarily you.  (You could just put 
working code there without the surrounding verb envelope, too.  I just 
find that this works better for me.)

I'm paranoiac about losing code (because it's always my own fault!), 
and so I ALWAYS manually save my "ijs" script (menu bar: "File | Save") 
before I ever run the whole thing.  Saved "ijs" files are just plain, 
ordinary files that you can look at and/or edit with ANY text editor.  
(Sometimes, if I'm doing only a quick look for something I wrote in the 
past, I'll just call up an "ijs" file with Notepad, rather than start 
up the entire J system.)  You can also save "ijx" as a file, if you 
want a LOG of everything you've done in a session--this is handy on 
occasion.

I prefer a different way of "running" the program/script than as 
indicated above.  In the interpreter ("ijx"), I LOAD the program/script 
(a saved "ijs" file), something like this (very similar to what you 
would do with an existing BASIC program):

   load '~temp\market.ijs'

Then, assuming that the explicit verb of interest to me (it might be 
the only verb in the script, or it might be one of several) is named 
"topbot" with a filename argument, I would type into the J interpreter 
(just like I would in BASIC, except that I'd have to have an INPUT 
statement to get the filename, rather than pass it directly, as in J):

   topbot '~user\data\DJIA.csv'

Typing the name of a verb (in the LOADED script) into the interpreter 
("ijx") is just like typing RUN in BASIC.

Once you get a handle on these things and are comfortable with them, 
then you can also connect J with other languages (for example, VBScript 
works pretty easily with J).  Related to this, you can also call the 
interpreter remotely with one or more arguments, like a command line in 
MS-DOS.  As a beginner with J, I was finally able to figure out how to 
do some of this stuff--with lots of help from the people in these 
forums--and you can, too.  But you've got to work with J itself, and 
forget about all the peripheral hardware stuff for a while.  Pick ONE 
of your computers--stick to just that one for a while, and take the 
time to really learn J.  J takes a bit of effort to learn, but it's 
effort well spent!

Since you've mentioned Prof. Keith Smillie a couple of times, you might 
be interested to know that he, too, has written a brief summary of J: 
http://webdocs.cs.ualberta.ca/~smillie/Jpage/Summary.pdf

as well some reminiscences and outstanding explanations of J: 
http://webdocs.cs.ualberta.ca/~smillie/Jpage/mostlyj.pdf

By the way, in the beginning of your comments on the J forum, you 
bemoaned the fact of learning all the seeming gibberish (symbols) in J. 
I hope you have discovered by now that you can also use WORDS instead 
of the symbols, if you so choose (J works either way--or a combination 
of the two).  Someone may have to correct me here, but I think that 
EVERY J primitive (and even some combinations, such as "each" and 
"every" and the like) can be expressed in words that the interpreter 
correctly handles, exactly as it does the symbols.  Most people here, 
however, suggest shying away from doing that, because it may take 
longer to learn the "real" J language and because it makes far 
lengthier lines of code when one of J's prime native attributes is its 
ability to "say" things in very little space.

Hope all of this helps a bit!

Harvey

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to