Hidra

May 10, 2009 by atdrez

Yesterday I decided to restart an old project called Hidra. Hidra is a very high-level programming language like Python and Ruby that I created some years ago. The project had only personal fun purpose and the code was never released. Hidra is a full object oriented language like Java but with the advantage of being dynamically typed and to have a more compact virtual machine due that fact. The virtual machine is very similar to JVM but with 5x less opcodes. The original compiler and virtual machine code was written using Java, wich reduces the performance a lot. So the idea is to recreate the virtual machine using C++ and for now I’m planning to recreate the compiler as a prototype using Python to have less code and more flexibility to change the grammar.
I spent the last 2 days recreating the virtual machine in C++ and it’s now almost fully functional, but there are a lot to be done in order to be stable. It needs also a garbage collector and debugging support. I will reserve some hours during weekends to work in the project.

The main purpose of the project now is to have a lightweight interpreter that could be used for C++ applications to embed scripts. This could be useful for description languages like Qt Declarative UI and also to create AI scripts for games. Regarding the lightweight/optimized feature, there is a devil in my shoulder telling me to replace the virtual machine to an AST interpreter, in other words start the project from scratch. Maybe I’ll do this, because it’s the simpler way and it would allow more optimizations to be done. But for now I’ll focus on features and syntax changes to consolidate the language.

Below is a Hello World example using the current Hidra syntax (unnecessarily big just to show a little more).

class HelloWorld
{
    var helloText;

    public static function main(args)
    {
        new HelloWorld("Hello World!").say();
    }

    public HelloWorld(text)
    {
        helloText = text;
    }

    public function say()
    {
        System.println(helloText);
    }
}

As you can see the current syntax is similar to JavaScript, but with a more solid object orientation. I pretend to maintain the grammar as simple as possible with some small changes to get a cleaner look (maybe more python like).

I’ll send some posts to give feedback of the progress. Stay tuned!

Video Wall

March 15, 2009 by atdrez

After watching the Core Animation Demo presented by Steve Jobs. I decided to create the same wow effect using QEdje, just for fun.

The original video is so amazing that you could almost think that there were hundreds video player instances running at the same time, even your common sense saying the opposite.

I think the trick applied was to strip some frames from the videos and to create a live thumbnail for each video containing few seconds of animation.

To achieve that I created a script that read some frames from a given video and creates an animated edje object. I’ve created also a demo that simulates the original presentation, creating a wall of 1000 video previews running at the same time. It shows how easy we can create such effect with no more than 160 lines of python code.

The source of the demo and the generator script can be download here.

(Note: In order to be smooth you must run this demo using raster or opengl graphics system that is available in Qt 4.5)

And here is the final result:

(Note: The demo chooses randomly the wall pattern from a small set of previews, so in the video above you can see duplicated previews. But if you have time and enough memory you can generate several thumbnails in order to fill the wall)

QtKinetic

December 13, 2008 by atdrez

It has been some time since my last post.
I have to create tasks to post more often because sometimes I even forget that I have a blog :) .

I’ll post a very old news, but still recent for the public, the QtKinetic project.

The time that we spent in Trolltech was really great. We arrived just at the pre release of the Animation API, and we could just take a glance at what we could expect for the new Qt Framework.
We helped during the Animation API review with sugestions and user experiences and we talked about the QtKinetic project, at that time not public yet. We shared some performance issues with the Trolls and some use cases of rich uis.
We spent most of the time with Andreas and Marius sharing ideas and we could watch the warm up for the Dev Days and it was really great :) .

All I have to say about the QtKinetic is that it rocks! It’s is simple and powerfull, and the most important it’s extensible. We will be able create our fancy widgets and just place them in the theme keeping our own set of widgets. Creating an iPhone like application in weeks. For Edje lovers like me, it will be possible to place your widgets on the screen using relative positions with layouts, and layout animations are on the roadmap too.

We hope to help as much as we can in the next year with the project. After finishing some internal projects. It will be great to see it running on mobile devices fast and smooth.

Talking about performance, the Trolls are working hard on that. I’m not very up to date with the recent commits. Some time ago I sent a patch to Aryia to solve a segfault in raster engine using 16 bits, and I think it’s already on the mainline. We can now run the raster engine on the N800. The results are not so impressive but I think it will be great after some fine tuning.

But we still hope not depending on raster for the next Nokia devices. I pray for that. So we can create really amazing and blazing fast animations using gl.

QEdje demo

August 12, 2008 by atdrez

This is a presentation tool that we made for akademy.
It’s coded using QEdje + QZion. It shows some cool effects that it’s already possible to do with QEdje and some QZion extra widgets.



Click here to see this video with high quality

QEdje

July 19, 2008 by atdrez

This is my first post, and I will talk about the QEdje project that will be presented next month in Akademy 2008 at Belgium.
The QEdje is a scripting language used to separate code from interface and to speed up the development of applications with beautiful interfaces.
The basic idea of the project is to port the original Edje (used by EFL – Enlightenment Foundation Libraries) to Qt. We, at INdT (Nokia Technology Institute), are planning to release a QEdje version with basic supports probably on the beginning of the next month.
Our plan is to give full Edje support until the end of the year for Qt. To have the same facilities that we had using Evas/Edje in our last projects, like Canola for example (http://openbossa.indt.org.br/canola/).

The great thing about QEdje is that we can combine the best of both worlds. Using Edje to create beautiful interfaces and still using Qt widgets embedded whenever necessary (for example: inputs, webkit browser, …).

Some of the bottlenecks that we are still facing resides on Qt Canvas. Most of the code generates a great overhead on small devices like n800, and to reach a performance near to the Evas performance, some optimizations must be done inside Qt code. But the great news is that INdT and Trolltech are planning to create a code camp for us, probably in September at Norway.

QEdje runs over a lightweight engine called QZion that is an extension of KGameCanvas. The first idea was to use QGraphicsView as the base engine for QEdje, but due the lack of performance on device, the use of QGV was postponed. But the good thing is that we can change QZion backend to use QGV with no much effort in the future, when its performance improve.

On the next post, I will demonstrate some demos using QEdje. Stay tuned!