You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-6Lines changed: 42 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,13 +125,13 @@ A single `end` closes the entire if-chain. The `elif` and `else` keywords introd
125
125
```text
126
126
var i = 0;
127
127
while i < 5:
128
-
print(i);
128
+
var _ = print_line(to_string(i));
129
129
i = i + 1;
130
-
end
130
+
end;
131
131
132
132
for x in [1, 2, 3]:
133
-
print(x);
134
-
end
133
+
var _ = print_line(to_string(x));
134
+
end;
135
135
```
136
136
137
137
-`break` exits the innermost loop immediately.
@@ -153,7 +153,7 @@ def factorial(n: Int) -> Int:
153
153
end;
154
154
155
155
val result = factorial(5);
156
-
assertrue(result == 120, "5! should be 120");
156
+
asserttrue(result == 120, "5! should be 120");
157
157
```
158
158
159
159
> **Syntax note:** Block statements (`if`, `while`, `for`, `def`) require a semicolon after the closing `end` when followed by additional statements at the same level.
@@ -163,10 +163,12 @@ assertrue(result == 120, "5! should be 120");
163
163
Anonymous functions can be assigned to variables or passed as arguments.
164
164
165
165
```text
166
-
val add = lambda (a: Int, b: Int) -> Int: a + b end;
166
+
val add = lambda (a: Int, b: Int) -> Int: return a + b end;
167
167
val sum = add(2, 3);
168
168
```
169
169
170
+
> **Current limitation:** Lambdas are parsed correctly but not yet fully implemented in the interpreter.
171
+
170
172
---
171
173
172
174
## Standard Library (Metabuiltins)
@@ -232,6 +234,8 @@ RPython provides two monadic types for representing optional or fallible values:
232
234
233
235
ADTs can be declared with multiple constructors. Pattern matching is not yet implemented; values are constructed and passed around opaquely.
234
236
237
+
> **Current limitation:** ADT declarations are parsed as types but cannot yet be declared as top-level statements. The syntax shown below is the planned syntax; it is not yet functional.
238
+
235
239
```text
236
240
data Shape:
237
241
| Circle Int
@@ -290,6 +294,32 @@ src/
290
294
-**`interpreter/statement_execute.rs`** — Executes statements; handles loops with `break`/`continue`.
cargo run --features pp-timing --example pp_timing
319
+
320
+
# Profile counters
321
+
cargo run --features pp-profile --example pp_bench
322
+
```
293
323
294
324
---
295
325
@@ -347,6 +377,12 @@ The interpreter reads from stdin and writes to stdout, making it suitable for au
347
377
5.**Limited error messages:** parser and type checker errors are functional but not always user-friendly.
348
378
6.**No tail-call optimization:** deep recursion may overflow the stack.
349
379
7.**Maybe/Result constructors:**`Just()`, `Nothing`, `Ok()`, `Err()` cannot be parsed from source code yet.
380
+
8.**Small standard library:** only a small set of metabuiltins is available (basic I/O, conversions, simple string/list helpers); there are no rich libraries for math, dates/times, networking, etc.
381
+
9.**No exceptions:** there is no `try`/`catch` mechanism or exception hierarchy; errors are represented via `Maybe`/`Result` types or abort execution with an error message.
382
+
10.**No objects or methods:** there are no classes, interfaces, or method calls; programs are written with functions, lists/tuples, and algebraic data types.
383
+
11.**No concurrency or async:** the language has no built-in support for threads, async/await, or parallel execution.
384
+
12.**Interpreter-only, unoptimized:** execution is performed by a tree-walking interpreter without bytecode/JIT or optimization passes, so performance is below production-grade VMs/compilers.
385
+
13.**Minimal tooling:** beyond the CLI and internal pretty printer, there is no dedicated debugger, formatter binary, or IDE integration yet.
0 commit comments