Klong: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
(Add KlongPy section)
m (Version bump)
Line 8: Line 8:
| file ext                = .kg
| file ext                = .kg
| developer                = Nils M Holm
| developer                = Nils M Holm
| latest release version  = 2019-09-26
| latest release version  = 2022-12-12
| implementation language  = [[wikipedia:C_(programming_language)|C]] ([[wikipedia:C99|C99]])
| implementation language  = [[wikipedia:C_(programming_language)|C]] ([[wikipedia:C99|C99]])
| platforms                = Unix, [[wikipedia:Plan 9 from Bell Labs|Plan 9]]
| platforms                = Unix, [[wikipedia:Plan 9 from Bell Labs|Plan 9]]

Revision as of 01:06, 20 April 2023

Klong is a language based on K (probably K3) which removes K's syntactic ambiguity and much of its overloading by using more digraphs (primitive functions and operators composed of two characters) to separate extra meanings. The removal of syntactic ambiguity means Klong has a context-free grammar.

KlongPy

KlongPy is an independent, compatible implementation of Klong in NumPy. It can be closely integrated with Python due to its use of NumPy arrays, and can be run on the GPU using CuPy in place of standard NumPy.

Primitives

Klong documentation refers to primitive functions ("verbs" in K) as "operators".

Operator Monadic Dyadic
+ Transpose Plus
- Negate Minus
* First Times
% Reciprocal Divide
:% Integer-Divide
| Reverse Max/Or
:+ Rotate
& Expand/Where Min/And
^ Shape Power
:^ Reshape
! Enumerate Remainder
< Grade-Up Less
> Grade-Down More
= Group Equal
~ Not Match
@ Atom Index/Apply
:@ Index-in-Depth
? Range (Unique) Find
, List (like Enclose) Join (like Catenate)
_ Floor Drop
:_ Undefined Cut
:# Char Split (Partition by lengths)
# Size Take
$ Format Format2
:= Amend
:- Amend-in-Depth
:: Define
:$ Form
Adverb Definition
f'a Each
a f'b Each2
a f:\b Each-Left
a f:/b Each-Right
f:'b Each-Pair
f/a Over
a f/b Over-Neutral
f:~a Converge
a f:~b While
a f:*b Iterate
f\a Scan-Over
a f\b Scan-Over-Neutral
f\~a Scan-Converging
a f\~a Scan-While
a f\*a Scan-Iterating

External links


APL dialects [edit]
Maintained APL+WinAPL2APL64APL\ivApletteAprilCo-dfnsDyalog APLDyalog APL Visiondzaima/APLGNU APLKapNARS2000PometoTinyAPL
Historical A Programming LanguageA+ (A) ∙ APL#APL2CAPL\360APL/700APL\1130APL\3000APL.68000APL*PLUSAPL.jlAPL.SVAPLXExtended Dyalog APLIverson notationIVSYS/7090NARSngn/aplopenAPLOperators and FunctionsPATRowanSAXSHARP APLRationalized APLVisualAPL (APLNext) ∙ VS APLYork APL
Derivatives AHPLBQNCoSyELIGleeIIvyJJellyK (Goal, Klong, Q) ∙ KamilaLispLang5LilNialRADUiua
Overviews Comparison of APL dialectsTimeline of array languagesTimeline of influential array languagesFamily tree of array languages