简体   繁体   English

HAXE; 是否可以将代码转换为Ruby?

[英]Haxe; Is this possible to transpile a code into Ruby?

I'm planning to write API client for *aaS system (SDK). 我打算为* aaS系统(SDK)编写API客户端。 IMO Haxe is one of the best choice to handle this situation. IMO Haxe是处理这种情况的最佳选择之一。

How can I transpile the code into Ruby one? 如何将代码转换为Ruby之一? (Haxe doesn't seem to support it for Ruby.) (Haxe似乎不支持Ruby。)

Any ideas? 有任何想法吗?

There is no official Ruby target for Haxe. Haxe没有正式的Ruby目标。

However I remember that someone once started one. 但是我记得有人曾经开始过一个。 You might want to contact this author about his progress on this target: 您可能想联系这位作者,了解他在此目标上的进展:
https://github.com/HaxeFoundation/haxe/issues/2394 https://github.com/HaxeFoundation/haxe/issues/2394

If you need to use Ruby for a professional solution, you might consider contacting the Haxe Foundation for a support plan: https://haxe.org/foundation/support-plans.html 如果需要将Ruby用于专业解决方案,则可以考虑与Haxe Foundation联系以获取支持计划: https : //haxe.org/foundation/support-plans.html

The simplest approach might be to compile your Haxe and embed HashLink or C++ within your Ruby. 最简单的方法可能是编译Haxe并将HashLink或C ++嵌入到Ruby中。

https://www.amberbit.com/blog/2014/6/12/calling-c-cpp-from-ruby/ https://www.amberbit.com/blog/2014/6/12/calling-c-cpp-from-ruby/

Talking between Ruby and C++ seems to often be implemented using FFI in a similar way to how hxcpp communicates with native c++ code. 似乎经常使用FFI在Ruby和C ++之间进行对话,其方式类似于hxcpp与本机c ++代码进行通信的方式。

http://old.haxe.org/doc/cpp/ffi http://old.haxe.org/doc/cpp/ffi

New approaches to mix Haxe hxcpp with c++ can be found within the SnowKit community and might give you ideas on how to connect hxcpp with Ruby. 在SnowKit社区中可以找到将Haxe hxcpp与c ++混合的新方法,并且可能为您提供有关如何将hxcpp与Ruby连接的想法。

https://snowkit.github.io/linc/ https://snowkit.github.io/linc/

with more docs on haxe c++ also hosted by SnowKit community SnowKit社区还提供了有关haxe c ++的更多文档

https://github.com/snowkit/hxcpp-guide https://github.com/snowkit/hxcpp-guide

It might be that you can embed other haxe targets within Ruby like Lua, but as already stated Haxe does not currently provide a Ruby target. 可能您可以像Lua一样将其他haxe目标嵌入到Ruby中,但是如上所述,Haxe当前不提供Ruby目标。

Using other targets with Ruby might be achieved via FFI or similar. 可以通过FFI或类似方法将其他目标与Ruby一起使用。

https://github.com/jmettraux/rufus-lua https://github.com/jmettraux/rufus-lua

https://github.com/halostatue/rubypython https://github.com/halostatue/rubypython

... ...

But may depend on the versions Haxe targets, a HashLink ( typed c vm ) bridge might require the most minimal connection but there is very little docs on this target so it maybe hard to setup ffi to ruby. 但是可能取决于Haxe目标的版本,HashLink(键入c vm)桥可能需要最少的连接,但是此目标上的文档很少,因此可能很难将ffi设置为ruby。

Probably not relevant but also came accross Haxe -> Ruby 可能不相关,但也出现在Haxe中-> Ruby

https://github.com/Peekmo/ruhax https://github.com/Peekmo/ruhax

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM