Ayke van Laethem
e895372918
compiler: Don't externally link runtime.init
...
There is no reason to make this exception.
2018-04-27 16:19:29 +02:00
Ayke van Laethem
3a4663150e
runtime: Implement GPIO output
...
Now we can actually blink a LED!
2018-04-27 01:29:13 +02:00
Ayke van Laethem
5bbd41e9fb
compiler: Implement -ffunction-sections work
2018-04-27 01:28:14 +02:00
Ayke van Laethem
f7c2d0124d
compiler: Support bitcasting non-integers
2018-04-27 00:59:27 +02:00
Ayke van Laethem
bddb0c49b2
compiler: Add boolean constants
2018-04-27 00:59:01 +02:00
Ayke van Laethem
6ad451a582
compiler: Fix named global path
2018-04-27 00:58:28 +02:00
Ayke van Laethem
4522d2f49e
Makefile: Remove SECONDARY: rule
...
For some reason it isn't necessary anymore.
2018-04-26 23:50:01 +02:00
Ayke van Laethem
d4170faa0a
runtime/nrf: Add Sleep()
2018-04-26 23:47:59 +02:00
Ayke van Laethem
4491a63fe8
Add print() for 64-bit integers
2018-04-26 23:46:34 +02:00
Ayke van Laethem
d17c21681b
compiler: Accept more variable types in print()
2018-04-26 23:41:20 +02:00
Ayke van Laethem
d13566b302
compiler: Don't ignore errors in parsePackage
2018-04-26 23:40:19 +02:00
Ayke van Laethem
f4ee774866
Set up a stack
...
I forgot to actually set up a stack for the program but strangely it
(mostly) worked - probably due to inlining.
2018-04-26 23:38:46 +02:00
Ayke van Laethem
c940617849
compiler: Implement init()
2018-04-26 18:54:46 +02:00
Ayke van Laethem
9a988dd1d1
compiler: Refactor Compiler.Parse: extract parsePackage
2018-04-26 18:52:57 +02:00
Ayke van Laethem
2d19bb11ba
compiler: Merge the runtime into the Go code, for better code size
2018-04-26 18:06:54 +02:00
Ayke van Laethem
775445cceb
compiler: Reduce code size
...
Mark most Go functions as private (removing dead code) and configure to
optimize for size.
2018-04-26 17:16:54 +02:00
Ayke van Laethem
a446b4de97
Be able to actually run the blinky example on an nRF
...
runtime.Sleep() doesn't work yet so it prints a lot of data. Also, this
depends on a small patch to nrfx.
2018-04-25 20:35:19 +02:00
Ayke van Laethem
10427c2b6f
Add blinky example (which doesn't blink a LED, yet)
2018-04-25 20:07:04 +02:00
Ayke van Laethem
04fef19753
Add runtime support for the nRF52
2018-04-25 20:06:08 +02:00
Ayke van Laethem
e80f06bc5e
Implement more type casting
2018-04-25 19:50:46 +02:00
Ayke van Laethem
69140c240b
Implement named binop types
2018-04-25 19:49:54 +02:00
Ayke van Laethem
b4ba90d7f5
Implement uintptr type
2018-04-25 19:48:42 +02:00
Ayke van Laethem
51b947956f
Use Clang as CGo compiler
2018-04-25 19:46:54 +02:00
Ayke van Laethem
93399c009e
Emit textual LLVM IR
2018-04-25 19:46:03 +02:00
Ayke van Laethem
ea129f3072
Implement runtime.Sleep
2018-04-22 19:23:16 +02:00
Ayke van Laethem
cefce41df0
Correct function name for calls to other packages
2018-04-22 19:22:12 +02:00
Ayke van Laethem
9d3dfd8868
Make package process order deterministic: based on import order
2018-04-22 19:06:44 +02:00
Ayke van Laethem
03c6b7256e
Simplify parseConstInt
2018-04-22 15:59:45 +02:00
Ayke van Laethem
5067891236
Implement unsigned integers
2018-04-22 15:59:17 +02:00
Ayke van Laethem
75fce0f949
runtime: Move print functions to separate file
2018-04-22 15:26:07 +02:00
Ayke van Laethem
cf9cea7a0d
Implement array bounds check
2018-04-21 01:03:05 +02:00
Ayke van Laethem
1f0651c84c
Implement string out of bounds checks
2018-04-21 00:40:21 +02:00
Ayke van Laethem
db66039dfe
Implement panic()
2018-04-21 00:26:14 +02:00
Ayke van Laethem
d812873e60
Add support for (zero-initialized) arrays
2018-04-20 23:57:27 +02:00
Ayke van Laethem
02332080e6
Use LLVM API for type size calculations
2018-04-20 23:55:30 +02:00
Ayke van Laethem
217c48f933
Implement interfaces on the string type
2018-04-20 22:42:43 +02:00
Ayke van Laethem
fc2eee4ee8
Better error checking on interface conversion
2018-04-20 17:22:20 +02:00
Ayke van Laethem
12eb9eec3c
Store LLVM reference instead of function name in Frame
2018-04-20 17:04:06 +02:00
Ayke van Laethem
45e7376f39
Implement print() and println() in Go
2018-04-20 16:32:40 +02:00
Ayke van Laethem
ff9e7a8b77
Implement CGo support
...
This mostly works around the default CGo support: this compiler doesn't
need special wrappers for C functions as it uses the C calling
convention by default.
2018-04-20 16:31:43 +02:00
Ayke van Laethem
deadcb8dae
Implement lookup on strings (extract byte values)
...
TODO: bounds checking
2018-04-20 16:20:13 +02:00
Ayke van Laethem
4d33d9d38b
Implement -expr
2018-04-20 16:18:54 +02:00
Ayke van Laethem
01d2cc566e
Fix type width for pointer types
2018-04-20 16:18:09 +02:00
Ayke van Laethem
e436ca7c8d
Implement named constants
2018-04-20 14:52:07 +02:00
Ayke van Laethem
f5f64782ce
Add casting between types
2018-04-20 14:50:52 +02:00
Ayke van Laethem
3e3c3d259f
Add rudimentary interface support
2018-04-19 20:33:10 +02:00
Ayke van Laethem
850fef9852
Add builtin len(string)
2018-04-19 20:24:01 +02:00
Ayke van Laethem
013b375904
Add type methods
2018-04-16 17:04:49 +02:00
Ayke van Laethem
139ac45cb1
Use only putchar() for printing
2018-04-16 01:56:10 +02:00
Ayke van Laethem
9060e699e4
Add heap allocation (without escape analysis!)
2018-04-16 01:55:44 +02:00