Gleam Programming Language Tour
tour.gleam.run·6h·
Discuss: Hacker News

Basics


Hello world

Here is a tiny program that prints out the text “Hello, Joe!”. We’ll explain how it works shortly.

In a normal Gleam project this program would be run using the command gleam run on the command line, but here in this tour the program is compiled and run inside your web browser, allowing you to try Gleam without installing anything on your computer.

Try changing the text being printed to Hello, Mike! and see what happens.

import gleam/io

pub fn main() {
io.println("Hello, Joe!")
}
</>Run code snippet

Modules

Gleam code is organized into units called modules. A module is a bunch of definitions (of types, functions, etc.) that seem to belong together. For example, the [gleam/io ](https:…

Similar Posts

Loading similar posts...