Skip to content

Commit 33c7197

Browse files
authored
Merge pull request #1 from stevedekorte/main
Add Hugo website for The Io Programming Language book
2 parents 70e6634 + f451232 commit 33c7197

File tree

182 files changed

+43812
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+43812
-2
lines changed

.claude/settings.local.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(python3:*)",
5+
"Bash(pkill:*)",
6+
"Bash(hugo --quiet)",
7+
"WebSearch",
8+
"Bash(do)",
9+
"Bash(if [[ \"$file\" != \"_index.md\" ]])",
10+
"Bash(then)",
11+
"Bash(sed:*)",
12+
"Bash(fi)",
13+
"Bash(__NEW_LINE__ sed -i '' 's/title: \"\"Getting Started with Io\"\"/title: \"\"Getting Started\"\"/' 02-getting-started.md)",
14+
"Bash(if [[ \"$file\" != \"_index.md\")",
15+
"Bash(unzip:*)",
16+
"Bash(do sed -i '' '/^\\*Next:/d' \"$file\")",
17+
"Bash(git add:*)",
18+
"Bash(git commit:*)"
19+
],
20+
"deny": [],
21+
"ask": []
22+
}
23+
}

01-introduction.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Chapter 1: Introduction - The Philosophy of Io
22

3-
> "The limits of my language mean the limits of my world." - Ludwig Wittgenstein
3+
> "The limits of my language mean the limits of my world."
4+
> - Ludwig Wittgenstein
45
56
Every programming language embodies a philosophy—a set of beliefs about how programs should be structured, how complexity should be managed, and what concepts are fundamental versus incidental. Java believes in protective encapsulation and type safety. Lisp believes in code as data. Haskell believes in mathematical purity.
67

CLAUDE.md

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,73 @@
22

33
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
44

