,

An Introduction to Gleam v1: A Comprehensive Guide and Tutorial on this Programming Language

Posted by

Gleam v1 – Programming Language Overview & Tutorial

Welcome to the Gleam v1 Programming Language Overview & Tutorial

Gleam is a statically-typed programming language designed for building scalable and maintainable applications. It is built on the Erlang runtime and leverages the actor model for concurrency. In this tutorial, we will cover the key features of Gleam and provide a hands-on introduction to writing code in Gleam.

Key Features of Gleam v1

  • Statically-typed: Gleam uses a type system to prevent runtime errors and ensure code quality.
  • Actor model: Concurrency in Gleam is based on the actor model, making it easier to write concurrent and distributed systems.
  • Erlang compatibility: Gleam is built on the Erlang runtime, allowing seamless interoperability with existing Erlang code.
  • Functional programming: Gleam supports functional programming paradigms such as immutability and higher-order functions.

Writing Your First Gleam Program

To get started with Gleam, you first need to install the Gleam compiler. You can find detailed instructions on how to install the compiler on the Gleam website. Once you have the compiler installed, you can create a new Gleam file with a .gleam extension and start writing code.

Here is a simple “Hello, World!” program written in Gleam:


fn main() {
let message = "Hello, World!"
IO.println(message)
}

In this code snippet, we define a main function that prints the message “Hello, World!” to the console using the IO.println function. To run this program, you can compile it using the Gleam compiler and execute the resulting binary.

Conclusion

Gleam v1 is a promising programming language that combines the power of Erlang with modern language features. In this tutorial, we have covered the key features of Gleam and provided a simple example to get you started with writing code in Gleam. We encourage you to explore the official documentation and community resources to learn more about Gleam and start building exciting applications with it.

0 0 votes
Article Rating
3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@bcpeinhardt
7 months ago

Thanks for making this video! Keep up the good work, hope to see you in the Gleam discord if you’re not already there!

@coder_one
7 months ago

It's great that you are making videos on Gleam. You clearly have the makings of a good instructor. You take on interesting topics and prepare well for them.

Here are some good tips and recommendations for recording your code work:
1. Font size – the size needs to be large enough to be able to read the content when viewing the material on a smartphone in a horizontal position without much effort. You can record several samples with different fonts and fire them locally on your smartphone to assess whether you have found the right font size.
2. The visual studio code file explorer should be moved to the right side. This is important for two reasons. First, we read text from left to right, so setting anything to the left of the text is a waste of screen space that could be better utilized. When the context menu is moved to the right side, even its frequent opening/closing will not cause code to jump around the screen. Secondly, a thumbnail of the screen recording your person can be aesthetically integrated into the explorer on the right side.

On the technical issue of recording:
1. Recordings where text is presented must be in at least 1080p quality. This has been a must have for a good few years. It is worth taking care of this, especially that screen recording does not require buying an expensive camera.
2. Microphone. In this case, there are two options – either use an external microphone and place it near your mouth, and if you use a microphone built into some device (camera, laptop, smartphone), then you absolutely must place these devices closer together.

Regarding the tool you worked with throughout the recording – your voice. You have a nice tone of voice, you are good to listen to. However, I strongly encourage you to work on your diction. Try to speak more clearly and a little slower. Unfortunately, the voice for video recording needs to be practiced, especially if you want your listeners to understand you perfectly and be able to learn programming from you (I guess that's your goal – to teach others). Don't be afraid of silences in the recording – it's normal for them to appear if you are programming at the same time, and the recording is not cut and edited.

Good luck and when will there be more material on Gleam? 😉

@4citi
7 months ago

Good video. Sometimes couldn't see terminal output clearly but otherwise great walkthrough