summaryrefslogtreecommitdiff
path: root/unix/main.c
AgeCommit message (Collapse)Author
2014-02-11unix: Implement garbage collection support.Paul Sokolovsky
2014-02-11Rename str_join -> strjoin to make it not clash with objstr's one.Paul Sokolovsky
2014-02-08Rename "rawsocket" module to "microsocket".Paul Sokolovsky
It's no longer intended to provide just "raw" socket interface, may include some convenience methods for compatibility with CPython socket - but anyway just minimal set required to deal with socket client and servers, not wider network functionality.
2014-02-05Search paths properly on import and execute __init__.py if it exists.Damien George
2014-02-05Remove older import helpers, no longer used.Paul Sokolovsky
2014-02-05unix: Be sure to add current/base dir of a script to sys.path.Paul Sokolovsky
This mirrors CPython behavior and makes possible to run scripts which import other modules not from script's directory.
2014-02-05unix: Initialize sys.path from MICROPYPATH environment variable.Paul Sokolovsky
If it's not available, "~/.micropython/lib:/usr/lib/micropython" is used as a fallback.
2014-02-02unix: Add basic time module (with time() and clock() functions).Paul Sokolovsky
Both return int so far (single-precision float doesn't have enough bits to represent int32 precisely).
2014-02-01Add mpconfigport.mk file to configure which modules to include into build.Paul Sokolovsky
Proof of concept, controls "ffi" module as one which requires external dependencies.
2014-01-29Add qstr_info() function and bindings for unix port.Damien George
2014-01-29unix: Initial implementation of FFI module.Paul Sokolovsky
Foreign Function Interface module allows to load native dynamic libraries, call functions and access variables in them. This makes possible to write interface modules in pure Python. This module provides thin wrapper around libffi. ctypes compatibility might be possible to implement on top of this module (though ctypes allow to call functions without prototypes, which is not supported by libffi (i.e. implementation would be inefficient))).
2014-01-25Implement mp_parse_node_free; print properly repr(string).Damien George
2014-01-25Add parse_node_free_struct() and use it to free parse tree after compilation.Paul Sokolovsky
TODO: Check lexer/parse/compile error path for leaks too.
2014-01-24unix main: Free input line.Paul Sokolovsky
Also, readline uses system malloc, so for symmetry, use the same for non-readline case.
2014-01-22Second stage of qstr revamp: uPy str object can be qstr or not.Damien George
2014-01-21Merge branch 'master' of github.com:micropython/micropythonDamien George
Conflicts: py/objstr.c py/py.mk py/stream.c unix/main.c unix/socket.c
2014-01-21Revamp qstrs: they now include length and hash.Damien George
Can now have null bytes in strings. Can define ROM qstrs per port using qstrdefsport.h
2014-01-20unix file: Refactor and add sys.stdout/stdin/stderr.Paul Sokolovsky
2014-01-20unix: Implement sys.argv.Paul Sokolovsky
2014-01-19py: Add full traceback to exception printing.Damien George
2014-01-19py: Add module/function/class name to exceptions.Damien George
Exceptions know source file, line and block name. Also tidy up some debug printing functions and provide a global flag to enable/disable them.
2014-01-18Merge pull request #194 from pfalcon/socketDamien George
Add lean ("raw") socket module.
2014-01-18Add source file name and line number to error messages.Damien George
Byte code has a map from byte-code offset to source-code line number, used to give better error messages.
2014-01-19Add lean ("raw") socket module.Paul Sokolovsky
2014-01-15Merge branch 'str-repr' of github.com:pfalcon/micropython into pfalcon-str-reprDamien George
Conflicts: tests/basics/tests/exception1.py
2014-01-15Convert parse errors to exceptions.Damien George
Parser no longer prints an error, but instead returns an exception ID and message.
2014-01-15type->print(): Distinguish str() and repr() variety by passing extra param.Paul Sokolovsky
2014-01-09py: Implement base class lookup, issubclass, isinstance.Damien George
2014-01-09Improved type/class/instance code; mp_obj_type_t now has load_attr, store_attr.Damien George
Creating of classes (types) and instances is much more like CPython now. You can use "type('name', (), {...})" to create classes.
2014-01-08unix: Add basic implementation of io.FileIO object.Paul Sokolovsky
Note: only read/write/close methods are defined so far, and class is not exposed (use open() factory function, as usual).
2014-01-07Merge branch 'cplusplus' of https://github.com/ian-v/micropython into ↵Damien George
ian-v-cplusplus Conflicts: py/objcomplex.c
2014-01-07Factor and simplify Makefile's and mpconfig.Damien George
2014-01-06Revert MP_BOOL, etc. and use <stdbool.h> insteadian-v
2014-01-06Co-exist with C++ (issue #85)ian-v
2014-01-05Convert many object types structs to use C99 tagged initializer syntax.Paul Sokolovsky
2014-01-04Convert Python types to proper Python type hierarchy.Damien George
Now much more inline with how CPython does types.
2014-01-04Convert USE_READLINE config option to be consistent with others.Paul Sokolovsky
2014-01-04Split qstr into pools, and put initial pool in ROM.Damien George
Qstr's are now split into a linked-list of qstr pools. This has 2 benefits: the first pool can be in ROM (huge benefit, since we no longer use RAM for the core qstrs), and subsequent pools use m_new for the next pool instead of m_renew (thus avoiding a huge single table for all the qstrs). Still would be better to use a hash table, but this scheme takes us part of the way (eventually convert the pools to hash tables). Also fixed bug with import. Also improved the way the module code is referenced (not magic number 1 anymore).
2014-01-03Change mp_compile so that it returns a function object for the module.Damien George
2014-01-03Basic implementation of import.Damien George
import works for simple cases. Still work to do on finding the right script, and setting globals/locals correctly when running an imported function.
2014-01-01malloc.h is obsolete.Edd Barrett
2014-01-01Make GNU Readline usage optional (USE_READLINE define). Still enabled.Paul Sokolovsky
Readline is GPL, so linking with it casts the binary GPL.
2014-01-01Add readline history support.Paul Sokolovsky
2013-12-29Change memory allocation API to require size for free and realloc.Damien
2013-12-29py: implement some basic exception matching.Damien
2013-12-21Change object representation from 1 big union to individual structs.Damien
A big change. Micro Python objects are allocated as individual structs with the first element being a pointer to the type information (which is itself an object). This scheme follows CPython. Much more flexible, not necessarily slower, uses same heap memory, and can allocate objects statically. Also change name prefix, from py_ to mp_ (mp for Micro Python).
2013-12-17unix: include obj.h, and build additional py files.Damien
2013-11-09Unix: add machine-specific sqrt support.Damien
2013-11-03Fix compiler warnings in unix/main.c.Damien
2013-11-02Test code for user objects.Damien