Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If only they could just add a very easy way to invoke functions (at least those with simple interfaces, i.e. taking just simple value types as inputs and returning a simple value type) from other languages (incl. Java and Python) this would already be a huge value boost even if performance would be not perfect.


Well, if you can get a C-compatible pointer to those functions you're already ready to go, and the inverse is true if those languages can consume C-compatible function pointers.

So from python you could probably flex to use ctypes, and from java, JNI. Naturally this is a bit awkward but I expect the mono binding tools would help smooth it over for Java (I have no idea about Python there.)


I know it's possible this way but I've mentioned "very easy" intentionally. I'd manage with what we have if I really needed it but if it was easier it could attract much more people who generally are scared away by words like JNI and C-compatible pointers.

If I were developing a program language and sought to attract more people I would consider seamless invocation of code written in other languages a strategic height.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: