GithubHelp home page GithubHelp logo

jumlang's People

Contributors

jumhyn avatar

Watchers

 avatar  avatar  avatar

jumlang's Issues

No stdlib

I have a broken program but can't tell what's wrong because I can't print. Broken program to follow in another issue.

Redefinition is buggy

[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
}

Which throws:
screen shot 2014-07-10 at 12 00 23 am

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.