Sign in to follow this  
jonnymind

A new kid on the block

Recommended Posts

Hello. I am delivering the fifth pre-beta version of the Falcon Programming Language in this days. The Falcon Programming Language is a powerful scripting language written in C++. The virtual machine is fast and compact, and the integration with the host applications is easy and kind. The language itself is quite complete, presenting many functionalities that aren't easily found in other embeddable script engines. Above every other aspect, the engine is completely modular and allows for seamless integration of source Falcon modules, pre-compiled Falcon modules and binary native modules. Falcon is multiplatform (win, linux/freebsd, mac) and internationalized. It comes with some powerful modules, as the regex and configuration parser modules; more modules (xml parsing and SQL db access) are under development. Prebeta-5 is under test in this days, and it will be packaged shortly. I have established this release as the milestone for opening development worldwide to every interested developer. We're searching for coders, but also for users and for people embedding the language in their application. If you are bored of the old things in scripting, give a try at Falcon. I can't swear it will be groundbreaking, but it adresses many issues embedders and script lanaguage users had up to date. If you are interested, visit http://www.falconpl.org and register to the forum, leaving a message there or contacting me. Or you may leave a reply here. Best regards, Giancarlo Niccolai.

Share this post


Link to post
Share on other sites
Looks real nice. Similar to Lua I guess, but better ;). I don't know if Lua has classes, so this seems like a good advantage over it, so, well done!

Share this post


Link to post
Share on other sites
AFAIK, LUA do has classes, but always AFAIK they are implemented just as a meta-grammar for dictionaries of callable items and properties. This makes a bit hard to implement interesting things as super-class references, nested and multiple inheritance, class static data and so on. Let's say Falcon OOP model should a bit wider.

Share this post


Link to post
Share on other sites
It looks pretty good! I might consider this for my next project [smile]
Btw, does your list notation allow step sizes aswell? ie

list1 = list[2:3:10] // 2nd, 5th, 8th
list1 = list[1:2:10] // 1st, 3rd, 5th, 7th, 9th

Share this post


Link to post
Share on other sites
I am not familiar at all with that syntax at all. Provided your example is correct, it seems fairly confusing.

Falcon supports list (and string) ranges (and inverted ranges).

i.e.

a = list[ 1:5 ] // a <- 1st, 2nd, 3rd, 4th
a = list[ 5:2 ] // a <- 5th, 4th, 3rd, 2nd


Ranges can also be cached into variables. I.e. the above is equivalent to

r = [1:5]
a = list[ r ]

Share this post


Link to post
Share on other sites
A little insight from Lua...

Lua is based on tables, which are a lot like hash maps (dictionaries). All values, including functions and tables can be stored in a variable or a table cell. It also supports lexical scoping (unlike Falcon). These combined gives a poor object notion, ie.

object.doStuff = function (arg1, arg2)
return arg1 + arg2 + x
end
object.x = 23

However, it also supports a concept called meta-tables, which allows you to define the behaviour of a table. One use is to define single or multiple inheritance, which can be done quite elegantly once you have the 25 line framework. See the lua-users wiki entry on it.

In general, Lua aims to be very extensible - a class system with single or multiple inheritance is just one example of what can be done easily. And it's entirely your decision if you want everything to be public or some or all member variables and functions of a class to be private.

In fact, I see nothing Falcon has that cannot be easily implemented in Lua. Maybe jonnymind could elaborate on this?

Share this post


Link to post
Share on other sites
About lexical scoping; it is currently supported only under some terms (functions, method and lambda functions have private variables, and possibly also static ones) because "arbitrary scoping" a-la-LUA wasn't liked by the developing group that started the project (mostly, by me) for various reasons. Actually, the compiler scopes the variables at an indefinite level of depth (actually, it does a great deal of effort in de-scoping global vars a-la-python), so adding a scope construct would be a matter of 1-2-3, if the community feels it is important.

