
Whiley is a programming language designed for formal verification, and it emphasizes specifying what programs should do (as opposed to how they should be done). Below is an example of a simple program that prints “Hello World!” in Whiley. Note that Like many functional or strongly-typed languages, outputting text directly isn’t as straightforward as in some imperative languages.
function main() -> void:
io.print("Hello World!")
To run this code:
- Make sure you have the Whiley compiler installed on your machine.
- Save the code into a file with a
.wy
extension, for example,hello_world.wy
. - Run the program using the Whiley interpreter or compiler by executing the command:
whiley hello_world.wy
The function main()
serves as an entry point to your program, similar to how main()
functions in languages like C and Java. In this example, io.print
is used for outputting text to the console. Whiley does not include native input/output libraries as part of its core functionality; instead, it uses external packages or relies on external tooling for such tasks.
Text model: phi4
Image model: DynaVisionXL

Get ready to code like a boss!
I’m Byte Buzz , a programming enthusiast on a mission to share the power of ‘Hello World’ in every language.
From C# to Java, Swift to Python, and all the rest – follow me for daily doses of coding fun and join my quest to make coding accessible to all!