J and LLM's base knowledge

40 views
Skip to first unread message

Thomas McGuire

unread,
Jul 12, 2026, 3:01:20 AMJul 12
to forum
During Henry Rich's zoom meeting on J, LLMs, agentic programming in J the question came up with how good is the base knowledge of the Frontier models. So a small test based on an example of some stock technical indicators was to use the Exponential moving average as the target and ask Anthropic's Fable, ChatGPT, and Grok 4.5 the following question:

"I want to test your base knowledge of the J programming language. Do not do a search on the web. From your own internal knowledge can you provide a verb definition of an exponential moving average in J. It should take a 1 dimensional J array and perform the exponential moving average on it."

I wasn't interested in correctness here I was just interested in how well the LLM attempted a J idiomatic solution. 

As many at the meeting predicted Anthropic Fable had the best base J knowledge producing a solution that used "\" instead of a large explicit definition that included a loop: 

NB. dyadic verb: alpha (left) EMA data (right) 
ema =: 4 : 0 
  a =. x 
  (] + a&*@:-)/@|.\ y 
)

Interestingly as people at the meeting had observed LLMs like to create variables where none are really needed. The alpha variable 'a" above is a case in point. "x" could have been used in the definition without any loss in understandability by even a novice J programmer. Speculation is that named temporary variables are a device to improve readability. But in J terse expressions are what we are looking for. It goes against the grain for your usual programming maintainability theories. J and other array oriented languages buck the usual software engineering paradigms. Thus making J a little more difficult for LLMs to use.  

Grok and ChatGPT produced a script with a loop. ChatGPT did indicate that it doesn't know off the top of its head but did offer to investigate further if a solution with "\" was possible. 

Each were able to better discuss or refine their solutions when a follow up question allowed web searching. This is why I put together the MCP servers that search the JSoftware website source text and the old JSoftware email forums. At their base it is a Xapian powered search engine against the corpus. The email MCP can provide entire threads of conversations to be read and analyzed. The website source breaks up many large documents (like JforC) into chapter files and pertinent hits on those can retrieve that text file to be read by an LLM. This provides fairly fine grained search capabilities that may not necessarily come from a standard web search.

Tom McGuire 

John Baker

unread,
Jul 13, 2026, 12:13:43 PM (13 days ago) Jul 13
to fo...@jsoftware.com
So for now J’ers are better off using our on heads.

On Jul 12, 2026, at 01:01, Thomas McGuire <tmcgu...@gmail.com> wrote:

During Henry Rich's zoom meeting on J, LLMs, agentic programming in J the question came up with how good is the base knowledge of the Frontier models. So a small test based on an example of some stock technical indicators was to use the Exponential moving average as the target and ask Anthropic's Fable, ChatGPT, and Grok 4.5 the following question:
To unsubscribe from this group and stop receiving emails from it, send an email to forum+un...@jsoftware.com.

Raul Miller

unread,
Jul 13, 2026, 2:03:13 PM (13 days ago) Jul 13
to fo...@jsoftware.com
If you're trying to use an unfamiliar API, an "AI" can help you get in
the right ballpark.

But edge cases (and of course correctness) are still on you.

--
Raul

Thomas McGuire

unread,
Jul 14, 2026, 4:45:50 AM (12 days ago) Jul 14
to forum

Background: The issue came up because as a couple of months go by and new Large Language Models are released with larger amounts of tokens being trained into models, the question of how much J knowledge is already baked into these newer models? How much bleed in is present in the base model from other languages that are more traditional in their processing of expressions (python, C/C++, Java, etc)? The models are usually able to produce J code but it tends to look like a directly transcribed python or C program without taking advantage of common J idioms. In the future as we approach General Artificial Intelligence we would expect that a model like a human can apply J knowledge with less bleed in from the way other programming languages work. In the mean time if you like programming in J how do you make the most out of what is currently available in the vibe coding arena?

Current state of programming with LLMs: agentic programming: Without going through ancient history (less than a year ago) in how agentic programming came about, this is the main method people use AI to code programming projects. There are many agentic platforms available (Claude Code, OpenCode, PI, Grok Build CLI, etc). Essentially these are the new IDE, so to speak, of programming. Agentic platforms are able to round trip a question to an LLM, obtain code,  place it in your project file system, run the code report back any errors, obtain corrections to those errors, and present you with a working set of code. 

Benefits to the J programmer: First if you are working on a J programming language project the agentic platforms can take care of deploying project directory to GitHub and provide you with source control. It can take care of all of the little headaches that aren't part of J programing itself. You can concentrate on the meat and potatoes and the agentic platform can take care of things like logging, putting things in try/catch blocks,  catching edge cases, even commenting/documentation. In a very basic form agentic programming is like having a templating system where you can concentrate on the fine points of your task in J. 

Keeping J relevant: This was on many people's minds during meetings. If these models are just better at Python/C etc and almost anything can be done in those languages what does that mean for J? I won't go deeply into this other than to say J is relevant to me. If AI is going to be useful to me it will let me do things the way I enjoy having them done. J is terse in its expressions, it takes me less time to review J code than almost any other language. When I see a more elegant way of doing something in J I get a feeling of satisfaction that I don't get from any other programming language. I do believe by getting agentic platforms to produce reasonable J code that J will move along much as it has in the past. People looking for new ways of doing things will happen upon it and either get hooked or cast it aside much of how things have happened with array languages since the 60s. 

