From aa7f1d12ae98da9726bf8bbdd3c494a671e3f94b Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 27 Apr 2019 21:58:14 -0400 Subject: Moved the modules under "lux/host/" to now be under "lux/target/". --- stdlib/source/lux/host/js.lux | 397 ------------------ stdlib/source/lux/host/jvm/attribute.lux | 103 ----- stdlib/source/lux/host/jvm/class.lux | 128 ------ stdlib/source/lux/host/jvm/constant.lux | 192 --------- stdlib/source/lux/host/jvm/constant/pool.lux | 79 ---- stdlib/source/lux/host/jvm/constant/tag.lux | 49 --- stdlib/source/lux/host/jvm/descriptor.lux | 84 ---- stdlib/source/lux/host/jvm/encoding.lux | 52 --- stdlib/source/lux/host/jvm/field.lux | 71 ---- stdlib/source/lux/host/jvm/index.lux | 33 -- stdlib/source/lux/host/jvm/loader.old.lux | 126 ------ stdlib/source/lux/host/jvm/magic.lux | 19 - stdlib/source/lux/host/jvm/method.lux | 62 --- stdlib/source/lux/host/jvm/modifier.lux | 84 ---- stdlib/source/lux/host/jvm/modifier/inner.lux | 30 -- stdlib/source/lux/host/jvm/name.lux | 32 -- stdlib/source/lux/host/jvm/version.lux | 38 -- stdlib/source/lux/host/lua.lux | 310 -------------- stdlib/source/lux/host/php.lux | 444 --------------------- stdlib/source/lux/host/python.lux | 435 -------------------- stdlib/source/lux/host/ruby.lux | 388 ------------------ stdlib/source/lux/host/scheme.lux | 317 --------------- stdlib/source/lux/target/js.lux | 397 ++++++++++++++++++ stdlib/source/lux/target/jvm/attribute.lux | 103 +++++ stdlib/source/lux/target/jvm/class.lux | 128 ++++++ stdlib/source/lux/target/jvm/constant.lux | 192 +++++++++ stdlib/source/lux/target/jvm/constant/pool.lux | 79 ++++ stdlib/source/lux/target/jvm/constant/tag.lux | 49 +++ stdlib/source/lux/target/jvm/descriptor.lux | 84 ++++ stdlib/source/lux/target/jvm/encoding.lux | 52 +++ stdlib/source/lux/target/jvm/field.lux | 71 ++++ stdlib/source/lux/target/jvm/index.lux | 33 ++ stdlib/source/lux/target/jvm/loader.old.lux | 126 ++++++ stdlib/source/lux/target/jvm/magic.lux | 19 + stdlib/source/lux/target/jvm/method.lux | 62 +++ stdlib/source/lux/target/jvm/modifier.lux | 84 ++++ stdlib/source/lux/target/jvm/modifier/inner.lux | 30 ++ stdlib/source/lux/target/jvm/name.lux | 32 ++ stdlib/source/lux/target/jvm/version.lux | 38 ++ stdlib/source/lux/target/lua.lux | 310 ++++++++++++++ stdlib/source/lux/target/php.lux | 444 +++++++++++++++++++++ stdlib/source/lux/target/python.lux | 435 ++++++++++++++++++++ stdlib/source/lux/target/ruby.lux | 388 ++++++++++++++++++ stdlib/source/lux/target/scheme.lux | 317 +++++++++++++++ .../lux/tool/compiler/meta/packager/script.lux | 2 +- .../lux/tool/compiler/phase/generation/js/case.lux | 2 +- .../phase/generation/js/extension/common.lux | 3 +- .../tool/compiler/phase/generation/js/function.lux | 2 +- .../lux/tool/compiler/phase/generation/js/loop.lux | 2 +- .../compiler/phase/generation/js/primitive.lux | 2 +- .../compiler/phase/generation/js/reference.lux | 2 +- .../tool/compiler/phase/generation/js/runtime.lux | 2 +- .../compiler/phase/generation/js/structure.lux | 2 +- .../tool/compiler/phase/generation/lua/case.lux | 2 +- .../phase/generation/lua/extension/common.lux | 3 +- .../compiler/phase/generation/lua/function.lux | 2 +- .../tool/compiler/phase/generation/lua/loop.lux | 2 +- .../compiler/phase/generation/lua/primitive.lux | 2 +- .../compiler/phase/generation/lua/reference.lux | 7 +- .../tool/compiler/phase/generation/lua/runtime.lux | 2 +- .../compiler/phase/generation/lua/structure.lux | 2 +- .../tool/compiler/phase/generation/php/case.lux | 2 +- .../phase/generation/php/extension/common.lux | 3 +- .../compiler/phase/generation/php/function.lux | 2 +- .../tool/compiler/phase/generation/php/loop.lux | 2 +- .../compiler/phase/generation/php/primitive.lux | 2 +- .../compiler/phase/generation/php/reference.lux | 2 +- .../tool/compiler/phase/generation/php/runtime.lux | 2 +- .../compiler/phase/generation/php/structure.lux | 2 +- .../tool/compiler/phase/generation/python/case.lux | 2 +- .../phase/generation/python/extension/common.lux | 3 +- .../compiler/phase/generation/python/function.lux | 2 +- .../tool/compiler/phase/generation/python/loop.lux | 2 +- .../compiler/phase/generation/python/primitive.lux | 2 +- .../compiler/phase/generation/python/reference.lux | 7 +- .../compiler/phase/generation/python/runtime.lux | 2 +- .../compiler/phase/generation/python/structure.lux | 6 +- .../tool/compiler/phase/generation/ruby/case.lux | 2 +- .../phase/generation/ruby/extension/common.lux | 3 +- .../compiler/phase/generation/ruby/function.lux | 2 +- .../tool/compiler/phase/generation/ruby/loop.lux | 2 +- .../compiler/phase/generation/ruby/primitive.lux | 2 +- .../compiler/phase/generation/ruby/reference.lux | 7 +- .../compiler/phase/generation/ruby/runtime.lux | 2 +- .../compiler/phase/generation/ruby/structure.lux | 2 +- .../tool/compiler/phase/generation/scheme/case.lux | 2 +- .../phase/generation/scheme/extension/common.lux | 3 +- .../compiler/phase/generation/scheme/function.lux | 2 +- .../tool/compiler/phase/generation/scheme/loop.lux | 2 +- .../compiler/phase/generation/scheme/primitive.lux | 2 +- .../compiler/phase/generation/scheme/reference.lux | 2 +- .../compiler/phase/generation/scheme/runtime.lux | 2 +- .../compiler/phase/generation/scheme/structure.lux | 2 +- stdlib/source/test/lux.lux | 9 +- stdlib/source/test/lux/host/jvm.old.lux | 89 ----- stdlib/source/test/lux/target/jvm.old.lux | 89 +++++ 96 files changed, 3630 insertions(+), 3626 deletions(-) delete mode 100644 stdlib/source/lux/host/js.lux delete mode 100644 stdlib/source/lux/host/jvm/attribute.lux delete mode 100644 stdlib/source/lux/host/jvm/class.lux delete mode 100644 stdlib/source/lux/host/jvm/constant.lux delete mode 100644 stdlib/source/lux/host/jvm/constant/pool.lux delete mode 100644 stdlib/source/lux/host/jvm/constant/tag.lux delete mode 100644 stdlib/source/lux/host/jvm/descriptor.lux delete mode 100644 stdlib/source/lux/host/jvm/encoding.lux delete mode 100644 stdlib/source/lux/host/jvm/field.lux delete mode 100644 stdlib/source/lux/host/jvm/index.lux delete mode 100644 stdlib/source/lux/host/jvm/loader.old.lux delete mode 100644 stdlib/source/lux/host/jvm/magic.lux delete mode 100644 stdlib/source/lux/host/jvm/method.lux delete mode 100644 stdlib/source/lux/host/jvm/modifier.lux delete mode 100644 stdlib/source/lux/host/jvm/modifier/inner.lux delete mode 100644 stdlib/source/lux/host/jvm/name.lux delete mode 100644 stdlib/source/lux/host/jvm/version.lux delete mode 100644 stdlib/source/lux/host/lua.lux delete mode 100644 stdlib/source/lux/host/php.lux delete mode 100644 stdlib/source/lux/host/python.lux delete mode 100644 stdlib/source/lux/host/ruby.lux delete mode 100644 stdlib/source/lux/host/scheme.lux create mode 100644 stdlib/source/lux/target/js.lux create mode 100644 stdlib/source/lux/target/jvm/attribute.lux create mode 100644 stdlib/source/lux/target/jvm/class.lux create mode 100644 stdlib/source/lux/target/jvm/constant.lux create mode 100644 stdlib/source/lux/target/jvm/constant/pool.lux create mode 100644 stdlib/source/lux/target/jvm/constant/tag.lux create mode 100644 stdlib/source/lux/target/jvm/descriptor.lux create mode 100644 stdlib/source/lux/target/jvm/encoding.lux create mode 100644 stdlib/source/lux/target/jvm/field.lux create mode 100644 stdlib/source/lux/target/jvm/index.lux create mode 100644 stdlib/source/lux/target/jvm/loader.old.lux create mode 100644 stdlib/source/lux/target/jvm/magic.lux create mode 100644 stdlib/source/lux/target/jvm/method.lux create mode 100644 stdlib/source/lux/target/jvm/modifier.lux create mode 100644 stdlib/source/lux/target/jvm/modifier/inner.lux create mode 100644 stdlib/source/lux/target/jvm/name.lux create mode 100644 stdlib/source/lux/target/jvm/version.lux create mode 100644 stdlib/source/lux/target/lua.lux create mode 100644 stdlib/source/lux/target/php.lux create mode 100644 stdlib/source/lux/target/python.lux create mode 100644 stdlib/source/lux/target/ruby.lux create mode 100644 stdlib/source/lux/target/scheme.lux delete mode 100644 stdlib/source/test/lux/host/jvm.old.lux create mode 100644 stdlib/source/test/lux/target/jvm.old.lux diff --git a/stdlib/source/lux/host/js.lux b/stdlib/source/lux/host/js.lux deleted file mode 100644 index 756530817..000000000 --- a/stdlib/source/lux/host/js.lux +++ /dev/null @@ -1,397 +0,0 @@ -(.module: - [lux (#- Code or and function if cond undefined for comment false true not) - [control - [pipe (#+ case>)]] - [data - ["." text - format] - [collection - ["." list ("#@." functor fold)]]] - [macro - ["." template]] - [type - abstract]]) - -(def: argument (text.enclose ["(" ")"])) -(def: element (text.enclose ["[" "]"])) - -(abstract: #export (Code brand) - {} - - Text - - (def: #export code - (-> (Code Any) Text) - (|>> :representation)) - - (template [ +] - [(abstract: #export ( brand) {} Any) - (`` (type: #export (|> Any (~~ (template.splice +)))))] - - [Expression Expression' [Code]] - [Computation Computation' [Expression' Code]] - [Location Location' [Computation' Expression' Code]] - [Statement Statement' [Code]] - ) - - (template [ +] - [(abstract: #export {} Any) - (`` (type: #export (|> (~~ (template.splice +)))))] - - [Var Var' [Location' Computation' Expression' Code]] - [Access Access' [Location' Computation' Expression' Code]] - [Loop Loop' [Statement' Code]] - [Label Label' [Code]] - ) - - (template [ ] - [(def: #export Computation (|> ..argument :abstraction))] - - [null "null"] - [undefined "undefined"] - [false "false"] - [true "true"] - [positive-infinity "Infinity"] - [negative-infinity "-Infinity"] - [not-a-number "NaN"] - ) - - (def: #export boolean - (-> Bit Computation) - (|>> (case> - #0 ..false - #1 ..true))) - - (def: #export number - (-> Frac Computation) - (|>> %f ..argument :abstraction)) - - (def: sanitize - (-> Text Text) - (`` (|>> (~~ (template [ ] - [(text.replace-all )] - - ["\" "\\"] - [text.tab "\t"] - [text.vertical-tab "\v"] - [text.null "\0"] - [text.back-space "\b"] - [text.form-feed "\f"] - [text.new-line "\n"] - [text.carriage-return "\r"] - [text.double-quote (format "\" text.double-quote)] - )) - ))) - - (def: #export string - (-> Text Computation) - (|>> ..sanitize - (text.enclose [text.double-quote text.double-quote]) - :abstraction)) - - (def: argument-separator ", ") - (def: field-separator ": ") - (def: statement-suffix ";") - - (def: #export array - (-> (List Expression) Computation) - (|>> (list@map ..code) - (text.join-with ..argument-separator) - ..element - :abstraction)) - - (def: #export var - (-> Text Var) - (|>> :abstraction)) - - (def: #export (at index array-or-object) - (-> Expression Expression Access) - (|> (format (:representation array-or-object) (..element (:representation index))) - ..argument - :abstraction)) - - (def: #export (the field object) - (-> Text Expression Access) - (:abstraction (format (:representation object) "." field))) - - (def: #export (apply/* function inputs) - (-> Expression (List Expression) Computation) - (|> inputs - (list@map ..code) - (text.join-with ..argument-separator) - ..argument - (format (:representation function)) - :abstraction)) - - (def: #export (do method inputs object) - (-> Text (List Expression) Expression Computation) - (apply/* (..the method object) inputs)) - - (def: #export object - (-> (List [Text Expression]) Computation) - (|>> (list@map (.function (_ [key val]) - (format (:representation (..string key)) ..field-separator (:representation val)))) - (text.join-with ..argument-separator) - (text.enclose ["{" "}"]) - ..argument - :abstraction)) - - (def: #export (, pre post) - (-> Expression Expression Computation) - (|> (format (:representation pre) ", " (:representation post)) - ..argument - :abstraction)) - - (def: #export (then pre post) - (-> Statement Statement Statement) - (:abstraction (format (:representation pre) - text.new-line - (:representation post)))) - - ## (def: indent - ## (-> Text Text) - ## (text.replace-all text.new-line (format text.new-line text.tab))) - - (def: block - (-> Statement Text) - (let [close (format text.new-line "}")] - (|>> :representation - (format text.new-line) - ## ..indent - (text.enclose ["{" - close])))) - - (def: #export (function name inputs body) - (-> Var (List Var) Statement Computation) - (|> body - ..block - (format "function " (:representation name) - (|> inputs - (list@map ..code) - (text.join-with ..argument-separator) - ..argument) - " ") - ..argument - :abstraction)) - - (def: #export (closure inputs body) - (-> (List Var) Statement Computation) - (|> body - ..block - (format "function" - (|> inputs - (list@map ..code) - (text.join-with ..argument-separator) - ..argument) - " ") - ..argument - :abstraction)) - - (template [ ] - [(def: #export ( param subject) - (-> Expression Expression Computation) - (|> (format (:representation subject) " " " " (:representation param)) - ..argument - :abstraction))] - - [= "==="] - [< "<"] - [<= "<="] - [> ">"] - [>= ">="] - - [+ "+"] - [- "-"] - [* "*"] - [/ "/"] - [% "%"] - - [left-shift "<<"] - [arithmetic-right-shift ">>"] - [logic-right-shift ">>>"] - - [or "||"] - [and "&&"] - [bit-xor "^"] - [bit-or "|"] - [bit-and "&"] - ) - - (template [ ] - [(def: #export - (-> Expression Computation) - (|>> :representation (text.prefix ) ..argument :abstraction))] - - [not "!"] - [bit-not "~"] - [negate "-"] - ) - - (template [ ] - [(def: #export ( value) - {#.doc "A 32-bit integer expression."} - (-> Computation) - (:abstraction (..argument (format ( value) "|0"))))] - - [to-i32 Expression :representation] - [i32 Int %i] - ) - - (def: #export (? test then else) - (-> Expression Expression Expression Computation) - (|> (format (:representation test) - " ? " (:representation then) - " : " (:representation else)) - ..argument - :abstraction)) - - (def: #export type-of - (-> Expression Computation) - (|>> :representation - (format "typeof ") - ..argument - :abstraction)) - - (def: #export (new constructor inputs) - (-> Expression (List Expression) Computation) - (|> (format "new " (:representation constructor) - (|> inputs - (list@map ..code) - (text.join-with ..argument-separator) - ..argument)) - ..argument - :abstraction)) - - (def: #export statement - (-> Expression Statement) - (|>> :representation (text.suffix ..statement-suffix) :abstraction)) - - (def: #export use-strict - Statement - (:abstraction (format text.double-quote "use strict" text.double-quote ..statement-suffix))) - - (def: #export (declare name) - (-> Var Statement) - (:abstraction (format "var " (:representation name) ..statement-suffix))) - - (def: #export (define name value) - (-> Var Expression Statement) - (:abstraction (format "var " (:representation name) " = " (:representation value) ..statement-suffix))) - - (def: #export (set name value) - (-> Location Expression Statement) - (:abstraction (format (:representation name) " = " (:representation value) ..statement-suffix))) - - (def: #export (throw message) - (-> Expression Statement) - (:abstraction (format "throw " (:representation message) ..statement-suffix))) - - (def: #export (return value) - (-> Expression Statement) - (:abstraction (format "return " (:representation value) ..statement-suffix))) - - (def: #export (delete value) - (-> Location Statement) - (:abstraction (format "delete " (:representation value) ..statement-suffix))) - - (def: #export (if test then! else!) - (-> Expression Statement Statement Statement) - (:abstraction (format "if(" (:representation test) ") " - (..block then!) - " else " - (..block else!)))) - - (def: #export (when test then!) - (-> Expression Statement Statement) - (:abstraction (format "if(" (:representation test) ") " - (..block then!)))) - - (def: #export (while test body) - (-> Expression Statement Loop) - (:abstraction (format "while(" (:representation test) ") " - (..block body)))) - - (def: #export (do-while test body) - (-> Expression Statement Loop) - (:abstraction (format "do " (..block body) - " while(" (:representation test) ")" ..statement-suffix))) - - (def: #export (try body [exception catch]) - (-> Statement [Var Statement] Statement) - (:abstraction (format "try " - (..block body) - " catch(" (:representation exception) ") " - (..block catch)))) - - (def: #export (for var init condition update iteration) - (-> Var Expression Expression Expression Statement Loop) - (:abstraction (format "for(" (:representation (..define var init)) - " " (:representation condition) - ..statement-suffix " " (:representation update) - ")" - (..block iteration)))) - - (def: #export label - (-> Text Label) - (|>> :abstraction)) - - (def: #export (with-label label loop) - (-> Label Loop Statement) - (:abstraction (format (:representation label) ": " (:representation loop)))) - - (template [ <0> <1>] - [(def: #export <0> - Statement - (:abstraction (format ..statement-suffix))) - - (def: #export (<1> label) - (-> Label Statement) - (:abstraction (format " " (:representation label) ..statement-suffix)))] - - ["break" break break-at] - ["continue" continue continue-at] - ) - - (template [ ] - [(def: #export - (-> Location Expression) - (|>> :representation - (text.suffix ) - :abstraction))] - - [++ "++"] - [-- "--"] - ) - - (def: #export (comment commentary on) - (All [kind] (-> Text (Code kind) (Code kind))) - (:abstraction (format "/* " commentary " */" " " (:representation on)))) - ) - -(def: #export (cond clauses else!) - (-> (List [Expression Statement]) Statement Statement) - (list@fold (.function (_ [test then!] next!) - (..if test then! next!)) - else! - (list.reverse clauses))) - -(template [ + + +] - [(`` (def: #export ( function) - (-> Expression (~~ (template.splice +)) Computation) - (.function (_ (~~ (template.splice +))) - (..apply/* function (list (~~ (template.splice +))))))) - - (`` (template [ ] - [(def: #export ( (..var )))] - - (~~ (template.splice +))))] - - [apply/1 [_0] [Expression] - [[not-a-number? "isNaN"]]] - - [apply/2 [_0 _1] [Expression Expression] - []] - - [apply/3 [_0 _1 _2] [Expression Expression Expression] - []] - ) diff --git a/stdlib/source/lux/host/jvm/attribute.lux b/stdlib/source/lux/host/jvm/attribute.lux deleted file mode 100644 index bcd3a3734..000000000 --- a/stdlib/source/lux/host/jvm/attribute.lux +++ /dev/null @@ -1,103 +0,0 @@ -(.module: - [lux (#- Info Code' Code) - [abstract - ["." equivalence (#+ Equivalence)] - [monad (#+ do)]] - [control - ["." state (#+ State)]] - [data - [format - ["." binary (#+ Format)]] - [collection - ["." row (#+ Row)]]] - [world - [binary (#+ Binary)]]] - ["." // #_ - ["#." encoding (#+ U2 U4)] - ["#." index (#+ Index)] - ["#." constant (#+ UTF8 Class Value) - ["#/." pool (#+ Pool)]]]) - -(type: #export (Info about) - {#name (Index UTF8) - #length U4 - #info about}) - -(def: #export (info-equivalence Equivalence) - (All [about] - (-> (Equivalence about) - (Equivalence (Info about)))) - ($_ equivalence.product - //index.equivalence - //encoding.u4-equivalence - Equivalence)) - -(def: (info-format about) - (All [about] - (-> (Format about) - (Format (Info about)))) - ($_ binary.and - //index.format - //encoding.u4-format - about)) - -(type: #export Constant - (Info (Index (Value Any)))) - -(def: #export constant-equivalence - (Equivalence Constant) - (..info-equivalence //index.equivalence)) - -(def: constant-format - (Format Constant) - (..info-format //index.format)) - -(type: #export Label U2) - -(type: #export Exception - {#start-pc Label - #end-pc Label - #handler-pc Label - #catch-type (Index Class)}) - -(type: #export (Code' Attribute) - {#max-stack U2 - #max-locals U2 - #code Binary - #exception-table (Row Exception) - #attributes (Row Attribute)}) - -(with-expansions [ (as-is (Info (Code' Attribute)))] - (type: #export #rec Attribute - (#Constant Constant) - ## (#Code ) - ) - - ## (type: #export Code - ## ) - ) - -(def: #export equivalence - (Equivalence Attribute) - ..constant-equivalence) - -(def: #export (constant index) - (-> (Index (Value Any)) - (State Pool Attribute)) - (do state.monad - [@name (//constant/pool.utf8 "ConstantValue")] - (wrap (#Constant {#name @name - #length (//encoding.to-u4 //encoding.u2-bytes) - #info index})))) - -## (def: #export (code specification) -## (-> Code' (State Pool Attribute)) -## (do state.monad -## [@name (//constant/pool.utf8 "Code")] -## (wrap (#Code {#name @name -## #length (undefined) -## #info specification})))) - -(def: #export format - (Format Attribute) - ..constant-format) diff --git a/stdlib/source/lux/host/jvm/class.lux b/stdlib/source/lux/host/jvm/class.lux deleted file mode 100644 index 6fb6f48d4..000000000 --- a/stdlib/source/lux/host/jvm/class.lux +++ /dev/null @@ -1,128 +0,0 @@ -(.module: - [lux #* - [abstract - ["." equivalence (#+ Equivalence)] - [monoid (#+)] - ["." monad (#+ do)]] - [control - [parser (#+)] - ["." state (#+ State)]] - [data - [number (#+) - [i64 (#+)]] - [format - ["." binary (#+ Format)]] - [collection - ["." row (#+ Row)]]] - [type - [abstract (#+)]]] - ["." // #_ - ["#." encoding (#+)] - ["#." modifier (#+ modifiers:)] - ["#." version (#+ Version Minor Major)] - ["#." name (#+ Internal)] - ["#." magic (#+ Magic)] - ["#." index (#+ Index)] - ["#." attribute (#+ Attribute)] - ["#." field (#+ Field)] - ["#." method (#+ Method)] - ["#." constant (#+ Constant) - ["#/." pool (#+ Pool)]]]) - -(modifiers: - ["0001" public] - ["0010" final] - ["0020" super] - ["0200" interface] - ["0400" abstract] - ["1000" synthetic] - ["2000" annotation] - ["4000" enum] - ) - -(type: #export Class - {#magic Magic - #minor-version Minor - #major-version Major - #constant-pool Pool - #modifier Modifier - #this (Index //constant.Class) - #super (Index //constant.Class) - #interfaces (Row (Index //constant.Class)) - #fields (Row Field) - #methods (Row Method) - #attributes (Row Attribute)}) - -(def: #export equivalence - (Equivalence Class) - ($_ equivalence.product - //encoding.u4-equivalence - //encoding.u2-equivalence - //encoding.u2-equivalence - //constant/pool.equivalence - ..modifier-equivalence - //index.equivalence - //index.equivalence - (row.equivalence //index.equivalence) - (row.equivalence //field.equivalence) - (row.equivalence //method.equivalence) - (row.equivalence //attribute.equivalence))) - -(def: default-minor-version Minor (//version.version 0)) - -(def: (install-classes this super interfaces) - (-> Internal Internal (List Internal) - (State Pool [(Index //constant.Class) (Index //constant.Class) (Row (Index //constant.Class))])) - (do state.monad - [@this (//constant/pool.class (//name.read this)) - @super (//constant/pool.class (//name.read super)) - @interfaces (: (State Pool (Row (Index //constant.Class))) - (monad.fold @ (function (_ interface @interfaces) - (do @ - [@interface (//constant/pool.class (//name.read interface))] - (wrap (row.add @interface @interfaces)))) - row.empty - interfaces))] - (wrap [@this @super @interfaces]))) - -(def: #export (class version modifier - super this interfaces - fields methods attributes) - (-> Major Modifier - Internal Internal (List Internal) - (List (State Pool Field)) - (Row Method) - (Row Attribute) - Class) - (let [[pool [@this @super @interfaces] =fields] - (state.run //constant/pool.empty - (do state.monad - [classes (install-classes this super interfaces) - =fields (monad.seq state.monad fields)] - (wrap [classes =fields])))] - {#magic //magic.code - #minor-version ..default-minor-version - #major-version version - #constant-pool pool - #modifier modifier - #this @this - #super @super - #interfaces @interfaces - #fields (row.from-list =fields) - #methods methods - #attributes attributes})) - -(def: #export format - (Format Class) - ($_ binary.and - //magic.format - //version.format - //version.format - //constant/pool.format - ..modifier-format - //index.format - //index.format - (binary.row/16 //index.format) - (binary.row/16 //field.format) - (binary.row/16 //method.format) - (binary.row/16 //attribute.format))) diff --git a/stdlib/source/lux/host/jvm/constant.lux b/stdlib/source/lux/host/jvm/constant.lux deleted file mode 100644 index 3af24af55..000000000 --- a/stdlib/source/lux/host/jvm/constant.lux +++ /dev/null @@ -1,192 +0,0 @@ -(.module: - [lux #* - [abstract - [monad (#+ do)] - ["." equivalence (#+ Equivalence)]] - [control - ["." parser]] - [data - [number - ["." int] - ["." frac]] - ["." text] - [format - ["." binary (#+ Format) ("#;." monoid)]] - [collection - ["." row (#+ Row)]]] - [type - abstract]] - ["." / #_ - ["#." tag ("#;." equivalence)] - ["." // #_ - [encoding (#+ U4)] - [descriptor (#+ Descriptor)] - ["#." index (#+ Index)]]]) - -(type: #export UTF8 Text) - -(def: utf8-format - (Format UTF8) - binary.utf8/16) - -(abstract: #export Class - {} - - (Index UTF8) - - (def: #export class - (-> (Index UTF8) Class) - (|>> :abstraction)) - - (def: #export class-equivalence - (Equivalence Class) - (:: equivalence.contravariant map-1 - (|>> :representation) - //index.equivalence)) - - (def: class-format - (Format Class) - (binary.adapt (|>> :abstraction) - (|>> :representation) - //index.format)) - ) - -(abstract: #export (Value kind) - - {} - - kind - - (def: #export value - (All [kind] (-> (Value kind) kind)) - (|>> :representation)) - - (def: #export (value-equivalence Equivalence) - (All [kind] - (-> (Equivalence kind) - (Equivalence (Value kind)))) - (:: equivalence.contravariant map-1 - (|>> :representation) - Equivalence)) - - (template [ ] - [(type: #export (Value )) - - (def: #export - (-> ) - (|>> :abstraction))] - - [integer Integer U4] - [long Long .Int] - [float Float Nothing] - [double Double Frac] - [string String (Index UTF8)] - ) - - (template [ ] - [(def: - (Format ) - (binary.adapt (|>> :abstraction) - (|>> :representation ) - ))] - - [long-format Long .int (<|) binary.bits/64] - [double-format Double frac.bits-to-frac frac.frac-to-bits binary.bits/64] - [string-format String (<|) (<|) //index.format] - ) - ) - -(type: #export Name-And-Type - {#name (Index UTF8) - #descriptor (Index (Descriptor Any))}) - -(type: #export Reference - {#class (Index Class) - #name-and-type (Index Name-And-Type)}) - -(template [ ] - [(def: #export - (Equivalence ) - ($_ equivalence.product - //index.equivalence - //index.equivalence)) - - (def: #export - (Format ) - ($_ binary.and - //index.format - //index.format))] - - [Name-And-Type name-and-type-equivalence name-and-type-format] - [Reference reference-equivalence reference-format] - ) - -(type: #export Constant - (#UTF8 UTF8) - (#Long Long) - (#Double Double) - (#Class Class) - (#String String) - (#Field Reference) - (#Method Reference) - (#Interface-Method Reference) - (#Name-And-Type Name-And-Type)) - -(def: #export equivalence - (Equivalence Constant) - ($_ equivalence.sum - ## #UTF8 - text.equivalence - ## #Long - (..value-equivalence int.equivalence) - ## #Double - (..value-equivalence frac.equivalence) - ## #Class - ..class-equivalence - ## #String - (..value-equivalence //index.equivalence) - ## #Field - ..reference-equivalence - ## #Method - ..reference-equivalence - ## #Interface-Method - ..reference-equivalence - ## #Name-And-Type - ..name-and-type-equivalence - )) - -(def: #export format - (Format Constant) - (with-expansions [ (as-is [#UTF8 /tag.utf8 ..utf8-format] - ## TODO: Integer - ## TODO: Float - [#Long /tag.long ..long-format] - [#Double /tag.double ..double-format] - [#Class /tag.class ..class-format] - [#String /tag.string ..string-format] - [#Field /tag.field ..reference-format] - [#Method /tag.method ..reference-format] - [#Interface-Method /tag.interface-method ..reference-format] - [#Name-And-Type /tag.name-and-type ..name-and-type-format] - ## TODO: Method-Handle - ## TODO: Method-Type - ## TODO: Invoke-Dynamic - )] - {#binary.reader (do parser.monad - [tag (get@ #binary.reader /tag.format)] - (`` (cond (~~ (template [ ] - [(/tag;= tag) - (:: @ map (|>> ) (get@ #binary.reader ))] - - )) - - ## else - (parser.fail "Cannot parse constant.")))) - #binary.writer (function (_ value) - (case value - (^template [ ] - ( value) - (binary;compose ((get@ #binary.writer /tag.format) ) - ((get@ #binary.writer ) value))) - () - ))})) diff --git a/stdlib/source/lux/host/jvm/constant/pool.lux b/stdlib/source/lux/host/jvm/constant/pool.lux deleted file mode 100644 index a304d5ac4..000000000 --- a/stdlib/source/lux/host/jvm/constant/pool.lux +++ /dev/null @@ -1,79 +0,0 @@ -(.module: - [lux #* - [abstract - ["." equivalence (#+ Equivalence)] - [monad (#+ do)]] - [control - ["." state (#+ State)]] - [data - ["." text ("#;." equivalence)] - [format - ["." binary (#+ Format)]] - [collection - ["." list ("#;." fold)] - ["." row (#+ Row)]]] - [type - abstract]] - ["." // (#+ UTF8 Class Constant) ("#;." class-equivalence) - [// - ["." encoding] - ["." index (#+ Index)] - ["." descriptor (#+ Descriptor)]]]) - -(def: offset 1) - -(type: #export Pool (Row Constant)) - -(def: #export equivalence - (Equivalence Pool) - (row.equivalence //.equivalence)) - -(template: (!add <=>) - (function (_ pool) - (with-expansions [ (as-is (index.index (encoding.to-u2 (n/+ offset idx)))) - (as-is (recur (.inc idx)))] - (loop [idx 0] - (case (row.nth idx pool) - (#.Some entry) - (case entry - ( reference) - (if (<=> reference ) - [pool - ] - ) - - _ - ) - - #.None - [(row.add ( ) pool) - ]))))) - -(def: #export (utf8 value) - (-> UTF8 (State Pool (Index UTF8))) - (!add value #//.UTF8 text;=)) - -(def: (class' value) - (-> Class (State Pool (Index Class))) - (!add value #//.Class //;=)) - -(def: #export (class name) - (-> UTF8 (State Pool (Index Class))) - (do state.monad - [@name (utf8 name)] - (class' (//.class @name)))) - -(def: #export (descriptor value) - (All [kind] - (-> (Descriptor kind) - (State Pool (Index (Descriptor kind))))) - (let [value (descriptor.descriptor value)] - (!add value #//.UTF8 text;=))) - -(def: #export format - (Format Pool) - (binary.row/16' ..offset //.format)) - -(def: #export empty - Pool - row.empty) diff --git a/stdlib/source/lux/host/jvm/constant/tag.lux b/stdlib/source/lux/host/jvm/constant/tag.lux deleted file mode 100644 index 71e75f40b..000000000 --- a/stdlib/source/lux/host/jvm/constant/tag.lux +++ /dev/null @@ -1,49 +0,0 @@ -(.module: - [lux #* - [abstract - [equivalence (#+ Equivalence)]] - [data - [format - ["." binary (#+ Format)]]] - [type - abstract]] - [/// - ["." encoding (#+ U1) ("u1/." u1-equivalence)]]) - -(abstract: #export Tag - {} - - U1 - - (structure: #export equivalence (Equivalence Tag) - (def: (= reference sample) - (u1/= (:representation reference) - (:representation sample)))) - - (template [ ] - [(def: #export - Tag - (:abstraction (encoding.to-u1 )))] - - [01 utf8] - [03 integer] - [04 float] - [05 long] - [06 double] - [07 class] - [08 string] - [09 field] - [10 method] - [11 interface-method] - [12 name-and-type] - [15 method-handle] - [16 method-type] - [18 invoke-dynamic] - ) - - (def: #export format - (Format Tag) - (binary.adapt (|>> :abstraction) - (|>> :representation) - encoding.u1-format)) - ) diff --git a/stdlib/source/lux/host/jvm/descriptor.lux b/stdlib/source/lux/host/jvm/descriptor.lux deleted file mode 100644 index d350cec65..000000000 --- a/stdlib/source/lux/host/jvm/descriptor.lux +++ /dev/null @@ -1,84 +0,0 @@ -(.module: - [lux (#- int char) - [data - ["." text - format] - [collection - ["." list ("#;." functor)]]] - [type - abstract]] - ["." // #_ - ["#." name (#+ Internal)]]) - -(abstract: #export Base' {} Any) -(abstract: #export Object' {} Any) -(abstract: #export Array' {} Any) -(abstract: #export Void' {} Any) - -(abstract: #export (Value' kind) {} Any) -(abstract: #export (Return kind) {} Any) - -(abstract: #export Method {} Any) - -(abstract: #export (Descriptor kind) - {} - - Text - - (type: #export (Value kind) (Return (Value' kind))) - (type: #export Void (Return Void')) - - (template [ ] - [(type: #export (Value ))] - - [Base Base'] - [Object Object'] - [Array Array']) - - (template [ ] - [(def: #export - (Descriptor ) - (:abstraction ))] - - ["Z" boolean Base] - - ["B" byte Base] - ["S" short Base] - ["I" int Base] - ["J" long Base] - - ["C" char Base] - - ["F" float Base] - ["D" double Base] - - ["V" void Void]) - - (def: #export object - (-> Internal (Descriptor Object)) - (|>> //name.read - (text.enclose ["L" ";"]) - :abstraction)) - - (def: #export array - (-> (Descriptor (Value Any)) - (Descriptor Array)) - (|>> :representation - (format "[") - :abstraction)) - - (def: #export (method inputs output) - (-> (List (Descriptor (Value Any))) - (Descriptor (Return Any)) - (Descriptor Method)) - (:abstraction - (format (|> inputs - (list;map (|>> :representation)) - (text.join-with "") - (text.enclose ["(" ")"])) - (:representation output)))) - - (def: #export descriptor - (-> (Descriptor Any) Text) - (|>> :representation)) - ) diff --git a/stdlib/source/lux/host/jvm/encoding.lux b/stdlib/source/lux/host/jvm/encoding.lux deleted file mode 100644 index 33ac427c2..000000000 --- a/stdlib/source/lux/host/jvm/encoding.lux +++ /dev/null @@ -1,52 +0,0 @@ -(.module: - [lux #* - [abstract - [equivalence (#+ Equivalence)]] - [control - ["." parser ("#;." functor)]] - [data - [number - ["." i64]] - [format - ["." binary (#+ Format)]]] - [type - abstract]]) - -(template [ ] - [(abstract: #export - {} - - (I64 Any) - - (def: #export Nat ) - - (def: #export - (-> (I64 Any) ) - (let [mask (|> - (n/* i64.bits-per-byte) - i64.mask)] - (|>> (i64.and mask) :abstraction))) - - (def: #export - (-> (I64 Any)) - (|>> :representation)) - - (structure: #export (Equivalence ) - (def: (= reference sample) - ("lux i64 =" (:representation reference) (:representation sample)))) - )] - - [1 U1 u1-bytes to-u1 from-u1 u1-equivalence] - [2 U2 u2-bytes to-u2 from-u2 u2-equivalence] - [4 U4 u4-bytes to-u4 from-u4 u4-equivalence] - ) - -(template [ ] - [(def: #export - (Format ) - (binary.adapt ))] - - [u1-format U1 binary.bits/8 ..from-u1 ..to-u1] - [u2-format U2 binary.bits/16 ..from-u2 ..to-u2] - [u4-format U4 binary.bits/32 ..from-u4 ..to-u4] - ) diff --git a/stdlib/source/lux/host/jvm/field.lux b/stdlib/source/lux/host/jvm/field.lux deleted file mode 100644 index 930ca97d8..000000000 --- a/stdlib/source/lux/host/jvm/field.lux +++ /dev/null @@ -1,71 +0,0 @@ -(.module: - [lux (#- static) - [abstract - ["." equivalence (#+ Equivalence)] - [monoid (#+)] - ["." monad (#+ do)]] - [control - [parser (#+)] - ["." state (#+ State)]] - [data - [number (#+) - [i64 (#+)]] - [format - ["." binary (#+ Format)]] - [collection - ["." row (#+ Row)]]] - [type - [abstract (#+)]]] - ["." // #_ - [encoding (#+)] - [modifier (#+ modifiers:)] - ["#." constant (#+ UTF8) - ["#/." pool (#+ Pool)]] - ["#." index (#+ Index)] - ["#." attribute (#+ Attribute)] - ["#." descriptor (#+ Descriptor Value)]]) - -(modifiers: - ["0001" public] - ["0002" private] - ["0004" protected] - ["0008" static] - ["0010" final] - ["0040" volatile] - ["0080" transient] - ["1000" synthetic] - ["4000" enum] - ) - -(type: #export Field - {#modifier Modifier - #name (Index UTF8) - #descriptor (Index (Descriptor (Value Any))) - #attributes (Row Attribute)}) - -(def: #export equivalence - (Equivalence Field) - ($_ equivalence.product - ..modifier-equivalence - //index.equivalence - //index.equivalence - (row.equivalence //attribute.equivalence))) - -(def: #export format - (Format Field) - ($_ binary.and - ..modifier-format - //index.format - //index.format - (binary.row/16 //attribute.format))) - -(def: #export (field modifier name descriptor attributes) - (-> Modifier UTF8 (Descriptor (Value Any)) (Row Attribute) - (State Pool Field)) - (do state.monad - [@name (//constant/pool.utf8 name) - @descriptor (//constant/pool.descriptor descriptor)] - (wrap {#modifier modifier - #name @name - #descriptor @descriptor - #attributes attributes}))) diff --git a/stdlib/source/lux/host/jvm/index.lux b/stdlib/source/lux/host/jvm/index.lux deleted file mode 100644 index 3a425dd32..000000000 --- a/stdlib/source/lux/host/jvm/index.lux +++ /dev/null @@ -1,33 +0,0 @@ -(.module: - [lux #* - [abstract - ["." equivalence (#+ Equivalence)]] - [data - [format - ["." binary (#+ Format)]]] - [type - abstract]] - ["." // #_ - ["#." encoding (#+ U2)]]) - -(abstract: #export (Index kind) - {} - - U2 - - (def: #export index - (All [kind] (-> U2 (Index kind))) - (|>> :abstraction)) - - (def: #export equivalence - (All [kind] (Equivalence (Index kind))) - (:: equivalence.contravariant map-1 - (|>> :representation) - //encoding.u2-equivalence)) - - (def: #export format - (All [kind] (Format (Index kind))) - (binary.adapt (|>> :abstraction) - (|>> :representation) - //encoding.u2-format)) - ) diff --git a/stdlib/source/lux/host/jvm/loader.old.lux b/stdlib/source/lux/host/jvm/loader.old.lux deleted file mode 100644 index 0ca92fa23..000000000 --- a/stdlib/source/lux/host/jvm/loader.old.lux +++ /dev/null @@ -1,126 +0,0 @@ -(.module: - [lux #* - [abstract - [monad (#+ do)]] - [control - ["ex" exception (#+ exception:)] - ["." io (#+ IO)] - [concurrency - ["." atom (#+ Atom)]]] - [data - ["." error (#+ Error)] - ["." text - format] - [collection - ["." array] - ["." list ("#;." functor)] - ["." dictionary (#+ Dictionary)]]] - [world - ["." binary (#+ Binary)]] - ["." host (#+ import: object do-to)]]) - -(type: #export Library - (Atom (Dictionary Text Binary))) - -(exception: #export (already-stored {class Text}) - (ex.report ["Class" class])) - -(exception: #export (unknown {class Text} {known-classes (List Text)}) - (ex.report ["Class" class] - ["Known classes" (|> known-classes - (list.sort (:: text.order <)) - (list;map (|>> (format text.new-line text.tab))) - (text.join-with ""))])) - -(exception: #export (cannot-define {class Text} {error Text}) - (ex.report ["Class" class] - ["Error" error])) - -(import: #long java/lang/Object - (getClass [] (java/lang/Class java/lang/Object))) - -(import: #long java/lang/String) - -(import: #long java/lang/reflect/Method - (invoke [java/lang/Object (Array java/lang/Object)] - #try java/lang/Object)) - -(import: #long (java/lang/Class a) - (getDeclaredMethod [java/lang/String (Array (java/lang/Class java/lang/Object))] - #try java/lang/reflect/Method)) - -(import: #long java/lang/Integer - (#static TYPE (java/lang/Class java/lang/Integer))) - -(import: #long java/lang/reflect/AccessibleObject - (setAccessible [boolean] void)) - -(import: #long java/lang/ClassLoader - (loadClass [java/lang/String] - #io #try (java/lang/Class java/lang/Object))) - -(def: java/lang/ClassLoader::defineClass - java/lang/reflect/Method - (let [signature (|> (host.array (java/lang/Class java/lang/Object) 4) - (host.array-write 0 (:coerce (java/lang/Class java/lang/Object) - (host.class-for java/lang/String))) - (host.array-write 1 (java/lang/Object::getClass (host.array byte 0))) - (host.array-write 2 (:coerce (java/lang/Class java/lang/Object) - (java/lang/Integer::TYPE))) - (host.array-write 3 (:coerce (java/lang/Class java/lang/Object) - (java/lang/Integer::TYPE))))] - (do-to (error.assume - (java/lang/Class::getDeclaredMethod "defineClass" - signature - (host.class-for java/lang/ClassLoader))) - (java/lang/reflect/AccessibleObject::setAccessible true)))) - -(def: #export (define class-name bytecode loader) - (-> Text Binary java/lang/ClassLoader (Error java/lang/Object)) - (let [signature (array.from-list (list (:coerce java/lang/Object - class-name) - (:coerce java/lang/Object - bytecode) - (:coerce java/lang/Object - (host.long-to-int +0)) - (:coerce java/lang/Object - (host.long-to-int (.int (binary.size bytecode))))))] - (java/lang/reflect/Method::invoke loader signature java/lang/ClassLoader::defineClass))) - -(def: #export (new-library _) - (-> Any Library) - (atom.atom (dictionary.new text.hash))) - -(def: #export (memory library) - (-> Library java/lang/ClassLoader) - (object [] java/lang/ClassLoader [] - [] - (java/lang/ClassLoader (findClass {class-name java/lang/String}) java/lang/Class - (let [classes (|> library atom.read io.run)] - (case (dictionary.get class-name classes) - (#.Some bytecode) - (case (|> _jvm_this - (..define class-name bytecode)) - (#error.Success class) - (:assume class) - - (#error.Failure error) - (error! (ex.construct ..cannot-define [class-name error]))) - - #.None - (error! (ex.construct ..unknown [class-name (dictionary.keys classes)]))))))) - -(def: #export (store name bytecode library) - (-> Text Binary Library (IO (Error Any))) - (do io.monad - [library' (atom.read library)] - (if (dictionary.contains? name library') - (wrap (ex.throw ..already-stored name)) - (do @ - [_ (atom.update (dictionary.put name bytecode) library)] - (wrap (#error.Success [])))))) - -(def: #export (load name loader) - (-> Text java/lang/ClassLoader - (IO (Error (java/lang/Class java/lang/Object)))) - (java/lang/ClassLoader::loadClass name loader)) diff --git a/stdlib/source/lux/host/jvm/magic.lux b/stdlib/source/lux/host/jvm/magic.lux deleted file mode 100644 index 5b74dc572..000000000 --- a/stdlib/source/lux/host/jvm/magic.lux +++ /dev/null @@ -1,19 +0,0 @@ -(.module: - [lux #* - [data - [number (#+ hex)] - [format - [binary (#+ Format)]]]] - ["." // #_ - ["#." encoding (#+ U4)]]) - -(type: #export Magic - U4) - -(def: #export code - Magic - (//encoding.to-u4 (hex "CAFEBABE"))) - -(def: #export format - (Format Magic) - //encoding.u4-format) diff --git a/stdlib/source/lux/host/jvm/method.lux b/stdlib/source/lux/host/jvm/method.lux deleted file mode 100644 index e4f3cdea2..000000000 --- a/stdlib/source/lux/host/jvm/method.lux +++ /dev/null @@ -1,62 +0,0 @@ -(.module: - [lux (#- static) - [abstract - ["." equivalence (#+ Equivalence)] - [monoid (#+)] - ["." monad (#+ do)]] - [control - [parser (#+)] - ["." state (#+ State)]] - [data - [number (#+) - [i64 (#+)]] - [format - ["." binary (#+ Format)]] - [collection - ["." row (#+ Row)]]] - [type - [abstract (#+)]]] - ["." // #_ - [encoding (#+)] - [modifier (#+ modifiers:)] - ["#." constant (#+ UTF8)] - ["#." index (#+ Index)] - ["#." attribute (#+ Attribute)] - ["#." descriptor (#+ Descriptor)]]) - -(modifiers: - ["0001" public] - ["0002" private] - ["0004" protected] - ["0008" static] - ["0010" final] - ["0020" synchronized] - ["0040" bridge] - ["0080" var-args] - ["0100" native] - ["0400" abstract] - ["0800" strict] - ["1000" synthetic] - ) - -(type: #export Method - {#modifier Modifier - #name (Index UTF8) - #descriptor (Index (Descriptor //descriptor.Method)) - #attributes (Row Attribute)}) - -(def: #export equivalence - (Equivalence Method) - ($_ equivalence.product - ..modifier-equivalence - //index.equivalence - //index.equivalence - (row.equivalence //attribute.equivalence))) - -(def: #export format - (Format Method) - ($_ binary.and - ..modifier-format - //index.format - //index.format - (binary.row/16 //attribute.format))) diff --git a/stdlib/source/lux/host/jvm/modifier.lux b/stdlib/source/lux/host/jvm/modifier.lux deleted file mode 100644 index f858e6548..000000000 --- a/stdlib/source/lux/host/jvm/modifier.lux +++ /dev/null @@ -1,84 +0,0 @@ -(.module: - [lux #* - [abstract - ["." equivalence] - ["." monoid]] - [control - ["." parser - ["s" code (#+ Parser)]]] - [data - ["." number - ["." i64]] - [format - ["." binary]] - [collection - ["." list ("#;." functor)]]] - [type - ["." abstract]] - [macro (#+ with-gensyms) - ["." code] - [syntax (#+ syntax:)]]] - ["." // #_ - ["#." encoding]]) - -(type: Modifier - {#code Text - #name Text}) - -(def: modifier - (Parser Modifier) - (s.tuple (parser.and s.text - s.local-identifier))) - -(def: (code modifier) - (-> Modifier Code) - (code.tuple (list (code.text (get@ #code modifier)) - (code.local-identifier (get@ #name modifier))))) - -(syntax: #export (modifiers: {options (parser.many ..modifier)}) - (with-gensyms [g!parameter g!subject g! g!] - (let [g!name (' Modifier) - g!combine (' combine) - g!empty (' empty) - g!format (' modifier-format) - typeC (` (abstract.abstract: (~' #export) (~ g!name) - {} - - //encoding.U2 - - (.def: (~' #export) (~' code) - (.-> (~ g!name) //encoding.U2) - (.|>> abstract.:representation)) - - (.def: (~' #export) ((~ g!combine) (~ g!parameter) (~ g!subject)) - (.-> (~ g!name) (~ g!name) (~ g!name)) - (abstract.:abstraction (//encoding.to-u2 (i64.and (//encoding.from-u2 (abstract.:representation (~ g!parameter))) - (//encoding.from-u2 (abstract.:representation (~ g!subject))))))) - - (.template [(~ g!) (~ g!)] - [(.def: (~' #export) (~ g!) - (~ g!name) - (.|> ((~! number.hex) (~ g!)) //encoding.to-u2 abstract.:abstraction))] - - ["0000" (~ g!empty)] - (~+ (list;map ..code options)) - ) - - (.structure: (~' #export) (~' modifier-equivalence) (equivalence.Equivalence (~ g!name)) - (.def: ((~' =) (~' reference) (~' sample)) - (.:: //encoding.u2-equivalence (~' =) - (abstract.:representation (~' reference)) - (abstract.:representation (~' sample))))) - - (.def: (~' #export) (~ g!format) - (binary.Format (~ g!name)) - (.let [(.^open "_;.") //encoding.u2-format] - {#binary.reader (|> (~' _;reader) - (:: parser.functor (~' map) - (|>> abstract.:abstraction))) - #binary.writer (|>> abstract.:representation - (~' _;writer))})))) - monoidC (` (.structure: (~' #export) (~' modifier-monoid) (monoid.Monoid (~ g!name)) - (.def: (~' identity) (~ g!empty)) - (.def: (~' compose) (~ g!combine))))] - (wrap (list typeC monoidC))))) diff --git a/stdlib/source/lux/host/jvm/modifier/inner.lux b/stdlib/source/lux/host/jvm/modifier/inner.lux deleted file mode 100644 index 2980ef6e4..000000000 --- a/stdlib/source/lux/host/jvm/modifier/inner.lux +++ /dev/null @@ -1,30 +0,0 @@ -(.module: - [lux (#- static) - [abstract - [equivalence (#+)] - [monoid (#+)]] - [control - [parser (#+)]] - [data - [number (#+) - [i64 (#+)]] - [format - [binary (#+)]]] - [type - [abstract (#+)]]] - [// (#+ modifiers:) - [// - [encoding (#+)]]]) - -(modifiers: - ["0001" public] - ["0002" private] - ["0004" protected] - ["0008" static] - ["0010" final] - ["0200" interface] - ["0400" abstract] - ["1000" synthetic] - ["2000" annotation] - ["4000" enum] - ) diff --git a/stdlib/source/lux/host/jvm/name.lux b/stdlib/source/lux/host/jvm/name.lux deleted file mode 100644 index 7f2119bc0..000000000 --- a/stdlib/source/lux/host/jvm/name.lux +++ /dev/null @@ -1,32 +0,0 @@ -(.module: - [lux #* - [data - ["." text]] - [type - abstract]]) - -(def: #export internal-separator "/") -(def: #export external-separator ".") - -(type: #export External Text) - -(abstract: #export Internal - {} - - Text - - (def: #export internal - (-> Text Internal) - (|>> (text.replace-all ..external-separator - ..internal-separator) - :abstraction)) - - (def: #export read - (-> Internal Text) - (|>> :representation)) - - (def: #export external - (-> Internal External) - (|>> :representation - (text.replace-all ..internal-separator - ..external-separator)))) diff --git a/stdlib/source/lux/host/jvm/version.lux b/stdlib/source/lux/host/jvm/version.lux deleted file mode 100644 index dd76a594d..000000000 --- a/stdlib/source/lux/host/jvm/version.lux +++ /dev/null @@ -1,38 +0,0 @@ -(.module: - [lux #* - [data - [format - ["." binary (#+ Format)]]]] - ["." // #_ - ["#." encoding (#+ U2)]]) - -(type: #export Version U2) -(type: #export Minor Version) -(type: #export Major Version) - -(def: #export version - (-> Nat Version) - //encoding.to-u2) - -(template [ ] - [(def: #export - Major - (..version ))] - - [45 v1_1] - [46 v1_2] - [47 v1_3] - [48 v1_4] - [49 v5_0] - [50 v6_0] - [51 v7] - [52 v8] - [53 v9] - [54 v10] - [55 v11] - [56 v12] - ) - -(def: #export format - (Format Version) - //encoding.u2-format) diff --git a/stdlib/source/lux/host/lua.lux b/stdlib/source/lux/host/lua.lux deleted file mode 100644 index 8dde357cc..000000000 --- a/stdlib/source/lux/host/lua.lux +++ /dev/null @@ -1,310 +0,0 @@ -(.module: - [lux (#- Code int if cond function or and not let) - [control - [pipe (#+ case> cond> new>)] - [parser - ["s" code]]] - [data - [number - ["." frac]] - ["." text - format] - [collection - ["." list ("#@." functor fold)]]] - [macro - ["." template] - ["." code] - [syntax (#+ syntax:)]] - [type - abstract]]) - -(def: input-separator ", ") -(def: statement-suffix ";") - -(def: nest - (-> Text Text) - (|>> (format text.new-line) - (text.replace-all text.new-line (format text.new-line text.tab)))) - -(abstract: #export (Code brand) - {} - - Text - - (def: #export manual - (-> Text Code) - (|>> :abstraction)) - - (def: #export code - (-> (Code Any) Text) - (|>> :representation)) - - (template [ ] - [(with-expansions [ (template.identifier [ "'"])] - (`` (abstract: #export ( brand) {} Any)) - (`` (type: #export ( brand) - ( ( brand)))))] - - [Expression Code] - [Computation Expression] - [Location Computation] - ) - - (template [ ] - [(with-expansions [ (template.identifier [ "'"])] - (`` (abstract: #export {} Any)) - (`` (type: #export ( ))))] - - [Literal Computation] - [Var Location] - [Access Location] - [Statement Code] - ) - - (def: #export nil - Literal - (:abstraction "nil")) - - (def: #export bool - (-> Bit Literal) - (|>> (case> #0 "false" - #1 "true") - :abstraction)) - - (def: #export (int value) - (-> Int Literal) - (:abstraction (.if (i/< +0 value) - (%i value) - (%n (.nat value))))) - - (def: #export float - (-> Frac Literal) - (|>> (cond> [(f/= frac.positive-infinity)] - [(new> "(1.0/0.0)" [])] - - [(f/= frac.negative-infinity)] - [(new> "(-1.0/0.0)" [])] - - [(f/= frac.not-a-number)] - [(new> "(0.0/0.0)" [])] - - ## else - [%f]) - :abstraction)) - - (def: sanitize - (-> Text Text) - (`` (|>> (~~ (template [ ] - [(text.replace-all )] - - ["\" "\\"] - [text.tab "\t"] - [text.vertical-tab "\v"] - [text.null "\0"] - [text.back-space "\b"] - [text.form-feed "\f"] - [text.new-line "\n"] - [text.carriage-return "\r"] - [text.double-quote (format "\" text.double-quote)] - )) - ))) - - (def: #export string - (-> Text Literal) - (|>> ..sanitize (text.enclose' text.double-quote) :abstraction)) - - (def: #export array - (-> (List (Expression Any)) Literal) - (|>> (list@map ..code) - (text.join-with ..input-separator) - (text.enclose ["{" "}"]) - :abstraction)) - - (def: #export table - (-> (List [Text (Expression Any)]) Literal) - (|>> (list@map (.function (_ [key value]) - (format key " = " (:representation value)))) - (text.join-with ..input-separator) - (text.enclose ["{" "}"]) - :abstraction)) - - (def: #export (nth idx array) - (-> (Expression Any) (Expression Any) Access) - (:abstraction (format (:representation array) "[" (:representation idx) "]"))) - - (def: #export (the field table) - (-> Text (Expression Any) (Computation Any)) - (:abstraction (format (:representation table) "." field))) - - (def: #export length - (-> (Expression Any) (Computation Any)) - (|>> :representation - (text.enclose ["#(" ")"]) - :abstraction)) - - (def: #export (apply/* args func) - (-> (List (Expression Any)) (Expression Any) (Computation Any)) - (|> args - (list@map ..code) - (text.join-with ..input-separator) - (text.enclose ["(" ")"]) - (format (:representation func)) - :abstraction)) - - (def: #export (do method table args) - (-> Text (Expression Any) (List (Expression Any)) (Computation Any)) - (|> args - (list@map ..code) - (text.join-with ..input-separator) - (text.enclose ["(" ")"]) - (format (:representation table) ":" method) - :abstraction)) - - (template [ ] - [(def: #export ( parameter subject) - (-> (Expression Any) (Expression Any) (Expression Any)) - (:abstraction (format "(" - (:representation subject) - " " " " - (:representation parameter) - ")")))] - - ["==" =] - ["<" <] - ["<=" <=] - [">" >] - [">=" >=] - ["+" +] - ["-" -] - ["*" *] - ["/" /] - ["//" //] - ["%" %] - [".." concat] - - ["or" or] - ["and" and] - ["|" bit-or] - ["&" bit-and] - ["~" bit-xor] - - ["<<" bit-shl] - [">>" bit-shr] - ) - - (def: #export (not subject) - (-> (Expression Any) (Expression Any)) - (:abstraction (format "(not " (:representation subject) ")"))) - - (def: #export var - (-> Text Var) - (|>> :abstraction)) - - (def: #export statement - (-> (Expression Any) Statement) - (|>> :representation (text.suffix ..statement-suffix) :abstraction)) - - (def: #export (then pre! post!) - (-> Statement Statement Statement) - (:abstraction - (format (:representation pre!) - text.new-line - (:representation post!)))) - - (def: locations - (-> (List (Location Any)) Text) - (|>> (list@map ..code) - (text.join-with ..input-separator))) - - (def: #export (local vars) - (-> (List Var) Statement) - (:abstraction (format "local " (..locations vars) ..statement-suffix))) - - (def: #export (set vars value) - (-> (List (Location Any)) (Expression Any) Statement) - (:abstraction (format (..locations vars) " = " (:representation value) ..statement-suffix))) - - (def: #export (let vars value) - (-> (List Var) (Expression Any) Statement) - ($_ ..then - (local vars) - (set vars value))) - - (def: #export (if test then! else!) - (-> (Expression Any) Statement Statement Statement) - (:abstraction (format "if " (:representation test) - text.new-line "then" (..nest (:representation then!)) - text.new-line "else" (..nest (:representation else!)) - text.new-line "end" ..statement-suffix))) - - (def: #export (when test then!) - (-> (Expression Any) Statement Statement) - (:abstraction (format "if " (:representation test) - text.new-line "then" (..nest (:representation then!)) - text.new-line "end" ..statement-suffix))) - - (def: #export (while test body!) - (-> (Expression Any) Statement Statement) - (:abstraction - (format "while " (:representation test) " do" - (..nest (:representation body!)) - text.new-line "end" ..statement-suffix))) - - (def: #export (for-in vars source body!) - (-> (List Var) (Expression Any) Statement Statement) - (:abstraction - (format "for " (|> vars - (list@map ..code) - (text.join-with ..input-separator)) - " in " (:representation source) " do" - (..nest (:representation body!)) - text.new-line "end" ..statement-suffix))) - - (def: #export (for-step var from to step body!) - (-> Var (Expression Any) (Expression Any) (Expression Any) Statement - Statement) - (:abstraction - (format "for " (:representation var) - " = " (:representation from) - ..input-separator (:representation to) - ..input-separator (:representation step) " do" - (..nest (:representation body!)) - text.new-line "end" ..statement-suffix))) - - (def: #export (return value) - (-> (Expression Any) Statement) - (:abstraction (format "return " (:representation value) ..statement-suffix))) - - (def: #export (closure args body!) - (-> (List Var) Statement (Expression Any)) - (|> (format "function " (|> args - ..locations - (text.enclose ["(" ")"])) - (..nest (:representation body!)) - text.new-line "end") - (text.enclose ["(" ")"]) - :abstraction)) - - (def: #export (function name args body!) - (-> Var (List Var) Statement Statement) - (:abstraction - (format "function " (:representation name) - (|> args - ..locations - (text.enclose ["(" ")"])) - (..nest (:representation body!)) - text.new-line "end" ..statement-suffix))) - - (def: #export break - Statement - (|> "break" - (text.suffix ..statement-suffix) - :abstraction)) - ) - -(def: #export (cond clauses else!) - (-> (List [(Expression Any) Statement]) Statement Statement) - (list@fold (.function (_ [test then!] next!) - (..if test then! next!)) - else! - (list.reverse clauses))) diff --git a/stdlib/source/lux/host/php.lux b/stdlib/source/lux/host/php.lux deleted file mode 100644 index 286d8d397..000000000 --- a/stdlib/source/lux/host/php.lux +++ /dev/null @@ -1,444 +0,0 @@ -(.module: - [lux (#- Code static int if cond or and not comment for) - [control - [pipe (#+ case> cond> new>)]] - [data - [number - ["." frac]] - ["." text - format] - [collection - ["." list ("#@." functor fold)]]] - [macro - ["." template]] - [type - abstract]]) - -(def: input-separator ", ") -(def: statement-suffix ";") - -(def: nest - (-> Text Text) - (|>> (format text.new-line) - (text.replace-all text.new-line (format text.new-line text.tab)))) - -(def: block - (-> Text Text) - (|>> ..nest (text.enclose ["{" (format text.new-line "}")]))) - -(def: group - (-> Text Text) - (text.enclose ["(" ")"])) - -(abstract: #export (Code brand) - {} - - Text - - (def: #export manual - (-> Text Code) - (|>> :abstraction)) - - (def: #export code - (-> (Code Any) Text) - (|>> :representation)) - - (template [ ] - [(with-expansions [ (template.identifier [ "'"])] - (`` (abstract: #export ( brand) {} Any)) - (`` (type: #export ( brand) - ( ( brand)))))] - - [Expression Code] - [Computation Expression] - [Location Computation] - ) - - (template [ ] - [(with-expansions [ (template.identifier [ "'"])] - (`` (abstract: #export {} Any)) - (`` (type: #export ( ))))] - - [Literal Computation] - [Var Location] - [Constant Location] - [Global Location] - [Access Location] - [Statement Code] - ) - - (type: #export Argument - {#reference? Bit - #var Var}) - - (def: #export ; - (-> (Expression Any) Statement) - (|>> :representation - (text.suffix ..statement-suffix) - :abstraction)) - - (def: #export var - (-> Text Var) - (|>> (format "$") :abstraction)) - - (def: #export constant - (-> Text Constant) - (|>> :abstraction)) - - (def: #export null - Literal - (:abstraction "NULL")) - - (def: #export bool - (-> Bit Literal) - (|>> (case> #0 "false" - #1 "true") - :abstraction)) - - (def: #export int - (-> Int Literal) - (|>> %i :abstraction)) - - (def: #export float - (-> Frac Literal) - (|>> (cond> [(f/= frac.positive-infinity)] - [(new> "+INF" [])] - - [(f/= frac.negative-infinity)] - [(new> "-INF" [])] - - [(f/= frac.not-a-number)] - [(new> "NAN" [])] - - ## else - [%f]) - :abstraction)) - - (def: sanitize - (-> Text Text) - (`` (|>> (~~ (template [ ] - [(text.replace-all )] - - ["\" "\\"] - [text.tab "\t"] - [text.vertical-tab "\v"] - [text.null "\0"] - [text.back-space "\b"] - [text.form-feed "\f"] - [text.new-line "\n"] - [text.carriage-return "\r"] - [text.double-quote (format "\" text.double-quote)] - )) - ))) - - (def: #export string - (-> Text Literal) - (|>> ..sanitize - (text.enclose [text.double-quote text.double-quote]) - :abstraction)) - - (def: arguments - (-> (List (Expression Any)) Text) - (|>> (list@map ..code) (text.join-with ..input-separator) ..group)) - - (def: #export (apply/* args func) - (-> (List (Expression Any)) (Expression Any) (Computation Any)) - (:abstraction - (format (:representation func) (..arguments args)))) - - (def: parameters - (-> (List Argument) Text) - (|>> (list@map (function (_ [reference? var]) - (.if reference? - (format "&" (:representation var)) - (:representation var)))) - (text.join-with ..input-separator) - ..group)) - - (template [ ] - [(def: #export - (-> Var Argument) - (|>> []))] - - [parameter #0] - [reference #1] - ) - - (def: #export (closure uses arguments body!) - (-> (List Argument) (List Argument) Statement Literal) - (let [uses (case uses - #.Nil - "" - - _ - (format "use " (..parameters uses)))] - (|> (format "function " (..parameters arguments) - " " uses " " - (..block (:representation body!))) - ..group - :abstraction))) - - (template [ + + +] - [(`` (def: #export ( [(~~ (template.splice +))] function) - (-> [(~~ (template.splice +))] (Expression Any) (Computation Any)) - (..apply/* (list (~~ (template.splice +))) function))) - - (`` (template [ ] - [(def: #export ( args) - (-> [(~~ (template.splice +))] (Computation Any)) - ( args (..constant )))] - - (~~ (template.splice +))))] - - [apply/0 [] [] - [[func-num-args/0 "func_num_args"] - [func-get-args/0 "func_get_args"] - [time/0 "time"]]] - [apply/1 [in0] [(Expression Any)] - [[is-null/1 "is_null"] - [empty/1 "empty"] - [count/1 "count"] - [strlen/1 "strlen"] - [array-pop/1 "array_pop"] - [array-reverse/1 "array_reverse"] - [intval/1 "intval"] - [floatval/1 "floatval"] - [strval/1 "strval"] - [ord/1 "ord"] - [chr/1 "chr"] - [print/1 "print"] - [exit/1 "exit"]]] - [apply/2 [in0 in1] [(Expression Any) (Expression Any)] - [[call-user-func-array/2 "call_user_func_array"] - [array-slice/2 "array_slice"] - [array-push/2 "array_push"]]] - [apply/3 [in0 in1 in2] [(Expression Any) (Expression Any) (Expression Any)] - [[array-slice/3 "array_slice"] - [array-splice/3 "array_splice"] - [strpos/3 "strpos"] - [substr/3 "substr"]]] - ) - - (def: #export (array/* values) - (-> (List (Expression Any)) Literal) - (|> values - (list@map ..code) - (text.join-with ..input-separator) - ..group - (format "array") - :abstraction)) - - (def: #export (array-merge/+ required optionals) - (-> (Expression Any) (List (Expression Any)) (Computation Any)) - (..apply/* (list& required optionals) (..constant "array_merge"))) - - (def: #export (array/** kvs) - (-> (List [(Expression Any) (Expression Any)]) Literal) - (|> kvs - (list@map (function (_ [key value]) - (format (:representation key) " => " (:representation value)))) - (text.join-with ..input-separator) - ..group - (format "array") - :abstraction)) - - (def: #export (new constructor inputs) - (-> Constant (List (Expression Any)) (Computation Any)) - (|> (format "new " (:representation constructor) (arguments inputs)) - :abstraction)) - - (def: #export (do method inputs object) - (-> Text (List (Expression Any)) (Expression Any) (Computation Any)) - (|> (format (:representation object) "->" method (arguments inputs)) - :abstraction)) - - (def: #export (nth idx array) - (-> (Expression Any) (Expression Any) Access) - (|> (format (:representation array) "[" (:representation idx) "]") - :abstraction)) - - (def: #export (global name) - (-> Text Global) - (|> (..var "GLOBALS") (..nth (..string name)) :transmutation)) - - (def: #export (? test then else) - (-> (Expression Any) (Expression Any) (Expression Any) (Computation Any)) - (|> (format (:representation test) " ? " - (:representation then) " : " - (:representation else)) - ..group - :abstraction)) - - (template [ ] - [(def: #export ( parameter subject) - (-> (Expression Any) (Expression Any) (Computation Any)) - (|> (format (:representation subject) " " " " (:representation parameter)) - ..group - :abstraction))] - - [or "||"] - [and "&&"] - [= "==="] - [< "<"] - [<= "<="] - [> ">"] - [>= ">="] - [+ "+"] - [- "-"] - [* "*"] - [/ "/"] - [% "%"] - [bit-or "|"] - [bit-and "&"] - [bit-xor "^"] - [bit-shl "<<"] - [bit-shr ">>"] - [concat "."] - ) - - (def: #export not - (-> (Computation Any) (Computation Any)) - (|>> :representation (format "!") :abstraction)) - - (def: #export (set var value) - (-> (Location Any) (Expression Any) (Computation Any)) - (|> (format (:representation var) " = " (:representation value)) - ..group - :abstraction)) - - (def: #export (set? var) - (-> Var (Computation Any)) - (..apply/1 [var] (..constant "isset"))) - - (template [ ] - [(def: #export - (-> Var Statement) - (|>> :representation (format " ") (text.suffix ..statement-suffix) :abstraction))] - - [define-global "global"] - ) - - (template [ ] - [(def: #export ( location value) - (-> (Expression Any) Statement) - (:abstraction (format " " (:representation location) - " = " (:representation value) - ..statement-suffix)))] - - [define-static "static" Var] - [define-constant "const" Constant] - ) - - (def: #export (if test then! else!) - (-> (Expression Any) Statement Statement Statement) - (:abstraction - (format "if " (..group (:representation test)) " " - (..block (:representation then!)) - " else " - (..block (:representation else!))))) - - (def: #export (when test then!) - (-> (Expression Any) Statement Statement) - (:abstraction - (format "if " (..group (:representation test)) " " - (..block (:representation then!))))) - - (def: #export (then pre! post!) - (-> Statement Statement Statement) - (:abstraction - (format (:representation pre!) - text.new-line - (:representation post!)))) - - (def: #export (while test body!) - (-> (Expression Any) Statement Statement) - (:abstraction - (format "while " (..group (:representation test)) " " - (..block (:representation body!))))) - - (def: #export (do-while test body!) - (-> (Expression Any) Statement Statement) - (:abstraction - (format "do " (..block (:representation body!)) - " while " (..group (:representation test)) - ..statement-suffix))) - - (def: #export (for-each array value body!) - (-> (Expression Any) Var Statement Statement) - (:abstraction - (format "foreach(" (:representation array) - " as " (:representation value) - ") " (..block (:representation body!))))) - - (type: #export Except - {#class Constant - #exception Var - #handler Statement}) - - (def: (catch except) - (-> Except Text) - (let [declaration (format (:representation (get@ #class except)) - " " (:representation (get@ #exception except)))] - (format "catch" (..group declaration) " " - (..block (:representation (get@ #handler except)))))) - - (def: #export (try body! excepts) - (-> Statement (List Except) Statement) - (:abstraction - (format "try " (..block (:representation body!)) - text.new-line - (|> excepts - (list@map catch) - (text.join-with text.new-line))))) - - (template [ ] - [(def: #export - (-> (Expression Any) Statement) - (|>> :representation (format " ") (text.suffix ..statement-suffix) :abstraction))] - - [throw "throw"] - [return "return"] - [echo "echo"] - ) - - (def: #export (define name value) - (-> Constant (Expression Any) (Expression Any)) - (..apply/2 [(|> name :representation ..string) - value] - (..constant "define"))) - - (def: #export (define-function name uses arguments body!) - (-> Constant (List Argument) (List Argument) Statement Statement) - (let [uses (case uses - #.Nil - "" - - _ - (format " use " (..parameters uses)))] - (:abstraction - (format "function " (:representation name) " " (..parameters arguments) - uses " " - (..block (:representation body!)))))) - - (template [ ] - [(def: #export - Statement - (|> - (text.suffix ..statement-suffix) - :abstraction))] - - [break "break"] - [continue "continue"] - ) - ) - -(def: #export (cond clauses else!) - (-> (List [(Expression Any) Statement]) Statement Statement) - (list@fold (function (_ [test then!] next!) - (..if test then! next!)) - else! - (list.reverse clauses))) - -(def: #export command-line-arguments - Var - (..var "argv")) diff --git a/stdlib/source/lux/host/python.lux b/stdlib/source/lux/host/python.lux deleted file mode 100644 index 80f6b12de..000000000 --- a/stdlib/source/lux/host/python.lux +++ /dev/null @@ -1,435 +0,0 @@ -(.module: - [lux (#- Code not or and list if cond int comment) - [control - [pipe (#+ new> case> cond>)] - [parser - ["s" code]]] - [data - [number - ["." frac]] - ["." text - format] - [collection - ["." list ("#@." functor fold)]]] - [macro - ["." template] - ["." code] - [syntax (#+ syntax:)]] - [type - abstract]]) - -(def: expression (-> Text Text) (text.enclose ["(" ")"])) - -(def: nest - (-> Text Text) - (|>> (format text.new-line) - (text.replace-all text.new-line (format text.new-line text.tab)))) - -(abstract: #export (Code brand) - {} - - Text - - (def: #export manual - (-> Text Code) - (|>> :abstraction)) - - (def: #export code - (-> (Code Any) Text) - (|>> :representation)) - - (template [ ] - [(with-expansions [ (template.identifier [ "'"])] - (`` (abstract: #export ( brand) {} Any)) - (`` (type: #export ( brand) - ( ( brand)))))] - - [Expression Code] - [Computation Expression] - [Location Computation] - [Var Location] - [Statement Code] - ) - - (template [ ] - [(with-expansions [ (template.identifier [ "'"])] - (`` (abstract: #export {} Any)) - (`` (type: #export ( ))))] - - [Literal Computation] - [Access Location] - [Loop Statement] - [Label Code] - ) - - (template [ ] - [(abstract: #export {} Any) - - (type: #export (Var ))] - - [SVar Single] - [PVar Poly] - [KVar Keyword] - ) - - (def: #export var - (-> Text SVar) - (|>> :abstraction)) - - (template [ ] - [(def: #export - (-> SVar (Var )) - (|>> :representation (format ) :abstraction))] - - [poly Poly "*"] - [keyword Keyword "**"] - ) - - (def: #export none - Literal - (:abstraction "None")) - - (def: #export bool - (-> Bit Literal) - (|>> (case> #0 "False" - #1 "True") - :abstraction)) - - (def: #export int - (-> Int Literal) - (|>> %i :abstraction)) - - (def: #export (long value) - (-> Int Literal) - (:abstraction (format (%i value) "L"))) - - (def: #export float - (-> Frac Literal) - (`` (|>> (cond> (~~ (template [ ] - [[(f/= )] - [(new> (format "float(" text.double-quote text.double-quote ")") [])]] - - [frac.positive-infinity "inf"] - [frac.negative-infinity "-inf"] - [frac.not-a-number "nan"] - )) - - ## else - [%f]) - :abstraction))) - - (def: sanitize - (-> Text Text) - (`` (|>> (~~ (template [ ] - [(text.replace-all )] - - ["\" "\\"] - [text.tab "\t"] - [text.vertical-tab "\v"] - [text.null "\0"] - [text.back-space "\b"] - [text.form-feed "\f"] - [text.new-line "\n"] - [text.carriage-return "\r"] - [text.double-quote (format "\" text.double-quote)] - )) - ))) - - (def: #export string - (-> Text Literal) - (|>> ..sanitize - (text.enclose [text.double-quote text.double-quote]) - :abstraction)) - - (def: (composite-literal left-delimiter right-delimiter entry-serializer) - (All [a] - (-> Text Text (-> a Text) - (-> (List a) Literal))) - (function (_ entries) - (<| :abstraction - ..expression - (format left-delimiter - (|> entries - (list@map entry-serializer) - (text.join-with ", ")) - right-delimiter)))) - - (template [
 ]
-    [(def: #export 
-       (-> (List (Expression Any)) Literal)
-       (composite-literal 
  ..code))]
-
-    [tuple "(" ")"]
-    [list  "[" "]"]
-    )
-
-  (def: #export (slice from to list)
-    (-> (Expression Any) (Expression Any) (Expression Any) Access)
-    (<| :abstraction
-        ..expression
-        (format (:representation list) "[" (:representation from) ":" (:representation to) "]")))
-
-  (def: #export (slice-from from list)
-    (-> (Expression Any) (Expression Any) Access)
-    (<| :abstraction
-        ..expression
-        (format (:representation list) "[" (:representation from) ":]")))
-
-  (def: #export dict
-    (-> (List [(Expression Any) (Expression Any)]) (Computation Any))
-    (composite-literal "{" "}" (.function (_ [k v]) (format (:representation k) " : " (:representation v)))))
-
-  (def: #export (apply/* func args)
-    (-> (Expression Any) (List (Expression Any)) (Computation Any))
-    (<| :abstraction
-        ..expression
-        (format (:representation func) "(" (text.join-with ", " (list@map ..code args)) ")")))
-
-  (template [  ]
-    [(def: ( var)
-       (-> (Expression Any) Text)
-       (format  (:representation var)))]
-
-    [splat-poly    Poly    "*"]
-    [splat-keyword Keyword "**"]
-    )
-
-  (template [ ]
-    [(def: #export ( args extra func)
-       (-> (List (Expression Any)) (Expression Any) (Expression Any) (Computation Any))
-       (<| :abstraction
-           ..expression
-           (format (:representation func)
-                   (format "(" (|> args
-                                   (list@map (function (_ arg) (format (:representation arg) ", ")))
-                                   (text.join-with ""))
-                           ( extra) ")"))))]
-
-    [apply-poly    splat-poly]
-    [apply-keyword splat-keyword]
-    )
-
-  (def: #export (the name object)
-    (-> Text (Expression Any) (Computation Any))
-    (:abstraction (format (:representation object) "." name)))
-
-  (def: #export (do method args object)
-    (-> Text (List (Expression Any)) (Expression Any) (Computation Any))
-    (..apply/* (..the method object) args))
-
-  (template [ ]
-    [(def: #export ( args extra method)
-       (-> (List (Expression Any)) (Expression Any) Text
-           (-> (Expression Any) (Computation Any)))
-       (|>> (..the method) ( args extra)))]
-
-    [do-poly    apply-poly]
-    [do-keyword apply-keyword]
-    )
-
-  (def: #export (nth idx array)
-    (-> (Expression Any) (Expression Any) Location)
-    (:abstraction (format (:representation array) "[" (:representation idx) "]")))
-
-  (def: #export (? test then else)
-    (-> (Expression Any) (Expression Any) (Expression Any) (Computation Any))
-    (<| :abstraction
-        ..expression
-        (format (:representation then) " if " (:representation test) " else " (:representation else))))
-
-  (template [ ]
-    [(def: #export ( param subject)
-       (-> (Expression Any) (Expression Any) (Computation Any))
-       (<| :abstraction
-           ..expression
-           (format (:representation subject) " "  " " (:representation param))))]
-
-    [is      "is"]
-    [=       "=="]
-    [<       "<"]
-    [<=      "<="]
-    [>       ">"]
-    [>=      ">="]
-    [+       "+"]
-    [-       "-"]
-    [*       "*"]
-    [/       "/"]
-    [%       "%"]
-    [**      "**"]
-    [bit-or  "|"]
-    [bit-and "&"]
-    [bit-xor "^"]
-    [bit-shl "<<"]
-    [bit-shr ">>"]
-
-    [or      "or"]
-    [and     "and"]
-    )
-
-  (def: #export (not subject)
-    (-> (Expression Any) (Computation Any))
-    (<| :abstraction
-        ..expression
-        (format "not " (:representation subject))))
-
-  (def: #export (lambda arguments body)
-    (-> (List (Var Any)) (Expression Any) (Computation Any))
-    (<| :abstraction
-        ..expression
-        (format "lambda " (|> arguments (list@map ..code) (text.join-with ", ")) ": "
-                (:representation body))))
-
-  (def: #export (set vars value)
-    (-> (List (Location Any)) (Expression Any) (Statement Any))
-    (:abstraction
-     (format (|> vars (list@map ..code) (text.join-with ", "))
-             " = "
-             (:representation value))))
-
-  (def: #export (delete where)
-    (-> (Location Any) (Statement Any))
-    (:abstraction (format "del " (:representation where))))
-
-  (def: #export (if test then! else!)
-    (-> (Expression Any) (Statement Any) (Statement Any) (Statement Any))
-    (:abstraction
-     (format "if " (:representation test) ":"
-             (..nest (:representation then!))
-             text.new-line "else:"
-             (..nest (:representation else!)))))
-
-  (def: #export (when test then!)
-    (-> (Expression Any) (Statement Any) (Statement Any))
-    (:abstraction
-     (format "if " (:representation test) ":"
-             (..nest (:representation then!)))))
-
-  (def: #export (then pre! post!)
-    (-> (Statement Any) (Statement Any) (Statement Any))
-    (:abstraction
-     (format (:representation pre!)
-             text.new-line
-             (:representation post!))))
-
-  (template [ <0>]
-    [(def: #export <0>
-       Statement
-       (:abstraction ))]
-
-    ["break"    break]
-    ["continue" continue]
-    )
-
-  (def: #export (while test body!)
-    (-> (Expression Any) (Statement Any) Loop)
-    (:abstraction
-     (format "while " (:representation test) ":"
-             (..nest (:representation body!)))))
-
-  (def: #export (for-in var inputs body!)
-    (-> SVar (Expression Any) (Statement Any) Loop)
-    (:abstraction
-     (format "for " (:representation var) " in " (:representation inputs) ":"
-             (..nest (:representation body!)))))
-
-  (def: #export statement
-    (-> (Expression Any) (Statement Any))
-    (|>> :transmutation))
-
-  (def: #export pass
-    (Statement Any)
-    (:abstraction "pass"))
-
-  (type: #export Except
-    {#classes (List SVar)
-     #exception SVar
-     #handler (Statement Any)})
-  
-  (def: #export (try body! excepts)
-    (-> (Statement Any) (List Except) (Statement Any))
-    (:abstraction
-     (format "try:"
-             (..nest (:representation body!))
-             (|> excepts
-                 (list@map (function (_ [classes exception catch!])
-                             (format text.new-line "except (" (text.join-with ", " (list@map ..code classes))
-                                     ") as " (:representation exception) ":"
-                                     (..nest (:representation catch!)))))
-                 (text.join-with "")))))
-
-  (template [ ]
-    [(def: #export ( message)
-       (-> (Expression Any) (Statement Any))
-       (:abstraction
-        (format  " " (:representation message))))]
-
-    [raise  "raise"]
-    [return "return"]
-    [print  "print"]
-    )
-  
-  (def: #export (def name args body)
-    (-> SVar (List (Ex [k] (Var k))) (Statement Any) (Statement Any))
-    (:abstraction
-     (format "def " (:representation name)
-             "(" (|> args (list@map ..code) (text.join-with ", ")) "):"
-             (..nest (:representation body)))))
-
-  (def: #export (import module-name)
-    (-> Text (Statement Any))
-    (:abstraction (format "import " module-name)))
-
-  (def: #export (comment commentary on)
-    (All [brand] (-> Text (Code brand) (Code brand)))
-    (:abstraction (format "# "  (..sanitize commentary) text.new-line
-                          (:representation on))))
-  )
-
-(def: #export (cond clauses else!)
-  (-> (List [(Expression Any) (Statement Any)]) (Statement Any) (Statement Any))
-  (list@fold (.function (_ [test then!] next!)
-               (..if test then! next!))
-             else!
-             (list.reverse clauses)))
-
-(syntax: (arity-inputs {arity s.nat})
-  (wrap (case arity
-          0 (.list)
-          _ (|> (dec arity)
-                (list.n/range 0)
-                (list@map (|>> %n code.local-identifier))))))
-
-(syntax: (arity-types {arity s.nat})
-  (wrap (list.repeat arity (` (Expression Any)))))
-
-(template [ +]
-  [(with-expansions [ (template.identifier ["apply/" ])
-                      (arity-inputs )
-                      (arity-types )
-                      (template.splice +)]
-     (def: #export ( function )
-       (-> (Expression Any)  (Computation Any))
-       (..apply/* function (.list )))
-
-     (template []
-       [(`` (def: #export (~~ (template.identifier [ "/" ]))
-              ( (..var ))))]
-
-       ))]
-
-  [1
-   [["str"]
-    ["ord"]
-    ["float"]
-    ["int"]
-    ["len"]
-    ["chr"]
-    ["repr"]
-    ["Exception"]]]
-
-  [2
-   []]
-
-  [3
-   []]
-  )
diff --git a/stdlib/source/lux/host/ruby.lux b/stdlib/source/lux/host/ruby.lux
deleted file mode 100644
index 037cdca5b..000000000
--- a/stdlib/source/lux/host/ruby.lux
+++ /dev/null
@@ -1,388 +0,0 @@
-(.module:
-  [lux (#- Code static int if cond function or and not comment)
-   [control
-    [pipe (#+ case> cond> new>)]]
-   [data
-    [number
-     ["." frac]]
-    ["." text
-     format]
-    [collection
-     ["." list ("#@." functor fold)]]]
-   [macro
-    ["." template]]
-   [type
-    abstract]])
-
-(def: input-separator ", ")
-(def: statement-suffix ";")
-
-(def: nest
-  (-> Text Text)
-  (|>> (format text.new-line)
-       (text.replace-all text.new-line (format text.new-line text.tab))))
-
-(abstract: #export (Code brand)
-  {}
-
-  Text
-
-  (def: #export manual
-    (-> Text Code)
-    (|>> :abstraction))
-
-  (def: #export code
-    (-> (Code Any) Text)
-    (|>> :representation))
-
-  (template [ ]
-    [(with-expansions [ (template.identifier [ "'"])]
-       (`` (abstract: #export ( brand) {} Any))
-       (`` (type: #export ( brand)
-             ( ( brand)))))]
-    
-    [Expression Code]
-    [Computation Expression]
-    [Location Computation]
-    [Var Location]
-    [Statement Code]
-    )
-
-  (template [ ]
-    [(with-expansions [ (template.identifier [ "'"])]
-       (`` (abstract: #export  {} Any))
-       (`` (type: #export  ( ))))]
-
-    [Literal Computation]
-    [Access Location]
-    )
-
-  (template [   ]
-    [(abstract: #export  {} Any)
-
-     (type: #export  (Var ))
-
-     (def: #export 
-       (-> Text )
-       (|>> (format ) :abstraction))]
-
-    [GVar Global   "$"  global]
-    [IVar Instance "@"  instance]
-    [SVar Static   "@@" static]
-    )
-
-  (abstract: #export (Local brand) {} Any)
-  (type: #export LVar (Var (Local Any)))
-
-  (def: #export local
-    (-> Text LVar)
-    (|>> :abstraction))
-
-  (template [    ]
-    [(abstract: #export  {} Any)
-
-     (type: #export  (Var (Local )))
-
-     (template [  ]
-       [(def: #export 
-          (->  )
-          (|>> :representation (format ) :abstraction))]
-
-       [ LVar ]
-       [ (Expression Any) (Computation Any)]
-       )]
-
-    [LVar*  Poly   "*"  variadic    splat]
-    [LVar** PolyKV "**" variadic-kv double-splat]
-    )
-
-  (template [ ]
-    [(def: #export  (..global ))]
-
-    ["@" latest-error]
-    ["_" last-string-read]
-    ["." last-line-number-read]
-    ["&" last-string-matched]
-    ["~" last-regexp-match]
-    ["=" case-insensitivity-flag]
-    ["/" input-record-separator]
-    ["\" output-record-separator]
-    ["0" script-name]
-    ["*" command-line-arguments]
-    ["$" process-id]
-    ["?" exit-status]
-    )
-
-  (def: #export nil
-    Literal
-    (:abstraction "nil"))
-
-  (def: #export bool
-    (-> Bit Literal)
-    (|>> (case> #0 "false"
-                #1 "true")
-         :abstraction))
-
-  (def: sanitize
-    (-> Text Text)
-    (`` (|>> (~~ (template [ ]
-                   [(text.replace-all  )]
-
-                   ["\" "\\"]
-                   [text.tab "\t"]
-                   [text.vertical-tab "\v"]
-                   [text.null "\0"]
-                   [text.back-space "\b"]
-                   [text.form-feed "\f"]
-                   [text.new-line "\n"]
-                   [text.carriage-return "\r"]
-                   [text.double-quote (format "\" text.double-quote)]
-                   ))
-             )))
-
-  (template [   ]
-    [(def: #export 
-       (->  Literal)
-       (|>>   :abstraction))]
-
-    [%i int Int     (<|)]
-    [%t string Text ..sanitize]
-    )
-
-  (def: #export float
-    (-> Frac Literal)
-    (|>> (cond> [(f/= frac.positive-infinity)]
-                [(new> "(+1.0/0.0)" [])]
-                
-                [(f/= frac.negative-infinity)]
-                [(new> "(-1.0/0.0)" [])]
-                
-                [(f/= frac.not-a-number)]
-                [(new> "(+0.0/-0.0)" [])]
-
-                ## else
-                [%f])
-         :abstraction))
-
-  (def: #export (array-range from to array)
-    (-> (Expression Any) (Expression Any) (Expression Any) (Computation Any))
-    (|> (format (:representation from) ".." (:representation to))
-        (text.enclose ["[" "]"])
-        (format (:representation array))
-        :abstraction))
-
-  (def: #export array
-    (-> (List (Expression Any)) Literal)
-    (|>> (list@map (|>> :representation))
-         (text.join-with ..input-separator)
-         (text.enclose ["[" "]"])
-         :abstraction))
-
-  (def: #export hash
-    (-> (List [(Expression Any) (Expression Any)]) Literal)
-    (|>> (list@map (.function (_ [k v])
-                     (format (:representation k) " => " (:representation v))))
-         (text.join-with ..input-separator)
-         (text.enclose ["{" "}"])
-         :abstraction))
-
-  (def: #export (apply/* args func)
-    (-> (List (Expression Any)) (Expression Any) (Computation Any))
-    (|> args
-        (list@map (|>> :representation))
-        (text.join-with ..input-separator)
-        (text.enclose ["(" ")"])
-        (format (:representation func))
-        :abstraction))
-
-  (def: #export (the field object)
-    (-> Text (Expression Any) Access)
-    (:abstraction (format (:representation object) "." field)))
-
-  (def: #export (nth idx array)
-    (-> (Expression Any) (Expression Any) Access)
-    (|> (:representation idx)
-        (text.enclose ["[" "]"])
-        (format (:representation array))
-        :abstraction))
-
-  (def: #export (? test then else)
-    (-> (Expression Any) (Expression Any) (Expression Any) (Computation Any))
-    (|> (format (:representation test) " ? "
-                (:representation then) " : "
-                (:representation else))
-        (text.enclose ["(" ")"])
-        :abstraction))
-
-  (def: #export statement
-    (-> (Expression Any) (Statement Any))
-    (|>> :representation
-         (text.suffix ..statement-suffix)
-         :abstraction))
-
-  (def: #export (then pre! post!)
-    (-> (Statement Any) (Statement Any) (Statement Any))
-    (:abstraction
-     (format (:representation pre!)
-             text.new-line
-             (:representation post!))))
-
-  (def: #export (set vars value)
-    (-> (List (Location Any)) (Expression Any) (Statement Any))
-    (:abstraction
-     (format (|> vars
-                 (list@map (|>> :representation))
-                 (text.join-with ..input-separator))
-             " = " (:representation value) ..statement-suffix)))
-
-  (def: (block content)
-    (-> Text Text)
-    (format content
-            text.new-line "end" ..statement-suffix))
-
-  (def: #export (if test then! else!)
-    (-> (Expression Any) (Statement Any) (Statement Any) (Statement Any))
-    (<| :abstraction
-        ..block
-        (format "if " (:representation test)
-                text.new-line (..nest (:representation then!))
-                text.new-line "else"
-                text.new-line (..nest (:representation else!)))))
-
-  (template [ ]
-    [(def: #export ( test then!)
-       (-> (Expression Any) (Statement Any) (Statement Any))
-       (<| :abstraction
-           ..block
-           (format  " " (:representation test)
-                   text.new-line (..nest (:representation then!)))))]
-
-    [when "if"]
-    [while "while"]
-    )
-
-  (def: #export (for-in var array iteration!)
-    (-> LVar (Expression Any) (Statement Any) (Statement Any))
-    (<| :abstraction
-        ..block
-        (format "for " (:representation var)
-                " in " (:representation array)
-                " do "
-                text.new-line (..nest (:representation iteration!)))))
-
-  (type: #export Rescue
-    {#classes (List Text)
-     #exception LVar
-     #rescue (Statement Any)})
-
-  (def: #export (begin body! rescues)
-    (-> (Statement Any) (List Rescue) (Statement Any))
-    (<| :abstraction
-        ..block
-        (format "begin"
-                text.new-line (:representation body!)
-                (|> rescues
-                    (list@map (.function (_ [classes exception rescue])
-                                (format text.new-line "rescue " (text.join-with ..input-separator classes)
-                                        " => " (:representation exception)
-                                        text.new-line (..nest (:representation rescue)))))
-                    (text.join-with text.new-line)))))
-
-  (def: #export (return value)
-    (-> (Expression Any) (Statement Any))
-    (:abstraction (format "return " (:representation value) ..statement-suffix)))
-
-  (def: #export (raise message)
-    (-> (Expression Any) (Computation Any))
-    (:abstraction (format "raise " (:representation message))))
-
-  (template [ ]
-    [(def: #export 
-       (Statement Any)
-       (|> 
-           (text.suffix ..statement-suffix)
-           :abstraction))]
-
-    [next "next"]
-    [redo "redo"]
-    [break "break"]
-    )
-
-  (def: #export (function name args body!)
-    (-> LVar (List (Var Any)) (Statement Any) (Statement Any))
-    (<| :abstraction
-        ..block
-        (format "def " (:representation name)
-                (|> args
-                    (list@map (|>> :representation))
-                    (text.join-with ..input-separator)
-                    (text.enclose ["(" ")"]))
-                text.new-line (:representation body!))))
-
-  (def: #export (lambda name args body!)
-    (-> (Maybe LVar) (List (Var Any)) (Statement Any) Literal)
-    (let [proc (|> (format (|> args
-                               (list@map (|>> :representation))
-                               (text.join-with ..input-separator)
-                               (text.enclose' "|"))
-                           " "
-                           (:representation body!))
-                   (text.enclose ["{" "}"])
-                   (format "lambda "))]
-      (|> (case name
-            #.None
-            proc
-            
-            (#.Some name)
-            (format (:representation name) " = " proc))
-          (text.enclose ["(" ")"])
-          :abstraction)))
-
-  (template [ ]
-    [(def: #export ( parameter subject)
-       (-> (Expression Any) (Expression Any) (Computation Any))
-       (:abstraction (format "(" (:representation subject) " "  " " (:representation parameter) ")")))]
-
-    ["==" =]
-    [ "<" <]
-    ["<=" <=]
-    [ ">" >]
-    [">=" >=]
-
-    [ "+" +]
-    [ "-" -]
-    [ "*" *]
-    [ "/" /]
-    [ "%" %]
-    ["**" pow]
-
-    ["||" or]
-    ["&&" and]
-    [ "|" bit-or]
-    [ "&" bit-and]
-    [ "^" bit-xor]
-
-    ["<<" bit-shl]
-    [">>" bit-shr]
-    )
-
-  (def: #export (not subject)
-    (-> (Expression Any) (Computation Any))
-    (:abstraction (format "(!" (:representation subject) ")")))
-
-  (def: #export (comment commentary on)
-    (All [brand] (-> Text (Code brand) (Code brand)))
-    (:abstraction (format "# "  (..sanitize commentary) text.new-line
-                          (:representation on))))
-  )
-
-(def: #export (do method args object)
-  (-> Text (List (Expression Any)) (Expression Any) (Computation Any))
-  (|> object (..the method) (..apply/* args)))
-
-(def: #export (cond clauses else!)
-  (-> (List [(Expression Any) (Statement Any)]) (Statement Any) (Statement Any))
-  (list@fold (.function (_ [test then!] next!)
-               (..if test then! next!))
-             else!
-             (list.reverse clauses)))
diff --git a/stdlib/source/lux/host/scheme.lux b/stdlib/source/lux/host/scheme.lux
deleted file mode 100644
index 820ff8c83..000000000
--- a/stdlib/source/lux/host/scheme.lux
+++ /dev/null
@@ -1,317 +0,0 @@
-(.module:
-  [lux (#- Code int or and if function cond let)
-   [control
-    [pipe (#+ new> cond> case>)]
-    ["." function]]
-   [data
-    [number
-     ["." frac]]
-    ["." text
-     format]
-    [collection
-     ["." list ("#;." functor fold)]]]
-   [macro
-    ["." template]]
-   [type
-    abstract]])
-
-(abstract: #export (Code k)
-  {}
-  
-  Text
-
-  (template [  +]
-    [(abstract: #export ( brand) {} Any)
-     (`` (type: #export  (|> Any  (~~ (template.splice +)))))]
-    
-    [Expression Expression' [Code]]
-    )
-
-  (template [  +]
-    [(abstract: #export  {} Any)
-     (`` (type: #export  (|>  (~~ (template.splice +)))))]
-
-    [Global Global' [Expression' Code]]
-    [Var Var' [Expression' Code]]
-    [Computation Computation' [Expression' Code]]
-    )
-
-  (type: #export Arguments
-    {#mandatory (List Var)
-     #rest (Maybe Var)})
-
-  (def: #export code (-> (Code Any) Text) (|>> :representation))
-
-  (def: #export var (-> Text Var) (|>> :abstraction))
-
-  (def: (arguments [vars rest])
-    (-> Arguments (Code Any))
-    (case rest
-      (#.Some rest)
-      (case vars
-        #.Nil
-        rest
-
-        _
-        (|> (format " . " (:representation rest))
-            (format (|> vars
-                        (list;map ..code)
-                        (text.join-with " ")))
-            (text.enclose ["(" ")"])
-            :abstraction))
-      
-      #.None
-      (|> vars
-          (list;map ..code)
-          (text.join-with " ")
-          (text.enclose ["(" ")"])
-          :abstraction)))
-
-  (def: #export nil
-    Computation
-    (:abstraction "'()"))
-
-  (def: #export bool
-    (-> Bit Computation)
-    (|>> (case> #0 "#f"
-                #1 "#t")
-         :abstraction))
-
-  (def: #export int
-    (-> Int Computation)
-    (|>> %i :abstraction))
-
-  (def: #export float
-    (-> Frac Computation)
-    (|>> (cond> [(f/= frac.positive-infinity)]
-                [(new> "+inf.0" [])]
-                
-                [(f/= frac.negative-infinity)]
-                [(new> "-inf.0" [])]
-                
-                [frac.not-a-number?]
-                [(new> "+nan.0" [])]
-                
-                ## else
-                [%f])
-         :abstraction))
-
-  (def: #export positive-infinity Computation (..float frac.positive-infinity))
-  (def: #export negative-infinity Computation (..float frac.negative-infinity))
-  (def: #export not-a-number Computation (..float frac.not-a-number))
-
-  (def: sanitize
-    (-> Text Text)
-    (`` (|>> (~~ (template [ ]
-                   [(text.replace-all  )]
-
-                   [text.alarm "\a"]
-                   [text.back-space "\b"]
-                   [text.tab "\t"]
-                   [text.new-line "\n"]
-                   [text.carriage-return "\r"]
-                   [text.double-quote (format "\" text.double-quote)]
-                   ["\" "\\"]
-                   ["|" "\|"]
-                   ))
-             )))
-  
-  (def: #export string
-    (-> Text Computation)
-    (|>> ..sanitize %t :abstraction))
-
-  (def: #export symbol
-    (-> Text Computation)
-    (|>> (format "'") :abstraction))
-
-  (def: #export global
-    (-> Text Global)
-    (|>> :abstraction))
-
-  (def: form
-    (-> (List (Code Any)) Text)
-    (|>> (list;map ..code)
-         (text.join-with " ")
-         (text.enclose ["(" ")"])))
-  
-  (def: #export (apply/* func args)
-    (-> Expression (List Expression) Computation)
-    (:abstraction (..form (#.Cons func args))))
-  
-  (template [ ]
-    [(def: #export 
-       (-> (List Expression) Computation)
-       (apply/* (..global )))]
-
-    [vector/* "vector"]
-    [list/*   "list"]
-    )
-
-  (def: #export (apply/0 func)
-    (-> Expression Computation)
-    (..apply/* func (list)))
-
-  (template [ ]
-    [(def: #export  (apply/0 (..global )))]
-
-    [newline/0 "newline"]
-    )
-
-  (template [ + + +]
-    [(`` (def: #export ( function)
-           (-> Expression (~~ (template.splice +)) Computation)
-           (.function (_ (~~ (template.splice +)))
-             (..apply/* function (list (~~ (template.splice +)))))))
-
-     (`` (template [ ]
-           [(def: #export  ( (..global )))]
-
-           (~~ (template.splice +))))]
-
-    [apply/1 [_0] [Expression]
-     [[exact/1 "exact"]
-      [integer->char/1 "integer->char"]
-      [number->string/1 "number->string"]
-      [string/1 "string"]
-      [length/1 "length"]
-      [values/1 "values"]
-      [null?/1 "null?"]
-      [car/1 "car"]
-      [cdr/1 "cdr"]
-      [raise/1 "raise"]
-      [error-object-message/1 "error-object-message"]
-      [make-vector/1 "make-vector"]
-      [vector-length/1 "vector-length"]
-      [not/1 "not"]
-      [string-length/1 "string-length"]
-      [string-hash/1 "string-hash"]
-      [reverse/1 "reverse"]
-      [display/1 "display"]
-      [exit/1 "exit"]]]
-
-    [apply/2 [_0 _1] [Expression Expression]
-     [[append/2 "append"]
-      [cons/2 "cons"]
-      [make-vector/2 "make-vector"]
-      [vector-ref/2 "vector-ref"]
-      [list-tail/2 "list-tail"]
-      [map/2 "map"]
-      [string-ref/2 "string-ref"]
-      [string-append/2 "string-append"]]]
-
-    [apply/3 [_0 _1 _2] [Expression Expression Expression]
-     [[substring/3 "substring"]
-      [vector-set!/3 "vector-set!"]]]
-
-    [apply/5 [_0 _1 _2 _3 _4] [Expression Expression Expression Expression Expression]
-     [[vector-copy!/5 "vector-copy!"]]]
-    )
-
-  (template [ ]
-    [(def: #export ( param subject)
-       (-> Expression Expression Computation)
-       (..apply/2 (..global ) subject param))]
-
-    [=/2   "="]
-    [eq?/2 "eq?"]
-    [eqv?/2 "eqv?"]
-    [/2   ">"]
-    [>=/2  ">="]
-    [string=?/2 "string=?"]
-    [string ]
-    [(def: #export 
-       (-> (List Expression) Computation)
-       (|>> (list& (..global )) ..form :abstraction))]
-
-    [or "or"]
-    [and "and"]
-    )
-
-  (template [   
]
-    [(def: #export ( bindings body)
-       (-> (List [ Expression]) Expression Computation)
-       (:abstraction
-        (..form (list (..global )
-                      (|> bindings
-                          (list;map (.function (_ [binding/name binding/value])
-                                      (:abstraction
-                                       (..form (list (
 binding/name)
-                                                     binding/value)))))
-                          ..form
-                          :abstraction)
-                      body))))]
-
-    [let           "let"           Var       function.identity]
-    [let*          "let*"          Var       function.identity]
-    [letrec        "letrec"        Var       function.identity]
-    [let-values    "let-values"    Arguments ..arguments]
-    [let*-values   "let*-values"   Arguments ..arguments]
-    [letrec-values "letrec-values" Arguments ..arguments]
-    )
-
-  (def: #export (if test then else)
-    (-> Expression Expression Expression Computation)
-    (:abstraction
-     (..form (list (..global "if") test then else))))
-
-  (def: #export (when test then)
-    (-> Expression Expression Computation)
-    (:abstraction
-     (..form (list (..global "when") test then))))
-
-  (def: #export (cond clauses else)
-    (-> (List [Expression Expression]) Expression Computation)
-    (|> (list;fold (.function (_ [test then] next)
-                     (if test then next))
-                   else
-                   (list.reverse clauses))
-        :representation
-        :abstraction))
-
-  (def: #export (lambda arguments body)
-    (-> Arguments Expression Computation)
-    (:abstraction
-     (..form (list (..global "lambda")
-                   (..arguments arguments)
-                   body))))
-
-  (def: #export (define name arguments body)
-    (-> Var Arguments Expression Computation)
-    (:abstraction
-     (..form (list (..global "define")
-                   (|> arguments
-                       (update@ #mandatory (|>> (#.Cons name)))
-                       ..arguments)
-                   body))))
-
-  (def: #export begin
-    (-> (List Expression) Computation)
-    (|>> (#.Cons (..global "begin")) ..form :abstraction))
-
-  (def: #export (set! name value)
-    (-> Var Expression Computation)
-    (:abstraction
-     (..form (list (..global "set!") name value))))
-
-  (def: #export (with-exception-handler handler body)
-    (-> Expression Expression Computation)
-    (:abstraction
-     (..form (list (..global "with-exception-handler") handler body))))
-  )
diff --git a/stdlib/source/lux/target/js.lux b/stdlib/source/lux/target/js.lux
new file mode 100644
index 000000000..756530817
--- /dev/null
+++ b/stdlib/source/lux/target/js.lux
@@ -0,0 +1,397 @@
+(.module:
+  [lux (#- Code or and function if cond undefined for comment false true not)
+   [control
+    [pipe (#+ case>)]]
+   [data
+    ["." text
+     format]
+    [collection
+     ["." list ("#@." functor fold)]]]
+   [macro
+    ["." template]]
+   [type
+    abstract]])
+
+(def: argument (text.enclose ["(" ")"]))
+(def: element (text.enclose ["[" "]"]))
+
+(abstract: #export (Code brand)
+  {}
+
+  Text
+
+  (def: #export code
+    (-> (Code Any) Text)
+    (|>> :representation))
+
+  (template [  +]
+    [(abstract: #export ( brand) {} Any)
+     (`` (type: #export  (|> Any  (~~ (template.splice +)))))]
+    
+    [Expression Expression' [Code]]
+    [Computation Computation' [Expression' Code]]
+    [Location Location' [Computation' Expression' Code]]
+    [Statement Statement' [Code]]
+    )
+
+  (template [  +]
+    [(abstract: #export  {} Any)
+     (`` (type: #export  (|>  (~~ (template.splice +)))))]
+
+    [Var Var' [Location' Computation' Expression' Code]]
+    [Access Access' [Location' Computation' Expression' Code]]
+    [Loop Loop' [Statement' Code]]
+    [Label Label' [Code]]
+    )
+
+  (template [ ]
+    [(def: #export  Computation (|>  ..argument :abstraction))]
+
+    [null "null"]
+    [undefined "undefined"]
+    [false "false"]
+    [true "true"]
+    [positive-infinity "Infinity"]
+    [negative-infinity "-Infinity"]
+    [not-a-number "NaN"]
+    )
+
+  (def: #export boolean
+    (-> Bit Computation)
+    (|>> (case>
+          #0 ..false
+          #1 ..true)))
+
+  (def: #export number
+    (-> Frac Computation)
+    (|>> %f ..argument :abstraction))
+
+  (def: sanitize
+    (-> Text Text)
+    (`` (|>> (~~ (template [ ]
+                   [(text.replace-all  )]
+
+                   ["\" "\\"]
+                   [text.tab "\t"]
+                   [text.vertical-tab "\v"]
+                   [text.null "\0"]
+                   [text.back-space "\b"]
+                   [text.form-feed "\f"]
+                   [text.new-line "\n"]
+                   [text.carriage-return "\r"]
+                   [text.double-quote (format "\" text.double-quote)]
+                   ))
+             )))
+
+  (def: #export string
+    (-> Text Computation)
+    (|>> ..sanitize
+         (text.enclose [text.double-quote text.double-quote])
+         :abstraction))
+
+  (def: argument-separator ", ")
+  (def: field-separator ": ")
+  (def: statement-suffix ";")
+
+  (def: #export array
+    (-> (List Expression) Computation)
+    (|>> (list@map ..code)
+         (text.join-with ..argument-separator)
+         ..element
+         :abstraction))
+
+  (def: #export var
+    (-> Text Var)
+    (|>> :abstraction))
+
+  (def: #export (at index array-or-object)
+    (-> Expression Expression Access)
+    (|> (format (:representation array-or-object) (..element (:representation index)))
+        ..argument
+        :abstraction))
+
+  (def: #export (the field object)
+    (-> Text Expression Access)
+    (:abstraction (format (:representation object) "." field)))
+
+  (def: #export (apply/* function inputs)
+    (-> Expression (List Expression) Computation)
+    (|> inputs
+        (list@map ..code)
+        (text.join-with ..argument-separator)
+        ..argument
+        (format (:representation function))
+        :abstraction))
+
+  (def: #export (do method inputs object)
+    (-> Text (List Expression) Expression Computation)
+    (apply/* (..the method object) inputs))
+
+  (def: #export object
+    (-> (List [Text Expression]) Computation)
+    (|>> (list@map (.function (_ [key val])
+                     (format (:representation (..string key)) ..field-separator (:representation val))))
+         (text.join-with ..argument-separator)
+         (text.enclose ["{" "}"])
+         ..argument
+         :abstraction))
+
+  (def: #export (, pre post)
+    (-> Expression Expression Computation)
+    (|> (format (:representation pre) ", " (:representation post))
+        ..argument
+        :abstraction))
+
+  (def: #export (then pre post)
+    (-> Statement Statement Statement)
+    (:abstraction (format (:representation pre)
+                          text.new-line
+                          (:representation post))))
+
+  ## (def: indent
+  ##   (-> Text Text)
+  ##   (text.replace-all text.new-line (format text.new-line text.tab)))
+
+  (def: block
+    (-> Statement Text)
+    (let [close (format text.new-line "}")]
+      (|>> :representation
+           (format text.new-line)
+           ## ..indent
+           (text.enclose ["{"
+                          close]))))
+
+  (def: #export (function name inputs body)
+    (-> Var (List Var) Statement Computation)
+    (|> body
+        ..block
+        (format "function " (:representation name)
+                (|> inputs
+                    (list@map ..code)
+                    (text.join-with ..argument-separator)
+                    ..argument)
+                " ")
+        ..argument
+        :abstraction))
+
+  (def: #export (closure inputs body)
+    (-> (List Var) Statement Computation)
+    (|> body
+        ..block
+        (format "function"
+                (|> inputs
+                    (list@map ..code)
+                    (text.join-with ..argument-separator)
+                    ..argument)
+                " ")
+        ..argument
+        :abstraction))
+
+  (template [ ]
+    [(def: #export ( param subject)
+       (-> Expression Expression Computation)
+       (|> (format (:representation subject) " "  " " (:representation param))
+           ..argument
+           :abstraction))]
+
+    [=  "==="]
+    [<  "<"]
+    [<= "<="]
+    [>  ">"]
+    [>= ">="]
+    
+    [+  "+"]
+    [-  "-"]
+    [*  "*"]
+    [/  "/"]
+    [%  "%"]
+
+    [left-shift "<<"]
+    [arithmetic-right-shift ">>"]
+    [logic-right-shift ">>>"]
+
+    [or      "||"]
+    [and     "&&"]
+    [bit-xor "^"]
+    [bit-or  "|"]
+    [bit-and "&"]
+    )
+
+  (template [ ]
+    [(def: #export 
+       (-> Expression Computation)
+       (|>> :representation (text.prefix ) ..argument :abstraction))]
+
+    [not "!"]
+    [bit-not "~"]
+    [negate "-"]
+    )
+
+  (template [  ]
+    [(def: #export ( value)
+       {#.doc "A 32-bit integer expression."}
+       (->  Computation)
+       (:abstraction (..argument (format ( value) "|0"))))]
+
+    [to-i32 Expression :representation]
+    [i32 Int %i]
+    )
+
+  (def: #export (? test then else)
+    (-> Expression Expression Expression Computation)
+    (|> (format (:representation test)
+                " ? " (:representation then)
+                " : " (:representation else))
+        ..argument
+        :abstraction))
+
+  (def: #export type-of
+    (-> Expression Computation)
+    (|>> :representation
+         (format "typeof ")
+         ..argument
+         :abstraction))
+
+  (def: #export (new constructor inputs)
+    (-> Expression (List Expression) Computation)
+    (|> (format "new " (:representation constructor)
+                (|> inputs
+                    (list@map ..code)
+                    (text.join-with ..argument-separator)
+                    ..argument))
+        ..argument
+        :abstraction))
+
+  (def: #export statement
+    (-> Expression Statement)
+    (|>> :representation (text.suffix ..statement-suffix) :abstraction))
+
+  (def: #export use-strict
+    Statement
+    (:abstraction (format text.double-quote "use strict" text.double-quote ..statement-suffix)))
+
+  (def: #export (declare name)
+    (-> Var Statement)
+    (:abstraction (format "var " (:representation name) ..statement-suffix)))
+
+  (def: #export (define name value)
+    (-> Var Expression Statement)
+    (:abstraction (format "var " (:representation name) " = " (:representation value) ..statement-suffix)))
+
+  (def: #export (set name value)
+    (-> Location Expression Statement)
+    (:abstraction (format (:representation name) " = " (:representation value) ..statement-suffix)))
+
+  (def: #export (throw message)
+    (-> Expression Statement)
+    (:abstraction (format "throw " (:representation message) ..statement-suffix)))
+
+  (def: #export (return value)
+    (-> Expression Statement)
+    (:abstraction (format "return " (:representation value) ..statement-suffix)))
+
+  (def: #export (delete value)
+    (-> Location Statement)
+    (:abstraction (format "delete " (:representation value) ..statement-suffix)))
+
+  (def: #export (if test then! else!)
+    (-> Expression Statement Statement Statement)
+    (:abstraction (format "if(" (:representation test) ") "
+                          (..block then!)
+                          " else "
+                          (..block else!))))
+
+  (def: #export (when test then!)
+    (-> Expression Statement Statement)
+    (:abstraction (format "if(" (:representation test) ") "
+                          (..block then!))))
+
+  (def: #export (while test body)
+    (-> Expression Statement Loop)
+    (:abstraction (format "while(" (:representation test) ") "
+                          (..block body))))
+
+  (def: #export (do-while test body)
+    (-> Expression Statement Loop)
+    (:abstraction (format "do " (..block body)
+                          " while(" (:representation test) ")" ..statement-suffix)))
+
+  (def: #export (try body [exception catch])
+    (-> Statement [Var Statement] Statement)
+    (:abstraction (format "try "
+                          (..block body)
+                          " catch(" (:representation exception) ") "
+                          (..block catch))))
+
+  (def: #export (for var init condition update iteration)
+    (-> Var Expression Expression Expression Statement Loop)
+    (:abstraction (format "for(" (:representation (..define var init))
+                          " " (:representation condition)
+                          ..statement-suffix " " (:representation update)
+                          ")"
+                          (..block iteration))))
+
+  (def: #export label
+    (-> Text Label)
+    (|>> :abstraction))
+
+  (def: #export (with-label label loop)
+    (-> Label Loop Statement)
+    (:abstraction (format (:representation label) ": " (:representation loop))))
+
+  (template [ <0> <1>]
+    [(def: #export <0>
+       Statement
+       (:abstraction (format  ..statement-suffix)))
+
+     (def: #export (<1> label)
+       (-> Label Statement)
+       (:abstraction (format  " " (:representation label) ..statement-suffix)))]
+
+    ["break"    break    break-at]
+    ["continue" continue continue-at]
+    )
+
+  (template [ ]
+    [(def: #export 
+       (-> Location Expression)
+       (|>> :representation
+            (text.suffix )
+            :abstraction))]
+
+    [++ "++"]
+    [-- "--"]
+    )
+
+  (def: #export (comment commentary on)
+    (All [kind] (-> Text (Code kind) (Code kind)))
+    (:abstraction (format "/* "  commentary " */" " " (:representation on))))
+  )
+
+(def: #export (cond clauses else!)
+  (-> (List [Expression Statement]) Statement Statement)
+  (list@fold (.function (_ [test then!] next!)
+               (..if test then! next!))
+             else!
+             (list.reverse clauses)))
+
+(template [ + + +]
+  [(`` (def: #export ( function)
+         (-> Expression (~~ (template.splice +)) Computation)
+         (.function (_ (~~ (template.splice +)))
+           (..apply/* function (list (~~ (template.splice +)))))))
+
+   (`` (template [ ]
+         [(def: #export  ( (..var )))]
+
+         (~~ (template.splice +))))]
+
+  [apply/1 [_0] [Expression]
+   [[not-a-number? "isNaN"]]]
+
+  [apply/2 [_0 _1] [Expression Expression]
+   []]
+
+  [apply/3 [_0 _1 _2] [Expression Expression Expression]
+   []]
+  )
diff --git a/stdlib/source/lux/target/jvm/attribute.lux b/stdlib/source/lux/target/jvm/attribute.lux
new file mode 100644
index 000000000..bcd3a3734
--- /dev/null
+++ b/stdlib/source/lux/target/jvm/attribute.lux
@@ -0,0 +1,103 @@
+(.module:
+  [lux (#- Info Code' Code)
+   [abstract
+    ["." equivalence (#+ Equivalence)]
+    [monad (#+ do)]]
+   [control
+    ["." state (#+ State)]]
+   [data
+    [format
+     ["." binary (#+ Format)]]
+    [collection
+     ["." row (#+ Row)]]]
+   [world
+    [binary (#+ Binary)]]]
+  ["." // #_
+   ["#." encoding (#+ U2 U4)]
+   ["#." index (#+ Index)]
+   ["#." constant (#+ UTF8 Class Value)
+    ["#/." pool (#+ Pool)]]])
+
+(type: #export (Info about)
+  {#name (Index UTF8)
+   #length U4
+   #info about})
+
+(def: #export (info-equivalence Equivalence)
+  (All [about]
+    (-> (Equivalence about)
+        (Equivalence (Info about))))
+  ($_ equivalence.product
+      //index.equivalence
+      //encoding.u4-equivalence
+      Equivalence))
+
+(def: (info-format about)
+  (All [about]
+    (-> (Format about)
+        (Format (Info about))))
+  ($_ binary.and
+      //index.format
+      //encoding.u4-format
+      about))
+
+(type: #export Constant
+  (Info (Index (Value Any))))
+
+(def: #export constant-equivalence
+  (Equivalence Constant)
+  (..info-equivalence //index.equivalence))
+
+(def: constant-format
+  (Format Constant)
+  (..info-format //index.format))
+
+(type: #export Label U2)
+
+(type: #export Exception
+  {#start-pc Label
+   #end-pc Label
+   #handler-pc Label
+   #catch-type (Index Class)})
+
+(type: #export (Code' Attribute)
+  {#max-stack U2
+   #max-locals U2
+   #code Binary
+   #exception-table (Row Exception)
+   #attributes (Row Attribute)})
+
+(with-expansions [ (as-is (Info (Code' Attribute)))]
+  (type: #export #rec Attribute
+    (#Constant Constant)
+    ## (#Code )
+    )
+
+  ## (type: #export Code
+  ##   )
+  )
+
+(def: #export equivalence
+  (Equivalence Attribute)
+  ..constant-equivalence)
+
+(def: #export (constant index)
+  (-> (Index (Value Any))
+      (State Pool Attribute))
+  (do state.monad
+    [@name (//constant/pool.utf8 "ConstantValue")]
+    (wrap (#Constant {#name @name
+                      #length (//encoding.to-u4 //encoding.u2-bytes)
+                      #info index}))))
+
+## (def: #export (code specification)
+##   (-> Code' (State Pool Attribute))
+##   (do state.monad
+##     [@name (//constant/pool.utf8 "Code")]
+##     (wrap (#Code {#name @name
+##                   #length (undefined)
+##                   #info specification}))))
+
+(def: #export format
+  (Format Attribute)
+  ..constant-format)
diff --git a/stdlib/source/lux/target/jvm/class.lux b/stdlib/source/lux/target/jvm/class.lux
new file mode 100644
index 000000000..6fb6f48d4
--- /dev/null
+++ b/stdlib/source/lux/target/jvm/class.lux
@@ -0,0 +1,128 @@
+(.module:
+  [lux #*
+   [abstract
+    ["." equivalence (#+ Equivalence)]
+    [monoid (#+)]
+    ["." monad (#+ do)]]
+   [control
+    [parser (#+)]
+    ["." state (#+ State)]]
+   [data
+    [number (#+)
+     [i64 (#+)]]
+    [format
+     ["." binary (#+ Format)]]
+    [collection
+     ["." row (#+ Row)]]]
+   [type
+    [abstract (#+)]]]
+  ["." // #_
+   ["#." encoding (#+)]
+   ["#." modifier (#+ modifiers:)]
+   ["#." version (#+ Version Minor Major)]
+   ["#." name (#+ Internal)]
+   ["#." magic (#+ Magic)]
+   ["#." index (#+ Index)]
+   ["#." attribute (#+ Attribute)]
+   ["#." field (#+ Field)]
+   ["#." method (#+ Method)]
+   ["#." constant (#+ Constant)
+    ["#/." pool (#+ Pool)]]])
+
+(modifiers:
+  ["0001" public]
+  ["0010" final]
+  ["0020" super]
+  ["0200" interface]
+  ["0400" abstract]
+  ["1000" synthetic]
+  ["2000" annotation]
+  ["4000" enum]
+  )
+
+(type: #export Class
+  {#magic Magic
+   #minor-version Minor
+   #major-version Major
+   #constant-pool Pool
+   #modifier Modifier
+   #this (Index //constant.Class)
+   #super (Index //constant.Class)
+   #interfaces (Row (Index //constant.Class))
+   #fields (Row Field)
+   #methods (Row Method)
+   #attributes (Row Attribute)})
+
+(def: #export equivalence
+  (Equivalence Class)
+  ($_ equivalence.product
+      //encoding.u4-equivalence
+      //encoding.u2-equivalence
+      //encoding.u2-equivalence
+      //constant/pool.equivalence
+      ..modifier-equivalence
+      //index.equivalence
+      //index.equivalence
+      (row.equivalence //index.equivalence)
+      (row.equivalence //field.equivalence)
+      (row.equivalence //method.equivalence)
+      (row.equivalence //attribute.equivalence)))
+
+(def: default-minor-version Minor (//version.version 0))
+
+(def: (install-classes this super interfaces)
+  (-> Internal Internal (List Internal)
+      (State Pool [(Index //constant.Class) (Index //constant.Class) (Row (Index //constant.Class))]))
+  (do state.monad
+    [@this (//constant/pool.class (//name.read this))
+     @super (//constant/pool.class (//name.read super))
+     @interfaces (: (State Pool (Row (Index //constant.Class)))
+                    (monad.fold @ (function (_ interface @interfaces)
+                                    (do @
+                                      [@interface (//constant/pool.class (//name.read interface))]
+                                      (wrap (row.add @interface @interfaces))))
+                                row.empty
+                                interfaces))]
+    (wrap [@this @super @interfaces])))
+
+(def: #export (class version modifier
+                     super this interfaces
+                     fields methods attributes)
+  (-> Major Modifier
+      Internal Internal (List Internal)
+      (List (State Pool Field))
+      (Row Method)
+      (Row Attribute)
+      Class)
+  (let [[pool [@this @super @interfaces] =fields]
+        (state.run //constant/pool.empty
+                   (do state.monad
+                     [classes (install-classes this super interfaces)
+                      =fields (monad.seq state.monad fields)]
+                     (wrap [classes =fields])))]
+    {#magic //magic.code
+     #minor-version ..default-minor-version
+     #major-version version
+     #constant-pool pool
+     #modifier modifier
+     #this @this
+     #super @super
+     #interfaces @interfaces
+     #fields (row.from-list =fields)
+     #methods methods
+     #attributes attributes}))
+
+(def: #export format
+  (Format Class)
+  ($_ binary.and
+      //magic.format
+      //version.format
+      //version.format
+      //constant/pool.format
+      ..modifier-format
+      //index.format
+      //index.format
+      (binary.row/16 //index.format)
+      (binary.row/16 //field.format)
+      (binary.row/16 //method.format)
+      (binary.row/16 //attribute.format)))
diff --git a/stdlib/source/lux/target/jvm/constant.lux b/stdlib/source/lux/target/jvm/constant.lux
new file mode 100644
index 000000000..3af24af55
--- /dev/null
+++ b/stdlib/source/lux/target/jvm/constant.lux
@@ -0,0 +1,192 @@
+(.module:
+  [lux #*
+   [abstract
+    [monad (#+ do)]
+    ["." equivalence (#+ Equivalence)]]
+   [control
+    ["." parser]]
+   [data
+    [number
+     ["." int]
+     ["." frac]]
+    ["." text]
+    [format
+     ["." binary (#+ Format) ("#;." monoid)]]
+    [collection
+     ["." row (#+ Row)]]]
+   [type
+    abstract]]
+  ["." / #_
+   ["#." tag ("#;." equivalence)]
+   ["." // #_
+    [encoding (#+ U4)]
+    [descriptor (#+ Descriptor)]
+    ["#." index (#+ Index)]]])
+
+(type: #export UTF8 Text)
+
+(def: utf8-format
+  (Format UTF8)
+  binary.utf8/16)
+
+(abstract: #export Class
+  {}
+  
+  (Index UTF8)
+  
+  (def: #export class
+    (-> (Index UTF8) Class)
+    (|>> :abstraction))
+
+  (def: #export class-equivalence
+    (Equivalence Class)
+    (:: equivalence.contravariant map-1
+        (|>> :representation)
+        //index.equivalence))
+
+  (def: class-format
+    (Format Class)
+    (binary.adapt (|>> :abstraction)
+                  (|>> :representation)
+                  //index.format))
+  )
+
+(abstract: #export (Value kind)
+
+  {}
+
+  kind
+
+  (def: #export value
+    (All [kind] (-> (Value kind) kind))
+    (|>> :representation))
+
+  (def: #export (value-equivalence Equivalence)
+    (All [kind]
+      (-> (Equivalence kind)
+          (Equivalence (Value kind))))
+    (:: equivalence.contravariant map-1
+        (|>> :representation)
+        Equivalence))
+
+  (template [  ]
+    [(type: #export  (Value ))
+
+     (def: #export 
+       (->  )
+       (|>> :abstraction))]
+
+    [integer Integer U4]
+    [long    Long    .Int]
+    [float   Float   Nothing]
+    [double  Double  Frac]
+    [string  String  (Index UTF8)]
+    )
+
+  (template [    ]
+    [(def: 
+       (Format )
+       (binary.adapt (|>>  :abstraction)
+                     (|>> :representation )
+                     ))]
+
+    [long-format Long .int (<|) binary.bits/64]
+    [double-format Double frac.bits-to-frac frac.frac-to-bits binary.bits/64]
+    [string-format String (<|) (<|) //index.format]
+    )
+  )
+
+(type: #export Name-And-Type
+  {#name (Index UTF8)
+   #descriptor (Index (Descriptor Any))})
+
+(type: #export Reference
+  {#class (Index Class)
+   #name-and-type (Index Name-And-Type)})
+
+(template [  ]
+  [(def: #export 
+     (Equivalence )
+     ($_ equivalence.product
+         //index.equivalence
+         //index.equivalence))
+
+   (def: #export 
+     (Format )
+     ($_ binary.and
+         //index.format
+         //index.format))]
+
+  [Name-And-Type name-and-type-equivalence name-and-type-format]
+  [Reference reference-equivalence reference-format]
+  )
+
+(type: #export Constant
+  (#UTF8 UTF8)
+  (#Long Long)
+  (#Double Double)
+  (#Class Class)
+  (#String String)
+  (#Field Reference)
+  (#Method Reference)
+  (#Interface-Method Reference)
+  (#Name-And-Type Name-And-Type))
+
+(def: #export equivalence
+  (Equivalence Constant)
+  ($_ equivalence.sum
+      ## #UTF8
+      text.equivalence
+      ## #Long
+      (..value-equivalence int.equivalence)
+      ## #Double
+      (..value-equivalence frac.equivalence)
+      ## #Class
+      ..class-equivalence
+      ## #String
+      (..value-equivalence //index.equivalence)
+      ## #Field
+      ..reference-equivalence
+      ## #Method
+      ..reference-equivalence
+      ## #Interface-Method
+      ..reference-equivalence
+      ## #Name-And-Type
+      ..name-and-type-equivalence
+      ))
+
+(def: #export format
+  (Format Constant)
+  (with-expansions [ (as-is [#UTF8             /tag.utf8             ..utf8-format]
+                                       ## TODO: Integer
+                                       ## TODO: Float
+                                       [#Long             /tag.long             ..long-format]
+                                       [#Double           /tag.double           ..double-format]
+                                       [#Class            /tag.class            ..class-format]
+                                       [#String           /tag.string           ..string-format]
+                                       [#Field            /tag.field            ..reference-format]
+                                       [#Method           /tag.method           ..reference-format]
+                                       [#Interface-Method /tag.interface-method ..reference-format]
+                                       [#Name-And-Type    /tag.name-and-type    ..name-and-type-format]
+                                       ## TODO: Method-Handle
+                                       ## TODO: Method-Type
+                                       ## TODO: Invoke-Dynamic
+                                       )]
+    {#binary.reader (do parser.monad
+                      [tag (get@ #binary.reader /tag.format)]
+                      (`` (cond (~~ (template [  ]
+                                      [(/tag;=  tag)
+                                       (:: @ map (|>> ) (get@ #binary.reader ))]
+
+                                      ))
+                                
+                                ## else
+                                (parser.fail "Cannot parse constant."))))
+     #binary.writer (function (_ value)
+                      (case value
+                        (^template [  ]
+                          ( value)
+                          (binary;compose ((get@ #binary.writer /tag.format) )
+                                          ((get@ #binary.writer ) value)))
+                        ()
+                        ))}))
diff --git a/stdlib/source/lux/target/jvm/constant/pool.lux b/stdlib/source/lux/target/jvm/constant/pool.lux
new file mode 100644
index 000000000..a304d5ac4
--- /dev/null
+++ b/stdlib/source/lux/target/jvm/constant/pool.lux
@@ -0,0 +1,79 @@
+(.module:
+  [lux #*
+   [abstract
+    ["." equivalence (#+ Equivalence)]
+    [monad (#+ do)]]
+   [control
+    ["." state (#+ State)]]
+   [data
+    ["." text ("#;." equivalence)]
+    [format
+     ["." binary (#+ Format)]]
+    [collection
+     ["." list ("#;." fold)]
+     ["." row (#+ Row)]]]
+   [type
+    abstract]]
+  ["." // (#+ UTF8 Class Constant) ("#;." class-equivalence)
+   [//
+    ["." encoding]
+    ["." index (#+ Index)]
+    ["." descriptor (#+ Descriptor)]]])
+
+(def: offset 1)
+
+(type: #export Pool (Row Constant))
+
+(def: #export equivalence
+  (Equivalence Pool)
+  (row.equivalence //.equivalence))
+
+(template: (!add   <=>)
+  (function (_ pool)
+    (with-expansions [ (as-is (index.index (encoding.to-u2 (n/+ offset idx))))
+                       (as-is (recur (.inc idx)))]
+      (loop [idx 0]
+        (case (row.nth idx pool)
+          (#.Some entry)
+          (case entry
+            ( reference)
+            (if (<=> reference )
+              [pool
+               ]
+              )
+            
+            _
+            )
+          
+          #.None
+          [(row.add ( ) pool)
+           ])))))
+
+(def: #export (utf8 value)
+  (-> UTF8 (State Pool (Index UTF8)))
+  (!add value #//.UTF8 text;=))
+
+(def: (class' value)
+  (-> Class (State Pool (Index Class)))
+  (!add value #//.Class //;=))
+
+(def: #export (class name)
+  (-> UTF8 (State Pool (Index Class)))
+  (do state.monad
+    [@name (utf8 name)]
+    (class' (//.class @name))))
+
+(def: #export (descriptor value)
+  (All [kind]
+    (-> (Descriptor kind)
+        (State Pool (Index (Descriptor kind)))))
+  (let [value (descriptor.descriptor value)]
+    (!add value #//.UTF8 text;=)))
+
+(def: #export format
+  (Format Pool)
+  (binary.row/16' ..offset //.format))
+
+(def: #export empty
+  Pool
+  row.empty)
diff --git a/stdlib/source/lux/target/jvm/constant/tag.lux b/stdlib/source/lux/target/jvm/constant/tag.lux
new file mode 100644
index 000000000..71e75f40b
--- /dev/null
+++ b/stdlib/source/lux/target/jvm/constant/tag.lux
@@ -0,0 +1,49 @@
+(.module:
+  [lux #*
+   [abstract
+    [equivalence (#+ Equivalence)]]
+   [data
+    [format
+     ["." binary (#+ Format)]]]
+   [type
+    abstract]]
+  [///
+   ["." encoding (#+ U1) ("u1/." u1-equivalence)]])
+
+(abstract: #export Tag
+  {}
+
+  U1
+
+  (structure: #export equivalence (Equivalence Tag)
+    (def: (= reference sample)
+      (u1/= (:representation reference)
+            (:representation sample))))
+
+  (template [ ]
+    [(def: #export 
+       Tag
+       (:abstraction (encoding.to-u1 )))]
+
+    [01 utf8]
+    [03 integer]
+    [04 float]
+    [05 long]
+    [06 double]
+    [07 class]
+    [08 string]
+    [09 field]
+    [10 method]
+    [11 interface-method]
+    [12 name-and-type]
+    [15 method-handle]
+    [16 method-type]
+    [18 invoke-dynamic]
+    )
+
+  (def: #export format
+    (Format Tag)
+    (binary.adapt (|>> :abstraction)
+                  (|>> :representation)
+                  encoding.u1-format))
+  )
diff --git a/stdlib/source/lux/target/jvm/descriptor.lux b/stdlib/source/lux/target/jvm/descriptor.lux
new file mode 100644
index 000000000..d350cec65
--- /dev/null
+++ b/stdlib/source/lux/target/jvm/descriptor.lux
@@ -0,0 +1,84 @@
+(.module:
+  [lux (#- int char)
+   [data
+    ["." text
+     format]
+    [collection
+     ["." list ("#;." functor)]]]
+   [type
+    abstract]]
+  ["." // #_
+   ["#." name (#+ Internal)]])
+
+(abstract: #export Base' {} Any)
+(abstract: #export Object' {} Any)
+(abstract: #export Array' {} Any)
+(abstract: #export Void' {} Any)
+
+(abstract: #export (Value' kind) {} Any)
+(abstract: #export (Return kind) {} Any)
+
+(abstract: #export Method {} Any)
+
+(abstract: #export (Descriptor kind)
+  {}
+
+  Text
+
+  (type: #export (Value kind) (Return (Value' kind)))
+  (type: #export Void (Return Void'))
+
+  (template [ ]
+    [(type: #export  (Value ))]
+
+    [Base Base']
+    [Object Object']
+    [Array Array'])
+
+  (template [  ]
+    [(def: #export 
+       (Descriptor )
+       (:abstraction ))]
+
+    ["Z" boolean Base]
+
+    ["B" byte Base]
+    ["S" short Base]
+    ["I" int Base]
+    ["J" long Base]
+
+    ["C" char Base]
+
+    ["F" float Base]
+    ["D" double Base]
+
+    ["V" void Void])
+
+  (def: #export object
+    (-> Internal (Descriptor Object))
+    (|>> //name.read
+         (text.enclose ["L" ";"])
+         :abstraction))
+
+  (def: #export array
+    (-> (Descriptor (Value Any))
+        (Descriptor Array))
+    (|>> :representation
+         (format "[")
+         :abstraction))
+
+  (def: #export (method inputs output)
+    (-> (List (Descriptor (Value Any)))
+        (Descriptor (Return Any))
+        (Descriptor Method))
+    (:abstraction
+     (format (|> inputs
+                 (list;map (|>> :representation))
+                 (text.join-with "")
+                 (text.enclose ["(" ")"]))
+             (:representation output))))
+
+  (def: #export descriptor
+    (-> (Descriptor Any) Text)
+    (|>> :representation))
+  )
diff --git a/stdlib/source/lux/target/jvm/encoding.lux b/stdlib/source/lux/target/jvm/encoding.lux
new file mode 100644
index 000000000..33ac427c2
--- /dev/null
+++ b/stdlib/source/lux/target/jvm/encoding.lux
@@ -0,0 +1,52 @@
+(.module:
+  [lux #*
+   [abstract
+    [equivalence (#+ Equivalence)]]
+   [control
+    ["." parser ("#;." functor)]]
+   [data
+    [number
+     ["." i64]]
+    [format
+     ["." binary (#+ Format)]]]
+   [type
+    abstract]])
+
+(template [     ]
+  [(abstract: #export 
+     {}
+
+     (I64 Any)
+
+     (def: #export  Nat )
+
+     (def: #export 
+       (-> (I64 Any) )
+       (let [mask (|> 
+                      (n/* i64.bits-per-byte)
+                      i64.mask)]
+         (|>> (i64.and mask) :abstraction)))
+
+     (def: #export 
+       (->  (I64 Any))
+       (|>> :representation))
+
+     (structure: #export  (Equivalence )
+       (def: (= reference sample)
+         ("lux i64 =" (:representation reference) (:representation sample))))
+     )]
+
+  [1 U1 u1-bytes to-u1 from-u1 u1-equivalence]
+  [2 U2 u2-bytes to-u2 from-u2 u2-equivalence]
+  [4 U4 u4-bytes to-u4 from-u4 u4-equivalence]
+  )
+
+(template [    ]
+  [(def: #export 
+     (Format )
+     (binary.adapt   ))]
+
+  [u1-format U1 binary.bits/8  ..from-u1 ..to-u1]
+  [u2-format U2 binary.bits/16 ..from-u2 ..to-u2]
+  [u4-format U4 binary.bits/32 ..from-u4 ..to-u4]
+  )
diff --git a/stdlib/source/lux/target/jvm/field.lux b/stdlib/source/lux/target/jvm/field.lux
new file mode 100644
index 000000000..930ca97d8
--- /dev/null
+++ b/stdlib/source/lux/target/jvm/field.lux
@@ -0,0 +1,71 @@
+(.module:
+  [lux (#- static)
+   [abstract
+    ["." equivalence (#+ Equivalence)]
+    [monoid (#+)]
+    ["." monad (#+ do)]]
+   [control
+    [parser (#+)]
+    ["." state (#+ State)]]
+   [data
+    [number (#+)
+     [i64 (#+)]]
+    [format
+     ["." binary (#+ Format)]]
+    [collection
+     ["." row (#+ Row)]]]
+   [type
+    [abstract (#+)]]]
+  ["." // #_
+   [encoding (#+)]
+   [modifier (#+ modifiers:)]
+   ["#." constant (#+ UTF8)
+    ["#/." pool (#+ Pool)]]
+   ["#." index (#+ Index)]
+   ["#." attribute (#+ Attribute)]
+   ["#." descriptor (#+ Descriptor Value)]])
+
+(modifiers:
+  ["0001" public]
+  ["0002" private]
+  ["0004" protected]
+  ["0008" static]
+  ["0010" final]
+  ["0040" volatile]
+  ["0080" transient]
+  ["1000" synthetic]
+  ["4000" enum]
+  )
+
+(type: #export Field
+  {#modifier Modifier
+   #name (Index UTF8)
+   #descriptor (Index (Descriptor (Value Any)))
+   #attributes (Row Attribute)})
+
+(def: #export equivalence
+  (Equivalence Field)
+  ($_ equivalence.product
+      ..modifier-equivalence
+      //index.equivalence
+      //index.equivalence
+      (row.equivalence //attribute.equivalence)))
+
+(def: #export format
+  (Format Field)
+  ($_ binary.and
+      ..modifier-format
+      //index.format
+      //index.format
+      (binary.row/16 //attribute.format)))
+
+(def: #export (field modifier name descriptor attributes)
+  (-> Modifier UTF8 (Descriptor (Value Any)) (Row Attribute)
+      (State Pool Field))
+  (do state.monad
+    [@name (//constant/pool.utf8 name)
+     @descriptor (//constant/pool.descriptor descriptor)]
+    (wrap {#modifier modifier
+           #name @name
+           #descriptor @descriptor
+           #attributes attributes})))
diff --git a/stdlib/source/lux/target/jvm/index.lux b/stdlib/source/lux/target/jvm/index.lux
new file mode 100644
index 000000000..3a425dd32
--- /dev/null
+++ b/stdlib/source/lux/target/jvm/index.lux
@@ -0,0 +1,33 @@
+(.module:
+  [lux #*
+   [abstract
+    ["." equivalence (#+ Equivalence)]]
+   [data
+    [format
+     ["." binary (#+ Format)]]]
+   [type
+    abstract]]
+  ["." // #_
+   ["#." encoding (#+ U2)]])
+
+(abstract: #export (Index kind)
+  {}
+
+  U2
+
+  (def: #export index
+    (All [kind] (-> U2 (Index kind)))
+    (|>> :abstraction))
+
+  (def: #export equivalence
+    (All [kind] (Equivalence (Index kind)))
+    (:: equivalence.contravariant map-1
+        (|>> :representation)
+        //encoding.u2-equivalence))
+
+  (def: #export format
+    (All [kind] (Format (Index kind)))
+    (binary.adapt (|>> :abstraction)
+                  (|>> :representation)
+                  //encoding.u2-format))
+  )
diff --git a/stdlib/source/lux/target/jvm/loader.old.lux b/stdlib/source/lux/target/jvm/loader.old.lux
new file mode 100644
index 000000000..0ca92fa23
--- /dev/null
+++ b/stdlib/source/lux/target/jvm/loader.old.lux
@@ -0,0 +1,126 @@
+(.module:
+  [lux #*
+   [abstract
+    [monad (#+ do)]]
+   [control
+    ["ex" exception (#+ exception:)]
+    ["." io (#+ IO)]
+    [concurrency
+     ["." atom (#+ Atom)]]]
+   [data
+    ["." error (#+ Error)]
+    ["." text
+     format]
+    [collection
+     ["." array]
+     ["." list ("#;." functor)]
+     ["." dictionary (#+ Dictionary)]]]
+   [world
+    ["." binary (#+ Binary)]]
+   ["." host (#+ import: object do-to)]])
+
+(type: #export Library
+  (Atom (Dictionary Text Binary)))
+
+(exception: #export (already-stored {class Text})
+  (ex.report ["Class" class]))
+
+(exception: #export (unknown {class Text} {known-classes (List Text)})
+  (ex.report ["Class" class]
+             ["Known classes" (|> known-classes
+                                  (list.sort (:: text.order <))
+                                  (list;map (|>> (format text.new-line text.tab)))
+                                  (text.join-with ""))]))
+
+(exception: #export (cannot-define {class Text} {error Text})
+  (ex.report ["Class" class]
+             ["Error" error]))
+
+(import: #long java/lang/Object
+  (getClass [] (java/lang/Class java/lang/Object)))
+
+(import: #long java/lang/String)
+
+(import: #long java/lang/reflect/Method
+  (invoke [java/lang/Object (Array java/lang/Object)]
+          #try java/lang/Object))
+
+(import: #long (java/lang/Class a)
+  (getDeclaredMethod [java/lang/String (Array (java/lang/Class java/lang/Object))]
+                     #try java/lang/reflect/Method))
+
+(import: #long java/lang/Integer
+  (#static TYPE (java/lang/Class java/lang/Integer)))
+
+(import: #long java/lang/reflect/AccessibleObject
+  (setAccessible [boolean] void))
+
+(import: #long java/lang/ClassLoader
+  (loadClass [java/lang/String]
+             #io #try (java/lang/Class java/lang/Object)))
+
+(def: java/lang/ClassLoader::defineClass
+  java/lang/reflect/Method
+  (let [signature (|> (host.array (java/lang/Class java/lang/Object) 4)
+                      (host.array-write 0 (:coerce (java/lang/Class java/lang/Object)
+                                                   (host.class-for java/lang/String)))
+                      (host.array-write 1 (java/lang/Object::getClass (host.array byte 0)))
+                      (host.array-write 2 (:coerce (java/lang/Class java/lang/Object)
+                                                   (java/lang/Integer::TYPE)))
+                      (host.array-write 3 (:coerce (java/lang/Class java/lang/Object)
+                                                   (java/lang/Integer::TYPE))))]
+    (do-to (error.assume
+            (java/lang/Class::getDeclaredMethod "defineClass"
+                                                signature
+                                                (host.class-for java/lang/ClassLoader)))
+      (java/lang/reflect/AccessibleObject::setAccessible true))))
+
+(def: #export (define class-name bytecode loader)
+  (-> Text Binary java/lang/ClassLoader (Error java/lang/Object))
+  (let [signature (array.from-list (list (:coerce java/lang/Object
+                                                  class-name)
+                                         (:coerce java/lang/Object
+                                                  bytecode)
+                                         (:coerce java/lang/Object
+                                                  (host.long-to-int +0))
+                                         (:coerce java/lang/Object
+                                                  (host.long-to-int (.int (binary.size bytecode))))))]
+    (java/lang/reflect/Method::invoke loader signature java/lang/ClassLoader::defineClass)))
+
+(def: #export (new-library _)
+  (-> Any Library)
+  (atom.atom (dictionary.new text.hash)))
+
+(def: #export (memory library)
+  (-> Library java/lang/ClassLoader)
+  (object [] java/lang/ClassLoader []
+    []
+    (java/lang/ClassLoader (findClass {class-name java/lang/String}) java/lang/Class
+                           (let [classes (|> library atom.read io.run)]
+                             (case (dictionary.get class-name classes)
+                               (#.Some bytecode)
+                               (case (|> _jvm_this
+                                         (..define class-name bytecode))
+                                 (#error.Success class)
+                                 (:assume class)
+
+                                 (#error.Failure error)
+                                 (error! (ex.construct ..cannot-define [class-name error])))
+
+                               #.None
+                               (error! (ex.construct ..unknown [class-name (dictionary.keys classes)])))))))
+
+(def: #export (store name bytecode library)
+  (-> Text Binary Library (IO (Error Any)))
+  (do io.monad
+    [library' (atom.read library)]
+    (if (dictionary.contains? name library')
+      (wrap (ex.throw ..already-stored name))
+      (do @
+        [_ (atom.update (dictionary.put name bytecode) library)]
+        (wrap (#error.Success []))))))
+
+(def: #export (load name loader)
+  (-> Text java/lang/ClassLoader
+      (IO (Error (java/lang/Class java/lang/Object))))
+  (java/lang/ClassLoader::loadClass name loader))
diff --git a/stdlib/source/lux/target/jvm/magic.lux b/stdlib/source/lux/target/jvm/magic.lux
new file mode 100644
index 000000000..5b74dc572
--- /dev/null
+++ b/stdlib/source/lux/target/jvm/magic.lux
@@ -0,0 +1,19 @@
+(.module:
+  [lux #*
+   [data
+    [number (#+ hex)]
+    [format
+     [binary (#+ Format)]]]]
+  ["." // #_
+   ["#." encoding (#+ U4)]])
+
+(type: #export Magic
+  U4)
+
+(def: #export code
+  Magic
+  (//encoding.to-u4 (hex "CAFEBABE")))
+
+(def: #export format
+  (Format Magic)
+  //encoding.u4-format)
diff --git a/stdlib/source/lux/target/jvm/method.lux b/stdlib/source/lux/target/jvm/method.lux
new file mode 100644
index 000000000..e4f3cdea2
--- /dev/null
+++ b/stdlib/source/lux/target/jvm/method.lux
@@ -0,0 +1,62 @@
+(.module:
+  [lux (#- static)
+   [abstract
+    ["." equivalence (#+ Equivalence)]
+    [monoid (#+)]
+    ["." monad (#+ do)]]
+   [control
+    [parser (#+)]
+    ["." state (#+ State)]]
+   [data
+    [number (#+)
+     [i64 (#+)]]
+    [format
+     ["." binary (#+ Format)]]
+    [collection
+     ["." row (#+ Row)]]]
+   [type
+    [abstract (#+)]]]
+  ["." // #_
+   [encoding (#+)]
+   [modifier (#+ modifiers:)]
+   ["#." constant (#+ UTF8)]
+   ["#." index (#+ Index)]
+   ["#." attribute (#+ Attribute)]
+   ["#." descriptor (#+ Descriptor)]])
+
+(modifiers:
+  ["0001" public]
+  ["0002" private]
+  ["0004" protected]
+  ["0008" static]
+  ["0010" final]
+  ["0020" synchronized]
+  ["0040" bridge]
+  ["0080" var-args]
+  ["0100" native]
+  ["0400" abstract]
+  ["0800" strict]
+  ["1000" synthetic]
+  )
+
+(type: #export Method
+  {#modifier Modifier
+   #name (Index UTF8)
+   #descriptor (Index (Descriptor //descriptor.Method))
+   #attributes (Row Attribute)})
+
+(def: #export equivalence
+  (Equivalence Method)
+  ($_ equivalence.product
+      ..modifier-equivalence
+      //index.equivalence
+      //index.equivalence
+      (row.equivalence //attribute.equivalence)))
+
+(def: #export format
+  (Format Method)
+  ($_ binary.and
+      ..modifier-format
+      //index.format
+      //index.format
+      (binary.row/16 //attribute.format)))
diff --git a/stdlib/source/lux/target/jvm/modifier.lux b/stdlib/source/lux/target/jvm/modifier.lux
new file mode 100644
index 000000000..f858e6548
--- /dev/null
+++ b/stdlib/source/lux/target/jvm/modifier.lux
@@ -0,0 +1,84 @@
+(.module:
+  [lux #*
+   [abstract
+    ["." equivalence]
+    ["." monoid]]
+   [control
+    ["." parser
+     ["s" code (#+ Parser)]]]
+   [data
+    ["." number
+     ["." i64]]
+    [format
+     ["." binary]]
+    [collection
+     ["." list ("#;." functor)]]]
+   [type
+    ["." abstract]]
+   [macro (#+ with-gensyms)
+    ["." code]
+    [syntax (#+ syntax:)]]]
+  ["." // #_
+   ["#." encoding]])
+
+(type: Modifier
+  {#code Text
+   #name Text})
+
+(def: modifier
+  (Parser Modifier)
+  (s.tuple (parser.and s.text
+                       s.local-identifier)))
+
+(def: (code modifier)
+  (-> Modifier Code)
+  (code.tuple (list (code.text (get@ #code modifier))
+                    (code.local-identifier (get@ #name modifier)))))
+
+(syntax: #export (modifiers: {options (parser.many ..modifier)})
+  (with-gensyms [g!parameter g!subject g! g!]
+    (let [g!name (' Modifier)
+          g!combine (' combine)
+          g!empty (' empty)
+          g!format (' modifier-format)
+          typeC (` (abstract.abstract: (~' #export) (~ g!name)
+                     {}
+
+                     //encoding.U2
+
+                     (.def: (~' #export) (~' code)
+                       (.-> (~ g!name) //encoding.U2)
+                       (.|>> abstract.:representation))
+
+                     (.def: (~' #export) ((~ g!combine) (~ g!parameter) (~ g!subject))
+                       (.-> (~ g!name) (~ g!name) (~ g!name))
+                       (abstract.:abstraction (//encoding.to-u2 (i64.and (//encoding.from-u2 (abstract.:representation (~ g!parameter)))
+                                                                         (//encoding.from-u2 (abstract.:representation (~ g!subject)))))))
+
+                     (.template [(~ g!) (~ g!)]
+                       [(.def: (~' #export) (~ g!)
+                          (~ g!name)
+                          (.|> ((~! number.hex) (~ g!)) //encoding.to-u2 abstract.:abstraction))]
+
+                       ["0000" (~ g!empty)]
+                       (~+ (list;map ..code options))
+                       )
+
+                     (.structure: (~' #export) (~' modifier-equivalence) (equivalence.Equivalence (~ g!name))
+                       (.def: ((~' =) (~' reference) (~' sample))
+                         (.:: //encoding.u2-equivalence (~' =)
+                           (abstract.:representation (~' reference))
+                           (abstract.:representation (~' sample)))))
+
+                     (.def: (~' #export) (~ g!format)
+                       (binary.Format (~ g!name))
+                       (.let [(.^open "_;.") //encoding.u2-format]
+                         {#binary.reader (|> (~' _;reader)
+                                             (:: parser.functor (~' map)
+                                                 (|>> abstract.:abstraction)))
+                          #binary.writer (|>> abstract.:representation
+                                              (~' _;writer))}))))
+          monoidC (` (.structure: (~' #export) (~' modifier-monoid) (monoid.Monoid (~ g!name))
+                       (.def: (~' identity) (~ g!empty))
+                       (.def: (~' compose) (~ g!combine))))]
+      (wrap (list typeC monoidC)))))
diff --git a/stdlib/source/lux/target/jvm/modifier/inner.lux b/stdlib/source/lux/target/jvm/modifier/inner.lux
new file mode 100644
index 000000000..2980ef6e4
--- /dev/null
+++ b/stdlib/source/lux/target/jvm/modifier/inner.lux
@@ -0,0 +1,30 @@
+(.module:
+  [lux (#- static)
+   [abstract
+    [equivalence (#+)]
+    [monoid (#+)]]
+   [control
+    [parser (#+)]]
+   [data
+    [number (#+)
+     [i64 (#+)]]
+    [format
+     [binary (#+)]]]
+   [type
+    [abstract (#+)]]]
+  [// (#+ modifiers:)
+   [//
+    [encoding (#+)]]])
+
+(modifiers:
+  ["0001" public]
+  ["0002" private]
+  ["0004" protected]
+  ["0008" static]
+  ["0010" final]
+  ["0200" interface]
+  ["0400" abstract]
+  ["1000" synthetic]
+  ["2000" annotation]
+  ["4000" enum]
+  )
diff --git a/stdlib/source/lux/target/jvm/name.lux b/stdlib/source/lux/target/jvm/name.lux
new file mode 100644
index 000000000..7f2119bc0
--- /dev/null
+++ b/stdlib/source/lux/target/jvm/name.lux
@@ -0,0 +1,32 @@
+(.module:
+  [lux #*
+   [data
+    ["." text]]
+   [type
+    abstract]])
+
+(def: #export internal-separator "/")
+(def: #export external-separator ".")
+
+(type: #export External Text)
+
+(abstract: #export Internal
+  {}
+
+  Text
+
+  (def: #export internal
+    (-> Text Internal)
+    (|>> (text.replace-all ..external-separator
+                           ..internal-separator)
+         :abstraction))
+
+  (def: #export read
+    (-> Internal Text)
+    (|>> :representation))
+
+  (def: #export external
+    (-> Internal External)
+    (|>> :representation
+         (text.replace-all ..internal-separator
+                           ..external-separator))))
diff --git a/stdlib/source/lux/target/jvm/version.lux b/stdlib/source/lux/target/jvm/version.lux
new file mode 100644
index 000000000..dd76a594d
--- /dev/null
+++ b/stdlib/source/lux/target/jvm/version.lux
@@ -0,0 +1,38 @@
+(.module:
+  [lux #*
+   [data
+    [format
+     ["." binary (#+ Format)]]]]
+  ["." // #_
+   ["#." encoding (#+ U2)]])
+
+(type: #export Version U2)
+(type: #export Minor Version)
+(type: #export Major Version)
+
+(def: #export version
+  (-> Nat Version)
+  //encoding.to-u2)
+
+(template [ ]
+  [(def: #export 
+     Major
+     (..version ))]
+
+  [45 v1_1]
+  [46 v1_2]
+  [47 v1_3]
+  [48 v1_4]
+  [49 v5_0]
+  [50 v6_0]
+  [51 v7]
+  [52 v8]
+  [53 v9]
+  [54 v10]
+  [55 v11]
+  [56 v12]
+  )
+
+(def: #export format
+  (Format Version)
+  //encoding.u2-format)
diff --git a/stdlib/source/lux/target/lua.lux b/stdlib/source/lux/target/lua.lux
new file mode 100644
index 000000000..8dde357cc
--- /dev/null
+++ b/stdlib/source/lux/target/lua.lux
@@ -0,0 +1,310 @@
+(.module:
+  [lux (#- Code int if cond function or and not let)
+   [control
+    [pipe (#+ case> cond> new>)]
+    [parser
+     ["s" code]]]
+   [data
+    [number
+     ["." frac]]
+    ["." text
+     format]
+    [collection
+     ["." list ("#@." functor fold)]]]
+   [macro
+    ["." template]
+    ["." code]
+    [syntax (#+ syntax:)]]
+   [type
+    abstract]])
+
+(def: input-separator ", ")
+(def: statement-suffix ";")
+
+(def: nest
+  (-> Text Text)
+  (|>> (format text.new-line)
+       (text.replace-all text.new-line (format text.new-line text.tab))))
+
+(abstract: #export (Code brand)
+  {}
+
+  Text
+
+  (def: #export manual
+    (-> Text Code)
+    (|>> :abstraction))
+
+  (def: #export code
+    (-> (Code Any) Text)
+    (|>> :representation))
+
+  (template [ ]
+    [(with-expansions [ (template.identifier [ "'"])]
+       (`` (abstract: #export ( brand) {} Any))
+       (`` (type: #export ( brand)
+             ( ( brand)))))]
+    
+    [Expression Code]
+    [Computation Expression]
+    [Location Computation]
+    )
+
+  (template [ ]
+    [(with-expansions [ (template.identifier [ "'"])]
+       (`` (abstract: #export  {} Any))
+       (`` (type: #export  ( ))))]
+
+    [Literal Computation]
+    [Var Location]
+    [Access Location]
+    [Statement Code]
+    )
+
+  (def: #export nil
+    Literal
+    (:abstraction "nil"))
+
+  (def: #export bool
+    (-> Bit Literal)
+    (|>> (case> #0 "false"
+                #1 "true")
+         :abstraction))
+
+  (def: #export (int value)
+    (-> Int Literal)
+    (:abstraction (.if (i/< +0 value)
+                    (%i value)
+                    (%n (.nat value)))))
+
+  (def: #export float
+    (-> Frac Literal)
+    (|>> (cond> [(f/= frac.positive-infinity)]
+                [(new> "(1.0/0.0)" [])]
+                
+                [(f/= frac.negative-infinity)]
+                [(new> "(-1.0/0.0)" [])]
+                
+                [(f/= frac.not-a-number)]
+                [(new> "(0.0/0.0)" [])]
+
+                ## else
+                [%f])
+         :abstraction))
+
+  (def: sanitize
+    (-> Text Text)
+    (`` (|>> (~~ (template [ ]
+                   [(text.replace-all  )]
+
+                   ["\" "\\"]
+                   [text.tab "\t"]
+                   [text.vertical-tab "\v"]
+                   [text.null "\0"]
+                   [text.back-space "\b"]
+                   [text.form-feed "\f"]
+                   [text.new-line "\n"]
+                   [text.carriage-return "\r"]
+                   [text.double-quote (format "\" text.double-quote)]
+                   ))
+             )))
+
+  (def: #export string
+    (-> Text Literal)
+    (|>> ..sanitize (text.enclose' text.double-quote) :abstraction))
+
+  (def: #export array
+    (-> (List (Expression Any)) Literal)
+    (|>> (list@map ..code)
+         (text.join-with ..input-separator)
+         (text.enclose ["{" "}"])
+         :abstraction))
+
+  (def: #export table
+    (-> (List [Text (Expression Any)]) Literal)
+    (|>> (list@map (.function (_ [key value])
+                     (format key " = " (:representation value))))
+         (text.join-with ..input-separator)
+         (text.enclose ["{" "}"])
+         :abstraction))
+
+  (def: #export (nth idx array)
+    (-> (Expression Any) (Expression Any) Access)
+    (:abstraction (format (:representation array) "[" (:representation idx) "]")))
+
+  (def: #export (the field table)
+    (-> Text (Expression Any) (Computation Any))
+    (:abstraction (format (:representation table) "." field)))
+
+  (def: #export length
+    (-> (Expression Any) (Computation Any))
+    (|>> :representation
+         (text.enclose ["#(" ")"])
+         :abstraction))
+
+  (def: #export (apply/* args func)
+    (-> (List (Expression Any)) (Expression Any) (Computation Any))
+    (|> args
+        (list@map ..code)
+        (text.join-with ..input-separator)
+        (text.enclose ["(" ")"])
+        (format (:representation func))
+        :abstraction))
+
+  (def: #export (do method table args)
+    (-> Text (Expression Any) (List (Expression Any)) (Computation Any))
+    (|> args
+        (list@map ..code)
+        (text.join-with ..input-separator)
+        (text.enclose ["(" ")"])
+        (format (:representation table) ":" method)
+        :abstraction))
+
+  (template [ ]
+    [(def: #export ( parameter subject)
+       (-> (Expression Any) (Expression Any) (Expression Any))
+       (:abstraction (format "("
+                             (:representation subject)
+                             " "  " "
+                             (:representation parameter)
+                             ")")))]
+
+    ["==" =]
+    ["<"  <]
+    ["<=" <=]
+    [">"  >]
+    [">=" >=]
+    ["+"  +]
+    ["-"  -]
+    ["*"  *]
+    ["/"  /]
+    ["//" //]
+    ["%"  %]
+    [".." concat]
+
+    ["or"  or]
+    ["and" and]
+    ["|"   bit-or]
+    ["&"   bit-and]
+    ["~"   bit-xor]
+
+    ["<<" bit-shl]
+    [">>" bit-shr]
+    )
+
+  (def: #export (not subject)
+    (-> (Expression Any) (Expression Any))
+    (:abstraction (format "(not " (:representation subject) ")")))
+
+  (def: #export var
+    (-> Text Var)
+    (|>> :abstraction))
+
+  (def: #export statement
+    (-> (Expression Any) Statement)
+    (|>> :representation (text.suffix ..statement-suffix) :abstraction))
+
+  (def: #export (then pre! post!)
+    (-> Statement Statement Statement)
+    (:abstraction
+     (format (:representation pre!)
+             text.new-line
+             (:representation post!))))
+
+  (def: locations
+    (-> (List (Location Any)) Text)
+    (|>> (list@map ..code)
+         (text.join-with ..input-separator)))
+
+  (def: #export (local vars)
+    (-> (List Var) Statement)
+    (:abstraction (format "local " (..locations vars) ..statement-suffix)))
+
+  (def: #export (set vars value)
+    (-> (List (Location Any)) (Expression Any) Statement)
+    (:abstraction (format (..locations vars) " = " (:representation value) ..statement-suffix)))
+
+  (def: #export (let vars value)
+    (-> (List Var) (Expression Any) Statement)
+    ($_ ..then
+        (local vars)
+        (set vars value)))
+
+  (def: #export (if test then! else!)
+    (-> (Expression Any) Statement Statement Statement)
+    (:abstraction (format "if " (:representation test)
+                          text.new-line "then" (..nest (:representation then!))
+                          text.new-line "else" (..nest (:representation else!))
+                          text.new-line "end" ..statement-suffix)))
+
+  (def: #export (when test then!)
+    (-> (Expression Any) Statement Statement)
+    (:abstraction (format "if " (:representation test)
+                          text.new-line "then" (..nest (:representation then!))
+                          text.new-line "end" ..statement-suffix)))
+
+  (def: #export (while test body!)
+    (-> (Expression Any) Statement Statement)
+    (:abstraction
+     (format "while " (:representation test) " do"
+             (..nest (:representation body!))
+             text.new-line "end" ..statement-suffix)))
+
+  (def: #export (for-in vars source body!)
+    (-> (List Var) (Expression Any) Statement Statement)
+    (:abstraction
+     (format "for " (|> vars
+                        (list@map ..code)
+                        (text.join-with ..input-separator))
+             " in " (:representation source) " do"
+             (..nest (:representation body!))
+             text.new-line "end" ..statement-suffix)))
+
+  (def: #export (for-step var from to step body!)
+    (-> Var (Expression Any) (Expression Any) (Expression Any) Statement
+        Statement)
+    (:abstraction
+     (format "for " (:representation var)
+             " = " (:representation from)
+             ..input-separator (:representation to)
+             ..input-separator (:representation step) " do"
+             (..nest (:representation body!))
+             text.new-line "end" ..statement-suffix)))
+
+  (def: #export (return value)
+    (-> (Expression Any) Statement)
+    (:abstraction (format "return " (:representation value) ..statement-suffix)))
+
+  (def: #export (closure args body!)
+    (-> (List Var) Statement (Expression Any))
+    (|> (format "function " (|> args
+                                ..locations
+                                (text.enclose ["(" ")"]))
+                (..nest (:representation body!))
+                text.new-line "end")
+        (text.enclose ["(" ")"])
+        :abstraction))
+
+  (def: #export (function name args body!)
+    (-> Var (List Var) Statement Statement)
+    (:abstraction
+     (format "function " (:representation name)
+             (|> args
+                 ..locations
+                 (text.enclose ["(" ")"]))
+             (..nest (:representation body!))
+             text.new-line "end" ..statement-suffix)))
+
+  (def: #export break
+    Statement
+    (|> "break"
+        (text.suffix ..statement-suffix)
+        :abstraction))
+  )
+
+(def: #export (cond clauses else!)
+  (-> (List [(Expression Any) Statement]) Statement Statement)
+  (list@fold (.function (_ [test then!] next!)
+               (..if test then! next!))
+             else!
+             (list.reverse clauses)))
diff --git a/stdlib/source/lux/target/php.lux b/stdlib/source/lux/target/php.lux
new file mode 100644
index 000000000..286d8d397
--- /dev/null
+++ b/stdlib/source/lux/target/php.lux
@@ -0,0 +1,444 @@
+(.module:
+  [lux (#- Code static int if cond or and not comment for)
+   [control
+    [pipe (#+ case> cond> new>)]]
+   [data
+    [number
+     ["." frac]]
+    ["." text
+     format]
+    [collection
+     ["." list ("#@." functor fold)]]]
+   [macro
+    ["." template]]
+   [type
+    abstract]])
+
+(def: input-separator ", ")
+(def: statement-suffix ";")
+
+(def: nest
+  (-> Text Text)
+  (|>> (format text.new-line)
+       (text.replace-all text.new-line (format text.new-line text.tab))))
+
+(def: block
+  (-> Text Text)
+  (|>> ..nest (text.enclose ["{" (format text.new-line "}")])))
+
+(def: group
+  (-> Text Text)
+  (text.enclose ["(" ")"]))
+
+(abstract: #export (Code brand)
+  {}
+  
+  Text
+
+  (def: #export manual
+    (-> Text Code)
+    (|>> :abstraction))
+
+  (def: #export code
+    (-> (Code Any) Text)
+    (|>> :representation))
+
+  (template [ ]
+    [(with-expansions [ (template.identifier [ "'"])]
+       (`` (abstract: #export ( brand) {} Any))
+       (`` (type: #export ( brand)
+             ( ( brand)))))]
+    
+    [Expression Code]
+    [Computation Expression]
+    [Location Computation]
+    )
+
+  (template [ ]
+    [(with-expansions [ (template.identifier [ "'"])]
+       (`` (abstract: #export  {} Any))
+       (`` (type: #export  ( ))))]
+
+    [Literal Computation]
+    [Var Location]
+    [Constant Location]
+    [Global Location]
+    [Access Location]
+    [Statement Code]
+    )
+
+  (type: #export Argument
+    {#reference? Bit
+     #var Var})
+
+  (def: #export ;
+    (-> (Expression Any) Statement)
+    (|>> :representation
+         (text.suffix ..statement-suffix)
+         :abstraction))
+
+  (def: #export var
+    (-> Text Var)
+    (|>> (format "$") :abstraction))
+
+  (def: #export constant
+    (-> Text Constant)
+    (|>> :abstraction))
+
+  (def: #export null
+    Literal
+    (:abstraction "NULL"))
+
+  (def: #export bool
+    (-> Bit Literal)
+    (|>> (case> #0 "false"
+                #1 "true")
+         :abstraction))
+
+  (def: #export int
+    (-> Int Literal)
+    (|>> %i :abstraction))
+
+  (def: #export float
+    (-> Frac Literal)
+    (|>> (cond> [(f/= frac.positive-infinity)]
+                [(new> "+INF" [])]
+                
+                [(f/= frac.negative-infinity)]
+                [(new> "-INF" [])]
+                
+                [(f/= frac.not-a-number)]
+                [(new> "NAN" [])]
+                
+                ## else
+                [%f])
+         :abstraction))
+
+  (def: sanitize
+    (-> Text Text)
+    (`` (|>> (~~ (template [ ]
+                   [(text.replace-all  )]
+
+                   ["\" "\\"]
+                   [text.tab "\t"]
+                   [text.vertical-tab "\v"]
+                   [text.null "\0"]
+                   [text.back-space "\b"]
+                   [text.form-feed "\f"]
+                   [text.new-line "\n"]
+                   [text.carriage-return "\r"]
+                   [text.double-quote (format "\" text.double-quote)]
+                   ))
+             )))
+
+  (def: #export string
+    (-> Text Literal)
+    (|>> ..sanitize
+         (text.enclose [text.double-quote text.double-quote])
+         :abstraction))
+
+  (def: arguments
+    (-> (List (Expression Any)) Text)
+    (|>> (list@map ..code) (text.join-with ..input-separator) ..group))
+
+  (def: #export (apply/* args func)
+    (-> (List (Expression Any)) (Expression Any) (Computation Any))
+    (:abstraction
+     (format (:representation func) (..arguments args))))
+
+  (def: parameters
+    (-> (List Argument) Text)
+    (|>> (list@map (function (_ [reference? var])
+                     (.if reference?
+                       (format "&" (:representation var))
+                       (:representation var))))
+         (text.join-with ..input-separator)
+         ..group))
+
+  (template [ ]
+    [(def: #export 
+       (-> Var Argument)
+       (|>> []))]
+
+    [parameter #0]
+    [reference #1]
+    )
+
+  (def: #export (closure uses arguments body!)
+    (-> (List Argument) (List Argument) Statement Literal)
+    (let [uses (case uses
+                 #.Nil
+                 ""
+
+                 _
+                 (format "use " (..parameters uses)))]
+      (|> (format "function " (..parameters arguments)
+                  " " uses " "
+                  (..block (:representation body!)))
+          ..group
+          :abstraction)))
+
+  (template [ + + +]
+    [(`` (def: #export ( [(~~ (template.splice +))] function)
+           (-> [(~~ (template.splice +))] (Expression Any) (Computation Any))
+           (..apply/* (list (~~ (template.splice +))) function)))
+
+     (`` (template [ ]
+           [(def: #export ( args)
+              (-> [(~~ (template.splice +))] (Computation Any))
+              ( args (..constant )))]
+           
+           (~~ (template.splice +))))]
+
+    [apply/0 [] []
+     [[func-num-args/0 "func_num_args"]
+      [func-get-args/0 "func_get_args"]
+      [time/0          "time"]]]
+    [apply/1 [in0] [(Expression Any)]
+     [[is-null/1   "is_null"]
+      [empty/1     "empty"]
+      [count/1     "count"]
+      [strlen/1    "strlen"]
+      [array-pop/1 "array_pop"]
+      [array-reverse/1 "array_reverse"]
+      [intval/1    "intval"]
+      [floatval/1  "floatval"]
+      [strval/1    "strval"]
+      [ord/1       "ord"]
+      [chr/1       "chr"]
+      [print/1     "print"]
+      [exit/1      "exit"]]]
+    [apply/2 [in0 in1] [(Expression Any) (Expression Any)]
+     [[call-user-func-array/2 "call_user_func_array"]
+      [array-slice/2          "array_slice"]
+      [array-push/2           "array_push"]]]
+    [apply/3 [in0 in1 in2] [(Expression Any) (Expression Any) (Expression Any)]
+     [[array-slice/3 "array_slice"]
+      [array-splice/3 "array_splice"]
+      [strpos/3 "strpos"]
+      [substr/3 "substr"]]]
+    )
+
+  (def: #export (array/* values)
+    (-> (List (Expression Any)) Literal)
+    (|> values
+        (list@map ..code)
+        (text.join-with ..input-separator)
+        ..group
+        (format "array")
+        :abstraction))
+
+  (def: #export (array-merge/+ required optionals)
+    (-> (Expression Any) (List (Expression Any)) (Computation Any))
+    (..apply/* (list& required optionals) (..constant "array_merge")))
+
+  (def: #export (array/** kvs)
+    (-> (List [(Expression Any) (Expression Any)]) Literal)
+    (|> kvs
+        (list@map (function (_ [key value])
+                    (format (:representation key) " => " (:representation value))))
+        (text.join-with ..input-separator)
+        ..group
+        (format "array")
+        :abstraction))
+
+  (def: #export (new constructor inputs)
+    (-> Constant (List (Expression Any)) (Computation Any))
+    (|> (format "new " (:representation constructor) (arguments inputs))
+        :abstraction))
+
+  (def: #export (do method inputs object)
+    (-> Text (List (Expression Any)) (Expression Any) (Computation Any))
+    (|> (format (:representation object) "->" method (arguments inputs))
+        :abstraction))
+
+  (def: #export (nth idx array)
+    (-> (Expression Any) (Expression Any) Access)
+    (|> (format (:representation array) "[" (:representation idx) "]")
+        :abstraction))
+
+  (def: #export (global name)
+    (-> Text Global)
+    (|> (..var "GLOBALS") (..nth (..string name)) :transmutation))
+
+  (def: #export (? test then else)
+    (-> (Expression Any) (Expression Any) (Expression Any) (Computation Any))
+    (|> (format (:representation test) " ? "
+                (:representation then) " : "
+                (:representation else))
+        ..group
+        :abstraction))
+
+  (template [ ]
+    [(def: #export ( parameter subject)
+       (-> (Expression Any) (Expression Any) (Computation Any))
+       (|> (format (:representation subject) " "  " " (:representation parameter))
+           ..group
+           :abstraction))]
+
+    [or      "||"]
+    [and     "&&"]
+    [=       "==="]
+    [<       "<"]
+    [<=      "<="]
+    [>       ">"]
+    [>=      ">="]
+    [+       "+"]
+    [-       "-"]
+    [*       "*"]
+    [/       "/"]
+    [%       "%"]
+    [bit-or  "|"]
+    [bit-and "&"]
+    [bit-xor "^"]
+    [bit-shl "<<"]
+    [bit-shr ">>"]
+    [concat  "."]
+    )
+
+  (def: #export not
+    (-> (Computation Any) (Computation Any))
+    (|>> :representation (format "!") :abstraction))
+
+  (def: #export (set var value)
+    (-> (Location Any) (Expression Any) (Computation Any))
+    (|> (format (:representation var) " = " (:representation value))
+        ..group
+        :abstraction))
+
+  (def: #export (set? var)
+    (-> Var (Computation Any))
+    (..apply/1 [var] (..constant "isset")))
+
+  (template [ ]
+    [(def: #export 
+       (-> Var Statement)
+       (|>> :representation (format  " ") (text.suffix ..statement-suffix) :abstraction))]
+
+    [define-global "global"]
+    )
+
+  (template [  ]
+    [(def: #export ( location value)
+       (->  (Expression Any) Statement)
+       (:abstraction (format  " " (:representation location)
+                             " = " (:representation value)
+                             ..statement-suffix)))]
+
+    [define-static   "static" Var]
+    [define-constant "const"  Constant]
+    )
+
+  (def: #export (if test then! else!)
+    (-> (Expression Any) Statement Statement Statement)
+    (:abstraction
+     (format "if " (..group (:representation test)) " "
+             (..block (:representation then!))
+             " else "
+             (..block (:representation else!)))))
+
+  (def: #export (when test then!)
+    (-> (Expression Any) Statement Statement)
+    (:abstraction
+     (format "if " (..group (:representation test)) " "
+             (..block (:representation then!)))))
+
+  (def: #export (then pre! post!)
+    (-> Statement Statement Statement)
+    (:abstraction
+     (format (:representation pre!)
+             text.new-line
+             (:representation post!))))
+
+  (def: #export (while test body!)
+    (-> (Expression Any) Statement Statement)
+    (:abstraction
+     (format "while " (..group (:representation test)) " "
+             (..block (:representation body!)))))
+
+  (def: #export (do-while test body!)
+    (-> (Expression Any) Statement Statement)
+    (:abstraction
+     (format "do " (..block (:representation body!))
+             " while " (..group (:representation test))
+             ..statement-suffix)))
+
+  (def: #export (for-each array value body!)
+    (-> (Expression Any) Var Statement Statement)
+    (:abstraction
+     (format "foreach(" (:representation array)
+             " as " (:representation value)
+             ") " (..block (:representation body!)))))
+
+  (type: #export Except
+    {#class Constant
+     #exception Var
+     #handler Statement})
+
+  (def: (catch except)
+    (-> Except Text)
+    (let [declaration (format (:representation (get@ #class except))
+                              " " (:representation (get@ #exception except)))]
+      (format "catch" (..group declaration) " "
+              (..block (:representation (get@ #handler except))))))
+  
+  (def: #export (try body! excepts)
+    (-> Statement (List Except) Statement)
+    (:abstraction
+     (format "try " (..block (:representation body!))
+             text.new-line
+             (|> excepts
+                 (list@map catch)
+                 (text.join-with text.new-line)))))
+
+  (template [ ]
+    [(def: #export 
+       (-> (Expression Any) Statement)
+       (|>> :representation (format  " ") (text.suffix ..statement-suffix) :abstraction))]
+
+    [throw  "throw"]
+    [return "return"]
+    [echo   "echo"]
+    )
+
+  (def: #export (define name value)
+    (-> Constant (Expression Any) (Expression Any))
+    (..apply/2 [(|> name :representation ..string)
+                value]
+               (..constant "define")))
+
+  (def: #export (define-function name uses arguments body!)
+    (-> Constant (List Argument) (List Argument) Statement Statement)
+    (let [uses (case uses
+                 #.Nil
+                 ""
+
+                 _
+                 (format " use " (..parameters uses)))]
+      (:abstraction
+       (format "function " (:representation name) " " (..parameters arguments)
+               uses " "
+               (..block (:representation body!))))))
+
+  (template [ ]
+    [(def: #export 
+       Statement
+       (|> 
+           (text.suffix ..statement-suffix)
+           :abstraction))]
+
+    [break "break"]
+    [continue "continue"]
+    )
+  )
+
+(def: #export (cond clauses else!)
+  (-> (List [(Expression Any) Statement]) Statement Statement)
+  (list@fold (function (_ [test then!] next!)
+               (..if test then! next!))
+             else!
+             (list.reverse clauses)))
+
+(def: #export command-line-arguments
+  Var
+  (..var "argv"))
diff --git a/stdlib/source/lux/target/python.lux b/stdlib/source/lux/target/python.lux
new file mode 100644
index 000000000..80f6b12de
--- /dev/null
+++ b/stdlib/source/lux/target/python.lux
@@ -0,0 +1,435 @@
+(.module:
+  [lux (#- Code not or and list if cond int comment)
+   [control
+    [pipe (#+ new> case> cond>)]
+    [parser
+     ["s" code]]]
+   [data
+    [number
+     ["." frac]]
+    ["." text
+     format]
+    [collection
+     ["." list ("#@." functor fold)]]]
+   [macro
+    ["." template]
+    ["." code]
+    [syntax (#+ syntax:)]]
+   [type
+    abstract]])
+
+(def: expression (-> Text Text) (text.enclose ["(" ")"]))
+
+(def: nest
+  (-> Text Text)
+  (|>> (format text.new-line)
+       (text.replace-all text.new-line (format text.new-line text.tab))))
+
+(abstract: #export (Code brand)
+  {}
+
+  Text
+
+  (def: #export manual
+    (-> Text Code)
+    (|>> :abstraction))
+
+  (def: #export code
+    (-> (Code Any) Text)
+    (|>> :representation))
+
+  (template [ ]
+    [(with-expansions [ (template.identifier [ "'"])]
+       (`` (abstract: #export ( brand) {} Any))
+       (`` (type: #export ( brand)
+             ( ( brand)))))]
+    
+    [Expression Code]
+    [Computation Expression]
+    [Location Computation]
+    [Var Location]
+    [Statement Code]
+    )
+
+  (template [ ]
+    [(with-expansions [ (template.identifier [ "'"])]
+       (`` (abstract: #export  {} Any))
+       (`` (type: #export  ( ))))]
+
+    [Literal Computation]
+    [Access Location]
+    [Loop Statement]
+    [Label Code]
+    )
+
+  (template [ ]
+    [(abstract: #export  {} Any)
+
+     (type: #export  (Var ))]
+
+    [SVar Single]
+    [PVar Poly]
+    [KVar Keyword]
+    )
+
+  (def: #export var
+    (-> Text SVar)
+    (|>> :abstraction))
+
+  (template [  ]
+    [(def: #export 
+       (-> SVar (Var ))
+       (|>> :representation (format ) :abstraction))]
+
+    [poly    Poly    "*"]
+    [keyword Keyword "**"]
+    )
+
+  (def: #export none
+    Literal
+    (:abstraction "None"))
+
+  (def: #export bool
+    (-> Bit Literal)
+    (|>> (case> #0 "False"
+                #1 "True")
+         :abstraction))
+
+  (def: #export int
+    (-> Int Literal)
+    (|>> %i :abstraction))
+
+  (def: #export (long value)
+    (-> Int Literal)
+    (:abstraction (format (%i value) "L")))
+
+  (def: #export float
+    (-> Frac Literal)
+    (`` (|>> (cond> (~~ (template [ ]
+                          [[(f/= )]
+                           [(new> (format "float(" text.double-quote  text.double-quote ")") [])]]
+
+                          [frac.positive-infinity "inf"]
+                          [frac.negative-infinity "-inf"]
+                          [frac.not-a-number "nan"]
+                          ))
+                    
+                    ## else
+                    [%f])
+             :abstraction)))
+
+  (def: sanitize
+    (-> Text Text)
+    (`` (|>> (~~ (template [ ]
+                   [(text.replace-all  )]
+
+                   ["\" "\\"]
+                   [text.tab "\t"]
+                   [text.vertical-tab "\v"]
+                   [text.null "\0"]
+                   [text.back-space "\b"]
+                   [text.form-feed "\f"]
+                   [text.new-line "\n"]
+                   [text.carriage-return "\r"]
+                   [text.double-quote (format "\" text.double-quote)]
+                   ))
+             )))
+
+  (def: #export string
+    (-> Text Literal)
+    (|>> ..sanitize
+         (text.enclose [text.double-quote text.double-quote])
+         :abstraction))
+
+  (def: (composite-literal left-delimiter right-delimiter entry-serializer)
+    (All [a]
+      (-> Text Text (-> a Text)
+          (-> (List a) Literal)))
+    (function (_ entries)
+      (<| :abstraction
+          ..expression
+          (format left-delimiter
+                  (|> entries
+                      (list@map entry-serializer)
+                      (text.join-with ", "))
+                  right-delimiter))))
+
+  (template [ 
 ]
+    [(def: #export 
+       (-> (List (Expression Any)) Literal)
+       (composite-literal 
  ..code))]
+
+    [tuple "(" ")"]
+    [list  "[" "]"]
+    )
+
+  (def: #export (slice from to list)
+    (-> (Expression Any) (Expression Any) (Expression Any) Access)
+    (<| :abstraction
+        ..expression
+        (format (:representation list) "[" (:representation from) ":" (:representation to) "]")))
+
+  (def: #export (slice-from from list)
+    (-> (Expression Any) (Expression Any) Access)
+    (<| :abstraction
+        ..expression
+        (format (:representation list) "[" (:representation from) ":]")))
+
+  (def: #export dict
+    (-> (List [(Expression Any) (Expression Any)]) (Computation Any))
+    (composite-literal "{" "}" (.function (_ [k v]) (format (:representation k) " : " (:representation v)))))
+
+  (def: #export (apply/* func args)
+    (-> (Expression Any) (List (Expression Any)) (Computation Any))
+    (<| :abstraction
+        ..expression
+        (format (:representation func) "(" (text.join-with ", " (list@map ..code args)) ")")))
+
+  (template [  ]
+    [(def: ( var)
+       (-> (Expression Any) Text)
+       (format  (:representation var)))]
+
+    [splat-poly    Poly    "*"]
+    [splat-keyword Keyword "**"]
+    )
+
+  (template [ ]
+    [(def: #export ( args extra func)
+       (-> (List (Expression Any)) (Expression Any) (Expression Any) (Computation Any))
+       (<| :abstraction
+           ..expression
+           (format (:representation func)
+                   (format "(" (|> args
+                                   (list@map (function (_ arg) (format (:representation arg) ", ")))
+                                   (text.join-with ""))
+                           ( extra) ")"))))]
+
+    [apply-poly    splat-poly]
+    [apply-keyword splat-keyword]
+    )
+
+  (def: #export (the name object)
+    (-> Text (Expression Any) (Computation Any))
+    (:abstraction (format (:representation object) "." name)))
+
+  (def: #export (do method args object)
+    (-> Text (List (Expression Any)) (Expression Any) (Computation Any))
+    (..apply/* (..the method object) args))
+
+  (template [ ]
+    [(def: #export ( args extra method)
+       (-> (List (Expression Any)) (Expression Any) Text
+           (-> (Expression Any) (Computation Any)))
+       (|>> (..the method) ( args extra)))]
+
+    [do-poly    apply-poly]
+    [do-keyword apply-keyword]
+    )
+
+  (def: #export (nth idx array)
+    (-> (Expression Any) (Expression Any) Location)
+    (:abstraction (format (:representation array) "[" (:representation idx) "]")))
+
+  (def: #export (? test then else)
+    (-> (Expression Any) (Expression Any) (Expression Any) (Computation Any))
+    (<| :abstraction
+        ..expression
+        (format (:representation then) " if " (:representation test) " else " (:representation else))))
+
+  (template [ ]
+    [(def: #export ( param subject)
+       (-> (Expression Any) (Expression Any) (Computation Any))
+       (<| :abstraction
+           ..expression
+           (format (:representation subject) " "  " " (:representation param))))]
+
+    [is      "is"]
+    [=       "=="]
+    [<       "<"]
+    [<=      "<="]
+    [>       ">"]
+    [>=      ">="]
+    [+       "+"]
+    [-       "-"]
+    [*       "*"]
+    [/       "/"]
+    [%       "%"]
+    [**      "**"]
+    [bit-or  "|"]
+    [bit-and "&"]
+    [bit-xor "^"]
+    [bit-shl "<<"]
+    [bit-shr ">>"]
+
+    [or      "or"]
+    [and     "and"]
+    )
+
+  (def: #export (not subject)
+    (-> (Expression Any) (Computation Any))
+    (<| :abstraction
+        ..expression
+        (format "not " (:representation subject))))
+
+  (def: #export (lambda arguments body)
+    (-> (List (Var Any)) (Expression Any) (Computation Any))
+    (<| :abstraction
+        ..expression
+        (format "lambda " (|> arguments (list@map ..code) (text.join-with ", ")) ": "
+                (:representation body))))
+
+  (def: #export (set vars value)
+    (-> (List (Location Any)) (Expression Any) (Statement Any))
+    (:abstraction
+     (format (|> vars (list@map ..code) (text.join-with ", "))
+             " = "
+             (:representation value))))
+
+  (def: #export (delete where)
+    (-> (Location Any) (Statement Any))
+    (:abstraction (format "del " (:representation where))))
+
+  (def: #export (if test then! else!)
+    (-> (Expression Any) (Statement Any) (Statement Any) (Statement Any))
+    (:abstraction
+     (format "if " (:representation test) ":"
+             (..nest (:representation then!))
+             text.new-line "else:"
+             (..nest (:representation else!)))))
+
+  (def: #export (when test then!)
+    (-> (Expression Any) (Statement Any) (Statement Any))
+    (:abstraction
+     (format "if " (:representation test) ":"
+             (..nest (:representation then!)))))
+
+  (def: #export (then pre! post!)
+    (-> (Statement Any) (Statement Any) (Statement Any))
+    (:abstraction
+     (format (:representation pre!)
+             text.new-line
+             (:representation post!))))
+
+  (template [ <0>]
+    [(def: #export <0>
+       Statement
+       (:abstraction ))]
+
+    ["break"    break]
+    ["continue" continue]
+    )
+
+  (def: #export (while test body!)
+    (-> (Expression Any) (Statement Any) Loop)
+    (:abstraction
+     (format "while " (:representation test) ":"
+             (..nest (:representation body!)))))
+
+  (def: #export (for-in var inputs body!)
+    (-> SVar (Expression Any) (Statement Any) Loop)
+    (:abstraction
+     (format "for " (:representation var) " in " (:representation inputs) ":"
+             (..nest (:representation body!)))))
+
+  (def: #export statement
+    (-> (Expression Any) (Statement Any))
+    (|>> :transmutation))
+
+  (def: #export pass
+    (Statement Any)
+    (:abstraction "pass"))
+
+  (type: #export Except
+    {#classes (List SVar)
+     #exception SVar
+     #handler (Statement Any)})
+  
+  (def: #export (try body! excepts)
+    (-> (Statement Any) (List Except) (Statement Any))
+    (:abstraction
+     (format "try:"
+             (..nest (:representation body!))
+             (|> excepts
+                 (list@map (function (_ [classes exception catch!])
+                             (format text.new-line "except (" (text.join-with ", " (list@map ..code classes))
+                                     ") as " (:representation exception) ":"
+                                     (..nest (:representation catch!)))))
+                 (text.join-with "")))))
+
+  (template [ ]
+    [(def: #export ( message)
+       (-> (Expression Any) (Statement Any))
+       (:abstraction
+        (format  " " (:representation message))))]
+
+    [raise  "raise"]
+    [return "return"]
+    [print  "print"]
+    )
+  
+  (def: #export (def name args body)
+    (-> SVar (List (Ex [k] (Var k))) (Statement Any) (Statement Any))
+    (:abstraction
+     (format "def " (:representation name)
+             "(" (|> args (list@map ..code) (text.join-with ", ")) "):"
+             (..nest (:representation body)))))
+
+  (def: #export (import module-name)
+    (-> Text (Statement Any))
+    (:abstraction (format "import " module-name)))
+
+  (def: #export (comment commentary on)
+    (All [brand] (-> Text (Code brand) (Code brand)))
+    (:abstraction (format "# "  (..sanitize commentary) text.new-line
+                          (:representation on))))
+  )
+
+(def: #export (cond clauses else!)
+  (-> (List [(Expression Any) (Statement Any)]) (Statement Any) (Statement Any))
+  (list@fold (.function (_ [test then!] next!)
+               (..if test then! next!))
+             else!
+             (list.reverse clauses)))
+
+(syntax: (arity-inputs {arity s.nat})
+  (wrap (case arity
+          0 (.list)
+          _ (|> (dec arity)
+                (list.n/range 0)
+                (list@map (|>> %n code.local-identifier))))))
+
+(syntax: (arity-types {arity s.nat})
+  (wrap (list.repeat arity (` (Expression Any)))))
+
+(template [ +]
+  [(with-expansions [ (template.identifier ["apply/" ])
+                      (arity-inputs )
+                      (arity-types )
+                      (template.splice +)]
+     (def: #export ( function )
+       (-> (Expression Any)  (Computation Any))
+       (..apply/* function (.list )))
+
+     (template []
+       [(`` (def: #export (~~ (template.identifier [ "/" ]))
+              ( (..var ))))]
+
+       ))]
+
+  [1
+   [["str"]
+    ["ord"]
+    ["float"]
+    ["int"]
+    ["len"]
+    ["chr"]
+    ["repr"]
+    ["Exception"]]]
+
+  [2
+   []]
+
+  [3
+   []]
+  )
diff --git a/stdlib/source/lux/target/ruby.lux b/stdlib/source/lux/target/ruby.lux
new file mode 100644
index 000000000..037cdca5b
--- /dev/null
+++ b/stdlib/source/lux/target/ruby.lux
@@ -0,0 +1,388 @@
+(.module:
+  [lux (#- Code static int if cond function or and not comment)
+   [control
+    [pipe (#+ case> cond> new>)]]
+   [data
+    [number
+     ["." frac]]
+    ["." text
+     format]
+    [collection
+     ["." list ("#@." functor fold)]]]
+   [macro
+    ["." template]]
+   [type
+    abstract]])
+
+(def: input-separator ", ")
+(def: statement-suffix ";")
+
+(def: nest
+  (-> Text Text)
+  (|>> (format text.new-line)
+       (text.replace-all text.new-line (format text.new-line text.tab))))
+
+(abstract: #export (Code brand)
+  {}
+
+  Text
+
+  (def: #export manual
+    (-> Text Code)
+    (|>> :abstraction))
+
+  (def: #export code
+    (-> (Code Any) Text)
+    (|>> :representation))
+
+  (template [ ]
+    [(with-expansions [ (template.identifier [ "'"])]
+       (`` (abstract: #export ( brand) {} Any))
+       (`` (type: #export ( brand)
+             ( ( brand)))))]
+    
+    [Expression Code]
+    [Computation Expression]
+    [Location Computation]
+    [Var Location]
+    [Statement Code]
+    )
+
+  (template [ ]
+    [(with-expansions [ (template.identifier [ "'"])]
+       (`` (abstract: #export  {} Any))
+       (`` (type: #export  ( ))))]
+
+    [Literal Computation]
+    [Access Location]
+    )
+
+  (template [   ]
+    [(abstract: #export  {} Any)
+
+     (type: #export  (Var ))
+
+     (def: #export 
+       (-> Text )
+       (|>> (format ) :abstraction))]
+
+    [GVar Global   "$"  global]
+    [IVar Instance "@"  instance]
+    [SVar Static   "@@" static]
+    )
+
+  (abstract: #export (Local brand) {} Any)
+  (type: #export LVar (Var (Local Any)))
+
+  (def: #export local
+    (-> Text LVar)
+    (|>> :abstraction))
+
+  (template [    ]
+    [(abstract: #export  {} Any)
+
+     (type: #export  (Var (Local )))
+
+     (template [  ]
+       [(def: #export 
+          (->  )
+          (|>> :representation (format ) :abstraction))]
+
+       [ LVar ]
+       [ (Expression Any) (Computation Any)]
+       )]
+
+    [LVar*  Poly   "*"  variadic    splat]
+    [LVar** PolyKV "**" variadic-kv double-splat]
+    )
+
+  (template [ ]
+    [(def: #export  (..global ))]
+
+    ["@" latest-error]
+    ["_" last-string-read]
+    ["." last-line-number-read]
+    ["&" last-string-matched]
+    ["~" last-regexp-match]
+    ["=" case-insensitivity-flag]
+    ["/" input-record-separator]
+    ["\" output-record-separator]
+    ["0" script-name]
+    ["*" command-line-arguments]
+    ["$" process-id]
+    ["?" exit-status]
+    )
+
+  (def: #export nil
+    Literal
+    (:abstraction "nil"))
+
+  (def: #export bool
+    (-> Bit Literal)
+    (|>> (case> #0 "false"
+                #1 "true")
+         :abstraction))
+
+  (def: sanitize
+    (-> Text Text)
+    (`` (|>> (~~ (template [ ]
+                   [(text.replace-all  )]
+
+                   ["\" "\\"]
+                   [text.tab "\t"]
+                   [text.vertical-tab "\v"]
+                   [text.null "\0"]
+                   [text.back-space "\b"]
+                   [text.form-feed "\f"]
+                   [text.new-line "\n"]
+                   [text.carriage-return "\r"]
+                   [text.double-quote (format "\" text.double-quote)]
+                   ))
+             )))
+
+  (template [   ]
+    [(def: #export 
+       (->  Literal)
+       (|>>   :abstraction))]
+
+    [%i int Int     (<|)]
+    [%t string Text ..sanitize]
+    )
+
+  (def: #export float
+    (-> Frac Literal)
+    (|>> (cond> [(f/= frac.positive-infinity)]
+                [(new> "(+1.0/0.0)" [])]
+                
+                [(f/= frac.negative-infinity)]
+                [(new> "(-1.0/0.0)" [])]
+                
+                [(f/= frac.not-a-number)]
+                [(new> "(+0.0/-0.0)" [])]
+
+                ## else
+                [%f])
+         :abstraction))
+
+  (def: #export (array-range from to array)
+    (-> (Expression Any) (Expression Any) (Expression Any) (Computation Any))
+    (|> (format (:representation from) ".." (:representation to))
+        (text.enclose ["[" "]"])
+        (format (:representation array))
+        :abstraction))
+
+  (def: #export array
+    (-> (List (Expression Any)) Literal)
+    (|>> (list@map (|>> :representation))
+         (text.join-with ..input-separator)
+         (text.enclose ["[" "]"])
+         :abstraction))
+
+  (def: #export hash
+    (-> (List [(Expression Any) (Expression Any)]) Literal)
+    (|>> (list@map (.function (_ [k v])
+                     (format (:representation k) " => " (:representation v))))
+         (text.join-with ..input-separator)
+         (text.enclose ["{" "}"])
+         :abstraction))
+
+  (def: #export (apply/* args func)
+    (-> (List (Expression Any)) (Expression Any) (Computation Any))
+    (|> args
+        (list@map (|>> :representation))
+        (text.join-with ..input-separator)
+        (text.enclose ["(" ")"])
+        (format (:representation func))
+        :abstraction))
+
+  (def: #export (the field object)
+    (-> Text (Expression Any) Access)
+    (:abstraction (format (:representation object) "." field)))
+
+  (def: #export (nth idx array)
+    (-> (Expression Any) (Expression Any) Access)
+    (|> (:representation idx)
+        (text.enclose ["[" "]"])
+        (format (:representation array))
+        :abstraction))
+
+  (def: #export (? test then else)
+    (-> (Expression Any) (Expression Any) (Expression Any) (Computation Any))
+    (|> (format (:representation test) " ? "
+                (:representation then) " : "
+                (:representation else))
+        (text.enclose ["(" ")"])
+        :abstraction))
+
+  (def: #export statement
+    (-> (Expression Any) (Statement Any))
+    (|>> :representation
+         (text.suffix ..statement-suffix)
+         :abstraction))
+
+  (def: #export (then pre! post!)
+    (-> (Statement Any) (Statement Any) (Statement Any))
+    (:abstraction
+     (format (:representation pre!)
+             text.new-line
+             (:representation post!))))
+
+  (def: #export (set vars value)
+    (-> (List (Location Any)) (Expression Any) (Statement Any))
+    (:abstraction
+     (format (|> vars
+                 (list@map (|>> :representation))
+                 (text.join-with ..input-separator))
+             " = " (:representation value) ..statement-suffix)))
+
+  (def: (block content)
+    (-> Text Text)
+    (format content
+            text.new-line "end" ..statement-suffix))
+
+  (def: #export (if test then! else!)
+    (-> (Expression Any) (Statement Any) (Statement Any) (Statement Any))
+    (<| :abstraction
+        ..block
+        (format "if " (:representation test)
+                text.new-line (..nest (:representation then!))
+                text.new-line "else"
+                text.new-line (..nest (:representation else!)))))
+
+  (template [ ]
+    [(def: #export ( test then!)
+       (-> (Expression Any) (Statement Any) (Statement Any))
+       (<| :abstraction
+           ..block
+           (format  " " (:representation test)
+                   text.new-line (..nest (:representation then!)))))]
+
+    [when "if"]
+    [while "while"]
+    )
+
+  (def: #export (for-in var array iteration!)
+    (-> LVar (Expression Any) (Statement Any) (Statement Any))
+    (<| :abstraction
+        ..block
+        (format "for " (:representation var)
+                " in " (:representation array)
+                " do "
+                text.new-line (..nest (:representation iteration!)))))
+
+  (type: #export Rescue
+    {#classes (List Text)
+     #exception LVar
+     #rescue (Statement Any)})
+
+  (def: #export (begin body! rescues)
+    (-> (Statement Any) (List Rescue) (Statement Any))
+    (<| :abstraction
+        ..block
+        (format "begin"
+                text.new-line (:representation body!)
+                (|> rescues
+                    (list@map (.function (_ [classes exception rescue])
+                                (format text.new-line "rescue " (text.join-with ..input-separator classes)
+                                        " => " (:representation exception)
+                                        text.new-line (..nest (:representation rescue)))))
+                    (text.join-with text.new-line)))))
+
+  (def: #export (return value)
+    (-> (Expression Any) (Statement Any))
+    (:abstraction (format "return " (:representation value) ..statement-suffix)))
+
+  (def: #export (raise message)
+    (-> (Expression Any) (Computation Any))
+    (:abstraction (format "raise " (:representation message))))
+
+  (template [ ]
+    [(def: #export 
+       (Statement Any)
+       (|> 
+           (text.suffix ..statement-suffix)
+           :abstraction))]
+
+    [next "next"]
+    [redo "redo"]
+    [break "break"]
+    )
+
+  (def: #export (function name args body!)
+    (-> LVar (List (Var Any)) (Statement Any) (Statement Any))
+    (<| :abstraction
+        ..block
+        (format "def " (:representation name)
+                (|> args
+                    (list@map (|>> :representation))
+                    (text.join-with ..input-separator)
+                    (text.enclose ["(" ")"]))
+                text.new-line (:representation body!))))
+
+  (def: #export (lambda name args body!)
+    (-> (Maybe LVar) (List (Var Any)) (Statement Any) Literal)
+    (let [proc (|> (format (|> args
+                               (list@map (|>> :representation))
+                               (text.join-with ..input-separator)
+                               (text.enclose' "|"))
+                           " "
+                           (:representation body!))
+                   (text.enclose ["{" "}"])
+                   (format "lambda "))]
+      (|> (case name
+            #.None
+            proc
+            
+            (#.Some name)
+            (format (:representation name) " = " proc))
+          (text.enclose ["(" ")"])
+          :abstraction)))
+
+  (template [ ]
+    [(def: #export ( parameter subject)
+       (-> (Expression Any) (Expression Any) (Computation Any))
+       (:abstraction (format "(" (:representation subject) " "  " " (:representation parameter) ")")))]
+
+    ["==" =]
+    [ "<" <]
+    ["<=" <=]
+    [ ">" >]
+    [">=" >=]
+
+    [ "+" +]
+    [ "-" -]
+    [ "*" *]
+    [ "/" /]
+    [ "%" %]
+    ["**" pow]
+
+    ["||" or]
+    ["&&" and]
+    [ "|" bit-or]
+    [ "&" bit-and]
+    [ "^" bit-xor]
+
+    ["<<" bit-shl]
+    [">>" bit-shr]
+    )
+
+  (def: #export (not subject)
+    (-> (Expression Any) (Computation Any))
+    (:abstraction (format "(!" (:representation subject) ")")))
+
+  (def: #export (comment commentary on)
+    (All [brand] (-> Text (Code brand) (Code brand)))
+    (:abstraction (format "# "  (..sanitize commentary) text.new-line
+                          (:representation on))))
+  )
+
+(def: #export (do method args object)
+  (-> Text (List (Expression Any)) (Expression Any) (Computation Any))
+  (|> object (..the method) (..apply/* args)))
+
+(def: #export (cond clauses else!)
+  (-> (List [(Expression Any) (Statement Any)]) (Statement Any) (Statement Any))
+  (list@fold (.function (_ [test then!] next!)
+               (..if test then! next!))
+             else!
+             (list.reverse clauses)))
diff --git a/stdlib/source/lux/target/scheme.lux b/stdlib/source/lux/target/scheme.lux
new file mode 100644
index 000000000..820ff8c83
--- /dev/null
+++ b/stdlib/source/lux/target/scheme.lux
@@ -0,0 +1,317 @@
+(.module:
+  [lux (#- Code int or and if function cond let)
+   [control
+    [pipe (#+ new> cond> case>)]
+    ["." function]]
+   [data
+    [number
+     ["." frac]]
+    ["." text
+     format]
+    [collection
+     ["." list ("#;." functor fold)]]]
+   [macro
+    ["." template]]
+   [type
+    abstract]])
+
+(abstract: #export (Code k)
+  {}
+  
+  Text
+
+  (template [  +]
+    [(abstract: #export ( brand) {} Any)
+     (`` (type: #export  (|> Any  (~~ (template.splice +)))))]
+    
+    [Expression Expression' [Code]]
+    )
+
+  (template [  +]
+    [(abstract: #export  {} Any)
+     (`` (type: #export  (|>  (~~ (template.splice +)))))]
+
+    [Global Global' [Expression' Code]]
+    [Var Var' [Expression' Code]]
+    [Computation Computation' [Expression' Code]]
+    )
+
+  (type: #export Arguments
+    {#mandatory (List Var)
+     #rest (Maybe Var)})
+
+  (def: #export code (-> (Code Any) Text) (|>> :representation))
+
+  (def: #export var (-> Text Var) (|>> :abstraction))
+
+  (def: (arguments [vars rest])
+    (-> Arguments (Code Any))
+    (case rest
+      (#.Some rest)
+      (case vars
+        #.Nil
+        rest
+
+        _
+        (|> (format " . " (:representation rest))
+            (format (|> vars
+                        (list;map ..code)
+                        (text.join-with " ")))
+            (text.enclose ["(" ")"])
+            :abstraction))
+      
+      #.None
+      (|> vars
+          (list;map ..code)
+          (text.join-with " ")
+          (text.enclose ["(" ")"])
+          :abstraction)))
+
+  (def: #export nil
+    Computation
+    (:abstraction "'()"))
+
+  (def: #export bool
+    (-> Bit Computation)
+    (|>> (case> #0 "#f"
+                #1 "#t")
+         :abstraction))
+
+  (def: #export int
+    (-> Int Computation)
+    (|>> %i :abstraction))
+
+  (def: #export float
+    (-> Frac Computation)
+    (|>> (cond> [(f/= frac.positive-infinity)]
+                [(new> "+inf.0" [])]
+                
+                [(f/= frac.negative-infinity)]
+                [(new> "-inf.0" [])]
+                
+                [frac.not-a-number?]
+                [(new> "+nan.0" [])]
+                
+                ## else
+                [%f])
+         :abstraction))
+
+  (def: #export positive-infinity Computation (..float frac.positive-infinity))
+  (def: #export negative-infinity Computation (..float frac.negative-infinity))
+  (def: #export not-a-number Computation (..float frac.not-a-number))
+
+  (def: sanitize
+    (-> Text Text)
+    (`` (|>> (~~ (template [ ]
+                   [(text.replace-all  )]
+
+                   [text.alarm "\a"]
+                   [text.back-space "\b"]
+                   [text.tab "\t"]
+                   [text.new-line "\n"]
+                   [text.carriage-return "\r"]
+                   [text.double-quote (format "\" text.double-quote)]
+                   ["\" "\\"]
+                   ["|" "\|"]
+                   ))
+             )))
+  
+  (def: #export string
+    (-> Text Computation)
+    (|>> ..sanitize %t :abstraction))
+
+  (def: #export symbol
+    (-> Text Computation)
+    (|>> (format "'") :abstraction))
+
+  (def: #export global
+    (-> Text Global)
+    (|>> :abstraction))
+
+  (def: form
+    (-> (List (Code Any)) Text)
+    (|>> (list;map ..code)
+         (text.join-with " ")
+         (text.enclose ["(" ")"])))
+  
+  (def: #export (apply/* func args)
+    (-> Expression (List Expression) Computation)
+    (:abstraction (..form (#.Cons func args))))
+  
+  (template [ ]
+    [(def: #export 
+       (-> (List Expression) Computation)
+       (apply/* (..global )))]
+
+    [vector/* "vector"]
+    [list/*   "list"]
+    )
+
+  (def: #export (apply/0 func)
+    (-> Expression Computation)
+    (..apply/* func (list)))
+
+  (template [ ]
+    [(def: #export  (apply/0 (..global )))]
+
+    [newline/0 "newline"]
+    )
+
+  (template [ + + +]
+    [(`` (def: #export ( function)
+           (-> Expression (~~ (template.splice +)) Computation)
+           (.function (_ (~~ (template.splice +)))
+             (..apply/* function (list (~~ (template.splice +)))))))
+
+     (`` (template [ ]
+           [(def: #export  ( (..global )))]
+
+           (~~ (template.splice +))))]
+
+    [apply/1 [_0] [Expression]
+     [[exact/1 "exact"]
+      [integer->char/1 "integer->char"]
+      [number->string/1 "number->string"]
+      [string/1 "string"]
+      [length/1 "length"]
+      [values/1 "values"]
+      [null?/1 "null?"]
+      [car/1 "car"]
+      [cdr/1 "cdr"]
+      [raise/1 "raise"]
+      [error-object-message/1 "error-object-message"]
+      [make-vector/1 "make-vector"]
+      [vector-length/1 "vector-length"]
+      [not/1 "not"]
+      [string-length/1 "string-length"]
+      [string-hash/1 "string-hash"]
+      [reverse/1 "reverse"]
+      [display/1 "display"]
+      [exit/1 "exit"]]]
+
+    [apply/2 [_0 _1] [Expression Expression]
+     [[append/2 "append"]
+      [cons/2 "cons"]
+      [make-vector/2 "make-vector"]
+      [vector-ref/2 "vector-ref"]
+      [list-tail/2 "list-tail"]
+      [map/2 "map"]
+      [string-ref/2 "string-ref"]
+      [string-append/2 "string-append"]]]
+
+    [apply/3 [_0 _1 _2] [Expression Expression Expression]
+     [[substring/3 "substring"]
+      [vector-set!/3 "vector-set!"]]]
+
+    [apply/5 [_0 _1 _2 _3 _4] [Expression Expression Expression Expression Expression]
+     [[vector-copy!/5 "vector-copy!"]]]
+    )
+
+  (template [ ]
+    [(def: #export ( param subject)
+       (-> Expression Expression Computation)
+       (..apply/2 (..global ) subject param))]
+
+    [=/2   "="]
+    [eq?/2 "eq?"]
+    [eqv?/2 "eqv?"]
+    [/2   ">"]
+    [>=/2  ">="]
+    [string=?/2 "string=?"]
+    [string ]
+    [(def: #export 
+       (-> (List Expression) Computation)
+       (|>> (list& (..global )) ..form :abstraction))]
+
+    [or "or"]
+    [and "and"]
+    )
+
+  (template [   
]
+    [(def: #export ( bindings body)
+       (-> (List [ Expression]) Expression Computation)
+       (:abstraction
+        (..form (list (..global )
+                      (|> bindings
+                          (list;map (.function (_ [binding/name binding/value])
+                                      (:abstraction
+                                       (..form (list (
 binding/name)
+                                                     binding/value)))))
+                          ..form
+                          :abstraction)
+                      body))))]
+
+    [let           "let"           Var       function.identity]
+    [let*          "let*"          Var       function.identity]
+    [letrec        "letrec"        Var       function.identity]
+    [let-values    "let-values"    Arguments ..arguments]
+    [let*-values   "let*-values"   Arguments ..arguments]
+    [letrec-values "letrec-values" Arguments ..arguments]
+    )
+
+  (def: #export (if test then else)
+    (-> Expression Expression Expression Computation)
+    (:abstraction
+     (..form (list (..global "if") test then else))))
+
+  (def: #export (when test then)
+    (-> Expression Expression Computation)
+    (:abstraction
+     (..form (list (..global "when") test then))))
+
+  (def: #export (cond clauses else)
+    (-> (List [Expression Expression]) Expression Computation)
+    (|> (list;fold (.function (_ [test then] next)
+                     (if test then next))
+                   else
+                   (list.reverse clauses))
+        :representation
+        :abstraction))
+
+  (def: #export (lambda arguments body)
+    (-> Arguments Expression Computation)
+    (:abstraction
+     (..form (list (..global "lambda")
+                   (..arguments arguments)
+                   body))))
+
+  (def: #export (define name arguments body)
+    (-> Var Arguments Expression Computation)
+    (:abstraction
+     (..form (list (..global "define")
+                   (|> arguments
+                       (update@ #mandatory (|>> (#.Cons name)))
+                       ..arguments)
+                   body))))
+
+  (def: #export begin
+    (-> (List Expression) Computation)
+    (|>> (#.Cons (..global "begin")) ..form :abstraction))
+
+  (def: #export (set! name value)
+    (-> Var Expression Computation)
+    (:abstraction
+     (..form (list (..global "set!") name value))))
+
+  (def: #export (with-exception-handler handler body)
+    (-> Expression Expression Computation)
+    (:abstraction
+     (..form (list (..global "with-exception-handler") handler body))))
+  )
diff --git a/stdlib/source/lux/tool/compiler/meta/packager/script.lux b/stdlib/source/lux/tool/compiler/meta/packager/script.lux
index 57e0800b1..2b93fc311 100644
--- a/stdlib/source/lux/tool/compiler/meta/packager/script.lux
+++ b/stdlib/source/lux/tool/compiler/meta/packager/script.lux
@@ -10,7 +10,7 @@
     [collection
      ["." row]
      ["." list ("#@." monad fold)]]]
-   [host
+   [target
     ["_" js]]
    [tool
     [compiler
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/case.lux b/stdlib/source/lux/tool/compiler/phase/generation/js/case.lux
index 74b1128c2..edfa2d038 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/js/case.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/js/case.lux
@@ -9,7 +9,7 @@
      format]
     [collection
      ["." list ("#@." functor fold)]]]
-   [host
+   [target
     ["_" js (#+ Expression Computation Var Statement)]]]
   ["." // #_
    ["#." runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/extension/common.lux b/stdlib/source/lux/tool/compiler/phase/generation/js/extension/common.lux
index 3cc75105f..7a38dc5cd 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/js/extension/common.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/js/extension/common.lux
@@ -1,12 +1,13 @@
 (.module:
   [lux #*
+   [host (#+ import:)]
    [abstract
     ["." monad (#+ do)]]
    [data
     ["." product]
     [collection
      ["." dictionary]]]
-   [host (#+ import:)
+   [target
     ["_" js (#+ Expression)]]]
   ["." /// #_
    ["#." runtime (#+ Operation Phase Handler Bundle)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/function.lux b/stdlib/source/lux/tool/compiler/phase/generation/js/function.lux
index 4839c9978..e43e71fe4 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/js/function.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/js/function.lux
@@ -10,7 +10,7 @@
      format]
     [collection
      ["." list ("#@." functor fold)]]]
-   [host
+   [target
     ["_" js (#+ Expression Computation Var)]]]
   ["." // #_
    [runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/loop.lux b/stdlib/source/lux/tool/compiler/phase/generation/js/loop.lux
index 9ab04cae6..fd2d3de58 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/js/loop.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/js/loop.lux
@@ -8,7 +8,7 @@
      format]
     [collection
      ["." list ("#@." functor)]]]
-   [host
+   [target
     ["_" js (#+ Computation Var)]]]
   ["." // #_
    [runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/primitive.lux b/stdlib/source/lux/tool/compiler/phase/generation/js/primitive.lux
index 1eb6141f9..6b1e32a36 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/js/primitive.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/js/primitive.lux
@@ -5,7 +5,7 @@
    [data
     [number
      ["." frac]]]
-   [host
+   [target
     ["_" js (#+ Computation)]]]
   ["." // #_
    ["#." runtime]])
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/reference.lux b/stdlib/source/lux/tool/compiler/phase/generation/js/reference.lux
index 9f8555788..4ac7483fa 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/js/reference.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/js/reference.lux
@@ -1,6 +1,6 @@
 (.module:
   [lux #*
-   [host
+   [target
     ["_" js (#+ Expression)]]]
   [//
    [//
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/runtime.lux b/stdlib/source/lux/tool/compiler/phase/generation/js/runtime.lux
index 314fe300d..ea42f44e2 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/js/runtime.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/js/runtime.lux
@@ -16,7 +16,7 @@
    ["." macro
     ["." code]
     [syntax (#+ syntax:)]]
-   [host
+   [target
     ["_" js (#+ Expression Var Computation Statement)]]]
   ["." ///
    ["//." //
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/structure.lux b/stdlib/source/lux/tool/compiler/phase/generation/js/structure.lux
index a70376569..5bdbfd1a6 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/js/structure.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/js/structure.lux
@@ -2,7 +2,7 @@
   [lux #*
    [abstract
     ["." monad (#+ do)]]
-   [host
+   [target
     ["_" js (#+ Expression)]]]
   ["." // #_
    ["#." runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/case.lux b/stdlib/source/lux/tool/compiler/phase/generation/lua/case.lux
index 13683f0ca..1e2e7d254 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/lua/case.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/lua/case.lux
@@ -10,7 +10,7 @@
     [collection
      ["." list ("#@." functor fold)]
      ["." set]]]
-   [host
+   [target
     ["_" lua (#+ Expression Var Statement)]]]
   ["." // #_
    ["#." runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/extension/common.lux b/stdlib/source/lux/tool/compiler/phase/generation/lua/extension/common.lux
index 6d060f0bf..e9aafeef6 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/lua/extension/common.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/lua/extension/common.lux
@@ -1,5 +1,6 @@
 (.module:
   [lux #*
+   [host (#+ import:)]
    [abstract
     ["." monad (#+ do)]]
    [control
@@ -8,7 +9,7 @@
     ["." product]
     [collection
      ["." dictionary]]]
-   [host (#+ import:)
+   [target
     ["_" lua (#+ Expression Literal)]]]
   ["." /// #_
    ["#." runtime (#+ Operation Phase Handler Bundle)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/function.lux b/stdlib/source/lux/tool/compiler/phase/generation/lua/function.lux
index 9fa8a3c7d..325ac58a6 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/lua/function.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/lua/function.lux
@@ -10,7 +10,7 @@
      format]
     [collection
      ["." list ("#@." functor fold)]]]
-   [host
+   [target
     ["_" lua (#+ Expression Statement)]]]
   ["." // #_
    ["#." runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/loop.lux b/stdlib/source/lux/tool/compiler/phase/generation/lua/loop.lux
index 39c983dcc..49180db8b 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/lua/loop.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/lua/loop.lux
@@ -8,7 +8,7 @@
      format]
     [collection
      ["." list ("#@." functor)]]]
-   [host
+   [target
     ["_" lua (#+ Expression)]]]
   ["." // #_
    [runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/primitive.lux b/stdlib/source/lux/tool/compiler/phase/generation/lua/primitive.lux
index 47ccf5006..4e326d1a3 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/lua/primitive.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/lua/primitive.lux
@@ -5,7 +5,7 @@
    [data
     [number
      ["." frac]]]
-   [host
+   [target
     ["_" lua (#+ Literal)]]]
   ["." // #_
    ["#." runtime]])
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/reference.lux b/stdlib/source/lux/tool/compiler/phase/generation/lua/reference.lux
index 62c69e8bc..ad8e4c6a0 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/lua/reference.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/lua/reference.lux
@@ -1,10 +1,9 @@
 (.module:
   [lux #*
-   [host
+   [target
     ["_" lua (#+ Expression)]]]
-  [//
-   [//
-    ["." reference]]])
+  [///
+   ["." reference]])
 
 (def: #export system
   (reference.system (: (-> Text (Expression Any)) _.var)
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/runtime.lux b/stdlib/source/lux/tool/compiler/phase/generation/lua/runtime.lux
index 57f8e11df..602897f1b 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/lua/runtime.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/lua/runtime.lux
@@ -16,7 +16,7 @@
    ["." macro
     ["." code]
     [syntax (#+ syntax:)]]
-   [host
+   [target
     ["_" lua (#+ Expression Location Var Computation Literal Statement)]]]
   ["." ///
    ["//." //
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/structure.lux b/stdlib/source/lux/tool/compiler/phase/generation/lua/structure.lux
index 2fab4daf0..d7c26c8a0 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/lua/structure.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/lua/structure.lux
@@ -2,7 +2,7 @@
   [lux #*
    [abstract
     ["." monad (#+ do)]]
-   [host
+   [target
     ["_" lua (#+ Expression)]]]
   ["." // #_
    ["#." runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/php/case.lux b/stdlib/source/lux/tool/compiler/phase/generation/php/case.lux
index 1167ae5a6..4e672e600 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/php/case.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/php/case.lux
@@ -11,7 +11,7 @@
     [collection
      ["." list ("#@." functor fold)]
      ["." set]]]
-   [host
+   [target
     ["_" php (#+ Var Expression Statement)]]]
   ["." // #_
    ["#." runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/php/extension/common.lux b/stdlib/source/lux/tool/compiler/phase/generation/php/extension/common.lux
index 9938bb2c1..bdda1861b 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/php/extension/common.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/php/extension/common.lux
@@ -1,5 +1,6 @@
 (.module:
   [lux #*
+   [host (#+ import:)]
    [abstract
     ["." monad (#+ do)]]
    [control
@@ -9,7 +10,7 @@
     ["." text]
     [collection
      ["." dictionary]]]
-   [host (#+ import:)
+   [target
     ["_" php (#+ Expression)]]]
   ["." /// #_
    ["#." runtime (#+ Operation Phase Handler Bundle)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/php/function.lux b/stdlib/source/lux/tool/compiler/phase/generation/php/function.lux
index b2b446ed0..5cbf855b6 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/php/function.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/php/function.lux
@@ -10,7 +10,7 @@
      format]
     [collection
      ["." list ("#@." functor fold)]]]
-   [host
+   [target
     ["_" php (#+ Argument Expression Statement)]]]
   ["." // #_
    [runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/php/loop.lux b/stdlib/source/lux/tool/compiler/phase/generation/php/loop.lux
index 3404953fe..94857fe4f 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/php/loop.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/php/loop.lux
@@ -8,7 +8,7 @@
      format]
     [collection
      ["." list ("#@." functor)]]]
-   [host
+   [target
     ["_" php (#+ Expression)]]]
   ["." // #_
    [runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/php/primitive.lux b/stdlib/source/lux/tool/compiler/phase/generation/php/primitive.lux
index 48a32389b..b5b953ba7 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/php/primitive.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/php/primitive.lux
@@ -5,7 +5,7 @@
    [data
     [number
      ["." frac]]]
-   [host
+   [target
     ["_" php (#+ Literal)]]]
   ["." // #_
    ["#." runtime]])
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/php/reference.lux b/stdlib/source/lux/tool/compiler/phase/generation/php/reference.lux
index 8f5313421..77b9bec74 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/php/reference.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/php/reference.lux
@@ -1,6 +1,6 @@
 (.module:
   [lux #*
-   [host
+   [target
     ["_" php (#+ Expression)]]]
   [//
    [//
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/php/runtime.lux b/stdlib/source/lux/tool/compiler/phase/generation/php/runtime.lux
index 8d3a2138a..7281a0c0e 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/php/runtime.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/php/runtime.lux
@@ -16,7 +16,7 @@
    ["." macro
     ["." code]
     [syntax (#+ syntax:)]]
-   [host
+   [target
     ["_" php (#+ Expression Var Global Computation Literal Statement)]]]
   ["." ///
    ["//." //
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/php/structure.lux b/stdlib/source/lux/tool/compiler/phase/generation/php/structure.lux
index 7bc675d7e..8ea387fa2 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/php/structure.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/php/structure.lux
@@ -2,7 +2,7 @@
   [lux #*
    [abstract
     ["." monad (#+ do)]]
-   [host
+   [target
     ["_" php (#+ Expression)]]]
   ["." // #_
    ["#." runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/case.lux b/stdlib/source/lux/tool/compiler/phase/generation/python/case.lux
index dc908eae7..3e07a6730 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/python/case.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/python/case.lux
@@ -10,7 +10,7 @@
     [collection
      ["." list ("#@." functor fold)]
      ["." set]]]
-   [host
+   [target
     ["_" python (#+ Expression SVar Statement)]]]
   ["." // #_
    ["#." runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/extension/common.lux b/stdlib/source/lux/tool/compiler/phase/generation/python/extension/common.lux
index 1113ec3b6..7e1b4d2c1 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/python/extension/common.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/python/extension/common.lux
@@ -1,5 +1,6 @@
 (.module:
   [lux #*
+   [host (#+ import:)]
    [abstract
     ["." monad (#+ do)]]
    [control
@@ -8,7 +9,7 @@
     ["." product]
     [collection
      ["." dictionary]]]
-   [host (#+ import:)
+   [target
     ["_" python (#+ Expression)]]]
   ["." /// #_
    ["#." runtime (#+ Operation Phase Handler Bundle)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/function.lux b/stdlib/source/lux/tool/compiler/phase/generation/python/function.lux
index 2631f629c..0cbcdde37 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/python/function.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/python/function.lux
@@ -10,7 +10,7 @@
      format]
     [collection
      ["." list ("#@." functor fold)]]]
-   [host
+   [target
     ["_" python (#+ Expression Statement)]]]
   ["." // #_
    [runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/loop.lux b/stdlib/source/lux/tool/compiler/phase/generation/python/loop.lux
index 9dae1b6dc..a58f02141 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/python/loop.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/python/loop.lux
@@ -8,7 +8,7 @@
      format]
     [collection
      ["." list ("#@." functor)]]]
-   [host
+   [target
     ["_" python (#+ Expression)]]]
   ["." // #_
    [runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/primitive.lux b/stdlib/source/lux/tool/compiler/phase/generation/python/primitive.lux
index 33b9b7781..da651ad8b 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/python/primitive.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/python/primitive.lux
@@ -5,7 +5,7 @@
    [data
     [number
      ["." frac]]]
-   [host
+   [target
     ["_" python (#+ Expression)]]]
   ["." // #_
    ["#." runtime]])
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/reference.lux b/stdlib/source/lux/tool/compiler/phase/generation/python/reference.lux
index acc09c784..c3daa9d37 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/python/reference.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/python/reference.lux
@@ -1,10 +1,9 @@
 (.module:
   [lux #*
-   [host
+   [target
     ["_" python (#+ Expression)]]]
-  [//
-   [//
-    ["." reference]]])
+  [///
+   ["." reference]])
 
 (def: #export system
   (reference.system (: (-> Text (Expression Any)) _.var)
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/runtime.lux b/stdlib/source/lux/tool/compiler/phase/generation/python/runtime.lux
index b2135a625..e325b1fca 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/python/runtime.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/python/runtime.lux
@@ -16,7 +16,7 @@
    ["." macro
     ["." code]
     [syntax (#+ syntax:)]]
-   [host
+   [target
     ["_" python (#+ Expression SVar Computation Literal Statement)]]]
   ["." ///
    ["//." //
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/structure.lux b/stdlib/source/lux/tool/compiler/phase/generation/python/structure.lux
index bcae96966..954efde26 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/python/structure.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/python/structure.lux
@@ -2,13 +2,13 @@
   [lux #*
    [abstract
     ["." monad (#+ do)]]
-   [host
+   [target
     ["_" python (#+ Expression)]]]
   ["." // #_
    ["#." runtime (#+ Operation Phase)]
    ["#." primitive]
-   ["#//" ///
-    ["#/" // #_
+   ["//#" ///
+    ["/#" // #_
      [analysis (#+ Variant Tuple)]
      ["#." synthesis (#+ Synthesis)]]]])
 
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/case.lux b/stdlib/source/lux/tool/compiler/phase/generation/ruby/case.lux
index 18979b0fa..614925cd6 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/case.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/ruby/case.lux
@@ -10,7 +10,7 @@
     [collection
      ["." list ("#@." functor fold)]
      ["." set]]]
-   [host
+   [target
     ["_" ruby (#+ Expression Statement)]]]
   ["." // #_
    ["#." runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/extension/common.lux b/stdlib/source/lux/tool/compiler/phase/generation/ruby/extension/common.lux
index eda6782b3..cb72ecca0 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/extension/common.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/ruby/extension/common.lux
@@ -1,5 +1,6 @@
 (.module:
   [lux #*
+   [host (#+ import:)]
    [abstract
     ["." monad (#+ do)]]
    [control
@@ -9,7 +10,7 @@
     ["." text]
     [collection
      ["." dictionary]]]
-   [host (#+ import:)
+   [target
     ["_" ruby (#+ Expression)]]]
   ["." /// #_
    ["#." runtime (#+ Operation Phase Handler Bundle)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/function.lux b/stdlib/source/lux/tool/compiler/phase/generation/ruby/function.lux
index be12aa2e2..52ef8fd1a 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/function.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/ruby/function.lux
@@ -10,7 +10,7 @@
      format]
     [collection
      ["." list ("#@." functor fold)]]]
-   [host
+   [target
     ["_" ruby (#+ Expression Statement)]]]
   ["." // #_
    [runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/loop.lux b/stdlib/source/lux/tool/compiler/phase/generation/ruby/loop.lux
index 91eb3eeb2..b7774d396 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/loop.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/ruby/loop.lux
@@ -8,7 +8,7 @@
      format]
     [collection
      ["." list ("#@." functor)]]]
-   [host
+   [target
     ["_" ruby (#+ Expression)]]]
   ["." // #_
    [runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/primitive.lux b/stdlib/source/lux/tool/compiler/phase/generation/ruby/primitive.lux
index 3fa59aaf4..b437230ee 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/primitive.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/ruby/primitive.lux
@@ -5,7 +5,7 @@
    [data
     [number
      ["." frac]]]
-   [host
+   [target
     ["_" ruby (#+ Literal)]]]
   ["." // #_
    ["#." runtime]])
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/reference.lux b/stdlib/source/lux/tool/compiler/phase/generation/ruby/reference.lux
index a5dcc1302..3a8e7e635 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/reference.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/ruby/reference.lux
@@ -1,10 +1,9 @@
 (.module:
   [lux #*
-   [host
+   [target
     ["_" ruby (#+ Expression)]]]
-  [//
-   [//
-    ["." reference]]])
+  [///
+   ["." reference]])
 
 (def: #export system
   (reference.system (: (-> Text (Expression Any)) _.global)
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/runtime.lux b/stdlib/source/lux/tool/compiler/phase/generation/ruby/runtime.lux
index b63571ddc..99c6ef38a 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/runtime.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/ruby/runtime.lux
@@ -16,7 +16,7 @@
    ["." macro
     ["." code]
     [syntax (#+ syntax:)]]
-   [host
+   [target
     ["_" ruby (#+ Expression LVar Computation Literal Statement)]]]
   ["." ///
    ["//." //
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/structure.lux b/stdlib/source/lux/tool/compiler/phase/generation/ruby/structure.lux
index b3d3046c8..a929f736c 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/structure.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/ruby/structure.lux
@@ -2,7 +2,7 @@
   [lux #*
    [abstract
     ["." monad (#+ do)]]
-   [host
+   [target
     ["_" ruby (#+ Expression)]]]
   ["." // #_
    ["#." runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/case.lux b/stdlib/source/lux/tool/compiler/phase/generation/scheme/case.lux
index d68abbdd7..d4cd440fb 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/case.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/scheme/case.lux
@@ -10,7 +10,7 @@
      format]
     [collection
      ["." list ("#;." functor fold)]]]
-   [host
+   [target
     ["_" scheme (#+ Expression Computation Var)]]]
   ["." // #_
    ["#." runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/extension/common.lux b/stdlib/source/lux/tool/compiler/phase/generation/scheme/extension/common.lux
index 31c101fdf..f33cb9599 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/extension/common.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/scheme/extension/common.lux
@@ -1,5 +1,6 @@
 (.module:
   [lux #*
+   [host (#+ import:)]
    [abstract
     ["." monad (#+ do)]]
    [control
@@ -18,7 +19,7 @@
    ["." macro (#+ with-gensyms)
     ["." code]
     [syntax (#+ syntax:)]]
-   [host (#+ import:)
+   [target
     ["_" scheme (#+ Expression Computation)]]]
   ["." /// #_
    ["#." runtime (#+ Operation Phase Handler Bundle)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/function.lux b/stdlib/source/lux/tool/compiler/phase/generation/scheme/function.lux
index 28bfd36ba..36de9712e 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/function.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/scheme/function.lux
@@ -10,7 +10,7 @@
      format]
     [collection
      ["." list ("#;." functor)]]]
-   [host
+   [target
     ["_" scheme (#+ Expression Computation Var)]]]
   ["." // #_
    ["#." runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/loop.lux b/stdlib/source/lux/tool/compiler/phase/generation/scheme/loop.lux
index 6922806e2..086d53fe3 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/loop.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/scheme/loop.lux
@@ -8,7 +8,7 @@
      format]
     [collection
      ["." list ("#;." functor)]]]
-   [host
+   [target
     ["_" scheme (#+ Computation Var)]]]
   ["." // #_
    [runtime (#+ Operation Phase)]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/primitive.lux b/stdlib/source/lux/tool/compiler/phase/generation/scheme/primitive.lux
index 5405e4c55..4bfa67161 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/primitive.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/scheme/primitive.lux
@@ -1,6 +1,6 @@
 (.module:
   [lux (#- i64)
-   [host
+   [target
     ["_" scheme (#+ Expression)]]])
 
 (template [  ]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/reference.lux b/stdlib/source/lux/tool/compiler/phase/generation/scheme/reference.lux
index b531c38f7..b9add2e48 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/reference.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/scheme/reference.lux
@@ -1,6 +1,6 @@
 (.module:
   [lux #*
-   [host
+   [target
     ["_" scheme (#+ Expression)]]]
   [///
    ["." reference]])
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/runtime.lux b/stdlib/source/lux/tool/compiler/phase/generation/scheme/runtime.lux
index c22906d2d..3fe02a55d 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/runtime.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/scheme/runtime.lux
@@ -15,7 +15,7 @@
    [macro
     ["." code]
     [syntax (#+ syntax:)]]
-   [host
+   [target
     ["_" scheme (#+ Expression Computation Var)]]]
   ["." ///
    ["#/" //
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/structure.lux b/stdlib/source/lux/tool/compiler/phase/generation/scheme/structure.lux
index e44ab508b..e101effeb 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/structure.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/scheme/structure.lux
@@ -2,7 +2,7 @@
   [lux #*
    [abstract
     ["." monad (#+ do)]]
-   [host
+   [target
     ["_" scheme (#+ Expression)]]]
   [//
    ["." runtime (#+ Operation Phase)]
diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux
index 5c5051a2c..a881dae3f 100644
--- a/stdlib/source/test/lux.lux
+++ b/stdlib/source/test/lux.lux
@@ -35,7 +35,7 @@
       [format
        [css (#+)]
        [markdown (#+)]]]
-     [host
+     [target
       [js (#+)]
       [python (#+)]
       [lua (#+)]
@@ -122,7 +122,8 @@
      ["#." tool]
      ["#." type]
      ["#." world]
-     ["#." host
+     ["#." host]
+     ["#." target #_
       ["#/." jvm]]]
     ))
 
@@ -343,9 +344,9 @@
           /tool.test
           /type.test
           /world.test
+          /host.test
           ($_ _.and
-              /host.test
-              /host/jvm.test)
+              /target/jvm.test)
           )))
 
 (program: args
diff --git a/stdlib/source/test/lux/host/jvm.old.lux b/stdlib/source/test/lux/host/jvm.old.lux
deleted file mode 100644
index 47c6f35d9..000000000
--- a/stdlib/source/test/lux/host/jvm.old.lux
+++ /dev/null
@@ -1,89 +0,0 @@
-(.module:
-  [lux #*
-   [abstract/monad (#+ do)]
-   [control
-    ["." io (#+ IO)]
-    [concurrency
-     ["." atom]]
-    [security
-     ["!" capability]]]
-   [data
-    ["." error (#+ Error)]
-    ["." text
-     format]
-    [format
-     ["." binary]]
-    [collection
-     ["." dictionary]
-     ["." row]]]
-   [world
-    ["." file (#+ File)]
-    [binary (#+ Binary)]]
-   [math
-    ["r" random]]
-   ["_" test (#+ Test)]]
-  {1
-   ["." / #_
-    ["#." loader (#+ Library)]
-    ["#." version]
-    ["#." name]
-    ["#." descriptor]
-    ["#." field]
-    ["#." class]
-    [modifier
-     ["#.M" inner]]]})
-
-(def: (write-class! name bytecode)
-  (-> Text Binary (IO Text))
-  (let [file-path (format name ".class")]
-    (do io.monad
-      [outcome (do (error.with @)
-                 [file (: (IO (Error (File IO)))
-                          (file.get-file io.monad file.system file-path))]
-                 (!.use (:: file over-write) bytecode))]
-      (wrap (case outcome
-              (#error.Success definition)
-              (format "Wrote: " (%t file-path))
-              
-              (#error.Failure error)
-              error)))))
-
-(def: class
-  Test
-  (do r.monad
-    [_ (wrap [])
-     #let [package "my.package"
-           name "MyClass"
-           full-name (format package "." name)
-           input (/class.class /version.v6_0 /class.public
-                               (/name.internal "java.lang.Object")
-                               (/name.internal full-name)
-                               (list (/name.internal "java.io.Serializable")
-                                     (/name.internal "java.lang.Runnable"))
-                               (list (/field.field /field.public "foo" /descriptor.long (row.row))
-                                     (/field.field /field.public "bar" /descriptor.double (row.row)))
-                               (row.row)
-                               (row.row))
-           bytecode (binary.write /class.format input)
-           loader (/loader.memory (/loader.new-library []))]]
-    ($_ _.and
-        (_.test "Can read a generated class."
-                (case (binary.read /class.format bytecode)
-                  (#error.Success output)
-                  (:: /class.equivalence = input output)
-                  
-                  (#error.Failure error)
-                  false))
-        (_.test "Can generate a class."
-                (case (/loader.define full-name bytecode loader)
-                  (#error.Success definition)
-                  true
-                  
-                  (#error.Failure error)
-                  false))
-        )))
-
-(def: #export test
-  Test
-  (<| (_.context "Class")
-      ..class))
diff --git a/stdlib/source/test/lux/target/jvm.old.lux b/stdlib/source/test/lux/target/jvm.old.lux
new file mode 100644
index 000000000..47c6f35d9
--- /dev/null
+++ b/stdlib/source/test/lux/target/jvm.old.lux
@@ -0,0 +1,89 @@
+(.module:
+  [lux #*
+   [abstract/monad (#+ do)]
+   [control
+    ["." io (#+ IO)]
+    [concurrency
+     ["." atom]]
+    [security
+     ["!" capability]]]
+   [data
+    ["." error (#+ Error)]
+    ["." text
+     format]
+    [format
+     ["." binary]]
+    [collection
+     ["." dictionary]
+     ["." row]]]
+   [world
+    ["." file (#+ File)]
+    [binary (#+ Binary)]]
+   [math
+    ["r" random]]
+   ["_" test (#+ Test)]]
+  {1
+   ["." / #_
+    ["#." loader (#+ Library)]
+    ["#." version]
+    ["#." name]
+    ["#." descriptor]
+    ["#." field]
+    ["#." class]
+    [modifier
+     ["#.M" inner]]]})
+
+(def: (write-class! name bytecode)
+  (-> Text Binary (IO Text))
+  (let [file-path (format name ".class")]
+    (do io.monad
+      [outcome (do (error.with @)
+                 [file (: (IO (Error (File IO)))
+                          (file.get-file io.monad file.system file-path))]
+                 (!.use (:: file over-write) bytecode))]
+      (wrap (case outcome
+              (#error.Success definition)
+              (format "Wrote: " (%t file-path))
+              
+              (#error.Failure error)
+              error)))))
+
+(def: class
+  Test
+  (do r.monad
+    [_ (wrap [])
+     #let [package "my.package"
+           name "MyClass"
+           full-name (format package "." name)
+           input (/class.class /version.v6_0 /class.public
+                               (/name.internal "java.lang.Object")
+                               (/name.internal full-name)
+                               (list (/name.internal "java.io.Serializable")
+                                     (/name.internal "java.lang.Runnable"))
+                               (list (/field.field /field.public "foo" /descriptor.long (row.row))
+                                     (/field.field /field.public "bar" /descriptor.double (row.row)))
+                               (row.row)
+                               (row.row))
+           bytecode (binary.write /class.format input)
+           loader (/loader.memory (/loader.new-library []))]]
+    ($_ _.and
+        (_.test "Can read a generated class."
+                (case (binary.read /class.format bytecode)
+                  (#error.Success output)
+                  (:: /class.equivalence = input output)
+                  
+                  (#error.Failure error)
+                  false))
+        (_.test "Can generate a class."
+                (case (/loader.define full-name bytecode loader)
+                  (#error.Success definition)
+                  true
+                  
+                  (#error.Failure error)
+                  false))
+        )))
+
+(def: #export test
+  Test
+  (<| (_.context "Class")
+      ..class))
-- 
cgit v1.2.3