hecl icon indicating copy to clipboard operation
hecl copied to clipboard

Embedment tutorial

Open JoseskVolpe opened this issue 3 years ago • 8 comments

I would like to embed Hecl in my J2ME project, UndertaleME, but there doesn't seems to be a documentation explaining how do i embed it on a Java application... And i really like your language There's a lot of directories on the home, so it looks a bit confusing to me

JoseskVolpe avatar Sep 06 '21 21:09 JoseskVolpe

Please read the INSTALL file and try 'ant packageCommandline'. This used to build a version which can be used with J2SE on the desktop. It seems that nobody has tried it for many years :-(

wkechel avatar Sep 07 '21 09:09 wkechel

Hi,

midp20/Hecl.java is the 'main' application for the midlet example. It shows how the midlet gets started up and creates a Hecl interpreter. You could take that and modify it or use it as an example.

On Mon, Sep 6, 2021, 14:18 JoseskVolpe @.***> wrote:

I would like to embed Hecl in my J2ME project, UndertaleME https://github.com/JoseskVolpe/UndertaleME, but there doesn't seems to be a documentation explaining how do i embed it on a Java application... There's a lot of directories on the home, so it looks a bit confusing to me

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/davidw/hecl/issues/8, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABHSCYVL2IDLRX3J5ZVBTUAUVZNANCNFSM5DRCWY4A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

davidw avatar Sep 07 '21 14:09 davidw

So after years, i'm gonna be the first to try :3 That's so much a cool project to just be left abandoned =^w^= I was thinking in create a custom language for that project before, and how i would be doing that (wich i had no idea). That's so good i've found this project so i'll not need to reinvent the wheel

midp20/Hecl.java is the 'main' application for the midlet example.

¡Thanks a lot! I'm gonna look that

JoseskVolpe avatar Sep 07 '21 18:09 JoseskVolpe

I'll notify when i manage to embed that :3

JoseskVolpe avatar Sep 08 '21 08:09 JoseskVolpe

Well, i have another doubt... I have added org.hecl package to my project. There is some errors in the scripts

But on these scripts, there's condition statements similar to what is used on C when using importers or defining constants. Java doesn't support this, and they're also into comments, so they are just ignored. There's something like this in almost every script: public //#if cldc == 1.0 abstract //#endif class DoubleThing extends FractionalThing {

¿Sould i manually check them and remove these lines according to my needs?

JoseskVolpe avatar Sep 09 '21 00:09 JoseskVolpe

image

¡Also, i managed to use it on terminal!

JoseskVolpe avatar Sep 09 '21 00:09 JoseskVolpe

image

I just managed to compile it, finally I had to set JAVA_HOME to OpenJDK 1.8 and download a older ant binary Although it compiled the full demo, that was not what i intended lol

But i could embed it as a library, yay I'm gonna remove useless classes soon to decrease size, i would like to try it as it is first and implement UndertaleME Hecl methods

image

JoseskVolpe avatar Sep 09 '21 04:09 JoseskVolpe

I'm beginning to make progress x3

https://github.com/JoseskVolpe/UndertaleME/blob/Engine/src/josesk/javameengine/hecl/commands/SpriteCmd.java

JoseskVolpe avatar Oct 14 '21 22:10 JoseskVolpe