micropython

README.txt

410:fa58e72b573a
2011-04-26 Paul Boddie Added missing list method. Added simple import test.
     1 Introduction
     2 ------------
     3 
     4 Micropython is a language environment incorporating a compiler for a
     5 simplified version of the Python programming language which targets a simple
     6 instruction set supported by a virtual machine known as RSVP (a Really Simple
     7 Virtual Processor).
     8 
     9 The RSVP instruction set is intended to map relatively closely to instructions
    10 employed by real processors, with only a few "macroinstructions" which would
    11 probably be implemented as short macros or library routines in programs
    12 translated to the instruction set of a real target processor.
    13 
    14 Quick Start
    15 -----------
    16 
    17 Currently, the test.py program is the principal means of compiling and running
    18 code. For example, to inspect the logical.py test program (with all
    19 optimisations enabled)...
    20 
    21   python -i test.py tests/logical.py -m -omax
    22 
    23 ...will provide a number of objects which can then be inspected, notably the
    24 rm (RSVP machine) object which provides the following methods:
    25 
    26   * show - reveals the contents of the machine's memory
    27   * run  - starts execution of the code in the memory
    28   * step - steps through the code one instruction at a time
    29   * dump - shows the machine's registers
    30 
    31 To run a test and check the output, specify the -t option:
    32 
    33   python test.py tests/logical.py -t -omax
    34 
    35 To run all tests, use the test_all.py program:
    36 
    37   python test_all.py -omax
    38 
    39 Both programs support optimisations either using the -o flag immediately
    40 followed (no space or separator) by a comma-separated list of options (defined
    41 in the docs/optimisations.txt document) or by specifying -omax to apply all
    42 possible optimisations.
    43 
    44 It is generally recommended to apply all possible optimisations when
    45 generating programs as this dramatically reduces the size of the program and
    46 accompanying structures, and it also makes the code generation process
    47 substantially faster. Optimisations should not cause programs to fail: they
    48 should all always be "safe" to apply.
    49 
    50 Contact, Copyright and Licence Information
    51 ------------------------------------------
    52 
    53 The current Web page for micropython at the time of release is:
    54 
    55 http://www.boddie.org.uk/python/micropython.html
    56 
    57 Copyright and licence information can be found in the docs directory - see
    58 docs/COPYING.txt and docs/gpl-3.0.txt for more information.