Skip to content

Getting started

Julius Paffrath edited this page Jul 11, 2026 · 24 revisions

Hello World

Every new language should introduce itself with a classic Hello, World!

print("Hello, World!")

In jask you don't need to specify a main function or importing stuff. Invoke the jask interpreter and try it yourself!

Interactive and file mode

The jask interpreter can be used in two ways: The interactive mode and the file mode.
The interactive mode allows you to enter jask code on the fly, just like the Python interactive mode. To start the interactive mode, just invoke the jask interpreter:

dotnet run

You can exit the interactive mode with the keyword exit or the build-in function exit(code:number). The interactive mode supports using your arrow keys for navigation and a history, similar to a linux terminal. For interpreting jask files, pass the file to the interpreter:

dotnet run example.jask

Variables

The jask language has the attempt to be easy readable. So storing data goes like this:

set NAME to VALUE

easy, right? Currently, jask supports these types of data:

  • strings, like "Hello!" or "This is a string"
  • numbers, like 42 or 3.1415
  • boolean values, can be true or false
  • lists
  • nil, to indicate an empty variable

As you can see, jask does not distinguishes between integers and floating-point numbers as well as characters and strings. A variable can change its type during runtime, making it dynamically:

set myValue to 1
set myValue to "A string!"

Aritmethic operations

Jask allows you to apply basic operators on values. See the following example:

100 + 200
100 - 200
100 * 200
100 / 200
100 % 200
"Hello " + "World!"

Functions

Functions are very straight forward in jask:

function doAwesomeStuff(param1: string, param2: number, param3: any)
    if type(param3) == "list"
        printLine(param1 + " " + param2 * listGet(param3, 2))
    endif
end

; prints Hi! 300
doAwesomeStuff("Hi!", 100, list(1, 2, 3))

You can read more on functions here.

Comments

A comment in a line can achieved by using a ;

; Prints the numbers of elapsed seconds since the 01.01.1970 unix time
print(clock())

; exits the program gracefully with status code 0
exit(0)

Multiple lines can be commented with ;;

;;
I am a multiline comment!
;;

print("")

Continue?

Would you like to continue learning jask? Check out the following topics or choose one from the sidebar!

Clone this wiki locally