FlowerScript?

FlowerScript? aims to be lightweight, simple and fast scripting language implemented in D. It started with the main purpose to replace PHP for web applications because 1) PHP syntax is... sux 2) PHP is heavy and slow 3) PHP's stdlib is C-like, which means not OO, which means a lot of typing 4) PHP is not flexible at all (for example, see how dynamic functions are implemented); Now the focus has shifted to general purpose language, but the web remains as a goal.

I like the simplicity and flexibility of JavaScript? so FS feels a lot like it (and is natively compatible with JSON), but does not aim for full EcmaScript? compatibility. I've simplified some things where I see fit. There are also some additions from D, like array slicing, foreach loops as well as some fresh ideas. I also like Tango/mootools style libraries, so I will try to make the stdlib similar to these.

Status

Currently, the language is being rewritten from scratch (for the third time). What is in the trunk is revision 2, which is now obsolete and will be deleted, when the third revision is published. It looks like there will be no more rewrites since I am quite happy with the performance.

The third revision is not yet complete but behaves very well so far. It performs really fast but has some more work to be done. Namely some features are not complete and the binding library, which is very important, is not complete too. And there are some questionable areas regarding the design. Otherwise the language is generally working good. I will not upload anything until at least the binding library is complete. If someone is interested in the language and/or helping in its development give me a note and I will upload the new sources.

Features/Goals

  • C family syntax; as simple and flexible as JavaScript? and beyond
  • General purpose
  • Dynamic typed
  • Strong type checking (this behavior could be overloaded)
  • Values passed by reference (except for numbers and booleans)
  • Prototypes
  • Fully customizable
  • Embeddable in HTML
    • As usable for web applications as PHP but lighter and faster
    • Built in encryption, decryption, optimizer and bytecode caching (i.e. no need for things like Zend optimizer/encoder)
    • Usable outside web applications
  • Easily extensible from D
  • Small source base, free from bloat, thus
    • Lightweight
    • Fast

Technical

FlowerScript? is implemented in D, using the Tango library. Its stdlib will be heavily influenced and based on Tango.

Examples

See the testsuite for examples. Try browsing it backwards, because the most interesting examples are in the end.

Credits

Credits go out for Jarrett Billingsley for his bindings library for MiniD, which I mostly leeched for FlowerScript?.