Yuichi Nishiwaki
57ca3174aa
define arithmetic operators as c functions
2013-12-07 20:43:36 -08:00
Yuichi Nishiwaki
629ee06b5f
s/DEFINE_MATH_PRED/DEFINE_ARITH_CMP/g
2013-12-07 20:42:10 -08:00
Yuichi Nishiwaki
791ab95219
[bugfix] taking a wrong symbol for exporting
2013-12-07 19:03:18 -08:00
Yuichi Nishiwaki
0f491adc73
select library during macroexpanding define-library
2013-12-07 18:59:35 -08:00
Yuichi Nishiwaki
7cdcbd4604
set name to each library
2013-12-07 18:59:13 -08:00
Yuichi Nishiwaki
35b99d11a8
let make_library return a library
2013-12-07 18:44:14 -08:00
Yuichi Nishiwaki
c764d28878
add pic_parse
2013-12-07 18:38:47 -08:00
Yuichi Nishiwaki
6b2d6a98eb
Revert "change APIs of library functions"
...
This reverts commit 0115ede4de
.
Conflicts:
include/picrin.h
2013-12-07 18:27:08 -08:00
Yuichi Nishiwaki
818430bb81
implement import/export syntax
2013-12-07 09:42:34 -08:00
Yuichi Nishiwaki
c989687564
[workaround] load core syntaces initially
2013-12-07 07:14:35 -08:00
Yuichi Nishiwaki
0115ede4de
change APIs of library functions
2013-12-07 07:11:22 -08:00
Yuichi Nishiwaki
9cb777eec3
select the minimal library at first
2013-12-07 07:05:22 -08:00
Yuichi Nishiwaki
7c6ba80581
add library operation methods
2013-12-07 07:05:06 -08:00
Yuichi Nishiwaki
1ac5b6458c
add pic_null_syntactic_env and pic_minimal_syntactic_env
2013-12-07 07:04:26 -08:00
Yuichi Nishiwaki
aac2082991
add pic_assoc
2013-12-07 06:30:21 -08:00
Yuichi Nishiwaki
dcb5b448cd
add pic_equal_p
2013-12-07 06:29:29 -08:00
Yuichi Nishiwaki
381ed58bff
add global library table
2013-12-07 05:36:14 -08:00
Yuichi Nishiwaki
931565d4ce
add pic_lib
2013-12-07 03:58:18 -08:00
Yuichi Nishiwaki
acbcde3b6a
initial library support
2013-12-07 03:04:27 -08:00
Yuichi Nishiwaki
a1e2e41840
add some symbols about library
2013-12-07 02:31:04 -08:00
Yuichi Nishiwaki
25378e3813
cosmetic changes
2013-12-06 07:51:32 -08:00
Yuichi Nishiwaki
b3a2da1079
Merge remote-tracking branch 'origin/master'
2013-12-06 04:48:10 -08:00
Yuichi Nishiwaki
ef04e3f02c
add pic_core_syntactic_env
2013-12-06 18:04:36 +09:00
Yuichi Nishiwaki
4d8ffa43c8
delete auto resource releasing facility
2013-12-03 08:16:53 -08:00
Yuichi Nishiwaki
7e69ae1878
add port-close procedure
2013-12-03 08:16:13 -08:00
Yuichi Nishiwaki
afffa20785
pic_apply supports multiple arguments
2013-12-03 06:40:50 -08:00
Yuichi Nishiwaki
a7df867a55
suppress gcc's warnings
2013-12-03 06:10:46 -08:00
Yuichi Nishiwaki
4e98d37ab1
remove old debug prints
2013-12-03 13:08:23 +09:00
Yuichi Nishiwaki
dc7c801c38
exprs during macroexpansion may have syntactic-closure in the tail position
2013-12-03 13:08:00 +09:00
Yuichi Nishiwaki
761deffe1f
macroexpand_list supports any kind of improper list
2013-12-03 13:07:25 +09:00
Yuichi Nishiwaki
b5b30de05a
remove a field for debug of union header
2013-12-03 11:49:32 +09:00
Yuichi Nishiwaki
7685afdb79
fix logic flaw in GC
2013-12-03 11:45:38 +09:00
Yuichi Nishiwaki
704b2d148b
rewrite pic_type_repr
2013-12-02 13:39:11 +09:00
Yuichi Nishiwaki
a43e3248e8
calloc should take size_t
2013-12-01 12:44:43 +09:00
Yuichi Nishiwaki
04434f44fd
cosmetic changes
2013-11-30 00:07:49 +09:00
Yuichi Nishiwaki
21f2c58a53
[gc][bugfix] sweeping failed when the heap gets completely
...
exhausted (i.e. all blocks' size are zero)
2013-11-29 12:10:10 +09:00
Yuichi Nishiwaki
f03a153774
add freed object counter
2013-11-29 12:10:10 +09:00
Yuichi Nishiwaki
4c5d3b4257
Revert "[bugfix] do not fuse end-of-page block into other blocks"
...
This reverts commit 5656590fa0
.
2013-11-29 12:10:10 +09:00
Yuichi Nishiwaki
ab5de1c0c4
fix #6
2013-11-29 12:10:02 +09:00
Yuichi Nishiwaki
5656590fa0
[bugfix] do not fuse end-of-page block into other blocks
2013-11-28 21:58:25 +09:00
Yuichi Nishiwaki
e10bbac8e5
accept injected symbols (syntactic-closures) at the places of lambda formals
2013-11-28 18:40:31 +09:00
Yuichi Nishiwaki
3266ae7d3c
[bugfix] missed to mark stx->senv
2013-11-28 13:15:27 +09:00
Yuichi Nishiwaki
c2d7f3d1f2
[bugfix] wrong size for pic_proc allocation
2013-11-27 06:31:49 -08:00
Yuichi Nishiwaki
49caf79ce6
[bugfix] new_uniq_sym must take one more byte chunk for new string
2013-11-27 06:31:12 -08:00
Yuichi Nishiwaki
7b8ee3eb97
add er-macro-transformer
2013-11-27 17:26:07 +09:00
Yuichi Nishiwaki
1ab588d21f
added hygienic macro facility! Fooo!
2013-11-27 15:58:28 +09:00
Yuichi Nishiwaki
9a027dae6e
add error guard
2013-11-27 15:57:23 +09:00
Yuichi Nishiwaki
bedc5dc6be
revise output format of syntactic closure object
2013-11-27 15:56:29 +09:00
Yuichi Nishiwaki
ceedd05ef0
[bugfix] pic_apply_argv concatenated args in reverse order
2013-11-27 15:55:54 +09:00
Yuichi Nishiwaki
78cafe3db7
add make-syntactic-closure function
2013-11-27 15:04:44 +09:00
Yuichi Nishiwaki
ab74920a6f
add pic_sc (syntactic closure) structure
2013-11-27 15:04:02 +09:00
Yuichi Nishiwaki
a7a3bfc270
[CSE] add new_global_senv and new_local_senv
2013-11-27 14:19:46 +09:00
Yuichi Nishiwaki
b4218a7a03
cosmetic changes
2013-11-27 14:00:23 +09:00
Yuichi Nishiwaki
73831283b6
cleanup
2013-11-27 13:51:24 +09:00
Yuichi Nishiwaki
c1788d31b0
Merge branch 'master' into syntactic-closure
2013-11-27 13:06:37 +09:00
Yuichi Nishiwaki
bbe3e990e4
Revert "pluggable heap pages"
...
This reverts commit e6523730a4
.
2013-11-27 13:04:12 +09:00
Yuichi Nishiwaki
5e3f2dacf4
Revert "add_heap_page should not be invoked in gc_alloc, but should be in obj_alloc"
...
This reverts commit f11623f075
.
2013-11-27 13:04:03 +09:00
Yuichi Nishiwaki
94aac37443
macros must be added to var_tbl
2013-11-26 17:43:59 -08:00
Yuichi Nishiwaki
d2af692280
add a fixme comment
2013-11-26 17:43:49 -08:00
Yuichi Nishiwaki
d7f8d67bf2
debug-print when unbound symbol is found
2013-11-26 16:52:30 -08:00
Yuichi Nishiwaki
38ab43d7fc
[bugfix] binding leak
2013-11-26 16:51:48 -08:00
Yuichi Nishiwaki
3710d5feea
support varg lambda
2013-11-26 16:51:17 -08:00
Yuichi Nishiwaki
b2704fb123
increment xlen in the end
2013-11-26 16:50:38 -08:00
Yuichi Nishiwaki
c336a354e4
publish pic_defmacro as a public API
2013-11-26 09:09:15 -08:00
Yuichi Nishiwaki
2dee30a0b5
macroexpand_list supports improper list
2013-11-26 09:07:57 -08:00
Yuichi Nishiwaki
43d449d2aa
s/define_macro/pic_defmacro/g
2013-11-26 09:07:06 -08:00
Yuichi Nishiwaki
cbd636e0a7
[bugfix] do not release pic->var_tbl when a senv holding it is dead
2013-11-26 09:00:16 -08:00
Yuichi Nishiwaki
e7673c65bd
[bugfix] syntaces should be registered to var_tbl, not global_tbl
2013-11-26 08:59:16 -08:00
Yuichi Nishiwaki
be311cb96f
replace old macroexpand facility with new renamer implementation
2013-11-26 08:43:58 -08:00
Yuichi Nishiwaki
1f3f7c99a2
save macro procesures in each syntax object
2013-11-26 08:42:13 -08:00
Yuichi Nishiwaki
3d1f74d8f5
add 'define-macro' core syntax
2013-11-26 08:41:01 -08:00
Yuichi Nishiwaki
ddbc2c83a2
add missing core symbol registration
2013-11-26 08:39:37 -08:00
Yuichi Nishiwaki
3009473d52
debug prints for macroexpand
2013-11-26 08:38:26 -08:00
Yuichi Nishiwaki
f6bc51d16d
add xlen/xcapa member to pic_senv
2013-11-26 08:36:58 -08:00
Yuichi Nishiwaki
a32473ae92
add core syntaces in pic_open
2013-11-26 08:35:35 -08:00
Yuichi Nishiwaki
a2e1f21b29
add global identifier table
2013-11-26 08:30:30 -08:00
Yuichi Nishiwaki
673b66a723
use register_core_symbol macro to initialize pic_state
2013-11-26 06:40:48 -08:00
Yuichi Nishiwaki
ad3c268f81
insert renamer pass after old macroexpansion phase
2013-11-26 04:08:46 -08:00
Yuichi Nishiwaki
1ad562f1a8
[wip] add renamer
2013-11-26 04:06:46 -08:00
Yuichi Nishiwaki
573ba79782
[bugfix] log10 must not be given 0
2013-11-26 04:06:03 -08:00
Yuichi Nishiwaki
b7f0f3dfb3
[bugfix] get rid of a comma
2013-11-26 04:05:37 -08:00
Yuichi Nishiwaki
c59d8f601b
add PIC_TT_SENV and PIC_TT_SYNTAX
2013-11-26 04:05:02 -08:00
Yuichi Nishiwaki
3c65025394
add macro.h
2013-11-26 04:03:52 -08:00
Yuichi Nishiwaki
bf6a337a5f
add pic_cxxr functions
2013-11-26 02:42:13 -08:00
Yuichi Nishiwaki
72cf45d4ea
add `new_uniq_sym` function
2013-11-25 23:38:39 -08:00
Yuichi Nishiwaki
4701f86ff0
fix a grammar error
2013-11-26 16:22:49 +09:00
Yuichi Nishiwaki
52f1776b22
cleanup
2013-11-25 11:10:57 +09:00
Yuichi Nishiwaki
f11623f075
add_heap_page should not be invoked in gc_alloc, but should be in obj_alloc
2013-11-25 00:24:03 +09:00
Yuichi Nishiwaki
df20de5285
push back dead objects to free list
2013-11-25 00:22:32 +09:00
Yuichi Nishiwaki
40bfe13895
add a comment to sweep algorithm
2013-11-22 07:30:29 -08:00
Yuichi Nishiwaki
563b65efde
s/expand.c/macro.c/
2013-11-22 07:22:52 -08:00
Yuichi Nishiwaki
579735d16e
s/heap_page/pic_heap/g
2013-11-22 07:19:31 -08:00
Yuichi Nishiwaki
e6523730a4
pluggable heap pages
2013-11-22 07:12:03 -08:00
Yuichi Nishiwaki
1be72f1e18
rewrite gc!
2013-11-22 06:38:29 -08:00
Yuichi Nishiwaki
2dd293c0f9
[workaround] add stack overflow detector
2013-11-22 06:37:57 -08:00
Yuichi Nishiwaki
0a521c2314
add overflow guards to some global stacks (or value pools)
2013-11-22 06:35:51 -08:00
Yuichi Nishiwaki
23b806cc41
print propagated error messages when stdlib failed to build
2013-11-22 06:34:34 -08:00
Yuichi Nishiwaki
4b326e4f6e
add new compilation flag GC_DEBUG_DETAIL
2013-11-22 03:29:05 -08:00
Yuichi Nishiwaki
4004282e50
alloc stacks by calloc, not malloc
2013-11-22 03:28:09 -08:00
Yuichi Nishiwaki
626c0adb3a
fix broken pic_type_repr
2013-11-22 03:27:09 -08:00
Yuichi Nishiwaki
f610424ae5
remove unnecessary protect
2013-11-22 01:53:22 -08:00
Yuichi Nishiwaki
05b2717b9e
less memory usage of pic_reverse
2013-11-21 06:32:56 -08:00
Yuichi Nishiwaki
00fc0ee931
protect more objects during expansion
2013-11-21 06:31:32 -08:00
Yuichi Nishiwaki
f146287eff
load_stdlib releases arena objects every time evaluating exprssion
2013-11-21 06:30:33 -08:00
Yuichi Nishiwaki
6581177ec5
realloc pic->irep when exhausted
2013-11-21 06:28:43 -08:00
Yuichi Nishiwaki
58b9e2cb60
debug prints when a global stack is realloc'ed
2013-11-21 06:28:06 -08:00
Yuichi Nishiwaki
e49ddbd13b
[bugfix] makeing a shared library failure under the version 3 of bison
2013-11-18 20:47:20 +09:00
Yuichi Nishiwaki
ed0b02ecfa
fixed #5 (again)
2013-11-18 20:38:03 +09:00
Yuichi Nishiwaki
d2bb4ad4f2
Revert "(maybe) fix #5 "
...
This reverts commit a3ac65a75f
.
2013-11-18 20:36:30 +09:00
Yuichi Nishiwaki
a3ac65a75f
(maybe) fix #5
2013-11-18 20:35:27 +09:00
Yuichi Nishiwaki
d5f01595b0
fixed #4
2013-11-18 20:24:09 +09:00
Yuichi Nishiwaki
6f94202e13
s/pic_expand/pic_macroexpand/g
2013-11-18 16:36:44 +09:00
Yuichi Nishiwaki
a3c2dabcc7
add feature function
2013-11-18 01:46:28 +09:00
Yuichi Nishiwaki
0d952d3639
add string functions
2013-11-18 01:09:54 +09:00
Yuichi Nishiwaki
6cfbe51c87
pic_get_args: change type of argc
2013-11-18 01:07:51 +09:00
Yuichi Nishiwaki
6ac3055816
change return type of pic_str_new to struct pic_string *
2013-11-18 00:28:42 +09:00
Yuichi Nishiwaki
d4188e0969
add error function
2013-11-17 18:16:03 +09:00
Yuichi Nishiwaki
5ffb4eb6c9
add string?
2013-11-17 17:42:52 +09:00
Yuichi Nishiwaki
9526ca789a
free as many as possible!
2013-11-17 17:33:28 +09:00
Yuichi Nishiwaki
fdc9bfea4e
initial exception handling support
2013-11-17 17:25:26 +09:00
Yuichi Nishiwaki
5668ae1b29
[bugfix] local variables should be initialized before copied to env object
2013-11-17 17:24:37 +09:00
Yuichi Nishiwaki
737f916a8c
add pic_errorf
2013-11-17 17:23:13 +09:00
Yuichi Nishiwaki
224b08fb92
[bugfix] after save_cont any local variable must not be modified!
...
If save_cont returns a cont object, a local variable will receive the
object and the machine stack state will have just been changed then.
To avoid that, we need set cont object to the local before the machine
stack is copied.
2013-11-17 17:20:19 +09:00
Yuichi Nishiwaki
38988b7770
add global exception handler stack
2013-11-17 16:02:58 +09:00
Yuichi Nishiwaki
c79e08632c
when restoring continuation sp and ci must be re-allocated
2013-11-17 15:58:53 +09:00
Yuichi Nishiwaki
5947240614
[bugfix] fix crash on deeply nested lambdas
2013-11-17 13:12:59 +09:00
Yuichi Nishiwaki
14ad038051
wipe reallocated cv_tbl
2013-11-17 13:10:36 +09:00
Yuichi Nishiwaki
242a366cbf
check vector index out of range
2013-11-17 02:32:27 +09:00
Yuichi Nishiwaki
1ef3ed91a2
fix for-each compilation bug
2013-11-16 23:32:34 +09:00
Yuichi Nishiwaki
a68b470e06
pic_get_args can parse '*'
2013-11-15 22:53:41 +09:00
Yuichi Nishiwaki
c57f1bfbe1
define math comp predicates as C functions
2013-11-15 22:51:51 +09:00
Yuichi Nishiwaki
e94aaffd34
shrink default arena size!
2013-11-15 19:54:47 +09:00
Yuichi Nishiwaki
9cdca8bc70
implement yy arena gc
2013-11-15 19:40:31 +09:00
Yuichi Nishiwaki
690f66dd76
s/is_marked/gc_is_marked/g
2013-11-15 19:32:01 +09:00
Yuichi Nishiwaki
f506eac3dd
add pic_obj_alloc_unsafe; preparation for yy_arena
2013-11-15 19:31:17 +09:00
Yuichi Nishiwaki
9662ab30ec
add pic_vec_extend_ip (for internal API)
2013-11-15 19:30:25 +09:00
Yuichi Nishiwaki
c62505b930
initialize newly allocated vector with falses
2013-11-15 19:29:54 +09:00
Yuichi Nishiwaki
73d9b0dc79
use strndup if possible
2013-11-15 17:08:18 +09:00
Yuichi Nishiwaki
93e5758e4c
[bugfix] gc may enter an infinite loop
2013-11-15 16:11:54 +09:00
Yuichi Nishiwaki
a2f022df4e
implement native version of some primitive functions such as car,crd...
2013-11-15 16:07:03 +09:00
Yuichi Nishiwaki
984588b1b6
add reference count GC for pic_block objects
2013-11-15 11:51:58 +09:00
Yuichi Nishiwaki
c22f566c06
arena stash can be statically allocated
2013-11-15 10:54:56 +09:00
Yuichi Nishiwaki
066575fa1c
error when apply got non-proc at the first place of arguments
2013-11-14 20:42:14 +09:00
Yuichi Nishiwaki
850290dda3
add some char primitives
2013-11-14 20:41:22 +09:00
Yuichi Nishiwaki
7f35eb7daa
support named characters
2013-11-14 19:45:38 +09:00
Yuichi Nishiwaki
6de5bc7550
propagate jmp_bufs (useful when C stack and scheme stack interleave)
2013-11-14 19:26:06 +09:00
Yuichi Nishiwaki
e68c69ceb1
support datum comment
2013-11-14 17:31:40 +09:00
Yuichi Nishiwaki
48c5c6b17c
add vector-set!
2013-11-14 16:57:07 +09:00
Yuichi Nishiwaki
b56b86aae2
[bugfix] variables defined by internal definitions may be referred from
...
inner environments
2013-11-14 16:52:49 +09:00
Yuichi Nishiwaki
b9fce69c61
support internal definitions
2013-11-13 18:08:22 +09:00