I.e. I just committed in the CVS a "def" construct that forces explicit variable declaration, if the scripter so wishes (I still have to write the docs, so don't search for it ;-)

About class inheritance, LUA has enough basic constructs to provide the user with everything it may want to do. Once you have tables and once that you can fill them with anything, including functions, you can do more or less everything. There's no news in that; GTK was written in C, yet it's fully object oriented. An OOP grammar, at a typeless script level, can only make the user more comfortable in operating with some constructs; and possibly be more efficient.

Although Falcon still requires much optimization, as we are in pre-beta, knowing at compiler level the structure of the objects, and having them fixed, allows for more efficient allocation, initialization and method access, at least in theory. I.e. sparse array compression on method/class unique IDS, done on a link step which is already performed in Falcon, may reduce the access time to properties and methods to o(1) (I suppose 2 or 3 direct constant dereferences) while table/dictionary based object models require, theoretically, always a binary scan on the dictionary entries (which may change dynamically at runtime).

However, I am not starting a "this is better than that" war here. Of course, a "version 5" mature product will be better than a "going beta" one under many to every aspect. What I am offering here is an occasion to get into a growing project that may result, eventually, if there is enough interest around it, into a better product than the ones currently available, for some specific tasks, because it was planned and realized to solve some of the problems that made currently existing solutions "hard" to use to some of us.


Share this post


Link to post
Share on other sites
[quote]Original post by jonnymind
I am not familiar at all with that syntax at all. Provided your example is correct, it seems fairly confusing.
[quote]

This is how MATLAB for example handles ranges.

[from:step:to]

[from:1:to] = [from:to]

// From 1 to 10
[0:10]

// From 1 to 10, but only every other
[0:2:10]

// From 1 to 10, but only every third
[0:3:10]

// From 0 to T in N steps:
[0:T/N:T]



Not that confusing really and quite useful. However it's not such a huge drawback if not supported, atleast for game development [smile]

Share this post


Link to post
Share on other sites
OIC. No, Falcon doesn't support this grammar; however, for/to loops have positive or negative step clause, so you can easily iterate like that.

Also, as this feature looks interesting, consider the function rngSelect( a, b, c ) added to our RTL :-). (although actual name may change)

Bests,
jm

Share this post


Link to post
Share on other sites
Quote:
Original post by Ahnfelt

In fact, I see nothing Falcon has that cannot be easily implemented in Lua. Maybe jonnymind could elaborate on this?


A thing that I didn't mention in my latest posts is that being that flexible (i.e. implementing multiple inheritance through script definitions) is really good at script level. I.e. a scripter can do everything on its own.

The point is that this kind of configurability is not necessary good for the embedding application. In example, Falcon modules written in C++ can create new classes inheriting from multiple parents (and calling their constructor at proper time) even if they don't have access to the classes they inherit from, and regardless of those classes being declared in other C++ modules, in Falcon native modules or in a combination of both (i.e. falcon native module classes with some methods written in c++). I suppose that, to achieve the same with LUA, one should hack its internals or run a script which creates the classes as seen in the wiki that has been pointed out.

I may be wrong, as I studied the internal of LUA just for a few weeks, but another drawback is that resolution of those VM-emulated inheritances seems to require VM steps that are not needed in Falcon, and that are repeated for every instance that is created. Unless some of the constructors of the base classes contains Falcon opcodes (i.e. coming from Falcon modules), the creation of an instance in Falcon never requires VM steps, and is performed entirely by optimized C++ code.

In Falcon, we decided to trade a bit of flexibility at script level to boost performance in VM and flexibility at embedding application level. In example, in Falcon it is not possible to add new members to instances once they are created. Combined with the item model, this allows for lightning fast instance creation, which is actually just a flat copy of the model data plus, if needed, call of a constructor.
Actually, as you can define new classes and change the contents of the properties (i.e. making them data or methods as will), the lack of that "flexibility" hadn't been felt by anyone to my best knowledge; OTOH, the higher performance that the few "rigidities" we introduced allows for, and the other that are coming in the next releases (i.e. sparse array compression to bring down method access time to o( log n ) to o( 1 )) are greatly appreciated by the (still few) users of Falcon.

I take the occasion to announce that we are currently in bug/pack freeze for the release of preb5 version; if someone wishes to check the code out, he is welcome at http://www.falconpl.org

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this