PLDB
Languages Features Calendar CSV Lists Blog About Sponsor Add Language
GitHub icon

Felix

Felix

Felix is a pl created in 2001 by John Skaller.

#486on PLDB 21Years Old 819Users
0Books 0Papers

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";

Keywords in Felix

_ _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 Example Token
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 ϴ

HackerNews discussions of Felix

title date score comments
Felix - a fast scripting language 01/04/2013 107 83
openvera.html · felix.html · musicxml.html

View source

PLDB - Build the next great programming language · v2022 · Day 33 · Docs · Build · Acknowledgements · Traffic Today · Traffic Trends · Mirrors · GitHub · feedback@pldb.com