about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
...
* 6670 - generic functionsKartik Agaram2020-07-252-3/+15
| | | | | | | | | | | | | | | | Function signatures can now take type parameters starting with '_'. Type parameters in a signature match any concrete type in the call. But they have to be consistent within a single call. Things I considered but punted on for now: - having '_' match anything without needing to be consistent. Wildcards actually seem harder to understand. - disallowing top-level '_' types. I'll wait until a concrete use case for disallowing. We still don't support *defining* types with type parameters, so for now this is only useful for calling functions on arrays or streams or handles.
* tmp - snapshot of type-parameter supportKartik Agaram2020-07-252-11/+125
| | | | | I think I've got all the stack management down. Time now for the business logic. There's one failing test.
* 6668Kartik Agaram2020-07-242-3/+4
| | | | type-match? is no longer symmetric; we have to be careful about arg ordering.
* 6667Kartik Agaram2020-07-242-1/+1
|
* 6666 - types starting with '_' now match anythingKartik Agaram2020-07-242-3/+85
| | | | We still need to perform pattern matching.
* 6665Kartik Agaram2020-07-241-4/+4
|
* 6664Kartik Agaram2020-07-241-5/+5
|
* 6663Kartik Agaram2020-07-242-1/+61
|
* 6662 - start support for genericsKartik Agaram2020-07-202-0/+100
| | | | Mu will be a language with generics -- but no static dispatch.
* 6661Kartik Agaram2020-07-201-3/+3
|
* 6660Kartik Agaram2020-07-202-2/+2
|
* 6659Kartik Agaram2020-07-182-14/+14
| | | | Tighten up some function signatures.
* 6658Kartik Agaram2020-07-182-7/+7
|
* 6657Kartik Agaram2020-07-163-39/+27
|
* 6656Kartik Agaram2020-07-161-0/+312
|
* 6655Kartik Agaram2020-07-161-0/+282
|
* 6654Kartik Agaram2020-07-162-125/+296
|
* 6653 - render deeper trees with a single childKartik Agaram2020-07-161-2/+14
| | | | | Every time you press a key the depth increases by 1, and then the tree re-renders.
* 6652 - function to divide whole numbersKartik Agaram2020-07-161-13/+112
|
* 6651Kartik Agaram2020-07-161-7/+39
| | | | baby steps: rendering a tree node with just one child
* 6650 - bit-shift operations really workingKartik Agaram2020-07-142-13/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | test input: fn foo { var y/edx: int <- copy 0 y <- shift-left 2 y <- shift-right 2 y <- shift-right-signed 2 var x: int shift-left x, 2 shift-right x, 2 shift-right-signed x, 2 } output: foo: # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp { $foo:0x00000001:loop: ff 6/subop/push %edx ba/copy-to-edx 0/imm32 c1/shift 4/subop/left %edx 2/imm8 c1/shift 5/subop/right-padding-zeroes %edx 2/imm8 c1/shift 7/subop/right-preserving-sign %edx 2/imm8 68/push 0/imm32 c1/shift 4/subop/left *(ebp+0xfffffff8) 2/imm8 c1/shift 5/subop/right-padding-zeroes *(ebp+0xfffffff8) 2/imm8 c1/shift 7/subop/right-preserving-sign *(ebp+0xfffffff8) 2/imm8 81 0/subop/add %esp 0x00000004/imm32 8f 0/subop/pop %edx } $foo:0x00000001:break: # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp c3/return test input 2: $ cat x.mu fn main -> o/ebx: int { o <- copy 3 o <- shift-left 2 } output 2: $ ./translate_mu x.mu $ ./a.elf $ echo $? 12
* 6649Kartik Agaram2020-07-142-7/+137
| | | | | | Bit-shifts aren't quite right yet. We need to emit /imm8 rather than /imm32. This commit introduces the field, though we don't use it yet.
* 6648 - bit-shift instructions in MuKartik Agaram2020-07-144-0/+152
| | | | I'm not happy with the names.
* 6647Kartik Agaram2020-07-141-4/+4
|
* 6646 - in-progress prototype: tree editorKartik Agaram2020-07-141-0/+111
|
* 6645 - heap allocations in MuKartik Agaram2020-07-135-2/+346
| | | | | | | | - allocate var - populate var, n Both rely on the type of `var` to compute the size of the allocation. No need to repeat the name of the type like in C, C++ or Java.
* 6644Kartik Agaram2020-07-132-99/+99
|
* 6643Kartik Agaram2020-07-133-12/+26
|
* 6642Kartik Agaram2020-07-121-10/+10
|
* 6641Kartik Agaram2020-07-121-3/+4
|
* 6640Kartik Agaram2020-07-125-271/+277
| | | | Re-sync markdown files with mu-normie fork.
* 6639Kartik Agaram2020-07-121-6/+4
|
* 6638 - require '0x' prefix on multi-digit literalsKartik Agaram2020-07-112-1/+135
| | | | | | Mu exclusively uses hex everywhere for a consistent programming experience from machine code up. But we all still tend to say '10' when we mean 'ten'. Catch that early.
* 6637Kartik Agaram2020-07-112-0/+9
| | | | Be more consistent about what we interpret as integer literals.
* 6636Kartik Agaram2020-07-112-0/+2
|
* 6635 - bugfixKartik Agaram2020-07-112-3/+47
|
* 6634 - highlight bad variables in vimKartik Agaram2020-07-111-0/+2
|
* 6633Kartik Agaram2020-07-112-3/+3
|
* 6632Kartik Agaram2020-07-1110-26/+26
|
* 6631Kartik Agaram2020-07-1117-22/+341
|
* 6631Kartik Agaram2020-07-1076-23651/+23830
|
* 6630 - define type signatures for SubX functionsKartik Agaram2020-07-105-12/+500
| | | | This was easier than I'd feared.
* 6629Kartik Agaram2020-07-101-16/+17
|
* 6628Kartik Agaram2020-07-102-1/+3
|
* 6627Kartik Agaram2020-07-1012-29/+29
|
* 6626Kartik Agaram2020-07-092-5/+11
|
* 6625Kartik Agaram2020-07-091-210/+210
|
* 6624Kartik Agaram2020-07-092-12/+11
|
* 6623Kartik Agaram2020-07-081-0/+56
|
* 6622 - new syscalls: time and ntimeKartik Agaram2020-07-0831-23/+120
| | | | | As a side-effect I find that my Linode can print ~100k chars/s. At 50 rows and 200 columns per screen, it's 10 frames/s.