basic structures work in the jit

This commit is contained in:
2024-04-11 08:57:50 -07:00
parent 5f2fc7cb34
commit 8479a84e07
4 changed files with 19 additions and 5 deletions

View File

@@ -0,0 +1,27 @@
struct Point {
x: u64;
y: u64;
}
v = 1u64;
function getX(p: Point) -> u64
p.x;
function getY(p: Point) -> u64
p.y;
function newPoint(x, y) -> Point
Point {
x: x;
y: y;
};
function slope(p1, p2) -> u64
(getY(p2) - p1.y) / (getX(p2) - p1.x);
origin = newPoint(0, 0);
farther = newPoint(2, 4);
mySlope = slope(origin, farther);
print mySlope;