Question

Looking over Hecl, the scripting language with a J2ME runtime, I wonder about its capabilities:

Assuming my base Midlet has methods and variables that I've written

  1. Can the Hecl interpreter run within my Midlet, and side-by-side with my classes?
  2. Can the Hecl script call any of my methods within the Midlet?
  3. Can the Hecl script utilize and modify any of my variables?

Thanks in advance.

Was it helpful?

Solution

Jeremy - at this point you'd be better off emailing me or (even better) writing to the Hecl mailing list, rather than relying on my RSS feed to notify me of SO articles related to Hecl!

  1. Yes, Hecl can run as an 'embedded' interpreter. For instance, you could write an entire app in Java and only use the interpreter for callbacks in response to events.

  2. Since J2ME doesn't have Reflection, you have to write the glue between your methods and what's available to the interpreter. It's pretty easy, though: PutsCmd.java

  3. To modify variables, once again, you'd have to provide some glue. It's not that hard though. There are ways to map back and forth between Hecl values and Java values.

In any case, I watch SO from time to time, but the mailing list or email would probably be a better place for more detailed questions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top