Skip to content

Commit 45a3705

Browse files
authored
Merge pull request #478 from DavidCanHelp/master
feat: Modernize developer experience with comprehensive tooling
2 parents 0a98ace + d4d229c commit 45a3705

File tree

9 files changed

+1085
-16
lines changed

9 files changed

+1085
-16
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug in Io
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Description
10+
<!-- A clear and concise description of the bug -->
11+
12+
## Steps to Reproduce
13+
1.
14+
2.
15+
3.
16+
17+
## Expected Behavior
18+
<!-- What you expected to happen -->
19+
20+
## Actual Behavior
21+
<!-- What actually happened -->
22+
23+
## Code Example
24+
```io
25+
// Minimal code example that reproduces the issue
26+
```
27+
28+
## Error Output
29+
```
30+
// Paste any error messages or stack traces here
31+
```
32+
33+
## Environment
34+
- **Io Version**: <!-- Run: io --version -->
35+
- **Operating System**: <!-- e.g., macOS 14.0, Ubuntu 22.04, Windows 11 -->
36+
- **Architecture**: <!-- e.g., x86_64, ARM64, Apple Silicon -->
37+
- **Build Type**: <!-- e.g., from source, homebrew, package manager -->
38+
39+
## Additional Context
40+
<!-- Add any other context about the problem here -->
41+
42+
## Possible Solution
43+
<!-- Optional: If you have ideas on how to fix this -->
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new feature or enhancement for Io
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Feature Description
10+
<!-- A clear and concise description of the feature you'd like -->
11+
12+
## Motivation
13+
<!-- Why is this feature needed? What problem does it solve? -->
14+
15+
## Proposed Solution
16+
<!-- How do you envision this feature working? -->
17+
18+
## Example Usage
19+
```io
20+
// Show how the feature would be used in Io code
21+
```
22+
23+
## Alternatives Considered
24+
<!-- Have you considered any alternative solutions or features? -->
25+
26+
## Implementation Notes
27+
<!-- Optional: Any thoughts on how this could be implemented? -->
28+
29+
## Additional Context
30+
<!-- Add any other context, mockups, or examples here -->

.github/ISSUE_TEMPLATE/question.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Question
3+
about: Ask a question about Io
4+
title: '[QUESTION] '
5+
labels: question
6+
assignees: ''
7+
---
8+
9+
## Question
10+
<!-- Your question about Io -->
11+
12+
## Context
13+
<!-- What are you trying to accomplish? -->
14+
15+
## What I've Tried
16+
<!-- What have you already attempted? Include code if relevant -->
17+
18+
```io
19+
// Any relevant code
20+
```
21+
22+
## Related Documentation
23+
<!-- Links to any documentation you've consulted -->
24+
25+
## Environment
26+
- **Io Version**: <!-- Run: io --version -->
27+
- **Operating System**: <!-- e.g., macOS, Linux, Windows -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
## Description
2+
<!-- Provide a brief description of the changes in this PR -->
3+
4+
## Type of Change
5+
<!-- Mark the relevant option with an "x" -->
6+
- [ ] Bug fix (non-breaking change which fixes an issue)
7+
- [ ] New feature (non-breaking change which adds functionality)
8+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
9+
- [ ] Documentation update
10+
- [ ] Performance improvement
11+
- [ ] Code refactoring
12+
13+
## Related Issues
14+
<!-- Link any related issues here using #issue_number -->
15+
Fixes #
16+
Related to #
17+
18+
## Changes Made
19+
<!-- List the main changes made in this PR -->
20+
-
21+
-
22+
-
23+
24+
## Testing
25+
<!-- Describe the tests you ran to verify your changes -->
26+
- [ ] All existing tests pass
27+
- [ ] Added new tests for the changes
28+
- [ ] Tested on the following platforms:
29+
- [ ] Linux
30+
- [ ] macOS (Intel)
31+
- [ ] macOS (Apple Silicon)
32+
- [ ] Windows
33+
- [ ] Other:
34+
35+
## Test Commands
36+
```bash
37+
# Commands used to test the changes
38+
make test
39+
```
40+
41+
## Checklist
42+
<!-- Mark completed items with an "x" -->
43+
- [ ] My code follows the project's style guidelines
44+
- [ ] I have performed a self-review of my own code
45+
- [ ] I have commented my code, particularly in hard-to-understand areas
46+
- [ ] I have made corresponding changes to the documentation
47+
- [ ] My changes generate no new warnings
48+
- [ ] I have added tests that prove my fix is effective or that my feature works
49+
- [ ] New and existing unit tests pass locally with my changes
50+
- [ ] Any dependent changes have been merged and published
51+
52+
## Screenshots (if applicable)
53+
<!-- Add screenshots to help explain your changes -->
54+
55+
## Additional Notes
56+
<!-- Add any additional notes or context about the PR here -->

.github/workflows/ci.yml

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,22 @@ on:
44
push:
55
branches:
66
- master
7+
- main
8+
- develop
79
pull_request:
810
branches:
911
- master
12+
- main
13+
- develop
14+
workflow_dispatch:
1015

1116
jobs:
1217
formatter:
13-
18+
name: Code Formatting Check
1419
runs-on: ubuntu-latest
1520
steps:
16-
1721
- name: Checkout
18-
uses: actions/checkout@v2
22+
uses: actions/checkout@v4
1923
with:
2024
submodules: 'recursive'
2125

