J

1 program Added 2025-10-22T15:06:51Z Model: anthropic/claude-4.5-sonnetTemp: 0.4 Evidence Report issue View issues
Aliases: J Programming Language
Provenance: commit 457c62641d · authored 2025-10-22T17:06:51+02:00 · model anthropic/claude-4.5-sonnet

Sources mentioning this language

9 sources · pl_id: pl/j
LLM (this repo) · 1PldbLinguistPygmentsWikipediaEsolangHyperpolyglotRosettacodeWikidata · Q383994

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsarray · functional · object-oriented (class-based · prototype-based) · function-level · tacit
Typingdynamic
Designed byJSoftware · Kenneth E. Iverson Roger Hui
First appeared1990
Influenced byAPL
LicenseGPLv3
Homepagehttp://www.jsoftware.com

Extensions claimed by this language

3 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.ijslinguistprimary51.5K files
.ijspygmentsprimary51.5K files
.ijswikidataprimary51.5K files

Related languages

Jac (0.73)S (0.72)Eta (0.68)Piet (0.68)Pike (0.68)

LLM-contributed programs

Quicksort Implementation

Provenance: commit 457c62641d · authored 2025-10-22T17:06:51+02:00 · model anthropic/claude-4.5-sonnet · Temp 0.4
code.ijs · added: 2025-10-22T15:06:51Z
NB. Quicksort implementation in J
NB. From the J Software Wiki

qs=: (($:@(<#[), (=#[), $:@(>#[)) ({~ ?@#)) ^: (1<#)

Real programs from Software Heritage

2 samples mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
gthrow.ijs · 3463 B · ext .ijs · seen 576× in SWH
via unique-primary
swh:1:cnt:897949865b795cc61f217cbcae2166dd6b96b5fa;origin=https://github.com/codereport/jsource;anchor=swh:1:rev:e6f1177d8db48d384ba898562687637bc5da7c8e;path=/test/gthrow.ijs
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
1:@:(dbr bind Debug)@:(9!:19)2^_44[(echo^:ECHOFILENAME) './gthrow.ijs'
NB. throw./catcht. ------------------------------------------------------

f=: 3 : 0
 if. y do.
  throw.
 end.
 0
)

(<'throw.') e. {:"1 t=: 1 (5!:7) <'f'

f=: 3 : 0
 try.
  1
  2
  3
 catcht.
  4
 end.
  :
 try. 5 catcht. 6 end.
)

(;:'try. catcht.') e. {:"1 t=: 1 (5!:7) <'f'

(;:'try. catcht.') e. {:"1 t=: 2 (5!:7) <'f'

main=: 3 : 0
 try.
  sub y
 catcht.
  select. type_jthrow_
   case. 'aaaa' do. 'catcht aaaa'  
   case. 'bbb'  do. 'catcht bbb'   
   case. 'cc'   do. 'catcht cc' 
   case.        do. throw.   NB. handled by higher-level catcht. (if any)
  end.
  return.
 end.
)

sub=: 3 : 0
 if. y<0  do. type_jthrow_=: 'aaaa' throw. end.
 if. y<4  do. type_jthrow_=: 'bbb'  throw. end.
 if. y<8  do. type_jthrow_=: 'cc'   throw. end.
 if. y=99 do. type_jthrow_=: 'd'    throw. end.
 (":y),' not cut back'
)

'catcht aaaa'     -: main _1
'catcht bbb'      -: main 2
'catcht cc'       -: main 6
'10 not cut back' -: main 10
NB. There is no way to test uncaught throw!  It will terminate the test perforce.
NB. 'uncaught throw.' -: sub etx _1   NB. throw without catcht

main1=: 3 : 0   NB. throw with adverse
 try. 
  sub :: 0:  y
 catcht.
  select. type_jthrow_
   case. 'aaaa' do. 'catcht aaaa'  
   case. 'bbb'  do. 'catcht bbb'   
   case. 'cc'   do. 'catcht cc' 
   case.        do. throw.   NB. handled by higher-level catcht. (if any)
  end.
  return.
 end.
)

'catcht aaaa'     -: main1 _1
'catcht bbb'      -: main1 2
'catcht cc'       -: main1 6
'10 not cut back' -: main1 10

main2=: 3 : 0   NB. throw with try/catch
 try.
  *'a'
 catch.
  try.
   sub y
  catcht.
   select. type_jthrow_
    case. 'aaaa' do. 'catcht aaaa'  
    case. 'bbb'  do. 'catcht bbb'   
    case. 'cc'   do. 'catcht cc' 
    case.        do. throw.   NB. handled by higher-level catcht. (if any)
   end.
   return.
  end.
 end.
)

'catcht aaaa'     -: main2 _1
'catcht bbb'      -: main2 2
'catcht cc'       -: main2 6
'10 not cut back' -: main2 10

main3=: 3 : 0
 try. 
  main4 y
 catcht.
  select. type_jthrow_
   case. 'd'    do. 'catcht d'  
   case.        do. throw.   NB. handled by higher-level catcht. (if any)
  end.
  return.
 end.
)

main4=: 3 : 0   NB. catcht at multiple levels
 try. 
  sub y
 catcht.
  select. type_jthrow_
   case. 'aaaa' do. 'catcht aaaa'  
   case. 'bbb'  do. 'catcht bbb'   
   case. 'cc'   do. 'catcht cc' 
   case.        do. throw.   NB. handled by higher-level catcht. (if any)
  end.
 end.
)

