Search found 7 matches

by microPyforMy
Fri Mar 24, 2017 5:09 pm
Forum: General Discussion and Questions
Topic: C enviroment that can read python occasionally, is micropython what I want?
Replies: 12
Views: 8189

Re: C enviroment that can read python occasionally, is micropython what I want?

You can also take a look at LUA (nodemcu) and JavaScript (espruino) -- they are implemented for similar platforms to those on which MicroPython works, and might fit your use case better. And of course there is always that Forth ;-). Good ideas! And I appreciate it. But... NodeMCU is a port of eLua ...
by microPyforMy
Fri Mar 24, 2017 2:13 pm
Forum: General Discussion and Questions
Topic: How small can microPython get?
Replies: 2
Views: 2296

Re: How small can microPython get?

The minimal target is the smallest target. It seems to be about 150K Hmmm, I was hoping that by cutting things out I could reduce the size from there. For a whole environment on the right micro that's not bad but for just adding scripting that's really large. Thanks for the info, I'll weigh options.
by microPyforMy
Fri Mar 24, 2017 4:41 am
Forum: General Discussion and Questions
Topic: How small can microPython get?
Replies: 2
Views: 2296

How small can microPython get?

Say I wanted to run C as my main code language and extend it with mpy to parse scripts. Now say I wanted to turn almost everything off. All I need is basic math, bitwise ops, and to be able to read/write to ram, that's all. No big imports, no peripheral access, nothing special at all. Am I still loo...
by microPyforMy
Thu Mar 23, 2017 6:14 pm
Forum: General Discussion and Questions
Topic: C enviroment that can read python occasionally, is micropython what I want?
Replies: 12
Views: 8189

Re: C enviroment that can read python occasionally, is micropython what I want?

Not directly. C functions which are callable from python have to be registered with the interpreter and have to have very particular signatures. In particular: https://github.com/micropython/micropython/blob/bacb52aa2dbf8dcb1e96aace28a85108ef0a8245/py/obj.h#L402-L409 Dave, Thanks for that. A little...
by microPyforMy
Thu Mar 23, 2017 4:23 pm
Forum: General Discussion and Questions
Topic: C enviroment that can read python occasionally, is micropython what I want?
Replies: 12
Views: 8189

Re: C enviroment that can read python occasionally, is micropython what I want?

The precompiled files can actually be larger than the original source, so you are unlikely to get much savings there. The Python functions you are calling can return a value, set a global variable, or call a method on an object they get to change the state. Well, that's annoying on compiled size be...
by microPyforMy
Wed Mar 22, 2017 11:11 pm
Forum: General Discussion and Questions
Topic: C enviroment that can read python occasionally, is micropython what I want?
Replies: 12
Views: 8189

Re: C enviroment that can read python occasionally, is micropython what I want?

[quote="deshipu"]What are those snippets of code supposed to do, exactly? Are you sure you can't replace them with data? An alternative, and much lighter, approach would be to write (or use a ready-written) a very small Forth interpreter...[/quote] Simple things. Execute some pre-made C functions wi...
by microPyforMy
Wed Mar 22, 2017 4:17 pm
Forum: General Discussion and Questions
Topic: C enviroment that can read python occasionally, is micropython what I want?
Replies: 12
Views: 8189

C enviroment that can read python occasionally, is micropython what I want?

I have a microconctroller project that absolutely must be done in C for reasons. However, I have functions this micro will need to perform that will come from a server. I'd LIKE to feed it python commands and have them execute locally. This means a python interpreter inside of a C program on a micro...