@@ -28,35 +32,36 @@ jobs:
2832
clangFormatVersion: 12
2933

3034
unix:
31-
35+
name: Unix Build (${{ matrix.os }} - ${{ matrix.build_type }})
3236
runs-on: ${{ matrix.os }}
3337
strategy:
38+
fail-fast: false
3439
matrix:
3540
os: [ macOS-latest, ubuntu-latest ]
41+
build_type: [ Debug, Release ]
42+
include:
43+
# Test on Apple Silicon
44+
- os: macos-14
45+
build_type: Release
46+
# Test on older macOS
47+
- os: macos-12
48+
build_type: Release
3649

3750
steps:
3851
- name: Checkout
39-
uses: actions/checkout@v2
52+
uses: actions/checkout@v4
4053
with:
4154
submodules: 'recursive'
4255

43-
# needed to test localy with nektos/act, don't delete it
44-
# neither uncomment, because on Github the image already has build-essential
45-
# - name: Install Makefile
46-
# if: matrix.os == 'ubuntu-latest'
47-
# run: |
48-
# apt-get update -y
49-
# apt-get install -y build-essential sudo git
50-
5156
- name: Setup cmake
52-
uses: jwlawson/actions-setup-cmake@v1.9
57+
uses: jwlawson/actions-setup-cmake@v1.14
5358

5459
- name: Build
5560
run: |
5661
mkdir build
5762
cd build
58-
cmake ..
59-
make
63+
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
64+
make -j$([ "$(uname)" = "Darwin" ] && sysctl -n hw.ncpu || nproc)
6065
6166
- name: Install
6267
run: |
@@ -68,6 +73,18 @@ jobs:
6873
cd build
6974
./_build/binaries/io --version
7075
./_build/binaries/io ../libs/iovm/tests/correctness/run.io
76+
timeout-minutes: 10
77+
78+
- name: Test Samples
79+
if: matrix.build_type == 'Release'
80+
run: |
81+
cd build
82+
for sample in ../samples/misc/*.io; do
83+
if [ -f "$sample" ]; then
84+
echo "Testing: $(basename $sample)"
85+
timeout 5s ./_build/binaries/io "$sample" || echo "Sample timed out or failed: $sample"
86+
fi
87+
done
7188
7289
windows:
7390
runs-on: windows-latest

CLAUDE.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Common Development Commands
6+
7+
### Building Io
8+
9+
```bash
10+
# Create build directory (one-time setup)
11+
mkdir build && cd build
12+
13+
# Configure for development (debug mode)
14+
cmake ..
15+
16+
# Configure for production (with optimizations)
17+
cmake -DCMAKE_BUILD_TYPE=release ..
18+
19+
# Build the project
20+
make
21+
22+
# Install (requires sudo on Unix systems)
23+
sudo make install
24+
```
25+
26+
### Running Tests
27+
28+
```bash
29+
# Run the main test suite (from build directory)
30+
io ../libs/iovm/tests/correctness/run.io
31+
32+
# Run a specific test file
33+
io ../libs/iovm/tests/correctness/<TestName>Test.io
34+
```
35+
36+
### Development Workflow
37+
38+
```bash
39+
# Clean rebuild
40+
cd build && make clean && make
41+
42+
# Run the Io REPL
43+
io
44+
45+
# Execute an Io script
46+
io script.io
47+
```
48+
49+
## Architecture Overview
50+
51+
### Core Structure
52+
53+
The Io language is a dynamic, prototype-based programming language implemented in C. The architecture consists of:
54+
55+
1. **Virtual Machine Core** (`libs/iovm/`): The interpreter and runtime system
56+
- Objects clone from prototypes (no classes)
57+
- Everything is an object that responds to messages
58+
- Message passing is the fundamental operation
59+
- Coroutines provide lightweight concurrency
60+
61+
2. **Foundation Libraries** (`libs/`):
62+
- `basekit`: Cross-platform C utilities and data structures
63+
- `coroutine`: Architecture-specific context switching (x86, x86_64, ARM64, PowerPC)
64+
- `garbagecollector`: Mark-and-sweep garbage collection
65+
66+
3. **Standard Library**: Split between C (`libs/iovm/source/`) and Io (`libs/iovm/io/`) implementations
67+
- Core objects like IoObject, IoMessage, IoState in C
68+
- Higher-level functionality in Io for flexibility
69+
70+
### Key Design Patterns
71+
72+
- **Prototype-based OOP**: Objects clone from prototypes rather than instantiating classes
73+
- **Message Passing**: All operations are messages sent to objects
74+
- **C Naming Convention**: `IoObjectName_methodName` for C functions
75+
- **Minimal Core**: Keep VM small, implement features in Io when possible
76+
77+
### Testing Approach
78+
79+
Tests are written in Io using the built-in UnitTest framework. The test runner (`libs/iovm/tests/correctness/run.io`) discovers and executes all test files ending with `Test.io`.
80+
81+
### Build System
82+
83+
CMake-based build system with hierarchical CMakeLists.txt files. Each library manages its own build configuration and dependencies.

0 commit comments

Comments
 (0)