Saffire Goals
• Be a (not the) programming language.
• Suitable for web (fastCGI) and command
line.
• “best of all programming worlds”.
Slide 4
Slide 4 text
History
• Joshua Thijssen decided on learning more
about flex / bison.
• “Why not write a language instead of a
calculator?”
• 2 hours later: 2 developers, a github
account and domains registered.
• Saffire, dutch/english mix of “saphire” (as in:
perl / ruby / ...).
Slide 5
Slide 5 text
History
• Primarily based on PHP / Python syntax
with some ideas from other languages
(java, ruby, javascript).
• We’re 10-15 years behind, but 10-15 years
of traps and pitfalls we can avoid.
Slide 6
Slide 6 text
Technical info
• Open source (3-clause BSD license).
• Written in C.
• Imperative language.
• Dynamically and strong typed.
• Byte code generation.
• Interpreter for now.
• JIT (and/or compilation) later.
Slide 7
Slide 7 text
Selling points
• Everything is an object.
• Even “foo”, 2, /reg?ex*/ and 3.14159265.
• UTF-8 out of the box.
• No functions, just objects and methods.
• Method and operator overloading.
Slide 8
Slide 8 text
Hello world
use io;
io.print(“hello world”);
Slide 9
Slide 9 text
Variables and such
use io;
$a = 1;
$b = “foo”.length(); // 3
$c = “björk”.length(); // 5!
$d = “björk”.bytes().length(); // 6!
$e = 1;
io.print(“$e equals “,$e);
Slide 10
Slide 10 text
Classes
use io;
class Foo {
const PI = 3.1415;
protected property $a = 1;
public method ctor() {
io.printf(“Constructor called!\n”);
}
public method dtor() {
io.printf(“Destructor called!\n”);
}
public method Bar() {
self.$a++;
}
}
$f = Foo();
io.printf(“PI is “, Foo.PI);
io.printf(“First call: “, $f.bar());
io.printf(“Second call: “, $f.bar());
$f.destroy(); // $f is no more
Slide 11
Slide 11 text
Modules
use io;
use FooFramework as Foo;
use BarFramework;
$foo = Foo::Framework();
$content = $foo->run();
$req = BarFramework::HTTP::Request();
$req.status = 200;
$req.content = $content;
$req.out();
Current Status
• Initial lexing / parsing done.
• Language specification on its way.
• Still figuring out problems.
• Abstract Syntax Trees (AST) can be
generated.
Slide 14
Slide 14 text
$./saffire test.sf --dot test.dot
Slide 15
Slide 15 text
What’s next
• Finish the language specification.
• Bytecode optimization phase (?)
• Create the interpreter.
• Create a more stable lex / parse system.
• ???
• Profit
Slide 16
Slide 16 text
Stable release?
• Depends on the help!
• Not until somewhere (late) 2013.
• Roadmap hasn’t been created.
Slide 17
Slide 17 text
We need YOU...
• C programmers, but many, many others for
websites, documentation, language
specification, testing/QA, app writers,
framework writers, evangelists, etc, etc..
• USERBASE!
• If you can read this, you can help us!