Nit
1 program
Added 2025-10-22T15:31:46Z
Model: anthropic/claude-4.5-sonnetTemp: 0.4
Evidence
Report issue
View issues
Aliases: nitlanguage
Provenance: commit a82268fd78 · authored 2025-10-22T17:31:46+02:00 · model anthropic/claude-4.5-sonnet
Sources mentioning this language
6 sources · pl_id:
pl/nitExtensions claimed by this language
2 claims. Each row is one upstream assertion with its strength.
SWH column shows file occurrences with that extension across the entire archive.| Extension | Source | Strength | SWH |
|---|---|---|---|
.nit | linguist | primary | 40.5K files |
.nit | pygments | primary | 40.5K files |
Related languages
Real programs from Software Heritage
No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)
Programs collected by LLM agents experimental · unverified
Gathered by LLM agents during the experiment that started this catalogue. They are not verified: the agent names an origin, but a program can be altered or invented — an audit found one attributed to a file that does not exist, in a syntax the language does not have. Prefer the programs archived by Software Heritage above. The catalogue's goal is the languages themselves, grounded in sources (PLDB, Wikipedia, Rosetta Code, …), with real archived programs; these examples may be dropped.
Binary Search Tree Implementation
Provenance: commit a82268fd78 · authored 2025-10-22T17:31:46+02:00 · model anthropic/claude-4.5-sonnet · Temp 0.4
# This file is part of NIT ( http://www.nitlanguage.org ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Simple example of binary search tree
module trees
# A binary tree node
class Node
var value: Int
var left: nullable Node = null
var right: nullable Node = null
# Insert a value in the tree
fun insert(v: Int)
do
if v < value then
var l = left
if l == null then
left = new Node(v)
else
l.insert(v)
end
else if v > value then
var r = right
if r == null then
right = new Node(v)
else
r.insert(v)
end
end
end
# Print the tree in order
fun print_in_order
do
var l = left
if l != null then l.print_in_order
print value
var r = right
if r != null then r.print_in_order
end
# Search for a value in the tree
fun search(v: Int): Bool
do
if v == value then return true
if v < value then
var l = left
if l == null then return false
return l.search(v)
else
var r = right
if r == null then return false
return r.search(v)
end
end
end
# Create a tree and insert some values
var root = new Node(50)
root.insert(30)
root.insert(70)
root.insert(20)
root.insert(40)
root.insert(60)
root.insert(80)
print "Tree in order:"
root.print_in_order
print "\nSearching for 40: {root.search(40)}"
print "Searching for 25: {root.search(25)}"