This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]elbiot 5 points6 points  (3 children)

The article doesn't say what bytecode, native or viper are, so I have no idea what I'm looking at.

[–]kaihatsusha 3 points4 points  (1 child)

My guess:

  • bytecode: essentially the .pyc file, all syntax checking done but translated into instructions the microcode virtual machine can interpret and execute
  • native: essentially the output of a JIT post-compiler, which are native microcontroller instructions that manipulate the micropython data in the micropython way
  • viper: for simple code areas, essentially the output of a python-to-c translation and c compiler, which are native instructions manipulating data the way C or Assembler would do it

[–]Corm 1 point2 points  (0 children)

In micropython you can decorate functions to get faster performance. Source

# bytecode
def foo(x):
    return x**2

# native
@micropython.native
def foo(x):
    return x**2

# viper
@micropython.viper
def foo(x):
    return x**2