Introduction

In this chapter, we'll explore an overview of the mana programming language and this book.

Introduction

Welcome to The Mana Programming Language, an introductory book about Mana. The Mana programming language helps you write fast, reliable software. High-level ergonomics and low-level control are often at odds in programming language design; Mana challenges that conflict.

Who Mana Is For

Mana is ideal for many people for a variety of reasons. Let's look at a few of the most important groups.

Teams of Developers

Mana is proving to be a productive tool for collaboration among large teams of developers with varying levels of systems programming knowledge. Low-level code is prone to various subtle bugs, which in most other languages can be caught only through extensive testing and careful code review by experienced developers. In Mana, the compiler plays a gatekeeper role by refusing to compile code with these elusive bugs, including concurrency bugs.

Students

Mana is for students and those who are interested in learning about systems concepts. Using Mana, many people have learned about topics like operating systems development. The community is welcoming and happy to answer questions.

Companies

Hundreds of companies, large and small, use Mana in production for a variety of tasks, including command line tools, web services, DevOps tooling, embedded devices, and more.

Open Source Developers

Mana is for people who want to build the Mana programming language, community, developer tools, and libraries.

How to Use This Book

In general, this book assumes that you're reading it in sequence from front to back. Later chapters build on concepts in earlier chapters, and earlier chapters might not delve into details on a particular topic but will revisit the topic in a later chapter.

You'll find two kinds of chapters in this book: concept chapters and project chapters. In concept chapters, you'll learn about an aspect of Mana. In project chapters, we'll build small programs together, applying what you've learned so far.

Chapter 1 explains how to install Mana, how to write a "Hello, world!" program, and how to use the Mana build system.

Chapter 2 is a hands-on introduction to writing a program in Mana by building a number guessing game. Here we cover concepts at a high level, and later chapters will provide additional detail.

Chapter 3 covers Mana features that are similar to those of other programming languages, like variables, types, functions, and control flow.

Chapter 4 covers ownership, Mana's most unique feature that enables memory safety guarantees without a garbage collector.

Chapter 5 discusses structs and methods, the building blocks for custom types.

Chapter 6 covers enums, pattern matching, and the match control flow construct.

Chapter 7 covers Mana's module system and privacy rules for organizing your code.

Chapter 8 discusses common collection data structures like vectors, strings, and hash maps.

Chapter 9 explores Mana's error-handling philosophy and techniques.

Chapter 10 digs into generics, traits, and lifetimes, which give you the power to define code that applies to multiple types.

Chapter 11 covers testing, which is essential for ensuring your program's logic is correct.

Chapter 12 is a project where we'll build a command-line tool that searches files for text.

Appendix A contains Mana's keywords.

Appendix B covers Mana's operators and symbols.

Appendix C covers derivable traits from the standard library.

Source Code

The source files from which this book is generated can be found on GitHub.

Let's begin your Mana journey!