Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An Implementation in Python with a Compiler #653

Open
wants to merge 60 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
da0c3b4
Copy files for rpl in to main dir
jcguu95 Mar 11, 2024
cd73f72
Add debug support to step1 (now main.py).
jcguu95 Mar 11, 2024
f7636c5
Import env, and worked on COMPILE.
jcguu95 Mar 11, 2024
4b537f7
Use a real debug logger.
jcguu95 Mar 11, 2024
402065f
Finish: def! (prim-opt), +-*/ (function).
jcguu95 Mar 11, 2024
3de4bbf
Clean the code. No logics changed.
jcguu95 Mar 11, 2024
6da0cf5
Finish: let* (prim-opt).
jcguu95 Mar 11, 2024
ad88939
Finish: do, if, fn* (prim-opts).
jcguu95 Mar 11, 2024
abc1538
Clean code. No logics changed.
jcguu95 Mar 11, 2024
cef411e
Add automatic tests and FIXME comments.
jcguu95 Mar 11, 2024
e512847
Remove comments.
jcguu95 Mar 11, 2024
8d62557
Seperate COMPILE and EXEC.
jcguu95 Mar 11, 2024
3db8a6b
Prevent compiler from polluting global bindings.
jcguu95 Mar 11, 2024
479d9d9
Finish: let* in the new setting.
jcguu95 Mar 11, 2024
57cfc0b
Scatter debugger in the compiled codes as well.
jcguu95 Mar 11, 2024
ed23b00
Renamed counter as i, and finish "do" primopt.
jcguu95 Mar 11, 2024
32ccb66
Fix bugs for arithmetics and result printing.
jcguu95 Mar 11, 2024
bc11d01
Refactor
jcguu95 Mar 11, 2024
4df900d
Make the compile switch clearer.
jcguu95 Mar 11, 2024
70f7b4d
Fix bug in last commit.
jcguu95 Mar 11, 2024
aa05747
Support nil.
jcguu95 Mar 11, 2024
bce3712
Shorter code. No logic changed.
jcguu95 Mar 11, 2024
980fe72
fn* is almost done, but there are some weird bugs.
jcguu95 Mar 12, 2024
a4668dc
Found subtle bug in `def!`; all tests passed.
jcguu95 Mar 12, 2024
61ae0bb
I'm concerned.. is this step cheating?
jcguu95 Mar 12, 2024
6b6d20e
Import core, and support scalars.
jcguu95 Mar 12, 2024
1858659
Two things:
jcguu95 Mar 12, 2024
58a6879
Tested atom, atom?, swap!, reset!, deref.
jcguu95 Mar 12, 2024
c384cf1
Tested reader @ as deref.
jcguu95 Mar 12, 2024
f627b37
Support primopt `quote`.
jcguu95 Mar 12, 2024
58f3a6b
Add major TODOs and clean up some comments.
jcguu95 Mar 12, 2024
a46552f
Try symlinking readme to front.
jcguu95 Mar 12, 2024
404376f
Rewrite TODOs and description in readme.
jcguu95 Mar 12, 2024
f404182
Implement fn* the right way without cheating.
jcguu95 Mar 12, 2024
07278d4
Try implementing defmacro! as a macro.
jcguu95 Mar 12, 2024
66c2dfd
Try implementing defmacro!
jcguu95 Mar 13, 2024
9aec4f8
Temporary Commit
jcguu95 Mar 14, 2024
39f897f
DONE defmacro! All tests passed :)
jcguu95 Mar 14, 2024
0b484ec
Move python\/compile to python-compile.
jcguu95 Mar 14, 2024
0e38138
Update README location.
jcguu95 Mar 14, 2024
500bcfc
Move codes around. No logic change.
jcguu95 Mar 14, 2024
39acea6
Support dict and vect compilation.
jcguu95 Mar 14, 2024
a2b062c
Add symlinks for testing easier.
jcguu95 Mar 14, 2024
864d13a
Define load-file. Pass all test 6.
jcguu95 Mar 14, 2024
4444bbb
Support vectors properly.
jcguu95 Mar 14, 2024
55f3a2a
Pass all hard tests from 3~7.
jcguu95 Mar 15, 2024
0c89eb1
Add tests for 7~9
jcguu95 Mar 15, 2024
f99c682
Passed all tests in step8 as well.
jcguu95 Mar 15, 2024
2745b97
Passed tests 2~8.
jcguu95 Mar 15, 2024
882c32d
Passed step 2,3,4,5,6,7,8,A
jcguu95 Mar 15, 2024
4f6e497
Refactor. All tests passed (23456789A)!
jcguu95 Mar 15, 2024
7222e7c
Clean up readme.
jcguu95 Mar 15, 2024
f6de0e3
Add a todo.
jcguu95 Mar 15, 2024
2153aa8
Finished file compiler.
jcguu95 Mar 15, 2024
b86e213
Raise recursion limit.
jcguu95 Mar 20, 2024
c07b337
Refactor. Logic Unchanged. Tests Passed.
jcguu95 Mar 20, 2024
b801b2d
Add TODOs.
jcguu95 Mar 20, 2024
87272da
Use compileall in compile_file. All tests passed.
jcguu95 Mar 20, 2024
02fe154
Remove logger, and compare performance.
jcguu95 Mar 20, 2024
ad5928d
Update readme.
jcguu95 Mar 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion Makefile.impls
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ IMPLS = ada ada.2 awk bash basic bbc-basic c c.2 chuck clojure coffee common-lis
guile haskell haxe hy io janet java java-truffle js jq julia kotlin livescript logo lua make mal \
matlab miniMAL nasm nim objc objpascal ocaml perl perl6 php picolisp pike plpgsql \
plsql powershell prolog ps purs python python.2 r racket rexx rpython ruby ruby.2 rust scala scheme skew sml \
swift swift3 swift4 swift5 tcl ts vala vb vhdl vimscript wasm wren yorick xslt zig
swift swift3 swift4 swift5 tcl ts vala vb vhdl vimscript wasm wren yorick xslt zig \
python-compile


step5_EXCLUDES += bash # never completes at 10,000
step5_EXCLUDES += basic # too slow, and limited to ints of 2^16
Expand Down Expand Up @@ -170,6 +172,7 @@ prolog_STEP_TO_PROG = impls/prolog/$($(1)).pl
ps_STEP_TO_PROG = impls/ps/$($(1)).ps
purs_STEP_TO_PROG = impls/purs/$($(1)).js
python_STEP_TO_PROG = impls/python/$($(1)).py
python-compile_STEP_TO_PROG = impls/python-compile/$($(1)).py
python.2_STEP_TO_PROG = impls/python.2/$($(1)).py
r_STEP_TO_PROG = impls/r/$($(1)).r
racket_STEP_TO_PROG = impls/racket/$($(1)).rkt
Expand Down