├── .gitignore ├── CHANGE_LOG.md ├── LICENSE.txt ├── README.md ├── benchmarks ├── README.md ├── tools │ └── benchmarker.bash ├── virtual-dom.js │ ├── .gitignore │ ├── LICENSE.txt │ ├── README.md │ ├── index.js │ ├── index.min.js │ ├── package-lock.json │ ├── package.json │ ├── test │ │ └── test.js │ └── tools │ │ └── minifier.bash └── virtual-dom.micro │ ├── README.md │ ├── index.micro │ ├── index.min.micro │ ├── test │ ├── __main__.micro │ └── test.micro │ └── utilities │ ├── assert_equality.micro │ ├── format │ ├── format_differences.micro │ ├── format_items.micro │ └── format_node.micro │ └── get_separator.micro ├── docs ├── LICENSE.txt ├── LICENSE_FULL.txt ├── README.md ├── brief.md ├── description.md ├── grammar.md ├── library.md ├── logo │ ├── LICENSE.txt │ ├── logo.png │ └── logo.svg └── runtime.md ├── examples ├── common │ ├── BaseListedPoint.micro │ ├── BasePoint.micro │ ├── BaseRandomRectangle.micro │ ├── BaseRectangle.micro │ └── display_cell.micro ├── life-1d │ ├── __main__.micro │ ├── display.micro │ ├── make_field.micro │ ├── populate.micro │ └── run_life.micro ├── life-2d │ ├── Point.micro │ ├── Rectangle.micro │ ├── __main__.micro │ ├── add_to_multiset.micro │ ├── display.micro │ ├── flatten.micro │ ├── from_lists.micro │ ├── make_neighbors.micro │ ├── make_points.micro │ ├── populate.micro │ └── run_life.micro ├── mandelbrot │ ├── Point.micro │ ├── Rectangle.micro │ └── __main__.micro ├── perceptron │ ├── Perceptron.micro │ ├── Point.micro │ ├── Rectangle.micro │ ├── __main__.micro │ ├── activate.micro │ ├── make_perceptron_displayer.micro │ └── make_point_displayer.micro ├── sphere │ ├── Point.micro │ ├── Rectangle.micro │ ├── VectorIIID.micro │ ├── __main__.micro │ ├── calculate_intensity.micro │ └── clamp.micro └── weasel-program │ ├── Evolver.micro │ ├── FitnessStrategy.micro │ ├── GenerationStrategy.micro │ ├── Generator.micro │ ├── Population.micro │ └── __main__.micro ├── micro ├── __init__.py ├── __main__.py ├── ast_node.py ├── ast_token.py ├── bitwise_operations.py ├── builtin_functions.py ├── data │ └── std │ │ ├── cli │ │ └── ansi.micro │ │ ├── list │ │ ├── drop.micro │ │ ├── filter.micro │ │ ├── find.micro │ │ ├── find_last.micro │ │ ├── for_each.micro │ │ ├── generate.micro │ │ ├── generate_if.micro │ │ ├── init.micro │ │ ├── last.micro │ │ ├── map.micro │ │ ├── reduce.micro │ │ ├── reverse.micro │ │ ├── sort.micro │ │ ├── take.micro │ │ ├── zip.micro │ │ └── zip_longest.micro │ │ ├── test │ │ ├── group.micro │ │ └── test.micro │ │ └── while.micro ├── error.py ├── evaluate.py ├── file_cache.py ├── file_selection.py ├── function_type.py ├── input_utilities.py ├── lexer.py ├── list_utilities.py ├── loading.py ├── main.py ├── options.py ├── parser.py ├── preparser.py ├── string_utilities.py ├── trampoline.py ├── type_utilities.py └── utilities.py ├── setup.py └── tools └── atom-plugin └── language-micro ├── LICENSE.txt ├── README.md ├── grammars └── micro.cson ├── package.json └── settings └── language-micro.cson /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *,cover 47 | .hypothesis/ 48 | 49 | # Translations 50 | *.mo 51 | *.pot 52 | 53 | # Django stuff: 54 | *.log 55 | local_settings.py 56 | 57 | # Flask stuff: 58 | instance/ 59 | .webassets-cache 60 | 61 | # Scrapy stuff: 62 | .scrapy 63 | 64 | # Sphinx documentation 65 | docs/_build/ 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | # Jupyter Notebook 71 | .ipynb_checkpoints 72 | 73 | # pyenv 74 | .python-version 75 | 76 | # celery beat schedule file 77 | celerybeat-schedule 78 | 79 | # SageMath parsed files 80 | *.sage.py 81 | 82 | # dotenv 83 | .env 84 | 85 | # virtualenv 86 | .venv 87 | venv/ 88 | ENV/ 89 | 90 | # Spyder project settings 91 | .spyderproject 92 | .spyproject 93 | 94 | # Rope project settings 95 | .ropeproject 96 | 97 | # mkdocs documentation 98 | /site 99 | 100 | # Files generated by PLY library 101 | parsetab.py 102 | parser.out 103 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (C) 2016-2018 thewizardplusplus 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ![](docs/logo/logo.png) Micro 2 | 3 | Interpreter of the Micro programming language. 4 | 5 | ## Installation 6 | 7 | Clone this repository: 8 | 9 | ``` 10 | $ git clone https://github.com/thewizardplusplus/micro.git 11 | $ cd micro 12 | ``` 13 | 14 | Then install the interpreter with [pip](https://pip.pypa.io/) tool: 15 | 16 | ``` 17 | $ sudo -H python3.5 -m pip install . 18 | ``` 19 | 20 | `sudo` command is required to install `micro` console script. If it's not required, `sudo` command can be omitted: 21 | 22 | ``` 23 | $ python3.5 -m pip install . 24 | ``` 25 | 26 | But then the interpreter should be started as `python3.5 -m micro`. 27 | 28 | ### Fix the warning from PLY library 29 | 30 | When you're running the interpreter, you can get the following error: 31 | 32 | ``` 33 | WARNING: Couldn't create 'parsetab'. [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/micro/parsetab.py' 34 | ``` 35 | 36 | In this case, you need to adjust permissions of the specified file: 37 | 38 | ``` 39 | $ sudo touch /usr/local/lib/python3.5/dist-packages/micro/parsetab.py 40 | $ sudo chown "$USER:" /usr/local/lib/python3.5/dist-packages/micro/parsetab.py 41 | ``` 42 | 43 | ## Usage 44 | 45 | ``` 46 | $ micro -v | --version 47 | $ micro -h | --help 48 | $ micro [-t TARGET | --target TARGET] [