aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/compiler/base.jvm.lux
blob: 01a97aec442543f6c366b9af904197fccaa955ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
(;module:
  lux
  (lux (control monad)
       [io #- run]
       (concurrency ["A" atom])
       (data [text]
             text/format)
       host)
  (luxc ["&" base]))

(jvm-import java.lang.Class)
(jvm-import java.lang.ClassLoader)
(jvm-import org.objectweb.asm.MethodVisitor)

(type: Blob Byte-Array)

(type: JVM-State
  {#visitor (Maybe MethodVisitor)
   #loader ClassLoader
   #store (A;Atom (D;Dict Text Blob))
   })

(def: host-state
  JVM-State
  (let [store (A;new (D;new text;Hash<Text>))]
    {#visitor #;None
     #loader (memory-class-loader store)
     #store store
     }))