Py2cr: A Python3 to Crystal Translator
github.com
github.com
Edit: Got a quick fix from the author and got a result which is not compiling correctly out of the box, but I'd be happy to finish manually. Definitely saves a lot of typing.
I haven't worked with Rust, but I wonder if that will move into this space.
What we have today:
1) stick to languages which target a common VM,
2) hope your language supports FFI for the library's language, or
3) microservices, in the old-school fashion (piping to/from Unix binaries) or the new-school fashion (HTTPing JSON to/from containerized applications).
I mean, you may prefer one of these:
foo.each { |i| ... }
for i in foo: ...
but after fixing up the scope issues, they're the same thing.However, it is heavily based on the (abandoned?) py2rb work by Naitoh which I made enhancements to.
IMO, Rubyists should have an easier time with Crystal syntax since it is more similar. Also, the likelihood of having type annotations in Python is much higher than Ruby because type annotations have been around longer in Python, iirc.
FYI All I know about crystal is that it's Ruby with Python style syntax.
It's not. It's a language on its own with Ruby-style syntax and close-but-not-same semantics.