'catcht aaaa'     -: main3 _1
'catcht bbb'      -: main3 2
'catcht cc'       -: main3 6
'catcht d'        -: main3 99
'10 not cut back' -: main3 10

main5=: 3 : 0   NB. catcht at multiple levels
 try. 
  if. y<0  do. type_jthrow_=: 'aaaa' throw. end.
  if. y<4  do. type_jthrow_=: 'bbb'  throw. end.
  if. y<8  do. type_jthrow_=: 'cc'   throw. end.
  if. y=99 do. type_jthrow_=: 'd'    throw. end.
  (":y),' not cut back'
 catcht.
  select. type_jthrow_
   case. 'aaaa' do. 'catcht aaaa'  
   case. 'bbb'  do. 'catcht bbb'   
   case. 'cc'   do. 'catcht cc' 
   case.        do. throw.   NB. handled by higher-level catcht. (if any)
  end.
 end.
)

NB. None of these did anything - main5 has nothing to catch the throws
NB. 'catcht aaaa'     -: main5 _1
NB. 'catcht bbb'      -: main5 2
NB. 'catcht cc'       -: main5 6
NB. 'catcht d'        -: main5 99
NB. '10 not cut back' -: main5 10

18!:55 <'jthrow'


4!:55 ;:'f main main1 main2 main3 main4 main5 sub t'


gbpar.ijs · 1789 B · ext .ijs · seen 576× in SWH
via unique-primary
swh:1:cnt:f4cefca112468f11175504b82a4f2a31dddc5feb;origin=https://github.com/codereport/jsource;anchor=swh:1:rev:e6f1177d8db48d384ba898562687637bc5da7c8e;path=/test/gbpar.ijs
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
1:@:(dbr bind Debug)@:(9!:19)2^_44[(echo^:ECHOFILENAME) './gbpar.ijs'
NB. byte parallel -------------------------------------------------------
NB. m-bytes-at-a-time operations on boolean functions

A=: 1 : 0
:
 g=: 4 : ('x ',(5!:5 <'u'),' y')
 xx=: x ?@$ 2
 yy=: (x,c=. y) ?@$ 2
 assert. (xx u yy) -: (c#"0 xx) u yy
 assert. (xx u yy) -: xx g"0 1 yy
 assert. (yy u xx) -: yy u c#"0 xx
 assert. (yy u xx) -: yy g"1 0 xx
 1
)

s=: 17
s =  A"1 0 >:i.25
s <  A"1 0 >:i.25
s <: A"1 0 >:i.25
s >  A"1 0 >:i.25
s >: A"1 0 >:i.25
s +. A"1 0 >:i.25
s +: A"1 0 >:i.25
s *. A"1 0 >:i.25
s *: A"1 0 >:i.25
s ~: A"1 0 >:i.25

I=: 1 : 0
:
 b=: (x,y) ?@$ 2
 assert. (u/   -: u/"1&.|:   ) b
 assert. (u/"2 -: u/"1&.|:"2 ) b
 assert. (u/"1 -: {.@(u/\.)"1) b
 assert. (u/"1 -: {:@(u/\ )"1) b
 1
)

s=: 5 11
s =  I"1 0 >:i.25
s <  I"1 0 >:i.25
s <: I"1 0 >:i.25
s >  I"1 0 >:i.25
s >: I"1 0 >:i.25
s +. I"1 0 >:i.25
s +: I"1 0 >:i.25
s *. I"1 0 >:i.25
s *: I"1 0 >:i.25
s ~: I"1 0 >:i.25

f=: 4 : 0
 b=: (x,y) ?@$ 2
 assert. (~:/"1 b) -: 2|+/"1 b
 assert. (= /"1 b) -: ~:/&.:-."1 b
 assert. (+ /"1 b) -: +/"1 b+0
 1
)

17  f"1 0 ]1  +i.25
2 5 f"1 0 ]1  +i.25
''  f"1 0 ]256+i.25

P=: 1 : 0
:
 b=: (x,y) ?@$ 2
 assert. (u/\   -: u/\"1&.|:  ) b
 assert. (u/\"2 -: u/\"1&.|:"2) b
 1
)

s=: 5 11
s =  P"1 0 >:i.17
s <  P"1 0 >:i.17
s <: P"1 0 >:i.17
s >  P"1 0 >:i.17
s >: P"1 0 >:i.17
s +. P"1 0 >:i.17
s +: P"1 0 >:i.17
s *. P"1 0 >:i.17
s *: P"1 0 >:i.17
s ~: P"1 0 >:i.17

S=: 1 : 0
:
 b=: (x,y) ?@$ 2
 assert. (u/\.   -: u/\."1&.|:  ) b
 assert. (u/\."2 -: u/\."1&.|:"2) b
 1
)

s=: 5 11
s =  S"1 0 >:i.17
s <  S"1 0 >:i.17
s <: S"1 0 >:i.17
s >  S"1 0 >:i.17
s >: S"1 0 >:i.17
s +. S"1 0 >:i.17
s +: S"1 0 >:i.17
s *. S"1 0 >:i.17
s *: S"1 0 >:i.17
s ~: S"1 0 >:i.17


4!:55 ;:'A b c f g I P S s xx yy'
 

Contribute — propose a file extension

Tell us where to find evidence about J (mapped to pl/j). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/J/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← izibasic J (programming language) →