Artistic banner representing NICS Language
HOME
HELLO WORLD
CONTACT
CONTACTHELLO WORLDHOME
Examples
Royal Doulton
Royal Worcester
Lladro
Beswick
Wedgwood
Capodimonte
Paul Cummins
Poole Pottery
Ruskin Pottery

Example 1: Hello World

The Structure

NICS is a series of statements. Every statement is a collection of variables or literals connected by binary or unary operators acting upon those variables. There are the following literal forms:

Variable
A variable is a named storage element that can hold any of the following types. A variable name starts with an alpha character and can continue with any number of alpha-numerics
String
"This is a string. It is bounded by double quotes"
Integer
45645655 // That was a number and this is a comment. Anything on a line after // is a comment and is ignored by the compiler
Array
[ "This is an array" "There are no commas separating the items" 5 "The items can be any type of items" [ "This is an array within an array and contains a string and an integer" 7 ] "This is the last item" ]
Code Block
{ a = 4 } // A code block is an item that is a set of statements surrounded by braces {}
Name Space
{{ a = 4 }} // A name space is an item that is a set of statements surrounded by double braces {{}}

And there are the following operators

  • The standard maths and logic ones as per C '= == + - / * & | ^ && || << >>' and also '**' for raise to the power, and ':' for code execution.

Built in functions

The language has the following functions built in:

Function PurposeExample
commandExecutes a system command page = command:"curl jsn.co"
if exectutes code blocks conditionallyif:[ { a==4 } { print:"A is 4" } { print:"A isn't 4" } ]
print prints a string print:"Hello World"
while exectutes code blocks conditionallywhile:[ { f > 0 } { f = f - 1 } ]
printprints a string
whileexectutes code blocks conditionally
readfilereads the contents of a file into a stringfilecontent = readfile:"myfile.txt"

Hello World

The solution is a single statement that uses the 'execute' operator to combine the build-in 'print' function with a string literal, "Hello World"

print:"Hello World"

Code Blocks and Name Spaces

All Code Blocks and Name Spaces are first-class citizens. Code Blocks are Closures. Name Spaces form their own Closure. What this means in practice is this:

  • Named Variables are not created on the stack

  • Any code when loaded for execution forms a Name Space, but can have separate Name Spaces defined within the code

  • All Named Variables start as integers with a value of zero

link to reviewable.uk Terms Privacy
© 2024–2026 NICS Language
NICS Language logo