Commit Graph

418 Commits

Author SHA1 Message Date
Kartik K. Agaram
378ffca74c 7730 - baremetal/shell: boolean values
In the process I found a bug in the Mu compiler. Limitations of just asserting
the emitted code but not running it.
2021-02-12 23:49:00 -08:00
Kartik Agaram
f626421bc4 7692
It's bad enough that metadata comments are restricted to integer literals;
let's at least make them work on _all_ integer literals.
2021-02-07 10:52:04 -08:00
Kartik Agaram
6c4c25555c 7689 - permit metadata on Mu literal integers
Metadata is always ignored. It's purely for documentation purposes. But
as long as Mu has no named constants it's starting to feel increasingly
essential.

I'm still not going to bother to add metadata to other parts of the language.
Let's see if we need them. Even though it's a little warty that the rules
vary throughout the stack:

  - bare SubX: metadata everywhere
  - SubX with syntax sugar: no metadata in calls or addressing-mode sigil-expressions
  - Mu: metadata only for literal integers
2021-02-06 22:24:24 -08:00
Kartik Agaram
b628655722 7526 2021-01-16 09:29:21 -08:00
Kartik Agaram
88152c621a 7350 - mu.subx optimization: skip no-op copies 2020-12-11 22:43:09 -08:00
Kartik Agaram
84f7026e82 7348 - mu.subx bug with string literals 2020-12-11 21:52:55 -08:00
Kartik Agaram
18d5bab2b6 7329 - snapshot: advent day 4 part 2
I've found two bugs in SubX libraries:

1. next-word had an out-of-bounds read
2. next-word was skipping comments, because that's what I need during bootstrapping.
I've created a new variant called next-raw-word that doesn't skip comments.
These really need better names.

We're now at the point where 4b.mu has the right structure and returns
identical result to 4a.mu.
2020-12-04 23:02:53 -08:00
Kartik Agaram
61cfedceef 7300 - bugfix in type-checking float returns 2020-11-29 12:42:34 -08:00
Kartik Agaram
33a85545e1 7299 - bug in code-generating float returns 2020-11-29 12:20:08 -08:00
Kartik Agaram
a518d84bf4 7295 2020-11-29 03:40:12 -08:00
Kartik Agaram
bbcf033aff 7292 - mu.subx: loosen copy-byte checks a bit
Without this there's no way to convert an int to a byte. And that feels
too restrictive, and gives up a lot of safe things one might want to do
with bytes. (Such as divide a number by 10 and emit the remainder as a
byte.)
2020-11-27 22:44:23 -08:00
Kartik Agaram
bcd2adfbf3 7291 2020-11-27 22:27:34 -08:00
Kartik Agaram
530af63477 7287
Regression: I'd broken compare on bytes. Apparently I took away support
for bytes from numberlike-output even though I didn't need to by the end.
2020-11-27 00:17:51 -08:00
Kartik Agaram
125bfde435 7286 - mu.subx: isolate bytes from previous values 2020-11-27 00:04:54 -08:00
Kartik Agaram
c165b0be5a 7285 2020-11-26 23:20:15 -08:00
Kartik Agaram
736bfe9547 7284 2020-11-26 22:34:32 -08:00
Kartik Agaram
b0dfe182ff 7283 2020-11-26 21:59:28 -08:00
Kartik Agaram
7f40e8a3f6 7282 2020-11-26 21:46:46 -08:00
Kartik Agaram
896a353a7d 7281 2020-11-26 21:37:09 -08:00
Kartik Agaram
066014d4b4 7280 2020-11-26 21:23:15 -08:00
Kartik Agaram
5ce7c8dcff 7279 2020-11-26 20:10:46 -08:00
Kartik Agaram
e9f411d5c5 7278 - typo in mu.subx 2020-11-26 12:58:02 -08:00
Kartik Agaram
fd4d7b38da 7267 - mu.subx: type-check 'convert' statements 2020-11-20 00:20:58 -08:00
Kartik Agaram
1696ed831a 7261 - mu.subx: array bounds-checking done 2020-11-17 18:16:26 -08:00
Kartik Agaram
83221b4e21 7260
This seems to preserve the intent of commit 6555.
2020-11-17 16:32:38 -08:00
Kartik Agaram
98399a621f 7258 2020-11-17 10:04:53 -08:00
Kartik Agaram
18944f44e6 7257 - partially undo commit 7253
I don't need to pass the function pointer quite so low. I think..
2020-11-17 10:04:49 -08:00
Kartik Agaram
18579f77c6 7253 - mu.subx: starting to bounds-check 'index'
First step: start passing the function name into code-generation functions.
We're going to need it for the error message.
2020-11-16 22:32:25 -08:00
Kartik Agaram
3d31467c0d 7251 2020-11-16 00:37:37 -08:00
Kartik Agaram
002f2609e9 7248 - mu.subx: new primitive 'clear-object' 2020-11-15 23:13:23 -08:00
Kartik Agaram
0879555213 7241 - mu.subx: check float registers 2020-11-15 17:24:38 -08:00
Kartik Agaram
dcf004d51e 7240 2020-11-15 17:14:07 -08:00
Kartik Agaram
91dc5814df 7239 2020-11-15 16:06:00 -08:00
Kartik Agaram
0e0a60013d 7238 - mu.subx: final restrictions on 'addr'
I had to tweak one app that wasn't following the rules.
2020-11-15 13:18:38 -08:00
Kartik Agaram
ea8a64cfb0 7232 - mu.subx: more checks for byte types 2020-11-12 23:56:41 -08:00
Kartik Agaram
165ed256a3 7230 - mu.subx: some more checks for stmt outputs 2020-11-12 23:13:48 -08:00
Kartik Agaram
307745bcc2 7225
Both manual tests described in commit 7222 now work.

