├── .gitignore
├── ChangeLog.md
├── LICENSE
├── README.md
├── Setup.hs
├── cam-julia
├── Manifest.toml
├── Project.toml
├── src
│ ├── CamJulia.jl
│ ├── CommonAbstractMachine.jl
│ ├── IdrisForeignCollections.jl
│ ├── IdrisList.jl
│ ├── ReadIR.jl
│ └── Runtime.jl
└── test
│ ├── runtests.jl
│ ├── test.cam
│ └── text.txt
├── examples
├── a.idr
├── pair.idr
└── test_ffi.idr
├── idris-cam.cabal
├── libs
├── Cam
│ ├── Data
│ │ ├── Collections.idr
│ │ ├── Compat.idr
│ │ └── FCollections.idr
│ ├── FFI.idr
│ ├── IO.idr
│ └── OS
│ │ ├── FileSystem.idr
│ │ └── Platform.idr
├── Test
│ └── Simple.idr
├── cam.ipkg
├── clean_ibc.py
├── gen_test.py
└── test.idr
├── src
├── IRTS
│ └── CodegenCam.hs
└── Main.hs
├── stack.yaml
├── test
└── Spec.hs
└── tools
└── prim-fn-gen.py
/.gitignore:
--------------------------------------------------------------------------------
1 | .stack-work/
2 | idris-python.cabal
3 | *~
4 | *.ibc
5 | *.o
6 | **_flymake.hs
7 |
8 | #
9 | libs/test2.idr
10 |
11 | # dot
12 | **Digraph.gv
13 |
14 | # emacs
15 | **~
16 | **\.#*
17 | **#*#
18 |
19 |
20 | # editors
21 | .idea/
22 | .vscode/
23 |
24 | # Byte-compiled / optimized / DLL files
25 | __pycache__/
26 | *.py[cod]
27 | *$py.class
28 | .coverage
29 |
30 | # C extensions
31 | *.so
32 |
33 | # Distribution / packaging
34 | .Python
35 | build/
36 | develop-eggs/
37 | dist/
38 | downloads/
39 | eggs/
40 | .eggs/
41 | lib/
42 | lib64/
43 | parts/
44 | sdist/
45 | var/
46 | wheels/
47 | *.egg-info/
48 | .installed.cfg
49 | *.egg
50 | MANIFEST
51 |
52 | # PyInstaller
53 | # Usually these files are written by a python script from a template
54 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
55 | *.manifest
56 | *.spec
57 |
58 | # Installer logs
59 | pip-log.txt
60 | pip-delete-this-directory.txt
61 |
62 | # Unit test / coverage reports
63 | htmlcov/
64 | .tox/
65 | .coverage
66 | .coverage.*
67 | .cache
68 | nosetests.xml
69 | coverage.xml
70 | *.cover
71 | .hypothesis/
72 | .pytest_cache/
73 |
74 | # Translations
75 | *.mo
76 | *.pot
77 |
78 | # Django stuff:
79 | *.log
80 | local_settings.py
81 | db.sqlite3
82 |
83 | # Flask stuff:
84 | instance/
85 | .webassets-cache
86 |
87 | # Scrapy stuff:
88 | .scrapy
89 |
90 | # Sphinx documentation
91 | docs/_build/
92 |
93 | # PyBuilder
94 | target/
95 |
96 | # Jupyter Notebook
97 | .ipynb_checkpoints
98 |
99 | # pyenv
100 | .python-version
101 |
102 | # celery beat schedule file
103 | celerybeat-schedule
104 |
105 | # SageMath parsed files
106 | *.sage.py
107 |
108 | # Environments
109 | .env
110 | .venv
111 | env/
112 | venv/
113 | ENV/
114 | env.bak/
115 | venv.bak/
116 |
117 | # Spyder project settings
118 | .spyderproject
119 | .spyproject
120 |
121 | # Rope project settings
122 | .ropeproject
123 |
124 | # mkdocs documentation
125 | /site
126 |
127 | # mypy
128 | .mypy_cache/
129 |
130 |
131 | stack.yaml.lock
--------------------------------------------------------------------------------
/ChangeLog.md:
--------------------------------------------------------------------------------
1 | # Changelog for idris-python
2 |
3 | ## Unreleased changes
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright thautwarm (c) 2019
2 |
3 | All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | * Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 |
11 | * Redistributions in binary form must reproduce the above
12 | copyright notice, this list of conditions and the following
13 | disclaimer in the documentation and/or other materials provided
14 | with the distribution.
15 |
16 | * Neither the name of thautwarm nor the names of other
17 | contributors may be used to endorse or promote products derived
18 | from this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # idris-cam
2 |
3 | A framework for Idris RTS.
4 |
5 |
6 | ## Features(listed by priorities)
7 |
8 | - [x] An abstraction of some intermediate representations(common abstract machine, aka CAM)
9 | - [x] Back end: Python AST
10 | - [x] Back end: Julia AST
11 | - [ ] Persisting locations with Idris IRs, like DDecls.
12 | - [ ] Python standard libraries
13 | - [x] Handy FFI
14 | - [ ] Tail call elimination
15 | - [ ] Back end: Python Bytecode
16 | - [ ] Specializations for some primitive data types
17 | - [ ] Incremental compilation
18 |
19 | ## Build && Cam Codegen
20 |
21 | - Build
22 |
23 | ```
24 | git clone https://github.com/thautwarm/idris-cam && cd idris-cam
25 | stack build
26 | ```
27 |
28 | - Codegen
29 |
30 | ```
31 | stack exec idris -- --codegen=cam -o