Top 1,000 Features Creators Resources Blog Explore Download
GitHub icon

Felix

< >

Felix is a programming language created in 2001 by John Skaller.

Source code:
git clone https://github.com/felix-lang/felix
#293on PLDB 23Years Old

The Felix Programming Language


Example from the web:
#import <flx.flxh> fun abs_div(a:int, b:int when b!=0) expect result >=0 => abs(a/b) ; print (abs_div(2,4)); print "\n";
Example from hello-world:
println$ "Hello World";
Felix Keywords
_ _deref all as assert attempt call callback case caseno cclass code compound ctypes do done downto elif else endattempt endcase endif endmatch enum except exceptions expect finally for forall forget fork functor goto ident if incomplete inherit instance interface jump lambda loop match module namespace new noexpand nonterm obj of open parse raise regexp reglex regmatch rename return the then to type typecase typedef typematch typeof upto when whilst with yield

Language features

Feature Supported Token Example
Binary Literals โœ“
// 0[Bb][01_]+([tTsSiIlLvV]|ll|LL|([iIuU])(8|16|32|64))?
Integers โœ“
// (0|[1-9][0-9_]*)([tTsSiIlLvV]|ll|LL|([iIuU])(8|16|32|64))?
Floats โœ“
// 0[xX]([0-9a-fA-F_]*\.[0-9a-fA-F_]+|[0-9a-fA-F_]+)[pP][+\-]?[0-9_]+[lLfFdD]?
Hexadecimals โœ“
// 0[xX][0-9a-fA-F_]+([tTsSiIlLvV]|ll|LL|([iIuU])(8|16|32|64))?
Octals โœ“
// 0[0-7_]+([tTsSiIlLvV]|ll|LL|([iIuU])(8|16|32|64))?
Conditionals โœ“
Strings โœ“ "
"Hello world"
Print() Debugging โœ“ println
Comments โœ“
// A comment
Line Comments โœ“ //
// A comment
Pattern Matching โœ“
match x with
 | Some x => println$ x; 
 | None => println "NONE";
 endmatch;
Polymorphism โœ“
// overloads
fun f (x:double) => x +42.1;
fun f (x:int) =>  x + 1;
fun f (x:string) => x + "!";
Generics โœ“
// generics
fun g (x) => f (f x);
println$ g 1, g "hello";
println$ _map f (1,"hello",2.0);
Pointers โœ“
var x = 1;
&x <- 2;
Semantic Indentation X

HackerNews discussions of Felix

title date score comments
Felix - a fast scripting language 01/04/2013 107 83

View source

- Build the next great programming language ยท About ยท Acknowledgements ยท Extensions ยท Day 624 ยท feedback@pldb.io