Skip to content

Latest commit

 

History

History
125 lines (93 loc) · 5.83 KB

File metadata and controls

125 lines (93 loc) · 5.83 KB

The Viper Bible

A complete guide to programming — from zero to mastery.

This book teaches you to program computers. You don't need any prior experience. By the end, you'll be building sophisticated applications: games, tools, networked systems, and more.

We teach primarily in Zia, a modern language designed for clarity and power. Every concept is also shown in BASIC for those who prefer a different style or need to work with existing code.


How This Book Works

The Viper Bible is organized as a journey, not a dictionary. Each chapter builds on the last. We don't just show you syntax — we explain why things work the way they do, what problems they solve, and how to think about programming.

Read it in order. Do the exercises. Type the code yourself. Make mistakes and fix them. That's how learning happens.


The Journey

Part I: Foundations

What is programming? How do computers work? Your first programs.

Chapter You Will Learn
0. Getting Started Installing Viper and running your first examples
1. The Machine What computers actually do, how programs work
2. Your First Program Writing, running, and understanding "Hello, World"
3. Values and Names Numbers, text, variables — the atoms of programs
4. Making Decisions If/else, conditions, boolean logic
5. Repetition Loops — doing things many times
6. Collections Arrays and lists — working with groups of things
7. Breaking It Down Functions — organizing code into reusable pieces

Part II: Building Blocks

The techniques that make real programs possible.

Chapter You Will Learn
8. Text and Strings Working with text, formatting, parsing
9. Files and Persistence Reading and writing files, saving data
10. Errors and Recovery When things go wrong, handling failures gracefully
11. Structures Grouping related data together
12. Modules Organizing code across files
13. The Standard Library What Viper gives you for free

Part III: Thinking in Objects

Modeling the world with objects and types.

Chapter You Will Learn
14. Objects and Classes Creating your own types
15. Inheritance Building on existing types
16. Interfaces Defining contracts between components
17. Polymorphism Writing code that works with many types
18. Design Patterns Common solutions to common problems

Part IV: Real Applications

Putting it all together to build things that matter.

Chapter You Will Learn
19. Graphics and Games Drawing, animation, game loops
20. User Input Keyboard, mouse, controllers
21. Building a Game Complete walkthrough: Frogger from scratch
22. Networking TCP, UDP, building connected applications
23. Data Formats JSON, CSV, serialization
24. Concurrency Doing multiple things at once

Part V: Mastery

Deep understanding and advanced techniques.

Chapter You Will Learn
25. How Viper Works The compiler, IL, and runtime
26. Performance Making programs fast
27. Testing Ensuring your code works
28. Architecture Designing large systems

Appendices

Reference material for when you need to look things up.

Appendix Contents
A. Zia Reference Complete syntax and semantics
B. BASIC Reference Complete syntax and semantics
D. Runtime Library All built-in functions and types
E. Error Messages What they mean and how to fix them
F. Glossary Programming terms explained

The Two Languages

Viper supports two languages that both compile to the same underlying system. This book emphasizes Zia but shows both:

Zia — Modern, clean, C-like syntax. Our recommended choice for new projects.

func greet(name: String) {
    Viper.Terminal.Say("Hello, " + name + "!");
}

BASIC — Classic, beginner-friendly, keyword-based. Great for learning and rapid prototyping.

SUB Greet(name AS STRING)
    PRINT "Hello, "; name; "!"
END SUB

Both are equally powerful. They access the same runtime library. Code written in one can call code written in the other. Choose the style that feels right to you.


Before You Begin

You'll need:

  • A computer (Windows, macOS, or Linux)
  • The Viper toolchain installed (see Getting Started)
  • A text editor (any will do)
  • Curiosity and patience

Let's begin.

Continue to Chapter 1: The Machine →