User:Dan Bron/Scratch

From J Wiki
Jump to: navigation, search

todo

writeups

initial topics

  • Write up "regrets": things we'd change in J if we could. Include the question of fork. (Read this entire thread, it has useful information)
  • Write up "order of execution"; mention things like &.>, ", for. and (f g h) y (this latter is the same as (f y) g h y except for order of execution, which is not specified in the fork.) There are many warnings on this topic in the Forum, find the first, or best representative, warning for each class of execution order (", for., f g h). Henry Rich is a good search term here (he's both disagreed with J's undefined order of execution for various classes, and provided ample warning to newbies). But try to find canonical statements from Roger. Here's a canonical statement on the order of cut.
  • Write up J's memory allocation model, and the fact there's never been a leak, except the "empty control structure" bug.
  • Write up a "keyless entry" puzzle & post it to the Forums.
  • Write up tips for recognizing the valence of verbs in a train (and obstacles to that goal).
  • Compare and contrast the different ways to loop in J.
  • Write up Function composition essay; this will be helpful for intermediate users who are daunted by tacit J -- the main obstacle to tacit J is function composition (and, in fact, function composition is the salient characteristic of tacit J [because most tacit J defines verbs rather than adverbs etc]). You'll need a companion essay on rank and frame/shape to fill out the tutorial. The example for function composition should be correlation -- give Oleg credit here (for first publishing this formulation -- you'll have to look it up).

evocation

There are many ways to evoke code in J.

The main ones are ". ~ f. 128!:2  : `:6 5!:0 @. D. t. t: and less directly / /. \ \. ^: } '`'=. ;..

There are also ways to activate these indirectly; for example ]&.": '3+2'. See anonymous evoke for a more general demonstration of the problem.

Even if J code is completely static, system access still provides a avenue for trouble. Certain foriegns need be restricted.