To make them work I had to figure out how to copy a file. It
requires a dependency on a new syscall: lseek.
2020-11-11 23:25:55 -08:00
Kartik Agaram
148f2c9b65 7217 2020-11-08 11:31:54 -08:00
Kartik Agaram
2be7af86db 7216
In addition to fixing a segfault, the realization here is that we don't
always have a type name. Error messages need to take that into account.
2020-11-08 09:43:35 -08:00
Kartik Agaram
494eb64aaf 7192 - more checks around literals
We can copy non-zero literals only to non-addr non-offset scalars.

This change is surprisingly short for the magnitude of the limb I felt
myself going out on for it. Surprising that there were no unpleasant discoveries.
2020-11-05 23:50:12 -08:00
Kartik Agaram
bdb48b5211 7191 2020-11-05 21:03:57 -08:00
Kartik Agaram
ed146be6bc 7190
Training sights now on some gaps with offset types.
2020-11-05 20:49:00 -08:00
Kartik Agaram
4b41663394 7189 - some validations on function name
Mu has no overloading or static dispatch for now.
2020-11-05 20:10:46 -08:00
Kartik Agaram
7a25625c43 7188 - raise error on deref of var on stack 2020-11-05 19:08:44 -08:00
Kartik Agaram
c31d1d3a3d 7185 - type checks for 'populate-stream'
Lots of copy-pasta.
2020-11-05 16:35:47 -08:00
Kartik Agaram
2ea3107c21 7184 - type checks for 'populate' 2020-11-05 16:27:46 -08:00
Kartik Agaram
6017f1e240 7183 - type checks for 'allocate' 2020-11-05 15:06:25 -08:00
Kartik Agaram
9b91efeadd 7182 - type checks for 'copy-object' 2020-11-05 01:20:23 -08:00
Kartik Agaram
686b87cc06 7181 - type checks for 'address' instruction 2020-11-05 00:51:15 -08:00
Kartik Agaram
cc356b35bf 7180
More bugfixes, now all apps are working.

In the process of fixing the bugs in translating apps/browse, I found a
typo in apps/tile that just happened to accidentally be compiling fine.
2020-11-04 22:58:13 -08:00