What is cppia scripting?

I just looked through the changelog for Haxe 3.2.0-rc.2 and found it at the end of the list of new features:

cpp : inititial implementation of cppia scripting 

Can someone tell me what that means? I can say that it has something to do with C ++, but a Google search does not give anything related to programming / scripting, except for the results related to Haxe.

+7
source share
2 answers

Cppia (pronounced sepia) is a new part of the C ++ goal for Haxe. In its simplest sense, it is a scripting language for hxcpp that can be compiled and run without using the C ++ compiler. Some official documentation can be found here:

Getting started with Haxe / Cppia

In order to compile in cppia, you need to modify your hxml build file. Add the -D cppia flag to your assembly and change the output to have the .cppia extension. Here is an example.

 -cpp out.cppia # the cppia output file -main Main # your Main.hx file -D cppia # this enables cppia compilation 

After you do this, you compile the hxml file as usual with Haxe. It will give you a file called out.cppia which can then be launched via hxcpp using the haxelib run hxcpp out.cppia . The disadvantage of this method is that it is not possible to use native extensions without building your own cppia host. Therefore, if you need to run something using OpenFL or Kha, you will have to wait until they support cppia.

According to the information I found, cppia seems to be as fast as Neko JIT. Given that compilation time is just as fast, I see that this will be a good alternative to the neko goal in the future.

For more information, see the slides from Hugh Sanderson's WWX 2015 speech.

http://gamehaxe.com/wwx/wwx2015.swf

+7
source

Only a few IRC logs were listed in the quick search. Some of them are used.

This seems to be a special output format for Haxe code that is intended to be used in development to quickly modify code. For example, when developing a game, having to recompile and redeploy your application every time you make small changes really slows down your progress. People have reported that this is a problem with iOS development.

Cppia seems to address this with specific code and a SLJIT-based JIT compiler (found in an hxcpp repo). Presumably (I came to the conclusion that from the logs mentioned above), it allows you to modify parts of your application at runtime.

However, cppia as a language is probably not intended to be used directly and is intended to be generated by the compiler.

These are the strongest clues I can come up with, and of course I will skip some details. But since this feature is fairly new, this data may not even be known right now.

+5
source

Source: https://habr.com/ru/post/986427/


All Articles