Script language with power of Java!

If you had to create a prototype of mobile application quickly, many of you would probably choose Python - someone may justify this choice by pointing out that you can write and run the code (script) immediately on the device and that other similar solutions aren't so integrated with smartphone's advanced functions. For simpler tasks you can choose Perl, Ruby, Opl (or some others). Such solutions have one substantial drawback - they need operating system to work on, in this case - Symbian. Recently, I've found interesting Java based option (it works with J2ME, MIDP + CLDC based devices). It's called HECL and it's an open source project.


Hecl derives simple, flexible, command based approach from Tcl and it's easy to learn even for people who aren't programmers. Of course, Hecl isn't a 'replacement for Java', but I find it as a complementary approach to Java. It's unlikely that an entire software would be written only in Hecl, so it's interesting how you can integrate Hecl and Java. Generally, there are two ways of doing this:

  • calling Hecl from Java - to utilize Hecl code from Java, you need to initialize the interpreter and then use it to evaluate the code
  • creating Java Extensions for Hecl - write your program in Hecl and add Java extensions to perform specific tasks. This model is very popular with mature languages like Tcl, Ruby and Python, where the scripting language contains all the functionality necessary to write a fully functioning system, and extensions (usually written in C) are needed only to deal with specific tasks.

You can use Hecl for example to script some configuration, automatically get the updates of the application just by downloading a text file (self-updatable script); one interesting thing is that you may have more than one of the interpreters at a time (in java code).


Source: Forum Nokia Blogs

0 comentários:

top