Archive for the ‘eC’ Category

Ecere SDK 0.44: Open Source Release

Friday, March 9th, 2012
I have the great pleasure to announce that the official version 0.44 of Ecere, codenamed “Ryoan-ji“, is now available.
It is the first “official” Open Source release of Ecere (not a draft, or preview).
The Windows installer is available at:
 https://launchpad.net/ecere/trunk/0.44/+download/setup-ecere-0.44-win32.exe
Our Ubuntu Linux PPA on Launchpad is at:
 https://code.launchpad.net/~ecere-team/+archive/ppa
To add our Ecere PPA to your Ubuntu system you can simply do:
sudo add-apt-repository ppa:ecere-team/ppa
sudo apt-get update
And then to install the Ecere SDK:
sudo apt-get install ecere-sdk
The source tarball for the Ecere SDK 0.44 is at:
 https://github.com/ecere/sdk/tarball/0.44
It took us some time and great efforts to get there, but we now have what should be a stable and complete release. A quick history of what happened since 0.43 (September 2008):
  • In December 2008, we had released a first open-source draft, 0.44 draft 1, which could bootstrap itself from GCC.
  • In March 2010, we released 0.44 preview 1, with some new features, bug fixes, and new bugs. We also got a new website design, with new phpBB forums.
  • In May 2010, we adopted Git as our version control system. Our source repository is hosted on GitHub at http://github.com/ecere/sdk
Both 0.44d1 and 0.44pre1 had some issues, and were lacking a Windows installer and proper Ubuntu PPAs.
Now all this is fixed, and it should be a breeze to get the Ecere SDK installed on your system in no time at all, to try out all the cool samples and features!
What’s new in this version:
  • Native Window decorationstoolbar and tool tips
  • new JSON-based .epj project format and powerful project settings, with powerful per File X Config X Platform Project Settings
  • Internationalization support, with Chinese and Spanish available by setting the LANGUAGE environment variable to zh_CN or es_ES
  • SQLite and Oracle drivers for Ecere Data Access (EDA)
  • Improved eC Distributed Objects
  • Less memory leaking on parsing code
  • Line Numbers in the Code Editor
  • Settings for multiple compilers (e.g. allowing to set up cross-compilers, different GCC versions…)
  • Support for ccache and distcc to speed up your builds
  • New Credits and License dialogs for the About box
  • A bunch of new samples, PowerPoint Tutorials and extras (SSLSocketAudio, WIA Scanning…)
  • Coursework to accompany the Tao
  • A new updated Windows installer, with MinGW (GCC 4.4.0 and GDB 7.0 were selected for working best)
  • PPAs for Ubuntu working on both 32 and 64 bit machines, for Lucid Lynx, Maverick Meerkat, Natty Narwhal, Oneiric Ocelot and Precise Pangolin
  • Numerous tracked issues were resolved, see the complete list at:
    http://ecere.com/mantis/changelog_page.php
A much needed README was added to the source tree, you can read it online at http://github.com/ecere/sdk#readme

For those of you who do not yet have an account on the forums, and wish to register, please let me know of your user name for activation, because I unfortunately cannot distinguish spammers from real users.

Now that internationalization support is complete, I would like to invite you all to contribute a translation of Ecere in your native language.
You can use the nice collaborative interface on Launchpad for this purpose, at:
 http://translations.launchpad.net/ecere
An article I wrote on Cross-Platform Development with the Ecere SDK will be featured in this month’s issue of theSoftware Developer’s Journal - http://en.sdjournal.org/ .
It should come out within the next week, I invite you to check it out. It’s an excellent introduction to coding in eC with the Ecere SDK!
For an overview of what lies ahead for Ecere, you can take a peek at:
 http://launchpad.net/ecere/+milestones
We will now focus on deploying Ecere applications on the Android platform.
All the best,
Jerome

The Ecere SDK and eC go Open Source

Thursday, December 25th, 2008

Hello everyone, sorry for the very few updates in the past few months.

Much development has happened lately focused on what has always been the calling for Ecere: a Free Open Source Software status, as well as a greater facility to deploy across multiple platforms.

The next major release (0.44) was to reach these objectives, and I was hoping for it to be ready earlier this fall.

Unfortunately things moved a little slower than expected, but I still have a present for the enthusiasts on this Christmas day: a fully automated self building Ecere source package. It makes use of a much improved bootstrapping system (thanks Joey Adams for thinking it through) directly generated from the actual eC sources of the compiler.

Recent work was done to test and improve the support for platforms such as Mac OS X and big-endian systems (such as PowerPC, PlayStation 3 Cell processor, SPARC machines, …). I will call this a Source Draft, because it has not undergone much testing yet (although this SDK version is what makes up my own development tools). I will not provide binaries at this moment either. An official 0.44 release should follow up within the next few weeks. This draft release however marks the very first officially open source (under the revised BSD license) Ecere SDK release.

