Skip to content

Commit 2ad4347

Browse files
Add image ops, FLIP/TFLIP builtins; remove GC extension
- Add image operators: BLIT, SCALE, CROP, GRAYSCALE, BLUR (ext/image.py) - Implement FLIP (int/str) and TFLIP (tensor axis reverse) in Builtins and register them - Add interpreter helper expect wrappers for extensions - Change FOR loop to use 1-based counter semantics (init to 1, <= target) - Update stdlib image and path helpers and tests to use new APIs - Update SPECIFICATION with FLIP/TFLIP entries - Remove broken GC extension (ext/gc.py)
1 parent bd5f6b1 commit 2ad4347

File tree

8 files changed

+503
-758
lines changed

8 files changed

+503
-758
lines changed

SPECIFICATION.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,8 @@
398398
### Tensor operations
399399
- `SHAPE(TNS: tensor):TNS` — Returns the tensor's shape as a 1D `TNS` (vector) of `INT` lengths (one entry per dimension).
400400
- `TLEN(TNS: tensor, INT: dim):INT` — Returns the length of the specified 1-based dimension. Errors if `dim` is out of range.
401+
- `FLIP(INT|STR: obj):INT|STR` — For `INT` input, returns an `INT` whose binary-digit spelling is the reverse of the absolute-value binary spelling of `obj` (sign is preserved). For `STR` input, returns the character-reversed `STR`.
402+
- `TFLIP(TNS: obj, INT: dim):TNS` — Returns a new `TNS` with the elements along 1-based dimension `dim` reversed. Errors if `dim` is out of range.
401403
- `FILL(TNS: tensor, ANY: value):TNS` — Returns a new tensor with the same shape as `tensor`, filled with `value`. The supplied value`s type must match the existing element type at every position.
402404
- `TNS(TNS: shape, ANY: value):TNS` Creates a new `TNS` with the shape described by a 1D `TNS` of positive `INT` lengths, filled with `value`.
403405
- `MADD/MSUB/MMUL/MDIV(TNS: x, TNS: y):TNS` Elementwise addition, subtraction, multiplication, and division. Shapes must match; all elements must be `INT` or all `FLT` (no mixing). Division by zero is an error.

asm-lang.exe

-455 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)