Skip to content

Commit d36f40e

Browse files
committed
Bump version to 1.0.0, update README with all features
1 parent a1b00ec commit d36f40e

2 files changed

Lines changed: 66 additions & 54 deletions

File tree

README.md

Lines changed: 65 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ curl -fsSL https://raw.githubusercontent.com/TRC-Loop/CColon/main/install.sh | s
3030
Or specify a version:
3131

3232
```sh
33-
curl -fsSL https://raw.githubusercontent.com/TRC-Loop/CColon/main/install.sh | sh -s v0.1.0
33+
curl -fsSL https://raw.githubusercontent.com/TRC-Loop/CColon/main/install.sh | sh -s v1.0.0
3434
```
3535

3636
### Windows (PowerShell)
@@ -59,11 +59,11 @@ sudo mv ccolon /usr/local/bin/
5959

6060
### Interactive Shell
6161

62-
Run `ccolon` with no arguments to start the REPL:
62+
Run `ccolon` with no arguments to start the REPL (with readline, history, and tab completion):
6363

6464
```
6565
$ ccolon
66-
CColon v0.1.0 - Interactive Mode
66+
CColon v1.0.0 - Interactive Mode
6767
Type 'exit' to quit.
6868
6969
c: > import console
@@ -87,28 +87,38 @@ function main() {
8787
}
8888
```
8989

90+
## Features
91+
92+
| Feature | Description |
93+
|---|---|
94+
| **Bytecode compiled** | Compiles to bytecode, runs on a stack-based VM |
95+
| **Static types** | `int`, `float`, `string`, `bool`, `list`, `array`, `dict`, `sint` |
96+
| **Classes** | Inheritance, constructors, public/private fields and methods |
97+
| **Error handling** | `try/catch/throw` with custom error classes |
98+
| **File imports** | `import "file.ccl"` for multi-file projects |
99+
| **Arbitrary precision** | `sint` type for unlimited-size integers (like Python) |
100+
| **Code formatter** | `ccolon fmt` with configurable `.ccolonfmt` |
101+
| **Bytecode files** | `ccolon compile` to `.cclb`, `ccolon file.cclb` to run |
102+
| **Package manager** | `ccolon pkg install` from any GitHub repo |
103+
| **Rich REPL** | Readline, history, tab completion, colored output |
104+
| **Standard library** | console, math, random, json, fs, datetime, os, http |
105+
90106
## Language Overview
91107

92108
CColon source files use the `.ccl` extension.
93109

94110
### Types
95111

96-
| Type | Description | Example |
97-
|---------|------------------------|--------------------------------|
98-
| `int` | 64-bit integer | `var int x = 42` |
99-
| `float` | 64-bit float | `var float pi = 3.14` |
100-
| `string`| Text | `var string s = "hello"` |
101-
| `bool` | Boolean | `var bool ok = true` |
102-
| `list` | Dynamic list | `var list a = [1, 2, 3]` |
103-
| `array` | Fixed-size array | `var array a = fixed([1, 2])` |
104-
105-
### Variables
106-
107-
```
108-
var int count = 0
109-
var string name = "CColon"
110-
count = count + 1
111-
```
112+
| Type | Description | Example |
113+
|---|---|---|
114+
| `int` | 64-bit integer | `var int x = 42` |
115+
| `sint` | Arbitrary precision integer | `var sint x = 99999999999999999999` |
116+
| `float` | 64-bit float | `var float pi = 3.14` |
117+
| `string` | Text | `var string s = "hello"` |
118+
| `bool` | Boolean | `var bool ok = true` |
119+
| `list` | Dynamic list | `var list a = [1, 2, 3]` |
120+
| `array` | Fixed-size array | `var array a = fixed([1, 2])` |
121+
| `dict` | Dictionary | `var dict d = {"a": 1}` |
112122

113123
### Functions
114124

@@ -117,12 +127,34 @@ function add(int a, int b) int {
117127
return a + b
118128
}
119129
120-
function greet(string name) {
121-
console.println("Hello, " + name + "!")
130+
function greet(string name, string prefix = "Hello") {
131+
console.println(prefix + ", " + name + "!")
122132
}
123133
```
124134

125-
The `main()` function is automatically called as the entry point.
135+
### Classes
136+
137+
```
138+
class Dog {
139+
var public string name = ""
140+
public function init(string name) {
141+
self.name = name
142+
}
143+
public function speak() string {
144+
return self.name + " barks!"
145+
}
146+
}
147+
```
148+
149+
### Error Handling
150+
151+
```
152+
try {
153+
throw Error("something went wrong")
154+
} catch (Error e) {
155+
console.println("caught: " + e.message)
156+
}
157+
```
126158

127159
### Control Flow
128160

@@ -141,42 +173,22 @@ for i in range(5) {
141173
console.println(i.tostring())
142174
}
143175
144-
for i in range(2, 8) {
145-
console.println(i.tostring())
176+
for item in items {
177+
console.println(item)
146178
}
147179
```
148180

149-
### Lists and Arrays
150-
151-
```
152-
var list items = [1, 2, 3]
153-
items.append(4)
154-
console.println(items[0].tostring())
155-
console.println(items.length().tostring())
156-
157-
var array coords = fixed([10, 20, 30])
158-
console.println(coords[1].tostring())
159-
```
160-
161-
### Methods on Values
162-
163-
```
164-
var int n = 42
165-
console.println(n.tostring())
166-
console.println(n.tofloat().tostring())
181+
## Tools
167182

168-
var string s = "hello"
169-
console.println(s.length().tostring())
170-
```
171-
172-
### Imports
173-
174-
```
175-
import console
183+
```sh
184+
ccolon file.ccl # Run a source file
185+
ccolon file.cclb # Run a compiled bytecode file
186+
ccolon fmt file.ccl # Format source code
187+
ccolon compile file.ccl # Compile to bytecode
188+
ccolon pkg install <url> # Install a package
189+
ccolon pkg list # List installed packages
176190
```
177191

178-
The `console` module provides `println`, `print`, and `scanp` for terminal I/O.
179-
180192
For the full language reference, see the [documentation](https://ccolon.arne.sh/).
181193

182194
## License
@@ -185,6 +197,6 @@ For the full language reference, see the [documentation](https://ccolon.arne.sh/
185197

186198
## Logo
187199

188-
You might want to rotate the logo by 90°.
200+
You might want to rotate the logo by 90.
189201

190202
This is a happy language indeed.

ccolon/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/TRC-Loop/ccolon/vm"
1818
)
1919

20-
const version = "0.2.3"
20+
const version = "1.0.0"
2121

2222
func main() {
2323
if len(os.Args) < 2 {

0 commit comments

Comments
 (0)