From: *Marshall Lochbaum* <[email protected]> Date: 6 May 2016 at 21:15 To: [email protected]
I am starting to write some references for aspiring and struggling J source developers (there are only two kinds), seen here: https://github.com/iocane/unbox/wiki If anyone has requests for particular topics that should be clarified, let me know. Marshall ---------- From: *Henry Rich* <[email protected]> Date: 7 May 2016 at 17:05 To: [email protected] So far, I wish I had: * a one-line description of what each routine does * a guide to Integrated Rank Support * a guide to how derived verbs are created and executed * a guide to how errors are signaled & processed; when ASSERT is not allowed; a simple rule: almost always RZ around a function call, and the rest of the time, RE around it * when is memory allocated & freed * how does u^:v work for noun & verb v * guide to name-referencing: the nvr stack; EPILOG; use counts * how J-like sequences, such as (' ' , }. y), are written in the C code When I work in an area, I describe it in detailed commentary in the source code. My next area will be the ^: conjunction. I think the primary repository of information should be the code, but it wouldn't hurt to extract useful bits into a separate document. Henry ---------- From: *Roger Hui* <[email protected]> Date: 8 May 2016 at 08:31 To: Henry Rich <[email protected]> Cc: [email protected] * a guide to how derived verbs are created and executed This is explained in *An Implementation of J* <http://www.jsoftware.com/papers/AIOJ/> from 2012, and also in *An Implementation of J* <http://www.jsoftware.com/books/pdf/aioj.pdf> book from 1992. I haven't investigated in detail but I am guessing that some of the other bullet points are also explained in those two references. ---------- From: *Roger Hui* <[email protected]> Date: 8 May 2016 at 21:15 To: Henry Rich <[email protected]> Cc: [email protected] * how J-like sequences, such as (' ' , }. y), are written in the C code Suppose you want to write a C function to do exactly ' ' , }. y. File t.c has a table that relates the C functions for the monadic and dyadic meanings of each J word. Thus , maps to over() and }. maps to behead. So what you have so far is: F1(blankfirst){R over(blah,behead(w));} blah has to correspond to ' '. File u.c has a bunch of functions sc*() for constructing scalar constants of various types. scc(' ') would be a scalar blank. Therefore: F1(blankfirst){R over(sc(' '),behead(w));} // ** It is possible that there is already a global constant defined for ' '. You'll have to check for that. The more interesting thing about this, is that several of the conventions in the J source are to make possible such succinct and direct correspondence between a J sentence and the C code necessary to implement that sentence. For example: - a 0 result indicates an error (e.g. what happens if y (w) is numeric) - there is explicit allocation/freeing of memory in the ** line - each J word is implemented by a named C function - monadic functions are defined by the F1 macro - #define R return, the shortest possible return from a C function etc. etc. On Sat, May 7, 2016 at 5:05 PM, Henry Rich <[email protected]> wrote: ---------- From: *Roger Hui* <[email protected]> Date: 8 May 2016 at 21:16 To: Henry Rich <[email protected]> Cc: [email protected] Sorry: - there is NO explicit allocation/freeing of memory in the ** line ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
