Felix Programming Language

Tags : Felix

Transitioning over to github.

posted on August 16, 2010 - 12:05 PM PDT by Erick Tryzelaar
filed under: FBuild, Felix

I just wanted to let everyone know that I'm transitioning the hosting of felix and fbuild over to github. You can find the following repositories over there:

I'll still be maintaining the http://git.felix-lang.org mirrors, but I'm considering github to be the primary location to get the code, as well as for bug tickets and etc.

read comments

We finally own #felix!

posted on August 16, 2010 - 11:20 AM PDT by Erick Tryzelaar
filed under: FBuild, Felix

Hi all, long time no see! I just wanted to say that we now officially own #felix for all your felix and fbuild related stuff. So hop on by if you want to chat :)

read comments

Hello Felix!

posted on September 28, 2009 - 02:10 AM PDT by Erick Tryzelaar
filed under: Felix, LLVM

Basic pointer types and c strings are now working!

type char = "%i8";
typedef charp = &char;    
proc puts : charp = "puts";

puts c"Hello world!";

Generates:

@0 = internal global [13 x i8] c"Hello world!\00" ; <[13 x i8]*> [#uses=1]

declare void @puts(i8*)

define void @1() {
entry:
  call void @puts(i8* getelementptr inbounds ([13 x i8]* @0, i32 0, i32 0))
  ret void
}

And prints out:

Hello World!

read comments

LLVM code generator support for flxc

posted on August 27, 2009 - 04:03 PM PDT by Erick Tryzelaar
filed under: Felix, LLVM

I've just committed a LLVM code generator for flxc.

#!build/debug/bin/flxc -I build/debug/lib --import nugram.flxh --import flx.flxh
>>> type int = "int";
... BOUND SYM:     type int<3> = "int";
>>> fun add : int*int -> int = "%add";
... BOUND SYM:     fun add<4>: int<3>^2 -> int<3> = "%add";
>>> fun foo (a:int, b:int, c:int) = { val d = a + b; return d + 1; }
... BOUND SYM:     fun foo<5>(val a<8>: int<3>,val b<9>: int<3>,val c<10>: int<3>): int<3>{
...   d<7> := (add<4> (a<8>, b<9>));
...   return (add<4> (d<7>, 1));}
>>> val x = 1;
... BOUND SYM:     val x<11>: int<3>;
... BOUND EXE:     x<11> := 1;
>>> val y = 2;
... BOUND SYM:     val y<12>: int<3>;
... BOUND EXE:     y<12> := 2;
>>> val z = foo (x, y, 3);
... BOUND SYM:     val z<13>: int<3>;
... BOUND EXE:     z<13> := (foo<5> (x<11>, y<12>, 3));
>>> ^D

And here's what it generates:

define void @__init__() {
entry:
  %z = alloca i32                                 ; <i32*> [#uses=1]
  %y = alloca i32                                 ; <i32*> [#uses=1]
  %x = alloca i32                                 ; <i32*> [#uses=1]
  store i32 1, i32* %x
  store i32 2, i32* %y
  %foo = call i32 @foo(i32 1, i32 2, i32 3)       ; <i32> [#uses=1]
  store i32 %foo, i32* %z
  ret void
}

define i32 @foo(i32 %a, i32 %b, i32 %c) {
entry:
  %d = alloca i32                                 ; <i32*> [#uses=1]
  %add = add i32 %a, %b                           ; <i32> [#uses=2]
  store i32 %add, i32* %d
  %add1 = add i32 %add, 1                         ; <i32> [#uses=1]
  ret i32 %add1
}

Of course it doesn't actually execute the commands yet, but the output's so pretty!

read comments