5+
6+
## Project Overview
7+
8+
This is a comprehensive book about the Io Programming Language, written in Markdown format with one file per chapter. The book targets experienced programmers and provides in-depth comparisons with mainstream languages like JavaScript, Python, Ruby, and Java.
9+
10+
## Repository Structure
11+
12+
- **Root directory**: Contains 19 Markdown files (chapters 00-18) that make up the book
13+
- **examples/**: Runnable Io code examples organized by chapter
14+
- Each chapter subdirectory contains `.io` files demonstrating concepts from that chapter
15+
- Examples can be run with: `io examples/chapter-XX/filename.io`
16+
17+
## Commands
18+
19+
### Running Io Code Examples
20+
```bash
21+
# Run any example file
22+
io examples/chapter-02/hello.io
23+
24+
# Run Io REPL for interactive exploration
25+
io
26+
```
27+
28+
### Working with the Book Content
29+
The book is written entirely in Markdown. Each chapter is a standalone `.md` file numbered sequentially (00-preface.md through 18-conclusion.md).
30+
31+
## Code Architecture
32+
33+
This is a documentation/book project, not a software application. The structure is:
34+
35+
1. **Book Content**: Individual Markdown files for each chapter containing:
36+
- Conceptual explanations
37+
- Code examples (inline in Markdown)
38+
- Comparisons to Python, JavaScript, Ruby, and Java
39+
- Exercises and "Try This" sections
40+
41+
2. **Example Code**: Standalone `.io` files in the `examples/` directory that readers can run to follow along with the book
42+
43+
## Key Considerations
44+
45+
- When editing chapters, maintain consistency in:
46+
- Code example formatting (use ```io code blocks)
47+
- Comparison style with other languages
48+
- Progressive building of concepts from earlier chapters
49+
50+
- When creating new Io examples:
51+
- Place them in the appropriate `examples/chapter-XX/` directory
52+
- Ensure they are self-contained and runnable
53+
- Include comments explaining key concepts
54+
55+
- The book emphasizes prototype-based programming concepts and frequently contrasts Io with class-based languages to help readers understand the paradigm shift
56+
57+
## Language Context
58+
59+
Io is:
60+
- A prototype-based object-oriented language (like JavaScript's prototype system)
61+
- Dynamically typed
62+
- Homoiconic (code is data)
63+
- Message-passing based
64+
- Uses differential inheritance through cloning
65+
66+
Common Io patterns seen in examples:
67+
- Everything is an object receiving messages
68+
- Methods are defined as slots: `Object methodName := method(...)`
69+
- Cloning for inheritance: `Child := Parent clone`
70+
- Blocks for closures: `block(x, x * 2)`
71+
=======
572
## Repository Purpose
673

774
This is a comprehensive book about the Io programming language, written entirely in Markdown. The book targets experienced programmers as a second or third language resource, focusing on prototype-based object-oriented programming concepts with comparisons to mainstream languages (JavaScript, Python, Ruby, Java).
@@ -46,4 +113,5 @@ Note: The Io interpreter may not be installed on all systems. Installation:
46113

47114
## Important Context
48115

49-
This book was generated by Claude (Opus 4.1) in collaboration with a human developer. The entire 400+ page book was created in a single conversation session, demonstrating AI-assisted technical writing capabilities. The content is released under CC0 1.0 Universal license, encouraging community contributions and corrections.
116+
This book was generated by Claude (Opus 4.1) in collaboration with a human developer. The entire 400+ page book was created in a single conversation session, demonstrating AI-assisted technical writing capabilities. The content is released under CC0 1.0 Universal license, encouraging community contributions and corrections.
117+

index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="refresh" content="0; url=website/public/index.html">
6+
<link rel="canonical" href="website/public/index.html">
7+
<title>Redirecting...</title>
8+
</head>
9+
<body>
10+
<p>Redirecting to <a href="website/public/index.html">The Io Programming Language</a>...</p>
11+
</body>
12+
</html>

website/.hugo_build.lock

Whitespace-only changes.

website/content/_index.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: "The Io Programming Language"
3+
---
4+
5+
Welcome to this comprehensive guide to the Io programming language—a journey into prototype-based programming that will challenge and expand your understanding of object-oriented design.
6+
7+
## Why Io?
8+
9+
In a world dominated by class-based languages, Io offers a refreshingly different perspective. Everything is an object. Everything is a message. And everything can be changed at runtime.
10+
11+
## What You'll Learn
12+
13+
Through detailed comparisons with JavaScript, Python, Ruby, and Java, you'll discover:
14+
15+
- How prototype-based inheritance creates more flexible designs
16+
- Why message passing is more powerful than method calls
17+
- How to think in objects without classes
18+
- The elegance of homoiconic languages
19+
20+
## Start Your Journey
21+
22+
Begin with the [Preface](/docs/) to understand Io's philosophy, or jump directly to [Getting Started](/docs/part-1-foundations/02-getting-started/) to write your first Io program.
23+
24+
---
25+
26+
*"Io's purpose is to refocus attention on expressiveness by exploring higher level dynamic programming features with greater levels of runtime flexibility."*
27+
— Steve Dekorte, Creator of Io

website/content/docs/00-preface.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
title: "Why Io?"
3+
weight: 10
4+
---
5+
6+
7+
8+
# Preface: Why Io?
9+
10+
In a world dominated by class-based object-oriented languages, why should you spend time learning Io, a prototype-based language with a relatively small community? This is a fair question, and one that deserves an honest answer.
11+
12+
## The Value of Alternative Paradigms
13+
14+
Most programmers today work in languages that share remarkably similar conceptual foundations. Whether you're writing Java, C#, Python, or Ruby, you're likely thinking in terms of classes, instances, inheritance hierarchies, and static method definitions. These concepts have served us well, but they represent just one way of organizing computational thought.
15+
16+
Io offers something different: a pure prototype-based object system where these familiar distinctions dissolve. There are no classes, only objects. There is no separation between data and behavior. Everything—including control structures and operators—is accomplished through message passing between objects.
17+
18+
Consider this simple comparison. In Python, you might write:
19+
20+
```python
21+
class Dog:
22+
def __init__(self, name):
23+
self.name = name
24+
25+
def bark(self):
26+
return f"{self.name} says woof!"
27+
28+
fido = Dog("Fido")
29+
print(fido.bark())
30+
```
31+
32+
In Io, the same concept looks like this:
33+
34+
```io
35+
Dog := Object clone
36+
Dog bark := method(name .. " says woof!")
37+
38+
fido := Dog clone
39+
fido name := "Fido"
40+
fido bark println
41+
```
42+
43+
At first glance, this might seem like a minor syntactic difference. But look closer: there's no class definition, no constructor, no special initialization syntax. `Dog` is just an object that we've cloned from the base `Object`. `fido` is just a clone of `Dog`. The simplicity is profound.
44+
45+
## What You'll Gain
46+
47+
### 1. **A Deeper Understanding of JavaScript**
48+
49+
If you've ever been puzzled by JavaScript's prototype chain, or wondered why `typeof null === "object"`, studying Io will illuminate these mysteries. JavaScript's object model is essentially prototype-based (though complicated by the later addition of class syntax), and Io presents these same concepts in a much purer form.
50+
51+
### 2. **Freedom from Artificial Boundaries**
52+
53+
In most languages, there's a rigid distinction between what the language provides and what you can build. You can't change how `if` statements work. You can't modify how method calls are resolved. You can't alter fundamental objects.
54+
55+
In Io, these boundaries don't exist. The `if` statement is just a message sent to an object. Method resolution is customizable. Even basic types like `Number` and `String` can be modified at runtime. This isn't just academically interesting—it enables patterns of expression impossible in more rigid languages.
56+
57+
### 3. **Appreciation for Message Passing**
58+
59+
While many languages claim to support "message passing," few take it as seriously as Io. When everything is truly a message—including operators, control flow, and assignment—you begin to see the elegant simplicity possible in language design. This perspective will change how you think about method calls and object interaction in any language.
60+
61+
### 4. **Metaprogramming Without Magic**
62+
63+
Languages like Ruby pride themselves on metaprogramming capabilities, but often these features feel like special cases—magic methods, decorators, metaclasses. In Io, metaprogramming isn't a special feature; it's the natural consequence of a simple, consistent object model. When you can inspect and modify any object at runtime, including the objects that define the language itself, metaprogramming becomes straightforward rather than mystical.
64+
65+
## Who Should Read This Book
66+
67+
This book assumes you're already a programmer. You should be comfortable with:
68+
69+
- Basic programming concepts (variables, functions, loops, conditions)
70+
- Object-oriented programming in at least one language
71+
- Using a command line and text editor
72+
- The idea that different languages encourage different ways of thinking
73+
74+
You don't need to be an expert. In fact, if you've only worked in one or two mainstream languages, you might find Io's different perspective especially valuable. Sometimes, those deeply entrenched in certain paradigms have the most difficulty seeing alternatives.
75+
76+
## What Makes Io Special
77+
78+
Steve Dekorte created Io in 2002 with several goals:
79+
80+
1. **Simplicity** - A minimal syntax with maximum expressiveness
81+
2. **Flexibility** - Everything modifiable at runtime
82+
3. **Uniformity** - One consistent model for everything
83+
4. **Power** - Advanced features like coroutines and actors built-in
84+
85+
The result is a language that fits in roughly 10,000 lines of C code, yet provides capabilities that mainstream languages achieve only through complex implementations or external libraries.
86+
87+
## A Language for Learning
88+
89+
I won't pretend that Io is likely to become your primary development language. Its community is small, its libraries limited, and its performance, while respectable, isn't competitive with systems languages or JIT-compiled platforms.
90+
91+
But Io excels as a language for *learning*. Its simple, consistent design makes it easy to understand completely. You can hold the entire language in your head. There are no special cases to remember, no historical baggage to work around. When you understand Io's seven basic concepts, you understand the entire language.
92+
93+
## How to Approach This Book
94+
95+
As you read, I encourage you to:
96+
97+
1. **Run every example**. Io's REPL starts instantly and makes experimentation effortless.
98+
99+
2. **Modify the examples**. What happens if you change this? What if you clone from a different object? What if you override this method?
100+
101+
3. **Compare with languages you know**. When you see an Io pattern, think about how you'd accomplish the same thing in Python, JavaScript, or Java. What's easier? What's harder? What's impossible?
102+
103+
4. **Embrace the discomfort**. Some Io concepts will feel alien at first. That's good—it means you're learning something genuinely new.
104+
105+
## A Personal Note
106+
107+
I've been programming for [X] years and have worked in dozens of languages. Most taught me new syntax or libraries. Io taught me new ways to think. It challenged assumptions I didn't know I had. It showed me that many "fundamental" concepts in programming are actually just design choices, and different choices lead to different possibilities.
108+
109+
Whether you spend a weekend or a month with Io, I believe you'll emerge a better programmer. Not because you'll use Io in production (though you might), but because you'll have a broader perspective on what programming languages can be.
110+
111+
Let's begin.
112+
113+
---
114+

0 commit comments

Comments
 (0)