My conclusion: Come up with a best practice for setting up an agentic programming platform for J that is both cost effective and competent at producing J code. In essence the more people that are able to dump their J coding projects to GitHub because it's just a side effect of how they use an agentic platform the more chance you have of someone finding something useful in J. The more J code on GitHub the more J knowledge there will be for the next generation LLMs. Digital evolution will take care of the rest. 

Current Best Practice: From our meetings and from my own experience Claude Code is probably the best platform to run for agentic coding. It's the one probably everyone has tried when coding in J. So there is a human knowledge base in the J programming world. It's very popular in general. From the experience of others they are able to get useful J programming done with the anthropic $20/month subscription. For a limited time (now until July 19th) Anthropic still allows the $20 subscriber to access Fable. This is by all accounts the best model out there so if you are new to agentic programming you will get the cutting edge experience of using an agentic platform for J programming. Once you have a subscription and download claude code. You run Claude Code, it will ask you to sign into your subscription. You then can just tell Claude Code to set itself up to do a J programming language project. For security purposes I would set up a separate user account on your machine dedicated to Claude Code. Do not give that account administrator privileges. This should protect you from Claude Code going haywire and deleting stuff you don't want deleted. 

Improving J knowledge on the agentic platform: This comes down to context injection. With the current frontier models having 1M tokens of context a good amount of J knowledge can be provided as the basis of its current working memory. Speaking in terms of Claude Code there are a number of ways to provide this. 

1) the initial prompt can include a summary of the J programming language, that it is an array language from JSoftware.com, it was developed by Kenneth Iverson the creator of APL as the next generation array language to APL. It is different from traditional programming languages in that it has no operator precedence other than the typical use of parenthesis and the expressions are parsed from right to left. If you are in doubt as to how an expression will be parsed use parenthesis to enforce which parts of an expression should be done first. 

2) Claude.md and Agent.md files. For these I usually have Claude Code read through a corpus of files that come with installation of the J programming language that I converted to markdown format. These include Jphrases, the JPrimer, Nuvoc pages. I tell Claude Code to distill these down and set up the Claude.md and any agent files with the information from these that will facilitate J programming. You can hand edit these files and add information if you feel the LLM didn't provide detailed enough information. These files are essentially the agentic platform memory and provide some persistence of knowledge through out a project session. 

3) My MCP servers, Previously I sent a message about the MCP servers I have up and running that have indexed the JSoftware.com website source and the old J Forums. The website source is package as files and they have been indexed with Xapian. Documents like JForC are there and because chapters are split off into files the indexing is able to drill down to a much smaller part of the document that can be retrieved and presented to the LLM to read and understand. The Forum emails are indexed by thread so that an entire thread can be presented to be read and the LLM can decide what pertinent information is available in the thread to use. In just some simple use I have found that even lesser models can find some good J code by using these servers.

4) j-mcp this gives direct access to the J interpreter without having to use BASH and the J console. While not context injection I believe from what I have seen so far in my experience that constant calling of jconsole starts to make the LLM believe it is doing a Java project. While BASH shell access is pretty fast the j-mcp should actually speed up the turn around of J code interpretation. 

5) Claude Code already has the ability to search the web so if it can't find the information from these dedicated sources it can do a more general web search. I haven't experimented with it but I would guess there would be a way to prioritize where it searches so you target J code repositories on GitHub and other array oriented websites before it broadens the search to more general areas about the project at hand. 

What you should expect:  By setting all this up you will get a usable J project in a matter of minutes. Yes you will need to manually code review at this point. But as you do more projects and find common misunderstandings you should be able to setup a code review agent and get the simple stuff taken care of before you need to do your final human code review. Now you are dealing with the details you care about. Getting the pertinent functionality into acceptable J code with good use of J coding idioms. 

Tom

Thomas McGuire

unread,
Jul 14, 2026, 5:29:07 AM (12 days ago) Jul 14
to forum
Since I mentioned the MCP servers I set up they are on a cloud server on Vultr. I got lazy so they do not have an http named address. You have to access them by IP address.  You can add them locally to a Claude Code project very easily by going to your project directory and before starting up Claude Code perform the following:

claude mcp add --transport http JWeb http://149.28.36.187:9500/mcp                                                          

claude mcp add --transport http JMail http://149.28.36.187:9600/mcp --header "Authorization: Bearer JSoftwareMailArchive001"

When you start up Claude Code use the /mcp command you should see that both servers are active. 

For tangentstorm's j-mcp server. You need this running locally on you machine. So follow his directions in the readme on his GitHub site (https://github.com/tangentstorm/j-mcp) to compile this program locally. Then all I had to do was the following to get it working under my local Claude Code project:

claude mcp add j -s local -e JHOME=/Applications/j9.8/bin -- /Users/tomdevel/j-mcp/build/j-mcp

This was done on a MacBookPro so your resulting pathnames will vary. I cloned his repository at my $HOME directory and then run the executable straight out of the build directory that was created. 

when you have done that run 'claude' and type the '/mcp' command you should see something like this:
 
   Manage MCP servers
   3 servers

     Local MCPs (/Users/tomdevel/.claude.json [project: /Users/tomdevel/jdev/jlinter])
   ❯ j · ✔ connected · 13 tools
     JMail · ✔ connected · 4 tools                                                                                                                                                                
    JWeb · ✔ connected · 5 tools


Hope this helps you get started. 

Tom McGuire

Jose Mario Quintana

unread,
Jul 14, 2026, 5:27:53 PM (12 days ago) Jul 14
to fo...@jsoftware.com
I wonder if the verb performance could have been significantly improved if it had been promted to optimize for speed. Otherwise, that kind of J misunderstanding might be a potential issue (for now).
Reply all
Reply to author
Forward
0 new messages