Contributions will be most welcome, and much efforts will be put in the coming weeks to increase the support for a community by establishing a clear roadmap, improving the web site, and coordinating interested developers. You can help us make this upcoming release the most stable Ecere SDK to date. Please note that any contribution will need to have its copyright renounced to Ecere, which will then relicense the code to everyone under the BSD license.

Despite being mainly a the first open source release, this new version features many improvements such as an automatic bootstrapping/build system, an SQLite driver for the Ecere Data Access system, additional IDE configurations enabling the integration of cross compilers, lots of bug fixes (most likely some new bugs as well) … and a tab control.

Download Ecere SDK 0.44 Draft 1 Sources

Merry Christmas, and I wish you all a wonderful year 2009, may you find internal peace and happiness in these fast pace and often challenging times.

Ecere SDK 0.43: Templates, Syntax Highlighting…

Wednesday, September 3rd, 2008

After a lot hard work, I am pleased to announce the release 0.43 of the Ecere SDK. Download links follow:

For Windows:

Ecere SDK 0.43 for Windows – September 3, 2008 (36 MB)

If you already have MinGW installed on your system (or if you already have an earlier version of the Ecere SDK installed), you can chose the following significantly smaller package instead. Note that it doesn’t contain GDB and UPX either.
Ecere SDK 0.43 (No MinGW/GDB/UPX) for Windows – September 3, 2008 (7 MB)
If you chose this smaller package, make sure that the MinGW executables are either in your PATH or in the IDE’s File/Global Settings/Executables paths so that they can be found by the build system. Also, the IDE will be looking for a “make.exe” (rather than a mingw-make.exe).

For Linux:

Ecere SDK 0.43 for Linux (Generic binaries) – September 3, 2008

Please read the INSTALL file for instructions on how to install the generic tarball and for general notes on operation under Linux.

Ecere SDK 0.43 for Debian/Ubuntu – September 3, 2008
The samples will be located in /usr/ecere/samples/ .

Ecere SDK 0.43 for GoboLinux – September 3, 2008
(Add http://www.ecere.com/gobo/packages/MANIFEST to your official repository and run InstallPackage Ecere)
The samples will be located in /Programs/Ecere/0.43/samples/ .

Additions to the eC language

This release main highlights are class templates as well as standard collection (container) classes which have been added to the eC language. This functionality represents major work which had actually started in the the earlier releases as well, and finally is ready in this new version.

Templates

Class templates make possible generic/meta programming.

The approach of eC towards templates is unique in that it is completely dynamic. A template class is in fact declared the same way as (and no different from) a regular class, but specify “template parameters” to be parametrized. It is dynamic in that the class as it is can already deal with any parameters the class template could be used with, even if that parameter refers to for example a class not defined within the module of that template.

eC classes can exist within a shared library, or an eC source file and it can be used across multiple modules without the need for header files. The same is true for eC class templates, which do not require any additional compilation for use with different parameters. Only a single piece of code for the actual class templates and its functions exists, just like for any other eC class.

This “no recompilation” approach templates makes for smaller code size, but may scare some about its performance. However, in practice this should be minimal, since many optimizations are being applied, and more optimizations should come as we benchmark the eC dynamic templates approach. These new templates have worked and performed nothing but extremely well so far.

Classes can be parametrized using any number of three types of parameters: data types, expressions (e.g. specifying a constant value), as well as identifiers (Which can currently identifier a data member, but will be extended to properties and methods as well).

The templates are very powerful and support even complex cases with recursions as in the following example:

class A : B<A> { int a; }
class B<class T> { T test; }

Containers

The standard container classes included in this release are “typed” class templates to replace the previous “non typed” container classes (List, BinaryTree, and pseudo-template Array, which will be slowly phased out. In the meantime List has been renamed to “OldList”, Array to “OldArray”, and Link to “OldLink”). The new containers are all derived from a base “Container” class from which all containers should derive in order to benefit from generic iteration and new eC syntactic sugar. The provided default containers cover dynamic arrays through the new Array class, link lists through the new classes List and LinkList, associative arrays through the new class Map, as well as AVL trees (a particular type of self balancing binary tree) through the new classes AVLTree and CustomAVLTree. It is somewhat analogous to a subset of the Standard Template Library and its corresponding classes such as std::vector, std::list and std::map, though I believe eC’s approach is generally a lot more elegant.

The syntactic sugar for containers include the array notation, e.g. [ 1, 2, 3 ] to denote a container containing the three integers 1, 2 and 3. It also introduces a “foreach” syntax using the regular for keyword in a new way. The following will print all i in array which are greater than 1:

Array<int> array { [ 1, 2, 3 ] };
for(i : array; i > 1) PrintLn(i);

Notice how i (which takes the type of the array elements) does not need to be declared. Iterating can be done generically (not knowing what kind of container we’re dealing with) using the Iterator class, for example in the following manner:

Iterator<int> i { array };
while(i.Next()) PrintLn(i.data);

The indexing operator can also be used directly with the container classes. The following example can be used to count the occurrences of strings, assuming it is repeatedly called with “s” being each string to count. Notice how wordCounts is indexed with “s”.

Map<String, int> wordCounts { };
wordCounts[s]++;

The container classes can also be used to iterate through infinite collections, or through data contained outside the actual container class. Please look at the ContainersTest sample in the samples directory for additional examples, including iterating through the Fibonacci series.

Print / PrintLn

You might have noticed the PrintLn function which is now available to print to the standard output any data type followed by a newline. The equivalent function Print does the same without printing the new line. Furthermore, these functions can take any variable number of parameters which can be of different types, and it comes in various flavors (inside the File class, PrintBuf/PrintLnBuf, PrintString/PrintLnString). The following demonstrate the elegance of this new tool:

int a = 3, b = 4;
PrintLn(a, " + ", b, " = ", a + b);

 Other improvements

Another very enjoyable improvement is much improved syntax highlighting inside the IDE’s code editor, as well as some tweaks to the way the editor works which can be changed in the File/Global Settings dialog.

Many bug fixes and other issues were resolved inside the IDE, notably relating to the debugger integration. The debugging functionality should now be very useable under both Linux and Windows.

I’m also happy to provide new packages available for specific Linux distributions, such as Gobolinux (my personal favorite to which I switched my main development station – www.gobolinux.org) and Debian/Ubuntu.

Ecere Communicator as well as Acovel Media Player have been slightly updated for the new release, with some minor fixes along the way not justifying new versions. Here are the download links:

Acovel Media Player 0.01 for Windows
Acovel Media Player 0.01 for Linux

Ecere Communicator 0.02 for Windows
Ecere Communicator 0.02 for Linux

Posix Regex

Wednesday, March 12th, 2008

Hi there!

I’m Redj, Ecere Contributor. :) This is my first post and I hope to be posting more and more as I have interesting news to report or cool code snippets like I have today.

