Compiler/virtual machine interpreter: Difference between revisions

Content added Content deleted
Line 613: Line 613:
Compile with ‘patscc -O3 -DATS_MEMALLOC_LIBC -o vm-postiats vm-postiats.dats -latslib’
Compile with ‘patscc -O3 -DATS_MEMALLOC_LIBC -o vm-postiats vm-postiats.dats -latslib’


With the optimizer turned on, like this, the program should run pretty fast.
With the optimizer turned on, like this, the program should run pretty fast, despite being relatively safe against going out of bounds, etc. Try it on the ASCII Mandelbrot example.


<lang ats>(*
<lang ats>(*
Line 938: Line 938:
fn
fn
parse_digits {n, i, j : int | 0 <= i; i <= j; j <= n}
parse_digits {n, i, j : int | 0 <= i; i <= j; j <= n}
(s : string n,
(s : string n,
i : size_t i,
i : size_t i,
j : size_t j) :
j : size_t j) :
vmint =
vmint =
let
let