Skip to content

Latest commit

 

History

History
95 lines (63 loc) · 2.66 KB

compilation.md

File metadata and controls

95 lines (63 loc) · 2.66 KB

Transpilation to tiny go possible

  1. transpile to code with lot's of anys
  2. know from type of lifted function what types should be generated.

Transpilation gives me concurrency and arduino (tinygo) does the actually compiler exist in WASM.

Crafting interpreters goes via a VM, and implemented in GO. !!!!!!!!!! (could just follow this then immutable beans)

General optimisations

Serious backends

other vms

  • atom vm (erlangy)
  • lunatic (erlangy)

GC

GC is very part of compilation but only interesting if going the compilation route.

https://matt.might.net/articles/cps-conversion/ How to compile with continuations

https://www.microsoft.com/en-us/research/wp-content/uploads/2016/08/algeff-tr-2016-1.pdf In practice though we wish to simplify the types more and leave out ‘obvious’ polymorphism. In Koka we adopted two extra type rules to achieve this

Working out a normalisation

A,A,a,b,c

A,a,b,c + Func a,b,c + Func,Func b,c, + Arg(a),Func c + Arg(x) + Let(x),A,a,b

    • Let(x),A,a,b

let x = a b x c

A,a,A,b,c a,A,b,c + Func A,b,c + Arg(a) b,c + Func,Arg(a) c + Arg(b),Arg(a)

let x = b c a x

-- list

A,A,Cons,x,T Cons,x,T + Func,Func x,T + Arg(Cons),Func T, Cons1(x)

T Cons1,Cons1()

-- select A,Select(x),y Select(x),y + Func

-- let

L(x),