Commit Graph

49 Commits

Author SHA1 Message Date
Kartik K. Agaram deb610367f start dropping parens everywhere 2021-06-20 21:29:33 -07:00
Kartik Agaram 662e6b7177 . 2021-06-11 23:02:12 -07:00
Kartik K. Agaram d4968adbc9 . 2021-06-11 23:00:00 -07:00
Kartik K. Agaram 0dc4f9c62b hacky bugfix: support floats in nth
Needed because we don't yet have a primitive in the shell to truncate/round
non-integers to integers.

Before:
  (nth (/ 31 10)    # we don't have float literals yet
       '(1 2 3 4))
  => NULL

..with an unpleasant abort likely later on.

Really the correct thing to do is ensure none of my primitives ever returns
NULL. Start with car/cdr.
2021-06-11 21:36:12 -07:00
Kartik K. Agaram 8257825468 . 2021-06-11 18:20:30 -07:00
Kartik K. Agaram 9d2c64455a fizz-buzz take 2 2021-06-06 23:22:57 -07:00
Kartik K. Agaram c546987a07 fizz-buzz exercise 2021-06-06 22:53:46 -07:00
Kartik K. Agaram b6e1cffd9b shell: concept of palettes 2021-06-06 22:38:56 -07:00
Kartik K. Agaram 32487eb00c growing disenamored with up and down 2021-06-06 22:25:07 -07:00
Kartik K. Agaram 3efbe5bf56 . 2021-06-06 22:14:24 -07:00
Kartik Agaram e941dd505c . 2021-06-06 19:03:41 -07:00
Kartik K. Agaram 9fd3111ea9 shell: more foundations from Lisp 2021-06-06 16:41:37 -07:00
Kartik K. Agaram f79ae9ea54 . 2021-06-06 16:40:35 -07:00
Kartik K. Agaram 86f9744257 . 2021-06-06 16:39:07 -07:00
Kartik K. Agaram c1fff5ec14 shell: fleshing out the 'standard library'
Based loosely on Arc's arc.arc:
  http://arclanguage.org
  https://github.com/arclanguage/anarki/blob/official/arc.arc
2021-06-06 12:55:06 -07:00
Kartik K. Agaram c4cf38773f more space for definitions 2021-06-06 10:54:50 -07:00
Kartik K. Agaram b5d3095c92 shell: cool new stress-test 2021-06-05 23:12:13 -07:00
Kartik K. Agaram 0b3d456f2c clean up a large memory leak
It turns out (bowboard screen 128) on a real screen massively slowed down
and ran out of memory since commit e2ab1b30b1 on May 19. The culprit was
these changes, which created memory allocations for a new trace on every
recursive call.

I originally had some vague desire to isolate these calls from the user-visible
trace. That's expensive enough that I'll wait until it becomes a concern
before trying to isolate again.
2021-06-05 20:43:39 -07:00
Kartik K. Agaram b012fba1bc . 2021-06-05 18:04:05 -07:00
Kartik K. Agaram 3ac99829c7 shell: moar macros 2021-06-05 17:49:03 -07:00
Kartik K. Agaram 4dd08c268d . 2021-06-04 16:46:20 -07:00
Kartik K. Agaram 224e264a65 . 2021-06-04 16:43:19 -07:00
Kartik K. Agaram cfb5dbce59 . 2021-06-04 16:41:18 -07:00
Kartik K. Agaram e683a3fdee . 2021-06-04 16:39:05 -07:00
Kartik K. Agaram 380837ac2a more convenient 'def' 2021-06-04 16:12:30 -07:00
Kartik K. Agaram bb1ccae27f rename the definition primitive to 'def' 2021-06-04 16:07:07 -07:00
Kartik Agaram 35336a5f64 .
State as of https://archive.org/details/akkartik-mu-2021-05-31
2021-05-31 23:13:10 -07:00
Kartik K. Agaram 650f417de2 . 2021-05-31 08:59:09 -07:00
Kartik K. Agaram 3331144395 data.limg now loading properly again 2021-05-31 08:09:19 -07:00
Kartik K. Agaram 6934f78e97 . 2021-05-22 09:30:11 -07:00
Kartik K. Agaram f8c28e3a36 . 2021-05-19 17:30:25 -07:00
Kartik K. Agaram c4475d83b7 shell: roll back a change to the 'when' macro
Introduced in commit 1adc904ef3 from a week ago, but it turns out brcircle
has been consistently broken ever since.
2021-05-15 12:43:35 -07:00
Kartik K. Agaram 183010779c A 'bowboard', a chessboard of rainbow circles
Compare with (chessboard screen 256)
2021-05-08 08:33:22 -07:00
Kartik K. Agaram 665b1e8f07 a full-circle rainbow 2021-05-08 07:58:56 -07:00
Kartik K. Agaram 1adc904ef3 new shell macro: do 2021-05-07 21:13:24 -07:00
Kartik K. Agaram c5f50f05b7 . 2021-05-07 12:46:41 -07:00
Kartik K. Agaram dd192dd52c . 2021-05-07 12:11:59 -07:00
Kartik K. Agaram e42ae8219e clean up all definitions 2021-05-07 12:08:07 -07:00
Kartik K. Agaram d605ba1f9a clean up chessboard
We still benefit from some helpers here because of the unrolling and multiple
calls to helpers.
2021-05-07 11:56:43 -07:00
Kartik K. Agaram d8298d1a2a clean up read_line 2021-05-07 11:37:48 -07:00
Kartik K. Agaram 91f76e6b22 clean up Bresenham line-drawing 2021-05-07 11:28:59 -07:00
Kartik K. Agaram 92fb55d50f no, we need hline1 for fill_rect 2021-05-07 10:14:51 -07:00
Kartik K. Agaram c651bbeffc clean up hline and vline 2021-05-07 10:05:20 -07:00
Kartik K. Agaram 74be534e2b starting to implement first macros
Another commit, another bugfix.

Some snippets from my currently exploding todo list:

- always investigate lookup errors immediately. Beyond the root cause, they should never happen at the moment, while we aren't reclaiming memory.
  we should always return a more precise error message. Usually involving null pointer checks.

- on abort, print out stack trace
  - emit mapping of labels to addresses during survey
  - store a mapping of symbols somewhere in the code image

- stop allocating 1KB per token; expand space for tokens as needed
2021-05-07 09:49:16 -07:00
Kartik K. Agaram a54c6f2ee7 belatedly migrate stale example definitions
Also bare-bones syntax highlighting for .limg files. Doesn't work when
.limg file is first file opened with Vim.
2021-05-06 16:42:08 -07:00
Kartik K. Agaram 606c5681b7 bresenham circles
Known issue: circles of radius 9 crash. (Multiples of 9 overflow the trace.)
2021-04-25 22:33:26 -07:00
Kartik K. Agaram 7148f1222e bug in bresenham lines 2021-04-25 22:20:57 -07:00
Kartik K. Agaram 891083c44d shell: primitives 'and' and 'or' 2021-04-25 22:19:00 -07:00
Kartik K. Agaram 1a18c9e24b . 2021-04-25 21:35:14 -07:00