| Well, right now -- as a novice -- I could take a look at: http://cffi.readthedocs.org/en/latest/overview.html#simple-e... And, under IPython (python3) on Windows (I already had ms visual studio installed): import pip
pip.main("install cffi".split())
> (...)
> Successfully installed cffi-1.0.3 pycparser-2.13
from cffi import FFI
ffi = FFI()
ffi.cdef("""int printf(const char *format, ...);
""")
C = ffi.dlopen(None)
arg = ffi.new("char[]", b"world")
C.printf(b"Hi there, %s!\n", arg)
> Hi there, world!
> 17
So a lot of this is tooling, integration and documentation.If one might whip up something similar for rust that works cross platform, and results in code that is reasonably easy to distribute via pypi (and similar for gems for ruby etc) -- that'd be great. So, I meant that for a novice, that wants to, say write a compiled extension/wrapper for python/ruby whatever -- a bit of C and the standard docs go a long way now. Obviously there's a lot of work to get to the point of C (it's been ubiquitous for a while...) -- but if some parts could be made similarly accessible; interfacing with rustc, if rustc is in path/installed "properly", some magic on the host-language side etc -- that would be very good, I think. |