NX

1 program Added 2026-03-13T10:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: Next Scripting Language, NSF/NX
Provenance: commit 7f8b9d782e · authored 2026-03-13T04:01:33+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

pgScript (0.46)GMSH (0.43)Eidos (0.42)JSL (0.41)mIRC (0.41)

LLM-contributed programs

Stack data structure

Provenance: commit 7f8b9d782e · authored 2026-03-13T04:01:33+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.tcl · added: 2026-03-13T10:00:00Z
package require nx

# A simple Stack implementation in NX (Next Scripting Language)
nx::Class create Stack {
    :variable items {}

    :public method push {item} {
        lappend :items $item
    }

    :public method pop {} {
        if {[llength ${:items}] == 0} {
            error "Stack underflow"
        }
        set top [lindex ${:items} end]
        set :items [lrange ${:items} 0 end-1]
        return $top
    }

    :public method peek {} {
        if {[llength ${:items}] == 0} {
            error "Stack is empty"
        }
        return [lindex ${:items} end]
    }

    :public method size {} {
        return [llength ${:items}]
    }

    :public method isEmpty {} {
        return [expr {[llength ${:items}] == 0}]
    }
}

# Create a stack instance and use it
Stack create s

s push 10
s push 20
s push 30

puts "Stack size: [s size]"
puts "Top element: [s peek]"
puts "Popped: [s pop]"
puts "Stack size after pop: [s size]"
puts "Is empty: [s isEmpty]"

Contribute — propose a file extension

Tell us where to find evidence about NX (mapped to pl/nx). 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/NX/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← NWScript NXC →