Commit graph

289 commits

Author SHA1 Message Date
Remko Tronçon
3d9b10c860 tests: Enable BASE test 2022-04-26 22:46:54 +02:00
Remko Tronçon
4d6c3cb34d compiler: Fix behavior of I & J to be compliant with ANS.
Keep loop indexes on the return stack for behavior of I and J.
2022-04-26 22:46:54 +02:00
Remko Tronçon
175bf67767 compiler: do: replace set+get by tee 2022-04-26 20:48:41 +02:00
Remko Tronçon
d6e8406c11 Remove unused predefined words from predefined list 2022-04-26 09:08:05 +02:00
Remko Tronçon
eeb6bf9587 Fix wabt 1.0.27 compatibility 2022-04-25 21:29:23 +02:00
Remko Tronçon
e2dedf224a remove whitespace 2022-04-24 20:42:45 +02:00
Remko Tronçon
3034869230 compiler: compile push & pop inline (infrastructure) 2022-04-24 12:23:42 +02:00
Remko Tronçon
257d731b96 compiler: fix bad local index offset 2022-04-24 12:22:16 +02:00
Remko Tronçon
610006c63e remove tos import in compiled words
This was there in case we wanted to use mutable globals for the TOS.
Since we now use a local TOS, this is no longer useful.
2022-04-23 23:13:17 +02:00
Remko Tronçon
5023ea7b2f thread tos as local through all words
This gives a 20% execution time improvement.
2022-04-23 22:45:55 +02:00
Remko Tronçon
da3ad27c43 Revert "make stack grow downward"
Reduces binary, but decreases performance, and only makes things a little bit simpler.
2022-04-22 13:57:48 +02:00
Remko Tronçon
41c6aa5d6f make stack grow downward 2022-04-22 12:15:02 +02:00
Remko Tronçon
6dd4f644f0 tests: use stackValues everywhere 2022-04-22 08:20:28 +02:00
Remko Tronçon
39dc0d422a remove toplevel module 2022-04-22 08:20:28 +02:00
Remko Tronçon
e7cf4909fa shell: display build date 2022-04-18 14:41:52 +02:00
Remko Tronçon
ea97e51644 shell: styling tweaks 2022-04-18 14:20:41 +02:00
Remko Tronçon
48dfdd00aa shell: avoid scroll on space 2022-04-18 14:05:02 +02:00
Remko Tronçon
4fe9471c66 shell: scroll cursor into view 2022-04-18 13:31:42 +02:00
Remko Tronçon
9a400f17c9 shell: bring up keyboard on iOS 2022-04-18 13:26:48 +02:00
Remko Tronçon
8fd40215c6 implement WORDS
Closes #25
2022-04-17 21:14:07 +02:00
Remko Tronçon
05e341c865 add comments 2022-04-17 17:19:15 +02:00
Remko Tronçon
0f0335568b fix backspace in shell 2022-04-17 17:12:32 +02:00
Remko Tronçon
ef0a360366 move waforth2c to src/ 2022-04-17 17:08:52 +02:00
Remko Tronçon
31bf2734b8 add failing standard testsuite test to unit tests
Temporarily disabled
2022-04-17 16:06:23 +02:00
Remko Tronçon
739556cec0 log error message when generated module fails to load 2022-04-17 16:04:10 +02:00
Remko Tronçon
9c647ef565 simplify compiled control flow instructions 2022-04-17 15:47:06 +02:00
Remko Tronçon
74bb57b72e simplify some loops 2022-04-17 13:59:01 +02:00
Remko Tronçon
7b62970b19 remove unnecessary branch 2022-04-17 13:40:47 +02:00
Remko Tronçon
1606979349 use forth loader for web build 2022-04-17 10:00:15 +02:00
Remko Tronçon
c39724348e reorganize directory structure 2022-04-17 09:30:19 +02:00
Remko Tronçon
2a7240c043 move wrapper & sieve to src/ 2022-04-15 15:39:59 +02:00
Remko Tronçon
7e2cf5dad5 move tools to scripts 2022-04-15 15:33:56 +02:00
Remko Tronçon
c64957e41e fix lint error 2022-04-14 23:00:45 +02:00
Remko Tronçon
5aa2485cd4 new shell tweaks 2022-04-14 22:40:57 +02:00
Remko Tronçon
aec82f987b ignore sieve emit 2022-04-14 22:33:22 +02:00
Remko Tronçon
e957c69723 remove unused b64 param 2022-04-14 22:21:35 +02:00
Remko Tronçon
c8fd06464e handle copy/paste 2022-04-14 22:15:37 +02:00
Remko Tronçon
533de49cd5 simplify base64 handling 2022-04-14 21:46:06 +02:00
Remko Tronçon
806ebd742c replace console with own implementation 2022-04-14 21:36:44 +02:00
Remko Tronçon
387f339780 use esbuild for tests 2022-04-14 16:53:57 +02:00
Remko Tronçon
10bfbf3876 remove commander dependency 2022-04-13 22:31:54 +02:00
Remko Tronçon
89e0ef71d8 remove promise-polyfill dependency 2022-04-13 22:23:30 +02:00
Remko Tronçon
6b9de10002 webpack -> esbuild 2022-04-13 21:09:18 +02:00
Remko Tronçon
3dd6aa11f1 Add .S implementation 2020-06-01 16:22:22 +02:00
Remko Tronçon
5d2a92abcf Readability 2019-11-12 13:41:50 +01:00
Remko Tronçon
6d91c15610 Get rid of preprocessor need 2019-11-11 11:40:52 +01:00
Remko Tronçon
6f3609f364 Prettify 2019-11-11 10:35:34 +01:00
Remko Tronçon
74420aa86a Clean up word names 2019-11-09 21:36:28 +01:00
Remko Tronçon
2077651bc7 Move README around 2019-11-09 21:13:55 +01:00
Remko Tronçon
face95106d Support bulk memory operations 2019-11-09 20:42:34 +01:00
Remko Tronçon
61db4bcbcb Add WIP file 2019-11-09 20:42:34 +01:00
Remko Tronçon
5f779eeeff Some simplification 2019-11-09 19:49:34 +01:00
Remko Tronçon
a8fa217933 Switch to dot notation for instructions 2019-11-09 19:28:59 +01:00
Remko Tronçon
b2cd69847b Some cleanup 2019-11-08 22:42:11 +01:00
Remko Tronçon
eecbca693f Prettify constants 2019-11-08 22:42:11 +01:00
Remko Tronçon
9c99a927be Replace assembler with preprocessor 2019-11-08 22:42:11 +01:00
Remko Tronçon
46cbda1f6a Remove prelude 2019-11-08 16:19:47 +01:00
Remko Tronçon
eaf52649f9 Implement U. natively 2019-11-08 16:16:13 +01:00
Remko Tronçon
29a8f5c518 Implement . natively 2019-11-08 16:10:19 +01:00
Remko Tronçon
7202762f0f Implement VALUE natively 2019-11-08 15:20:10 +01:00
Remko Tronçon
2446f28f91 Implement VALUE natively 2019-11-08 15:18:47 +01:00
Remko Tronçon
0a3debbd87 Implement UWIDTH natively 2019-11-08 15:13:58 +01:00
Remko Tronçon
f0127b4691 Implement CONSTANT natively 2019-11-08 15:00:35 +01:00
Remko Tronçon
9cfd1100dd Add helper to create dictionary entry 2019-11-08 14:17:53 +01:00
Remko Tronçon
fa5bf0558a Remove more macros 2019-11-08 10:39:49 +01:00
Remko Tronçon
3395713abf Bring back some constants 2019-11-08 09:56:26 +01:00
Remko Tronçon
c20c93d516 Make some prelude functions native 2019-11-08 09:21:50 +01:00
Remko Tronçon
8391028855 Remove macro for table elements 2019-11-07 21:59:26 +01:00
Remko Tronçon
2e236860a1 Remove dictionary macros 2019-11-07 21:32:11 +01:00
Remko Tronçon
62f295d536 Reordering 2019-11-07 21:09:55 +01:00
Remko Tronçon
fd3a69cb93 Hard-code string offsets 2019-11-07 20:21:16 +01:00
Remko Tronçon
a6e8d28219 Fix POSTPONE 2019-03-14 20:28:01 +01:00
Remko Tronçon
621d77d622 Use 1 byte for counted string length 2019-03-14 18:10:08 +01:00
Remko Tronçon
c15e5549e8 Fix EVALUATE 2019-03-14 17:15:34 +01:00
Remko Tronçon
ac2517248c Implement WORD 2019-03-14 15:35:02 +01:00
Remko Tronçon
172312b595 Implement \ as a real word 2019-03-14 12:11:25 +01:00
Remko Tronçon
bb657661aa Fix +LOOP with negative increment 2019-03-14 11:54:20 +01:00
Remko Tronçon
a0f216f79b Fix bug in LEAVE 2019-03-14 09:49:17 +01:00
Remko Tronçon
870014d3b9 More tests 2019-03-13 22:35:19 +01:00
Remko Tronçon
bb9e6196ff Implement M* + UM* 2019-03-13 21:24:40 +01:00
Remko Tronçon
186ab96276 Implement S>D 2019-03-13 20:01:17 +01:00
Remko Tronçon
e41247b2a7 Implement REFILL + make >IN handling compliant 2019-03-13 17:47:35 +01:00
Remko Tronçon
c507d50f19 Order assembled output 2019-03-12 22:05:29 +01:00
Remko Tronçon
0248e87dc3 Cleanup 2019-03-12 21:16:43 +01:00
Remko Tronçon
0417afefe6 Add error messages 2019-03-12 20:15:01 +01:00
Remko Tronçon
03b045d943 Implement ABORT" 2019-03-12 16:05:19 +01:00
Remko Tronçon
7920432071 Implement ABORT + QUIT 2019-03-12 14:26:38 +01:00
Remko Tronçon
2e344baf31 Implement KEY + ACCEPT 2019-03-12 11:14:13 +01:00
Remko Tronçon
06dd7c12e7 shell.key->shell.getc 2019-03-12 09:04:39 +01:00
Remko Tronçon
7bac62308a Remove unused export 2019-03-11 16:25:19 +01:00
Remko Tronçon
166d82d899 Remove unused code 2019-03-11 15:57:32 +01:00
Remko Tronçon
775c714904 Remove stray ; 2019-03-11 15:20:58 +01:00
Remko Tronçon
4af07fe635 KEY isn't what some other forths made me think it was 2019-03-11 14:24:50 +01:00
Remko Tronçon
779945c306 Implement [CHAR] 2019-03-11 14:01:46 +01:00
Remko Tronçon
f17dac3e09 Implement ['] 2019-03-11 14:01:42 +01:00
Remko Tronçon
5c1c33d63d Implement POSTPONE 2019-03-11 11:18:29 +01:00
Remko Tronçon
b23bf78a45 Implement CONSTANT & VALUE in terms of CREATE DOES> 2019-03-10 16:59:40 +01:00
Remko Tronçon
2a7322cfa5 Implement DOES> 2019-03-10 16:46:51 +01:00
Remko Tronçon
f7a1ab2aa2 Prepare for DOES> 2019-03-10 14:29:25 +01:00
Remko Tronçon
eb97d29d90 Add command-line unit test runner 2019-03-10 14:29:25 +01:00
Remko Tronçon
bbe5a4eec3 Add documentation 2019-03-09 22:03:13 +01:00
Remko Tronçon
05323af20a Fix CREATE 2019-03-09 22:03:13 +01:00
Remko Tronçon
e824778981 Add some code comments 2019-03-09 21:04:17 +01:00
Remko Tronçon
d536309494 Update quadruple.wat. 2019-03-09 20:17:16 +01:00
Remko Tronçon
6a3c1d96b4 Export state symbols 2019-03-08 22:05:34 +01:00
Remko Tronçon
b23d7ec689 Import better initial table size 2019-03-08 21:59:26 +01:00
Remko Tronçon
ae0f0c6347 Don't import table index offset 2019-03-08 21:52:14 +01:00
Remko Tronçon
6ce0cf86bc Don't use unnecessary parameter for non-data words 2018-06-03 21:40:03 +02:00
Remko Tronçon
1c9d8182e5 Simplify interpreter 2018-06-03 20:43:16 +02:00
Remko Tronçon
d481a1cdb1 Implement UNUSED 2018-06-03 20:08:03 +02:00
Remko Tronçon
f038f31ba0 Implement SOURCE-ID 2018-06-03 20:05:14 +02:00
Remko Tronçon
255f963ae7 Implement TRUE & FALSE 2018-06-03 20:00:31 +02:00
Remko Tronçon
8097b7575c Support BASE in number parser.
Resolves #7
2018-06-03 19:56:09 +02:00
Remko Tronçon
328f362982 Implement more words 2018-06-03 18:35:28 +02:00
Remko Tronçon
56e3750344 Implement EVALUATE 2018-06-03 16:49:36 +02:00
Remko Tronçon
f6293c9d3d Refactor I/O again 2018-06-03 15:17:38 +02:00
Remko Tronçon
5fb2a671ca Implement SOURCE 2018-06-03 09:54:35 +02:00
Remko Tronçon
ef0eb1209b Implement >IN 2018-06-03 09:51:57 +02:00
Remko Tronçon
692e0ea288 Refactor I/O 2018-06-03 09:40:23 +02:00
Remko Tronçon
c5453432f3 Implement */MOD 2018-06-01 23:05:28 +02:00
Remko Tronçon
8140811ead Implement */ 2018-06-01 22:49:16 +02:00
Remko Tronçon
b6fecdebb1 Implement MOVE 2018-06-01 22:26:45 +02:00
Remko Tronçon
9cd4e7134d Move state to memory 2018-06-01 21:39:22 +02:00
Remko Tronçon
eb1971de73 Implement more core words 2018-06-01 21:09:05 +02:00
Remko Tronçon
76b1975ff6 Add name section support.
Resolves #2
2018-05-31 22:06:55 +02:00
Remko Tronçon
903ccd2df5 Fix direct sieve 2018-05-30 18:09:40 +02:00
Remko Tronçon
d6033e83ce Refactor push compilation in preparation for #1 2018-05-30 14:49:46 +02:00
Remko Tronçon
4043db2afd Use webpack for bundling
Parcel has too many limitations.
2018-05-29 20:54:45 +02:00
Remko Tronçon
bebe495332 Extract sieve benchmark 2018-05-29 13:44:26 +02:00
Remko Tronçon
df64428f77 Import memory and TOS in compiled word modules
In preparation of #1
2018-05-28 13:48:05 +02:00
Remko Tronçon
e49e8439ea Move table index management to WebAssembly core 2018-05-28 13:48:05 +02:00
Remko Tronçon
bdfb63fa88 Factor out push compilation.
In preparation of #1
2018-05-28 13:48:05 +02:00
Remko Tronçon
71b506fddd Optimize loop compilation
Fixes #3
2018-05-28 13:48:05 +02:00
Remko Tronçon
15cb0a8256 Add variable support 2018-05-24 22:16:31 +02:00
Remko Tronçon
664e8863fb Thread data pointer to words 2018-05-24 22:14:55 +02:00
Remko Tronçon
bfb70d6c9c Cleanup 2018-05-24 08:44:55 +02:00
Remko Tronçon
f4eed729ea Remove temporary find 2018-05-23 16:43:44 +02:00
Remko Tronçon
a1ddce475f More work. 2018-05-13 17:07:54 +02:00
Remko Tronçon
73db2977f2 Import 2018-05-21 16:44:58 +02:00