jumhyn / jumlang Goto Github PK
View Code? Open in Web Editor NEWMessing around with writing a compiler in Objective-C
Messing around with writing a compiler in Objective-C
I have a broken program but can't tell what's wrong because I can't print. Broken program to follow in another issue.
Ignore. I'm dumb.
[int fac: int num] {
int res = 1;
while (num > 0) {
res = res * num;
num = num - 1;
}
return res;
}
[int main] {
int x = [fac: 6];
return x;
}
Generates
target triple = "x86_64-apple-macosx10.9.0"
define i32 @fac(i32 %num) {
%res = alloca i32
store i32 1, i32* %res
br label %L3
L3:
%t1 = icmp sgt i32 %num, 0
br i1 %t1, label %L5, label %L4
L5:
%t2 = load i32* %res
%t3 = mul i32 %t2, %num
store i32 %t3, i32* %res
%num = alloca i32
%t4 = sub i32 %num, 1
store i32 %t4, i32* %num
br label %L3
L4:
%t5 = load i32* %res
ret i32 %t5
}
define i32 @main() {
%x = alloca i32
%t6 = call i32 @fac(i32 6)
store i32 %t6, i32* %x
%t7 = load i32* %x
ret i32 %t7
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.