The JOD Page

JOD is a J language programming tool. 

Version: 1.1.1 released February 10, 2024

This page maintains references to primary JOD materials.

JOD can be installed and updated with the J package manager.

JOD PDF Help – current JOD system documentation in one PDF document. The same document is also available on this alternate server.

JOD Jupyter Notebooks – Jupyter notebook versions of some JOD labs.

Hard Copy JOD documentation – you can order JOD documentation in book form from Amazon. If this link does not work search Amazon books for ISBN-13: 979-8554921117. You can also search with Amazon’s ASIN key B08M2KBMND.

JOD Dictionary Dump Scripts – This GitHub repository holds working dictionary dump scripts. Dump scripts are used to create, update and archive JOD dictionaries.

JOD Source Code is available as:

  1. JOD dictionary database dumps – install the jodsource addon with the J package manager.
  2. A GitHub JOD repository. Pull into an empty local repository with:
    git remote add jod https://github.com/bakerjd99/jod.git  git pull jod master
  3. This repository is the official GitHub J Software repository for pacman addons.
  4. A Knuth style literate programming single PDF document.
  5. Downloading release zips from OneDrive.

Many Examples of JOD Generated Scripts – see the GitHub jacks repository.

34 thoughts on “The JOD Page

  1. John
    Your book is well presented as a pdf with all the links including page numbers in the Table of Contents. Can you what packages where used to create the pdf and I am considering writing a small book and your presentation style is most impressive.
    Thanks
    Bill

    1. Thanks Bill,

      A few years ago I published the JOD manual as a little book. The link is:

      http://www.lulu.com/shop/http://www.lulu.com/shop/john-baker/jod-j-object-dictionary/paperback/product-22188272.html

      One of the things on my endless todo list is to finish a few planned features of JOD and revise this
      publication to reflect the current state of the system.

      The current PDF distributed in the document addon is current.

      How are things in OZ these days. Your continent, and Antartica, are still on my continent todo list.

      John

      1. Hi John
        All is well in OZ – and going into spring -and please get in touch if planning a visit downunder.
        Did you write the initial text in word and convert to pdf or some other process to get the links in the pdf ?.

        Regards
        Bill

      2. Bill,

        I use LaTeX and the Hyperref package. Both are fairly standard technical writing tools. Even better they are public domain and freely available. Check out TeX Live and MikTeX if you are interested. Cheers John

  2. Couldn’t get it to work through the labs or the tutorial in the pdf doc, using j805 beta and macOS. It creates the files, jod.ijn and jmaster.ijf under the ~addons/general/jod directory after load’general/jod’. The first newd succeeds, but then everything else just returns

    0 !JOD error: cannot read master

    1. I have not tested JOD with the j805 beta on mac systems yet but I can offer a few suggestions.

      1) J on 32-bit mac systems is being deprecated. From now on only 64-bit mac systems will be supported. So first make sure you are using a 64 bit system. All new macs are 64 bit but older machines may still be 32-bit.

      2) The error you are reporting is related to reading a jfiles jmaster.ijf file. If you are not seeing a J error as part of the error message then, for some reason, the J process does not have access to the jmaster.ijf file.

      3) If you see a regular J error as part of the JOD message please pass on the message.

      4) Finally, all JOD words trap errors. If you type get without arguments you will see something like get_2_. You can call get_2_ directly, this bypasses top level error trapping, and will show in J errors in the standard manner. If such a call generates a J error this means there is a bug in JOD or something is fishy with the j805 beta. If you do not see a J error there is some file access issue in this environment.

      Hope this helps. John Baker

      1. Thanks for the reply. There’s an issue with the jsource code, and I sent a message to the beta forum.

        About volfree/freedisk, if you want to check disk space, df accepts a path name, and don’t use -l, which breaks nfs. However, it’s unnecessary to check free space. A simple argument is that you can never account for the disk space changes by other processes while you are doing your IO. It’s the system/kernel’s job to do it right. A cleaner way for user space code would be emit an error if any disk IO fails.

        When you pass any command line to 2!:0, please quote the argument, just as what you did with the windows rd command. I recommend single quotes instead of double quotes.

        Thanks for the package. It’s a very interesting way of organizing code snippets.

  3. Bill,

    Thanks for the note. jodhelp goes to online help by default. Normally the online help is more current but in the last month I have been making lots of changes to the PDF version.

    On thing you can do to is to define a verb that always loads the PDF version if that is your preferrence, eg:

    jodpdf_ijod_=: 3 : 'jodhelp~ ''PDF'' '

    Then jodpdf 0 always goes to the local PDF version.

    John

  4. John
    Installed latest PDF manual (12/12/2011) : need to rename from jodnew.pdf to jod.pdf.
    using:
    jodhelp ~ ‘PDF’
    works and goes to the local PDF file.

    Whereas:
    jodhelp ‘put’
    goes to the online help.
    It makes more sense to go to the latest help which is online.
    Bill

  5. Bill,

    Your error is caused by the arc/zip addon. It is used in the source setup script to extract the zipped dump scripts. Apparently it doesn’t work on 64 bit systems.

    This is not a show stopper. jodsource.zip is just a plain old zip file. You can extract and build the source dictionaries like this:

    1) Unzip utils.ijs, jod.ijs, joddev.ijs to a temp directory say c:/temp

    2) Start J and load JOD: load 'general/jod'

    3) Create your source dictionaries with the location you want:

    
    newd 'utils';'c:/users/owner/j64-601/utils'
    newd 'jod';'c:/users/owner/j64-601/jod'
    newd 'joddev';'c:/users/owner/j64-601/joddev'
    
    

    4) Open the dictionaries and load the dump scripts in this order.

    
    od 'utils'
    0!:0 <'c:/temp/utils.ijs'
    0 globs&> }. revo ''  NB. rebuilds cross references
    3 od ''
    
    od  ;:'jod utils'
    0!:0 <'c:/temp/jod.ijs'
    0  globs&> }. revo '' 
    3 od ''
    
    od  ;:' joddev jod utils'
    0!:0 <'c:/temp/joddev.ijs'
    0  globs&> }. revo '' 
    3 od ''
    
    

    Hope this helps.
    John

  6. John
    Tried running:
    load ‘c:/users/owner/j64-701/addons/general/jodsource/jodsourcesetup.ijs’ on a 64 bit system.

    Got the following error:
    |domain error: unzOpen
    | 0=Z=. unzOpen,<ZN

    I note that the script has been tested on 32 bit systems.

    Can I load the jsource dictionaries into:
    c:/users/owner/jod/j701 or c:/users/owner/j64-601

    instead of:

    c:/jod/j701

    Bill

  7. John
    In Section 7 of the PDF (Release 0.8.0 3/2/2009) manual you refer to the jmaster.ijs as a binary component file. Should this be jmaster.ijf ?. Similar treatment for jwords.ijs etc in the section.

    How can I get and display the documentation stored by:
    newd ‘play’;’c:/jod/j701/play’;’this is documentation to get and display’

    Thanks Bill

    1. Bill,

      You are correct about section 7. I spotted this error when I was revising jod.pdf. There is a new version of the manual jodnew.pdf available here:

      http://www.box.com/shared/gajfu50gc0

      and in the Files sidebar that fixes this and also reflects changes to JOD since version 0.8.0.

      As for your other question. There is no direct JOD command to fetch this documentation but you can get at it by first displaying the locations of dictionaries with od and then directly reading component 2 of the jwords.ijf file.

      4 od ”
      +-+————————————————-+
      |1|+———-+————————————+|
      | ||cbh |/home/john/jod/j701/cbh/ ||
      | |+———-+————————————+|
      | ||docs |/home/john/jod/j701/docs/ ||
      | |+———-+————————————+|
      | ||play |/home/john/jod/j701/play/ ||
      | |+———-+————————————+|
      | ||utils |/home/john/jod/j701/utils/ ||
      | |+———-+————————————+|
      +-+————————————————-+

      jread (‘/home/john/jod/j701/play/jwords.ijf’);2
      +———+
      |j toy box|
      +———+

      This looks like a good candidate for a little extension verb that reads and writes this item.

      Thanks for your careful reading. If you spot any errors in jodnew.pdf please let me know.

      John

      1. Bill,

        I have extended the put and get verbs to read and write dictionary documentation.

        NB. read documentation
        5 get ”

        NB. write documentation – any character list
        5 put ‘document me’

        This is available in JOD version 0.9.65+

        John

  8. John
    Starting to use JOD. Trivial question. In setting up a new dictionary I did not include any documentation as the third item. How do I subsequently add documentation and edit ?
    Any help welcome.

    Regards

    Bill

    1. Bill,

      To revise documentation for an existing dictionary you have to unregister and re-register it. The following sequence illustrates how to do this:

      
       NB. load or require JOD
       load 'general/jod'
      
       NB. unregister the dictionary - it must be
       NB. a READWRITE dictionary (the default)
       3 regd 'play'
      
       NB. re-register using the same name and 
       NB. location with a third documentation item
       regd 'play';'c:/jod/j701/play';'this is documentation'
      
      

      Editing the documentation list, ‘this is the documentation’
      is something you do outside of JOD. You can use the J or
      any text editor to create this list.

      Hope this answers your question. – Thanks for dropping bye.

  9. Is JOD a (world-wide) repository of reusable pieces of J code? This reminds about Phrases on jsoftware.com and RosettaCode. No, probably JOD is not that; for that, one needs a universally available storage for pieces.

    Is JOD a system for coding in J in an organization? Where someone decided that text files aren’t as good as a company-wide database for code pieces? May be.

    I agree that docs on JOD aren’t entirely clear.

    1. Thanks for commenting. I have been using JOD for so long that it’s hard for me to see it through other eyes. JOD’S online documentation is mainly for quick reference. jod.pdf is detailed and should answer most questions about JOD.

      JOD is not a world wide repository. It uses local jfiles. The jfiles may be on network drives. If I ever replace JOD’s storage object I might use some global store like Google Storage.

      JOD’s main function is organizing my code. In my active dictionaries I have over two thousand J words ranging from tiny tacit definitions to multi-page explicit definitions. J code is typically functional and side effect free which means most of these words can be freely reused in new contexts. I could set up standard require files but it’s easier to define JOD word groups and generate scripts on the fly. This approach yields exactly tailored runtime scripts that do not include redundant or unused chunks of code.

  10. I’ve read the article, I’ve viewed the slides, and read the JOD documentation. Yet, NONE of these sources answers the following questions:

    * What is JOD?
    * Why would I want to use it?
    * What problems does it solve?

    I see lots and lots of buzzwords and technical matter in the documentation, but nothing which communicates why it exists at all.

    1. 1) What is JOD? It’s a J word database.

      2) Why would I want to use it? All J words, including large nouns (arrays), can be stored with a single put ‘array’ and fetched with a single get ‘array’.

      3) What problems does it solve? The same problems natural language dictionaries solve.

      4) Why does it exist at all? It exists because I had previous experience with code databases and saw how they significantly improve code reuse.

Leave a reply to John Baker Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.