I know several languages, but not Gleam specifically. The problem, I find, with many introductory material is they use a REPL to introduce you to the language. To me, a program starts with a single file printing "Hello, World".
Although many of you are, I'm sure familiar with Python, I will go through a basic Hello, World program. This is not meant to teach you Python, but just to show you what I think most languages should do, and I am unclear if Gleam does this.
Suppose you have the following code in a file called hello.py
print("Hello, world!")
To run, you can go to the command line, and run
python hello.py
This only requires Python3 to be installed an on your path and a single Python file. That's it. There's no need to use pip or venv or whatever complications Python has to manage packages and Python versions.
This is the Glean equivalent (I think). Here's a sample hello.gleam
// hello.gleam
import gleam/io
pub fn main() {
io.println("Hello, Gleam!")
}
I'd expect to run it at the command line as
glean run hello.gleam
in the same directory as hello.gleam. However, when I do this, it says it can't find a gleam.toml file.
Does that mean I have to use the rather heavyweight way of creating a project just to run a simple program? If so, what are the steps to run hello.gleam if I must create the project?
Thanks for answering my simple questions.