Discuss "security level" and its inadequacy. For example, 9!:25[1 restricts file system access, yet 0!:0 file is still possible. So a script could be reloaded. Given that and 4!:4 and 4!:4, the names it defines could be discovered (possibly including host system information).

There is even a vulnerability in the "locked script" implementation so that code encryption can't help you (Quintana's "fully fixed functional form" would alleviate this to an extent").

Plus noun names can't be locked, so if you have sensitive information in nouns, it's always available to reflecting code.

Finally, all these make it possible to executed arbitrary code in a fixed number of tokens, which complicates J golf tournaments.

trivia

Create an open ended "J trivia challenge" or "scavenger hunt".

initial topics

   {.($.1 1)&+1 : '5!:2{.;:''u'''
+-----+
|0 | 1|
|1 | 1|
+-----+
   ;2#{.($.1 1)&+1 : '5!:2{.;:''u'''
scheck a rank
|system error

   a:,'' NB. USually you can catenate an empty array to anything..
++
||
++
   a:,0$,12
++
||
++
   a:,0$,1 1   NB. But not boxes to sparse arrays

Other such trivia:

ghost hunting

Maybe write up ghosts hunting to describe the investigative tools and processes available to "chases ghosts" in J.

Include:

  • In re: Mysterious Foreigns, you could use your !:-seeker in J4 (or the better one , and distinguish between valence and domain errors. That way you'd have some (dated) indication of where the hidden foreigns lie. Maybe they're all in 13!: -- the 13!:33 and 13!:34 didn't seem related to debug (nor are they paired). So maybe Roger dumps them all his experiments in 13!:. Doubt it though -- 33 and 34 are right after 32, which is probably the low ceiling Roger set for him self so he could expand the public, documented, 13!: foreigns without collision. Also, if you do use code to seek xenos, ensure you skip over the base-120 repeats.
      A=:~:       ~ i. 1e6
      B=:~: 13!:34~ i. 1e6

      rjust fmt"> 7!:5;:'A B'
   1,048,576
     131,072

      %/7!:5;:'A B'
   8
      NB. Unsurprising.  8 bits per byte.

identity table

Try to find a use for the difference between ["0/ and ]"0/ . Maybe it's possible to rewrite transpose using, e.g. ,&.>~/~ ?

Try reading through the result of a J Forum search for ]"0 and one for ["0.

Note that ~, like many adverbs, does not change the rank of its operand. That is, f~b.0 -: f b.0.

bond chain

Study Raul Miller's question on chains of bonds. Perhaps try to find an f where (u^:(f x0,x1,x2) -: u&x0&x1&x2) y .

more PrimitivePrimitives

  • Related to ^::
    NB.  Basically f@:]/ (-x+#y) {. y
    NB.  i.e.  f f f f y
    NB.  But monadic only (easy to generalize to  ^:
    NB.  with an 2 : 'explicit conjunction'
    pow =. (@:]) / (@:(] {.~ (-@:+#)))

   +:^:3 ]5
16
   3 +: pow 5
16

wiki gnoming

short list

  • Rewrite :Essays/Distributed_Apply to conform with Jose's 128!:2 pattern. Also add it to the FAQ, and mention "doog" as a more general utility (show usage).
  • Start adding Forum links to the FAQ (e.g. for the Dist Apply FAQ, find all forum posts where someone asked how to do it, and add those links to the FAQ (quoting relevant parts). This will help search engines index and will help keep track of how popular a FAQ is and whether it's worth adding a primitive facility to cover)

reports and requests

Rewrite System Requests & Bug reports.

Try to reorganize the linked pages to match the matrix (i.e. two major sections, one for system, one for doco). Make sure each linked page has a reciprocal link back to the matrix (And only to the matrix).

 [[TableOfContents(2)]]

 == The J System ==
  The J system is built by the J Software team.  The team has split the system into 3 major components:   the engine (and its specification), the standard library (scripts shipped with J), and the interface (the GUI and command line tools).  As the system is divided, so are the responsibilities.

  Broadly speaking, these 3 components are respectively in the purviews of [[User:Roger Hui|Roger Hui]], [[User:Chris Burke|Chris Burke]], and [[User:Eric Iverson|Eric Iverson]] (with not inconsiderable contributions from members of the [:Community:community] like [[User:Oleg Kobchenko|Oleg Kobchenko]] and HenryRich).

  == Reports and Requests ==

  And, as the components are split, so are the attentions of the team.   So, the proper places to issue bug reports and make feature requests are enumerated below.

The lists are subdivided into "system" vs "documentation for the system"  (e.g. the J interpreter vs [wiki:JDic:contents the J dictionary]) and "outstanding" (current) and "archived" (resolved or otherwise out of scope).  Further, the "J interface" is divided into "jwdw" and "jwdj".

The former is reserved for the Windows interface and and the latter for the interface on non-Windows platforms.  Most tools are the same on both platforms, with the notable exception of the session manager (the GUI IDE).  On Windows, this is written in C++ and `wd'qwd'` gives `'jwdw'`; on other platforms in Java and the command gives `'jwdp'` (for '''W'''indows and '''P'''ortable, respectively).

Finally, while these Wiki pages are preferred (because they stand as a record), it is also permitted to report bugs and make requests on the [:System/Forums:J Forums] (specifically the beta forum if the bug appears in a beta version).

  == bug reports ===
  === outstanding ===

  || interpreter || system || documentation ||
  || stdlib      || system || documentation ||
  || jwdp        || system || documentation ||
  || jwdj        || system || documentation ||

  === archived ===
  ==== 2007 ====
  || interpreter || system || documentation ||
  || stdlib      || system || documentation ||
  || jwdp        || system || documentation ||
  || jwdj        || system || documentation ||

  ==== 2006 ====
  || interpreter || system || documentation ||
  || stdlib      || system || documentation ||
  || jwdp        || system || documentation ||
  || jwdj        || system || documentation ||

  ==== 2005 ====
  || interpreter || system || documentation ||
  || stdlib      || system || documentation ||
  || jwdp        || system || documentation ||
  || jwdj        || system || documentation ||

  == feature requests ===
  === outstanding ===

  || interpreter || system || documentation ||
  || stdlib      || system || documentation ||
  || jwdp        || system || documentation ||
  || jwdj        || system || documentation ||

  === archived ===
  ==== 2007 ====
  || interpreter || system || documentation ||
  || stdlib      || system || documentation ||
  || jwdp        || system || documentation ||
  || jwdj        || system || documentation ||

  ==== 2006 ====
  || interpreter || system || documentation ||
  || stdlib      || system || documentation ||
  || jwdp        || system || documentation ||
  || jwdj        || system || documentation ||

  ==== 2005 ====
  || interpreter || system || documentation ||
  || stdlib      || system || documentation ||
  || jwdp        || system || documentation ||
  || jwdj        || system || documentation ||

Dan Bron

  • Move User:Dan Bron#works_intended here. Particularly move "Jems" to the writeup section.
  • Clean up "full contributions" section. Only point to contributions of interest.
  • Kill the redundancy of the "Temp" table and the :DanBron/Temp page. Just keep it all on the Temp page, and transclude the Temp page into the Dan Bron page.
  • Move useful code out of Snippets or Temp and into SVN or the proposed "reflect" addon. If an addon, maybe rewrite the documentation pages in Snippets using the :Literate/Wiki_Tool .
  • Move other "works intended" into the utils section here.
  • Jot down your other seed ideas, like your J OnLine IDE (jolide). Scan that page you wrote up.

jokes

  • jokes : j-puns
  • jems: j-gems
  • j'erms: j-bugs
  • exejsis: j-exegesis.
  • jury-rigging: PrimitivePrimitives
  • jerry-building: quick and dirty J scripts.
  • j-aunting, -ogging, -ourneying: Learning about J
  • j-etsam: miscellania
  • jingoism: J-patriotism or chauvenism
  • junkie: a J enthusiast
  • jawing: talking about J?
  • jactictation: bragging about a particularly nice piece of J
  • jubiliation: the feeling you get from writing a particularly nice piece of J
  • jazzy: a sparkling example of J

utils

seed ideas

  • Create a J utility (with GUI) to create & contribute to Forum-based J contests.
  • Create an OEIS search utility
  • Write a "reflect" addon with all your reflection code.

soft stop

Finish up soft_stop where you were trying to answer a question from David Porter

inter-j communication

  • Create an IJC addon (inter-J communication) with the following dependencies (other addons you must write):
                                                              IJC
                                                               ^
                                                               |
                                                +-------------+----------+
                                                |                          |
                                              IPC (OOP)             J starter<--cmdln parser
                                                 ^                         ^
                                                 |                         |
    +---------------------+-------------------+-------------+       +--+--------------+
    |                      |                    |             |         |                  |
Socket Server (OOP)   Socket Client (OOP)     jmf.ijs     task.ijs   exe start  console start
    ^                      ^                                             ^             ^
    |                      |                                             |             |
    +--------------+------+                                        scriptname       REPL
    |               |
socket.ijs        Timer (OOP)

J.exe doesn't have a STDIN, so it must be passed script names; hence we need a way to identify the name of the currently running script (to fork it). But 4!:4 no longer accepts local names as arguments. Jconsole allows us to avoid writing anything to disk or depending upon filesystem paths; we can just pass code into STDIN (and get results back via STDOUT).

Theoretically, to start a new instance of J, fork ;{.ARGV is all that's required; {.ARGV is what was used to start this instance of J, and since we inherited the environment of the process that did that (including PATH and working directory), the command should work the same way.

The J starter has to do more than that, though. I imagine it as a J app startup framework, that allows you to declare variables which have to come from sources like the command line or env vars, and those variables should be available at startup. Etc.