Search found 3 matches

by Vinci
Tue Apr 02, 2019 7:35 am
Forum: Development of MicroPython
Topic: Does MicroPython have constant evaluation (folding)?
Replies: 3
Views: 291

Re: Does MicroPython have constant evaluation (folding)?

I accidentally measured the compilation of the C-string into bytecode instead of the execution itself... sry. The benchmark produces reasonable results now.
by Vinci
Mon Mar 25, 2019 2:13 pm
Forum: Development of MicroPython
Topic: Does MicroPython have constant evaluation (folding)?
Replies: 3
Views: 291

Does MicroPython have constant evaluation (folding)?

Hello Does MicroPython support constant evaluation of functions when they get compiled to bytecode? Let's assume I compile a C-string which calls a function with an integer argument (so something like "f(42)") to bytecode and then execute it, is there any chance that the result of that call is pre-c...
by Vinci
Mon Mar 25, 2019 1:45 pm
Forum: Development of MicroPython
Topic: Documentation of the C api and types
Replies: 2
Views: 346

Re: Documentation of the C api and types

No, there is hardly any documentation about the interaction of MicroPython and C. Your best bet is opening "obj.h" and use whatever you find in there. Starting with line 615 there are object creation functions which you can use to access C objects.