Here is an early implementation of a Regex class the ecere way…

Download Regex.ec

Just add Regex.ec to your project and use it as follows:


import "Regex"

void TestRegex()
{
   char * result;
   Regex regex { "[abc][xyz]", true };
   if((result = regex.Match("match me aZ I am")))
      printf("we have a match: %s\n", result);
}

Note that at line 6, “[abc][xyz]“ sets the regex property and true sets the caseInsensitive property.

If you need the POSIX Regex extended syntax, just set the extendedSyntax property to true. Do the same for the newLineException, lineStartException and lineEndException properties if you need them. If you don’t know what they are, you probably don’t need them.

For Windows users: Note that in order to use this class, you will need to download the user contributed mingw regex library mingw-libgnurx-2.5.1-bin.tar.gz and extract it’s contents (libgnurx-0.dll) to Ecere SDK’s bin directory. You will also need this regex.h file to be present in mingw’s include directory.

For Linux users: Make sure your include paths are correctly set to find regex.h and you should be all set.

If you need assistance or would like to give use feedback, join us in #ecere on freenode.net or visit the forums and wiki (see links in the Ecere section of the sidebar).

That’s it for now. Enjoy!

Posted by Redj

eC Programming Guide Section Completed

Wednesday, February 6th, 2008

It has been more than a month since the last blog post, but both sections 1 and 2 of The Ecere Tao of Programming are finally completed. The first sections teach mostly the aspects that eC shares with C, while at the same time pointing out the innovations of eC. The second section teaches the object oriented concepts introduced with eC.

