J Language Changelog

What's new in J Language 901

Aug 15, 2020
  • Summary of Changes to the J Language in the release
  • Language addition: gerund"r: the left operand of m"v can now be a cyclic gerund, giving a sequence of verbs to be applied to corresponding cells of the arguments. At long last you can apply a different verb to each cell of a noun. For compatibility with the older uses of m"n, the gerund is recognized only if the ranks v are not all infinite and m is a list of boxes containing a valid gerund. This is an incompatible change only if you used m"n with finite rank and an m that looked like a gerund. In that case, you need to replace m"n with m"_"n.
  • Language change: Scatter-amend support: x m} y changed when m is a numeric array of rank>1. In that case, each 1-cell of m is the index list of a cell of y that is replaced by the corresponding cell of x. This is an incompatible change with J8.07 and earlier, but is compatible with previous J9.01 betas.
  • Language addition: New primitives for iteration: A family of primitives implements Fold, as previously proposed. Features:
  • iteration can be forward or backward through items of a noun
  • initial value provided as its own argument
  • early termination allowed
  • either one result for the whole iteration or a result item per iteration
  • result of an iteration can be a subset of the complete internal state passed to the next iteration
  • results of individual iterations can be put into the overall result or not
  • iteration can be by item or on the entire argument until a condition is met
  • Language addition: : u. and v. are added to mean 'u/v in the calling context'. They are implied locatives, carrying with them the private namespace and implied locale at the time the operands they represent were created. When they are executed, the execution occurs in the original name environment. This long-awaited change allows you to pass a private name from an explicit definition into an explicit modifier, and when the modifier executes its u./v. operand, the execution happens as if it were executed at the point just before the modifier was called.
  • Language addition: Foreigns to set script name: 4!:6 y adds an entry to the table of script names returned by 4!:3; 4!:7 y sets the script number to use for subsequent assignments.
  • New control over precision of numeric constants:
  • No numeric constant containing a period will be demoted to lower than floating-point precision (thus 2. or 2.0 is a float value)
  • no number of more than one character will be demoted below integer precision (thus, 01 is an integer value).
  • No numeric constant containing 'j' will be demoted below complex precision (thus, 1j0 is a complex value).
  • No numeric constant containing 'r' will be demoted below rational precision (thus, 2r1 is a rational value).
  • This makes it easier to create DLL inputs of the correct precision, and to make the datatype of constants match that of other nouns they operate with. Linear representations preserve the distinction between precisions.
  • If an adverb/conjunction with only one defined valence refers to any of m n u v and also to x, the defined valence will be construed as dyadic. Example:
  • 1 : 'x u y'
  • Formerly this would give domain error when executed as a dyad, or value error when executed as a monad. This is an incompatible change only if you used the variable x in a monadic adverb/conjunction. In that case, use a different name, or add a nonempty dyadic case to the end of your definition.
  • Quicker way to specify numbered locales: numbered locales can be referred to by indirect locatives that are an integer atom or a boxed integer atom (rather than a boxed string). Such locatives can be processed quicker because they do not have to be validated and converted to a number. If you have (obj =: conew parameters) you can replace that with (obj =: 0&".@> conew parameters) and get a performance improvement every time you use (name__obj).
  • Domain of x u;.0 y expanded: the selected subarray may start on any valid atom of its axis, or on the atom one position before or after the axis. In all cases the length will be limited to the largest valid value for the starting position (which will be 0 for positions starting outside the array)
  • Domain of {:: extended: 0 {:: y now returns > y rather than length error when y is an atom.
  • Language deletion: primitive conjunctions .. and .: (Even and Odd) are removed from the language
  • Language deletion: calculus primitives (d. D. D:) are removed from the language, replaced by a J addon math/calculus that provides most of the functionality
  • Language deletion: Taylor-series primitives (t. t: T.) are removed from the language
  • At the end of a for_xyz. loop, the names xyz and xyz_index remain defined. If the loop was exited by break. or goto., the names simply retain their latest values. If the loop is exited by executing all the iterations, xyz is set to an empty list and xyz_index is set to the number of iterations that were executed.
  • else. is now allowed as the last alternative in an if. control, even if there has been a previous elseif.

New in J Language 807 (Oct 9, 2018)

  • X +/@:*"1 y is now supported as a primitive with Integrated Rank Support. The new version is 2x faster than before on long vectors, 4x on sets of 60-long, 20x on sets of 6-long. Details here
  • X +/@:* y faster on floating-point arguments
  • [x] ".@'name' y improved. This is the best way to defer the evaluation of (name) until a verb is executed.
  • 7 o. y faster
  • X p. y improved. Does not scan y for infinities, supports inplace operation, has integrated rank support, and has special cases for linear, quadratic, and cubic polynomials
  • Coefficient-form polynomials now give an infinite result (rather than NaN error) for an infinite argument, with the sign of the infinity chosen based on the coefficients.
  • Rank-0 loops over arguments rewritten to use the new result-assembly code and virtual blocks. These loops include u"0 and u@v, u&v, and u&.v, and the system names each and every.
  • Boxing overhead is avoided for the following forms. These are now as fast as u&.> was in earlier versions (for unboxed arguments, they are faster because they avoid an initial step of boxing the arguments):
  • <@f
  • F@>
  • F&.>
  • <@(f@>)
  • F&.>
  • (<@:f)@>
  • (<@f)@> when the rank of f is infinite
  • And also the above when @ is replaced by &
  • If u is one of the forms above that opens its argument, and v is a form that boxes its result, the compounds u@v and u&v can pass virtual blocks from v to u.
  • U&.v now calculates the inverse immediately if it does not contain names (previously it waited until receiving the verb arguments). u^:_1 behaves similarly, for the monadic valence only.
  • If u or v contain names, you can use f. on either that argument or the whole compound to remove the names
  • Erroneous inverses, like +&.i. and i.^:_1, are detected earlier
  • X u/. y recoded yet again to collect input cells faster
  • 6!:3 y has millisecond accuracy on all systems
  • J807 beta-g
  • Name search rewritten. Will make a difference for programs with long search paths
  • J807 beta-f (withdrawn, do not use)
  • Incompatible change
  • If you use a synonym for the Cap verb ([:), the synonym must be defined before it is used to create a capped fork.
  • Work Done for This Beta
  • X u/. y recoded to collect input cells faster
  • The result of an explicit definition can be operated on in place (provided the value was not assigned to a name within the explicit definition)
  • U/ y, [x] u"r y, x u/. y, and [x] u;._2 _1 1 2 y allow inplace operation of u on cells of inplaceable arguments
  • ,/"r y (merge two axes of y) produces a virtual result
  • U/. y uses virtual blocks and the new Result Assembly. Special forms detected are:
  • <@f/. y
  • <@f/ y
  • Forms using raze:
  • ;@:(<@f/.) y
  • ;@:(<@f/) y
  • U/ y uses virtual blocks for the cells
  • Startup overhead for atomic dyads (+ * % etc) reduced by almost 50%. Noticeable for small arrays.
  • X (<"1@[ { ]) y, which avoids boxing x, is faster if x is nonnegative (almost 2x improvement for y with integer atomic cells). This is the fastest way to scatter-read from an array.
  • J807 beta-e
  • Features no longer supported
  • Mapped boxed arrays
  • Old-style argument names x. y. u. v. m. n.
  • Work Done for This Beta
  • Cuts u;._2 _1 0 1 2 use virtual blocks and the new RA code. Generally faster, especially for homogeneous non-boxed results, and for u in the form <@f.
  • X f;.0 y is now as fast for any f as it used to be for ];.0
  • X f;.0 y uses a virtual block whenever x has 1 column, regardless of the rank of y
  • Prefix and infix ([x] f y) use virtual blocks and the new RA code
  • _2 f/ y is now supported by special code, like 2 f/ y
  • New case added to the i.-family: x i. y where the rank of an item of x is no less than the rank of y. Uses sequential search rather than hashing: about 2x faster, if there are few searches. Previous versions recognized this situation only when y had rank<2.
  • Raze (; y) is detected in some partitioning compounds and processed more efficiently:
  • ;@:(<@v)
  • ;@:(<@v"r)
  • ;@:(<@:v;.0) also &:
  • ;@(<@:v;._3 _2 _1 1 2 3) also &:
  • ;@:(<@f)
  • 2 ;@:(<@(f/)) y also _2
  • If the raze is omitted, the rest of the form is still detected for faster processing
  • Transpose ([x] |: y) polished, about 3x faster for arrays that fit in L2 cache (e. g. integer matrices up to 200x200), 20% faster for large arrays
  • Virtual Blocks and Recursive Usecounts are now available for extended-numeric and rational precisions
  • J807 beta-d
  • Cd is changed to avoid troubles arising from virtual blocks
  • More primitives produce virtual blocks:
  • , y
  • X ($,) y when the atoms of y are not repeated and there is no fill
  • X $ y when the atoms of y are not repeated and there is no fill
  • X { y when x is unboxed and the selection returns an array of contiguous atoms of y
  • Code for Result Assembly (RA) is being consolidated. This is the code that collects the results of execution on multiple cells into a single result array with framing fill. Versions of this code with differing levels of sophistication have been scattered around the JE. As primitives are modified to support virtual blocks, they are being upgraded to use the new common RA code. The new code for RA has the following features:
  • Never executes a verb on a cell more than once (some of the former RA code restarted the whole execution of a primitive if a result did not match the shape/type/precision of the first result)
  • Handles changes of precision without falling back to the code for dissimilar shapes
  • Fills results of dissimilar shapes without copying fill to the entire result area first
  • Creates boxed results as having recursive usecounts, which are more efficient
  • Detects verbs that always produce an atomic box (<@:f for example) and avoids boxing each individual result of f
  • Allows relaxation of virtual-block restrictions when the result of the operation feeds into a primitive that immediately opens it (; y, > y, &.> (each), @> (every))
  • Frees intermediate memory blocks as quickly as possible
  • New RA code is used in
  • [x] u"r y
  • [x] f@g y
  • [x] f&g y
  • The main RA loop for dyadics is quadruply-nested. Sequences of u"r, f&g, and f@g are consolidated where possible to minimize the number of RA operations required.
  • IRS support within the JE
  • [x] u;.3 y and [x] u;._3 y
  • [x] u;.3 y and [x] u;._3 y are completely rewritten to use virtual blocks for the subarrays. Much faster on general arguments.
  • Incompatible change: Previously, if the number of columns of x was less than the rank of y, x was extended with columns that selected the axis in full and these added axes appeared in the shape of the result. Now the new axes do not appear in the result-shape.
  • J807 beta-b
  • Virtual blocks introduced, whereby the result of a block may reside within another block. The result must be copied to a real block if it is assigned to a name or put into a box.
  • Virtual blocks used in:
  • {. y
  • {: y
  • }. y
  • }: y
  • Atom {. y
  • Atom }. y
  • JGetR gets JDo formatted output. Used in new addons/api/python3.
  • J807 beta-a
  • Reworked memory allocator to allow for virtual blocks
  • Smaller header makes better use of cache lines
  • Foreigns 9!:48 and 9!:49 (allow use of old names x. y. etc) removed
  • Changes to the base system
  • Update regex to PCRE2 with standard (not POSIX) interface. This also fixes multiline bugs that had been reported. Documentation at Regular Expressions.
  • Move most of the Help|User Manual to the wiki.
  • Changes to the Qt IDE
  • For Qt IDE 1.7.7 or later.
  • Fix segfault on exit on some linux systems
  • Add support for case-sensitive drives and folders in Windows, see Windows case-sensitive
  • Add QWebChannel support for webview (full Qt 5.6 or later), see demo at Help|Studio|Showcase|webview
  • Add webview load event (full Qt 5.6 or later)
  • Add Form resize event
  • Add edit control textchanged event
  • Add wd 'pmoves [x y w h]' (to save/restore form position and size, see pmoves
  • Add wd 'sm profont {fontspec}' command to set proportional font
  • Add TabWidth config option
  • Add CursorWidth config option to set cursor width in session windows
  • Add open image and pdf files from editor
  • Add menu item show|hide
  • Add set backgroundcolor for webview
  • Add listbox drag and drop, see Help|Studio|Qt Demos|drag and drop
  • Add support for themes, see Help|Studio|Qt Demos|theme for an example with the dark theme
  • Add Open in File Manager and Open in Terminal to the Edit|Project menu, both starting in the current project directory
  • Enable add new tab (with no contents)
  • Enable HighDpiScaling on Windows
  • Improved textview, with zoom/line numbers/full screen/word wrap, see Ctrl+H in a textview window
  • Support external links in static controls

New in J Language 806 (Nov 13, 2017)

  • New features:
  • u@n (where n is a noun) is now allowed, and executes u on the value of n, ignoring any arguments (equivalent to u@(n"_))
  • u :: n (where n is a noun) is now allowed, and gives the result n if u fails (equivalent to u :: (n"_))
  • [x] 128!:6 y - see latest Dictionary for documentation on support for Secure Hash Algorithms
  • u d. _1 now knows how to integrate more cases of m&^ and ^&n, with some bugs fixed (contribution from Jon Hough)
  • Performance improvements (timings taken on 64-bit Windows):
  • (x -: y) coded to be a bit faster for boxed arrays
  • (x -:!.0 y) coded significantly faster on floating/complex arrays by avoiding code to replace -0 with +0
  • (x +/ . * y) coded using block tiling with BLAS micro kernels which take advantage of SIMD instructions (if supported by the user's CPU).
  • (x +/ . * y) executes on multi-cores (if OpenMP is available) to perform parallel calculations.
  • The i.-family has been recoded to use improved algorithms and AVX/NEON instructions
  • During x {:: y, any selection in which x is a numeric atom and y is a list of boxes is handled by special code
  • Arrays with a large number of boxes are greatly improved. Assigning such an array to a name no longer requires visiting every leaf.
  • x m} y and x , y operate in-place if possible when x and y are boxed (they have long been in-place for non-boxed types)
  • The no-change cases 0 }. y, 1 # y, and 0 |. y execute instantly
  • Nested dyadic ranks, for example x u"0 0"1 _ y or x u"0/ y, are handled with a single looping structure rather than a nested one that required copying the data twice
  • Monadic and dyadic ranks run a bit faster after a rewrite primarily intended as a bug fix
  • u"n, when u returns a boxed result, is a bit faster by saving one copying of the boxing
  • Changes to the Qt IDE:
  • The Qt IDE version is 1.6.2, and is built with Qt 5.6 on Windows and OSX, and with Qt 5.3 on Linux.
  • Changes:
  • add svgview control using QSvgRenderer, see Help|Studio|Qt Demos|svg
  • add browser control using QTextBrowser, see Help|Studio|Qt Demos|browser
  • add websocket and opengl support to the slim build
  • user QTextEdit control for Term. This replaces QPlainTextEdit, and enables html output to Term, e.g.
  • A=: '<html><span style="color:red;font-style:italic">hello there</span></html>'
  • wd 'sm html *',A
  • hello there

New in J Language 804 (Jun 13, 2016)

  • Changes to the base system:
  • the Windows J engine is updated to J804 with support for 64-bit OLE and unicode, see Guides/OLE Automation
  • 9!:14'' is extended with build information
  • Changes to the Qt IDE:
  • the Qt IDE version is 1.4.9
  • the Windows Jqt.exe supports OLE automation server, see Guides/OLE
  • Automation:
  • add Ctrl+/ toggles NB. comments. This replaces the earlier Ctrl+Shift+B and Ctrl+Shift+N.
  • add Ctrl+Shift+/ (OSX Option+Command+/) toggles Note'' comments.
  • add new Qt key definitions to ~addons/ide/qt/keys.ijs
  • add Open in folder subfolder to Term and Edit File menus
  • additions to Debug:
  • support setting stops in verbs with headers, see Debug/Stops#Headers
  • add programming interface for setting stops and dissect information
  • changes to line recall, see Line Recall:
  • add filtering to the Input Log dialog. Any text entered subsets the list to lines containing the text
  • add get/set inputlog
  • add Qt IDE config KeepCursorPosOnRecall. If set, this preserves the cursor position when recalling an earlier line from the session
  • fix crashes in event handling when J is suspended
  • fix crash in multi-dimensional isigrid when moving away a single row label
  • fix drag/drop in OSX isigrid
  • fix FIW and FIF layouts in OSX
  • fix incorrect title of second edit window
  • fix isigrid bug where axes changed after grid is scrolled
  • fix problem with Edit script reload, when the script was changed multiple times
  • Configure|Styles... has added styles selb (background color for selections) and selt (text color for selections)
  • Edit Run Line commands now treat a multiline explicit definition as a single line
  • in Term, Shift+Home selects to the beginning of the text, if any
  • line numbers are shown only for Edit windows, not in Term
  • point NuVoc help to the new wiki
  • replace svg images with png images
  • when saving a new script to a new name, it is added to the recent files list
  • Changes to the Qt IDE Window Driver:
  • add char event for edit control
  • add dial, multimedia, scrollbar controls
  • add glcursor command
  • add glqtype to return 0=isigraph, 1=isidraw
  • add maxwh, verbose, getp, setp commands
  • add sysmodifiers includes 4 when Alt (OSX Option) is pressed
  • add wd 'sm set edit scroll N' scrolls the editor to line N or maximum possible if less.
  • change pshow command to accept an optional parameter
  • change gl command glfill to accept RGBA format
  • check for illegal or extra parameters and control styles
  • enhance get and set commands, see Window Driver/ChildClasses
  • enhance grid command, see grid commands
  • enhance session manager commands, see Guides/Window Driver/Session
  • Manager:
  • fix wd parsing to reinstate support for binary parameters to some commands, e.g. websockets
  • gltextmetrics uses glfontextent
  • support dynamic OpenGL on Windows platforms
  • wd 'mb font [title] [fontspec]' now supported, allowing a title for the font dialog. If only a single argument is given after font, it will be interpreted as the title.

New in J Language 804 Beta (Jun 29, 2015)

  • Changes to the Qt IDE (other than Window Driver):
  • the Qt IDE version is 1.4.2
  • additions to Debug:
  • support setting stops in verbs with headers, see Debug/Stops#Headers
  • add programming interface for setting stops and dissect information
  • Changes to the Qt IDE Window Driver:
  • support dynamic OpenGL on Windows platforms
  • add dial, multimedia, scrollbar controls
  • add maxwh, verbose, getp, setp commands
  • add char event for edit control
  • add gl command glcursor
  • change pshow command to accept an optional parameter
  • change gl command glfill to accept RGBA format
  • check for illegal or extra parameters and control styles
  • enhance grid command, see grid commands
  • enhance get and set commands, see JQtChildClasses
  • enhance session manager commands, see Guides/Window Driver/Session Manager
  • fix crashes in event handling when J is suspended

New in J Language 803 (Dec 10, 2014)

  • Changes to the base system:
  • J engine updated to J803 with bug fixes
  • support read/write jpeg and png formats
  • project decommenter leaves in any comments beginning NB.!
  • Changes to the Qt IDE (other than Window Driver):
  • the Qt IDE version is 1.3.1
  • add Debug GUI
  • add isigrid control
  • add user-defined shortcut keys, see menu Edit|Configure|User Keys
  • add menu File|Open addons to Term menu
  • change KeepInputLog to MaxInputLog in the Edit|Configure|Qt Ide configuration, to allow the saved log length to be set
  • change menu "Studio|wd Demos..." to "Studio|Showcase..."
  • some Qt commands can now be called from Jconsole, by loading ~addons/ide/qt/qt.ijs
  • user-defined keys that run a J expression first define WinText_jqtide_ and WinSelect_jqtide_ for the active window. This allows the J expression access to the current text and selection.
  • menu file|quit in edit closes only the editor, not the J session
  • run all now uses loadd (load with display)
  • fixed - disable role-based merging of wd menus on mac
  • Changes to the Qt IDE Window Driver:
  • add "bin m" command, see JQt layout
  • add find command to edith and editm controls
  • add gl commands glfontextent, glqpixelm. glfontextent must now be used before calls to glqextent (previously glfont was used).
  • add penstyle to glpen, which makes it available for outlines of glrect objects. Note that the numeric codes for penstyle (PS_xxx) have changed; use the codes in file graphics/gl2. Note especially that penstyle 0, formerly the solid line PS_SOLID, has changed to the invisible line PS_NULL.
  • add set tooltip for windows controls
  • add SOH delimiter for wd parms, and change LF delimiter, see Command Syntax
  • add several sm commands. See ~addons/ide/qt/demo/sm.ijs for examples.
  • add "selectable" parameter to editm readonly control. This shows the cursor and selections.
  • fix glcmds error handling