Loadable native modules

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
jjlong
Posts: 5
Joined: Tue Feb 24, 2015 9:36 pm

Loadable native modules

Post by jjlong » Fri Apr 24, 2015 8:21 pm

What is the current status of loadable native modules? I see the example on the github branch 'loadable-native', and it works, but I am lost when it comes to understanding how to go about implementing anything other than the simple add1 function provided. I have existing C code that I would love to be able to call from within micropython.

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Re: Loadable native modules

Post by Damien » Fri Apr 24, 2015 10:01 pm

That functionality is still work in progress. It needs some thought in how to make a compete and future proof ABI.

It's very easy to interface with existing C functions just by including them in the build. Take a look at any of the module or classes in stmhal/ for inspiration. It's easy to call Python from C, or be called.

Post Reply