These sections together are intended to teach eC programming to both new programmers and experienced programmers alike (regardless of the background experience, be it C, C++, C#, Java, VB…). They therefore make up the official eC programming guide.

The remaining sections of the book will focus on teaching the various functionalities available in the Ecere SDK, such as the GUI toolkit and 2D/3D graphics engine.

Ecere programming book, Happy Holidays!

Saturday, December 22nd, 2007

I realize it has already been two weeks since the last blog entry. I’ve previously mentioned I would resume the work on the Acovel Media Player as well as improving the IDE’s code editor (Undo is still a blatantly missing feature…). These things are still high in priority, but I started working on a new project which should turn out very valuable. Thus those goodies will not be ready in 2007 as I would have hoped, but they’re still coming sometime soon in the new year.

About the new project, despite the abundance of good samples, I believe the lack of documentation is a major reason for people hesitating to jump on using eC and the Ecere SDK. Filling up the API documentation reference would certainly be helpful, but I think an in depth guide on how to use these various technologies available in the SDK would be even more useful. That is why I decided to start writing a book.

The Ecere Tao of Programming will teach programming from the ground up, making use of all the tools making up the Ecere SDK. I haven’t totally decided yet on the distribution method, but I would like to print and publish hard cover editions. You can take a look at an excerpt from the first chapters as well as an overview of the table of the contents for the book here. The intent is for the book to be a thorough Programmer’s Guide for the SDK, while at the same time it should be able to teach basic programming using C and eC to previously non programmers. It will also cover advanced programming concepts such as 3D graphics, multithreading, networking and much more.

I would like to wish everybody very happy holidays, and a wonderful year 2008. Also, special thanks to every current and future Ecere SDK users for their support :)

On eC Properties and Automatic Conversions

Thursday, October 25th, 2007

Today I want to talk to you about eC properties, as well as conversions properties which reveal their true power… As you may know, eC places a lot of emphasis on properties. Properties are sort of half-way between methods and data members. They provide methods to “set” or “get” the property of an object, which is often stored internally in a data member. eC has one of the cleanest syntax for defining properties:

class Pen
{
   Color color;
   public property Color color
   {
      get { return color; }
      set { color = value; }
   }
}

In eC, class constructors never take in any parameters. Instead, eC relies on the initializers passed through instantiation. These can either be data members or properties. Here is how one could set the color property for a Pen object:

Pen pen { red };
Pen pen { color = red };

Although functionally equivalent to Set and Get methods, properties behave exactly like data members (with some limitations, such as not being able to obtain their address). For example,

pen.color = ~pen.color;
pen.color += 10;
pen.color.r = 255;
pen.color = 0xFF0000;
pen.color = { 255, 0, 0 };

These all go through the Set/Get methods to do their work. Notice here that the Color class is an eC Bit Class, which allows to be accessed both as a “unit type”, such as setting it to 0xFF0000, and as a “structure type”, when accessing the r member or using the curly brackets initializers.

The advantages of properties are multiple. First, they allow for instant visual feedback, for example in the case of the Ecere IDE’s Object Designer. The IDE has a property sheet in which you can visualize and change the values of properties, and get instant feedback in the visual designer window. The IDE’s Object Designer is extremely powerful and versatile. Currently, it is only used for the Form Designer, which is itself bundled inside the Window class of the runtime library. However, third parties could easily integrate into it to enable to visually represent and edit their own classes. The property editor as well as the code generation & parsing system will automatically be usable to those ends. This system all relies on the properties and was the original reason for designing eC and the Ecere Component Object Model.

Second, properties present this layer of protection over the data members. A property can be made public whereas the data member actually used to store the property can remain private. Properties can also only contain a Set or a Get method, therefore making it write-only or read-only. A property can also return or set a value which is not stored exactly as such in the class. This brings us to a special case of eC properties, the Conversion Properties.

Conversion properties are specified with only a data type, and no “name”. For example, a Radians property in the Degrees class allows to set a Radians value to a Degrees angle. eC will resolve cascading conversions to convert from one type to another. This is what enables the following magic:

pen.color = ColorHSV { 0, 100, 100 };
pen.color = ColorLab { 53, 79, 66 };
pen.color = ColorCMYK { 0, 100, 100, 0 };

Beautiful isn’t it? But what is really wonderful is that all this is done at compile time. Therefore this is not any slower than providing the color in RGB format, as the eC compiler will do all conversions and store the proper hexadecimal value here for the color. Like most class constructs, properties (including conversions) can be used in any kind of eC data types (structs, classes, units, enums…). However, they play a major role in the Units, to establish the relation between different compatible units, often allowing to perform the same functionality as overloaded operators would in other languages such as C++. It is therefore a very powerful tool which can save considerable amounts of code, since you don’t need to provide the implementation for any operator.

Dynamic Arrays (Similar to C++ std::vector)

Monday, October 22nd, 2007

Here is an early implementation of a dynamic array for Ecere…

It is most likely a interim solution until truer “templates” make an apparition in eC.

Download Array.ec

(Please don’t mind the obscurity of the internals. Like all things, it’s impermanent.)

You would use it as such:

import “Array”

public class ArrayPoint : Array
{
type = class(Point);
public Point * points;
};
void Test()
{
ArrayPoint points { size = 10 };
points.points[0] = { 10, 10 };
points.size = 20;
points.points[19] = { 5, 5 };
delete points;
}