Summary
I've just uploaded the latest Heron version which now supports classes, structs and delegations
Advertisement
In the previous version of HeronFront a class would have to be written in C++, and the interface (previously a "trait") would have to be written in Heron. Well that was kind of confusing to say the least, so I finally managed to get the HeronFront translator to handle classes. A Heron class looks more or less like a class in C++/Scala/Python:
In a class all fields are private, while in a struct all fields are public. This is intended to assure that the interface of a class is only made up of functions. This may lead to other features in the future, like the ability to ellicit an interface from a class.
The _eq, _plus, and _plus_eq functions are operator overloads. The _init function is the constructor. There are a few extra neccessary semicolons (why they are needed is a very long story related to the future ability to pass code-blocks to macros).
The delegation specification automatically generates functions which forward an interface's required functions to a member field.
The latest version of HeronFront is very unstable, but I posted it to http://www.heron-language.com/downloads.html for anyone who might be using the HeronFront / YARD code base for their own work.
For the time being I have to figure out why my vlist-based string class is so much slower than the GCC standard library implementation of a string!
> For the time being I have to figure out why my vlist-based > string class is so much slower than the GCC standard > library implementation of a string!
In turns out I was comparing different compilers! The speed is essentially the same, but the lines of code is a fraction of the size.
I plugged HeronFront into my C++ IDE (Dev-C++ which is for available for free at http://www.bloodshed.net/ ) and it works really well.
Anyway things are starting to roll finally, look out below!