ngn/k

From The K Language Wiki
< Ngn
(Redirected from Ngnk)


ngn/k
Developer ngn
Released 2017

Dialect K6
Temporal types none
Table support yes (no prettyprinting)
Prototypes partial support

Implemented in C
Platforms x86_64
Operating Systems Linux, BSD, Windows(unofficial)
License AGPL

Website Codeberg
Documentation in repl
Run Online editor (Bitbucket, Codeberg), repl (Bitbucket, Codeberg)

Influenced By K7, K9

ngn/k is an implementation of K6 created by ngn.

ngn/k has undergone several rewrites, borrowing ideas from many Arthur Whitney Ks, and occasionally deviating from their functionality.

ngn/k is written in Whitney C, and is written to be performant, compact, and with minimal dependencies.

History[edit]

Development on ngn/k was started on April 9, 2017[1]. The older Github repository for ngn/k points towards kparc.io[2] for its spec.

The codebase was then moved to Gitlab. The exact date is not known since the repository no longer exists on the site.

The ngn/k repl and editor was created in October 2020 and subsequently moved from ngn.bitbucket.io to ngn.bitbucket.io/k[3]. It has remained in that state ever since.

The codebase was the moved to Sourcehut (sr.ht) on December 21, 2020[4].

The current version of ngn/k resides in Codeberg, and the move was officially announced on May 21, 2021[5]. The codeberg repository has its initial commit at 2019, where it had support for x86_64 linux only.

ngn/k was indefinitely frozen[6] on May 24, 2022.

In January 2024, ngn/k was announced to be no longer supported.

Running[edit]

The main way of running ngn/k is building it. This can be done reliably on Unix-like systems with the help of either clang-12 or gcc-10 C compilers, and the make utility. Build instructions can be found in the ngn/k README file.

ngn/k has a WASM distribution available online. These can be accessed from the "Run Online" links in the sidebar. The Codeberg page is restricted in some countries.

Traws has a fork of ngn/k on Github which is made for compilation under cosmopolitan libc.

Features[edit]

I/O Verbs[edit]

ngn/k's I/O verbs are defined as per the K6 standard. They are made up of a single digit, followed by a : symbol: loc u: data for output and u: loc for input.

A symbol, string or number can be given as loc. Any number given must be a valid tie number (see: Tie(ngn/k)).

Every input verb is classified by data:

  • 0: takes lists of strings. (concatenates them with newlines)
  • 1: takes a single string.

Reserved Symbols[edit]

ngn/k has reserved symbols used for providing access to features that are not important enough to be added as primitives, but still warrant a name for quick use. These symbols can be used like any other nouns.

The ngn/k help topic for adverbs is available at \` in the ngn/k repl.

Defined Verbs[edit]

ngn/k allows creation of new verbs that can be used infix, as part of its syntax. These must be defined as follows (using as an example symbol):

(∇:): monad
(∇): dyad

References[edit]