diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/documentation/lux/meta.lux | 4 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/meta/compiler/language/lux/declaration.lux | 4 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/meta/compiler/language/lux/translation.lux (renamed from stdlib/source/documentation/lux/meta/compiler/language/lux/generation.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/meta/extension.lux | 6 | ||||
-rw-r--r-- | stdlib/source/experiment/tool/interpreter.lux | 24 | ||||
-rw-r--r-- | stdlib/source/library/lux.lux | 2 | ||||
-rw-r--r-- | stdlib/source/library/lux/abstract/monoid.lux | 4 | ||||
-rw-r--r-- | stdlib/source/library/lux/data/color.lux | 197 | ||||
-rw-r--r-- | stdlib/source/library/lux/data/color/named.lux | 13 | ||||
-rw-r--r-- | stdlib/source/library/lux/data/color/rgb.lux | 146 | ||||
-rw-r--r-- | stdlib/source/library/lux/data/format/css/value.lux | 198 | ||||
-rw-r--r-- | stdlib/source/library/lux/documentation.lux | 125 | ||||
-rw-r--r-- | stdlib/source/library/lux/ffi.lux | 72 | ||||
-rw-r--r-- | stdlib/source/library/lux/ffi/export.js.lux | 20 | ||||
-rw-r--r-- | stdlib/source/library/lux/ffi/export.lua.lux | 38 | ||||
-rw-r--r-- | stdlib/source/library/lux/ffi/export.py.lux | 20 | ||||
-rw-r--r-- | stdlib/source/library/lux/ffi/export.rb.lux | 20 | ||||
-rw-r--r-- | stdlib/source/library/lux/math.lux | 40 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/default/init.lux | 74 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/default/platform.lux | 28 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/analysis/evaluation.lux | 30 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/declaration.lux | 12 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/declaration.lux | 4 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux | 54 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux | 6 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/jvm.lux | 90 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/lux.lux | 76 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/synthesis/lux.lux | 8 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/common_lisp.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/common_lisp.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/common_lisp/common.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/common_lisp/common.lux) | 8 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/common_lisp/host.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/common_lisp/host.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/js.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/js.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/js/common.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/js/common.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/js/host.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/js/host.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/jvm.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/jvm.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/jvm/common.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/jvm/common.lux) | 74 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/jvm/host.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/jvm/host.lux) | 362 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/lua.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/lua.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/lua/common.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/lua/common.lux) | 8 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/lua/host.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/lua/host.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/php.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/php.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/php/common.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/php/common.lux) | 14 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/php/host.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/php/host.lux) | 4 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/python.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/python.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/python/common.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/python/common.lux) | 18 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/python/host.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/python/host.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/r.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/r.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/r/common.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/r/common.lux) | 8 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/r/host.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/r/host.lux) | 4 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/ruby.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/ruby.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/ruby/common.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/ruby/common.lux) | 14 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/ruby/host.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/ruby/host.lux) | 3 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/scheme.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/scheme.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/scheme/common.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/scheme/common.lux) | 8 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/scheme/host.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/scheme/host.lux) | 3 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/loop.lux | 4 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp.lux) | 12 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/extension.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/extension.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/extension/common.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/extension/common.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/function.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/function.lux) | 18 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/loop.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/loop.lux) | 16 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/primitive.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/primitive.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/reference.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/reference.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/runtime.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/runtime.lux) | 18 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/structure.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/structure.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/when.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/when.lux) | 24 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/extension.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/extension.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js.lux) | 8 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/function.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/function.lux) | 18 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/loop.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/loop.lux) | 20 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/primitive.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/primitive.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/reference.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/reference.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/runtime.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/runtime.lux) | 20 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/structure.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/structure.lux) | 16 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/when.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/when.lux) | 20 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm.lux) | 12 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/debug.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/debug.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function.lux) | 70 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/abstract.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/abstract.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/constant.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/constant.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/constant/arity.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/constant/arity.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/variable.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/variable.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/variable/count.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/variable/count.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/variable/foreign.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/variable/foreign.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/variable/partial.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/variable/partial.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/method.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/method/apply.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/apply.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/method/implementation.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/implementation.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/method/init.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/init.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/method/new.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/new.lux) | 28 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/method/reset.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/reset.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/host.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/host.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/loop.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/loop.lux) | 12 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/primitive.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/primitive.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/program.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/program.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/reference.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/reference.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/runtime.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/runtime.lux) | 36 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/structure.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/structure.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/type.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/type.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/value.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/value.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/when.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/when.lux) | 18 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua.lux) | 8 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/function.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/function.lux) | 18 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/loop.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/loop.lux) | 22 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/primitive.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/primitive.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/reference.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/reference.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/runtime.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/runtime.lux) | 20 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/structure.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/structure.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/when.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/when.lux) | 24 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php.lux) | 18 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/extension.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/extension.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/extension/common.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/extension/common.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/function.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/function.lux) | 18 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/loop.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/loop.lux) | 24 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/primitive.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/primitive.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/reference.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/reference.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/runtime.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/runtime.lux) | 20 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/structure.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/structure.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/when.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/when.lux) | 28 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python.lux) | 16 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/function.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/function.lux) | 20 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/loop.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/loop.lux) | 22 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/primitive.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/primitive.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/reference.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/reference.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/runtime.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/runtime.lux) | 20 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/structure.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/structure.lux) | 16 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/when.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/when.lux) | 32 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r.lux) | 12 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/function.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/function.lux) | 24 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/loop.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/loop.lux) | 14 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/primitive.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/primitive.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/procedure/common.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/procedure/common.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/procedure/host.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/procedure/host.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/reference.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/reference.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/runtime.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/runtime.lux) | 18 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/structure.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/structure.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/when.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/when.lux) | 16 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/reference.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/reference.lux) | 8 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby.lux) | 16 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/function.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/function.lux) | 16 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/loop.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/loop.lux) | 14 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/primitive.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/primitive.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/reference.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/reference.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/runtime.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/runtime.lux) | 20 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/structure.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/structure.lux) | 16 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/when.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/when.lux) | 28 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme.lux) | 12 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/extension.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/extension.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/extension/common.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/extension/common.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/function.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/function.lux) | 14 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/loop.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/loop.lux) | 12 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/primitive.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/primitive.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/reference.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/reference.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/runtime.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/runtime.lux) | 18 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/structure.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/structure.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/when.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/when.lux) | 16 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/synthesis.lux | 2 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/language/lux/translation.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/generation.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/meta/archive/artifact/category.lux | 4 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/meta/archive/registry.lux | 8 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/meta/cache/dependency/artifact.lux | 6 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/meta/io/archive.lux | 42 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/meta/packager/jvm.lux | 2 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/meta/packager/scheme.lux | 2 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/extension.lux | 16 | ||||
-rw-r--r-- | stdlib/source/library/lux/meta/type/linear.lux (renamed from stdlib/source/library/lux/meta/type/resource.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/program/compositor.lux | 12 | ||||
-rw-r--r-- | stdlib/source/specification/compositor.lux | 16 | ||||
-rw-r--r-- | stdlib/source/specification/compositor/common.lux | 28 | ||||
-rw-r--r-- | stdlib/source/test/lux.lux | 3 | ||||
-rw-r--r-- | stdlib/source/test/lux/control/maybe.lux | 3 | ||||
-rw-r--r-- | stdlib/source/test/lux/data.lux | 5 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/list.lux | 3 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/color.lux | 25 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/color/rgb.lux | 128 | ||||
-rw-r--r-- | stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/primitive.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/lux/meta/compiler/meta/archive/registry.lux | 10 | ||||
-rw-r--r-- | stdlib/source/test/lux/meta/extension.lux | 124 | ||||
-rw-r--r-- | stdlib/source/test/lux/meta/type.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/lux/meta/type/linear.lux (renamed from stdlib/source/test/lux/meta/type/resource.lux) | 0 |
180 files changed, 1873 insertions, 1483 deletions
diff --git a/stdlib/source/documentation/lux/meta.lux b/stdlib/source/documentation/lux/meta.lux index 329a5703d..a14f67132 100644 --- a/stdlib/source/documentation/lux/meta.lux +++ b/stdlib/source/documentation/lux/meta.lux @@ -24,7 +24,7 @@ [lux ["[1][0]" analysis] ["[1][0]" declaration] - ["[1][0]" generation] + ["[1][0]" translation] ["[1][0]" synthesis]]]]]) (def /compiler @@ -33,7 +33,7 @@ (list /compiler/phase.documentation /compiler/analysis.documentation /compiler/declaration.documentation - /compiler/generation.documentation + /compiler/translation.documentation /compiler/synthesis.documentation ))) diff --git a/stdlib/source/documentation/lux/meta/compiler/language/lux/declaration.lux b/stdlib/source/documentation/lux/meta/compiler/language/lux/declaration.lux index 2b906d759..8a073556e 100644 --- a/stdlib/source/documentation/lux/meta/compiler/language/lux/declaration.lux +++ b/stdlib/source/documentation/lux/meta/compiler/language/lux/declaration.lux @@ -28,9 +28,9 @@ ($.definition /.Bundle) ($.definition /.analysis) ($.definition /.synthesis) - ($.definition /.generation) + ($.definition /.translation) ($.definition /.lifted_analysis) ($.definition /.lifted_synthesis) - ($.definition /.lifted_generation) + ($.definition /.lifted_translation) ($.definition /.set_current_module) )) diff --git a/stdlib/source/documentation/lux/meta/compiler/language/lux/generation.lux b/stdlib/source/documentation/lux/meta/compiler/language/lux/translation.lux index 990029dd0..f37babfcd 100644 --- a/stdlib/source/documentation/lux/meta/compiler/language/lux/generation.lux +++ b/stdlib/source/documentation/lux/meta/compiler/language/lux/translation.lux @@ -51,7 +51,7 @@ ($.definition /.learn_custom) ($.definition /.learn_analyser) ($.definition /.learn_synthesizer) - ($.definition /.learn_generator) + ($.definition /.learn_translator) ($.definition /.learn_declaration) ($.definition /.unknown_definition) ($.definition /.remember) diff --git a/stdlib/source/documentation/lux/meta/extension.lux b/stdlib/source/documentation/lux/meta/extension.lux index f27a7c7a0..3c81d0205 100644 --- a/stdlib/source/documentation/lux/meta/extension.lux +++ b/stdlib/source/documentation/lux/meta/extension.lux @@ -37,10 +37,10 @@ ($.example (synthesis ("my synthesis" self phase archive [pass_through <analysis>.any]) (phase archive pass_through)))) - ($.definition /.generation + ($.definition /.translation "" - ($.example (generation ("my generation" self phase archive [pass_through <synthesis>.any]) - (phase archive pass_through)))) + ($.example (translation ("my translation" self phase archive [pass_through <synthesis>.any]) + (phase archive pass_through)))) ($.definition /.declaration "" diff --git a/stdlib/source/experiment/tool/interpreter.lux b/stdlib/source/experiment/tool/interpreter.lux index 53fe60a88..a52ae4129 100644 --- a/stdlib/source/experiment/tool/interpreter.lux +++ b/stdlib/source/experiment/tool/interpreter.lux @@ -15,7 +15,7 @@ ["[0]" analysis ["[0]" module] ["[0]" type]] - ["[0]" generation] + ["[0]" translation] ["[0]" declaration (.only State Operation) ["[0]" total]]] ["[0]" default @@ -65,15 +65,15 @@ [_ (module.create 0 ..module)] (analysis.set_current_module ..module)))) -(def (initialize Monad<!> Console<!> platform configuration generation_bundle) +(def (initialize Monad<!> Console<!> platform configuration translation_bundle) (All (_ ! anchor expression declaration) (-> (Monad !) (Console !) (Platform ! anchor expression declaration) Configuration - (generation.Bundle anchor expression declaration) + (translation.Bundle anchor expression declaration) (! (State anchor expression declaration)))) (do Monad<!> - [state (platform.initialize platform generation_bundle) + [state (platform.initialize platform translation_bundle) state (platform.compile platform (has cli.#module syntax.prelude configuration) (has [declaration.#analysis declaration.#state @@ -102,7 +102,7 @@ [state phase.state .let [analyse (the [declaration.#analysis declaration.#phase] state) synthesize (the [declaration.#synthesis declaration.#phase] state) - generate (the [declaration.#generation declaration.#phase] state)] + translate (the [declaration.#translation declaration.#phase] state)] [_ codeT codeA] (declaration.lifted_analysis (analysis.with_scope (type.with_fresh_env @@ -114,12 +114,12 @@ (in [codeT codeA]))))) codeS (declaration.lifted_synthesis (synthesize codeA))] - (declaration.lifted_generation - (generation.with_buffer + (declaration.lifted_translation + (translation.with_buffer (do ! - [codeH (generate codeS) - count generation.next - codeV (generation.evaluate! (format "interpretation_" (%.nat count)) codeH)] + [codeH (translate codeS) + count translation.next + codeV (translation.evaluate! (format "interpretation_" (%.nat count)) codeH)] (in [codeT codeV])))))) (def (interpret configuration code) @@ -187,12 +187,12 @@ (has #source source')) representation])))) -(def .public (run! Monad<!> Console<!> platform configuration generation_bundle) +(def .public (run! Monad<!> Console<!> platform configuration translation_bundle) (All (_ ! anchor expression declaration) (-> (Monad !) (Console !) (Platform ! anchor expression declaration) Configuration - (generation.Bundle anchor expression declaration) + (translation.Bundle anchor expression declaration) (! Any))) (do [! Monad<!>] [state (initialize Monad<!> Console<!> platform configuration)] diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index 9250c2cc6..710521e74 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -5834,7 +5834,7 @@ [Analysis] [Synthesis] - [Generation] + [Translation] [Declaration] ) diff --git a/stdlib/source/library/lux/abstract/monoid.lux b/stdlib/source/library/lux/abstract/monoid.lux index 6190cfe7e..bef824ab0 100644 --- a/stdlib/source/library/lux/abstract/monoid.lux +++ b/stdlib/source/library/lux/abstract/monoid.lux @@ -10,7 +10,9 @@ composite))) (def .public (and left right) - (All (_ l r) (-> (Monoid l) (Monoid r) (Monoid [l r]))) + (All (_ left right) + (-> (Monoid left) (Monoid right) + (Monoid [left right]))) (implementation (def identity [(at left identity) diff --git a/stdlib/source/library/lux/data/color.lux b/stdlib/source/library/lux/data/color.lux index 0f6b443be..a0971891a 100644 --- a/stdlib/source/library/lux/data/color.lux +++ b/stdlib/source/library/lux/data/color.lux @@ -2,9 +2,11 @@ [library [lux (.except) [abstract - [equivalence (.only Equivalence)] [monoid (.only Monoid)] + ["[0]" equivalence (.only Equivalence)] ["[0]" hash (.only Hash)]] + [control + ["[0]" try]] [data [collection ["[0]" list (.use "[1]#[0]" functor)]]] @@ -17,10 +19,11 @@ ["[0]" i64]]] [meta [type - ["[0]" primitive (.except def)]]]]]) + ["[0]" primitive]]]]] + [/ + ["[0]" rgb (.only RGB)]]) -(def rgb_limit 256) -(def top (-- rgb_limit)) +(def top (-- rgb.limit)) (def rgb_factor (|> top .int int.frac)) @@ -33,12 +36,6 @@ (-> Frac Nat) (|>> (f.* rgb_factor) f.int .nat)) -(type .public RGB - (Record - [#red Nat - #green Nat - #blue Nat])) - (type .public HSL [Frac Frac Frac]) @@ -55,92 +52,62 @@ (primitive.def .public Color RGB - (def .public (of_rgb [red green blue]) + (def .public of_rgb (-> RGB Color) - (abstraction [#red (n.% ..rgb_limit red) - #green (n.% ..rgb_limit green) - #blue (n.% ..rgb_limit blue)])) + (|>> primitive.abstraction)) (def .public rgb (-> Color RGB) - (|>> representation)) + (|>> primitive.representation)) (def .public equivalence (Equivalence Color) - (implementation - (def (= reference sample) - (let [[rR gR bR] (representation reference) - [rS gS bS] (representation sample)] - (and (n.= rR rS) - (n.= gR gS) - (n.= bR bS)))))) + (at equivalence.functor each ..rgb rgb.equivalence)) (def .public hash (Hash Color) - (implementation - (def equivalence ..equivalence) - - (def (hash value) - (let [[r g b] (representation value)] - (all i64.or - (i64.left_shifted 16 r) - (i64.left_shifted 8 g) - b))))) - - (def .public black - Color - (..of_rgb [#red 0 - #green 0 - #blue 0])) - - (def .public white - Color - (..of_rgb [#red ..top - #green ..top - #blue ..top])) - - (def .public addition - (Monoid Color) - (implementation - (def identity ..black) - - (def (composite left right) - (let [[lR lG lB] (representation left) - [rR rG rB] (representation right)] - (abstraction [#red (n.max lR rR) - #green (n.max lG rG) - #blue (n.max lB rB)]))))) - - (def (opposite_intensity value) - (-> Nat Nat) - (|> ..top (n.- value))) - - (def .public (complement color) + (at hash.functor each ..rgb rgb.hash)) + + (with_template [<color> <rgb>] + [(def .public <color> + Color + (primitive.abstraction <rgb>))] + + [black rgb.black] + [white rgb.white] + ) + + (with_template [<color> <rgb>] + [(def .public <color> + (Monoid Color) + (implementation + (def identity + (primitive.abstraction + (at <rgb> identity))) + + (def (composite left right) + (primitive.abstraction + (at <rgb> composite + (primitive.representation left) + (primitive.representation right))))))] + + [addition rgb.addition] + [subtraction rgb.subtraction] + ) + + (def .public complement (-> Color Color) - (let [[red green blue] (representation color)] - (abstraction [#red (opposite_intensity red) - #green (opposite_intensity green) - #blue (opposite_intensity blue)]))) - - (def .public subtraction - (Monoid Color) - (implementation - (def identity ..white) - - (def (composite left right) - (let [[lR lG lB] (representation (..complement left)) - [rR rG rB] (representation right)] - (abstraction [#red (n.min lR rR) - #green (n.min lG rG) - #blue (n.min lB rB)]))))) + (|>> primitive.representation + rgb.complement + primitive.abstraction)) ) (def .public (hsl color) (-> Color HSL) (let [[red green blue] (rgb color) - red (..down red) - green (..down green) - blue (..down blue) + red (..down (rgb.number red)) + green (..down (rgb.number green)) + blue (..down (rgb.number blue)) max (all f.max red green blue) min (all f.min red green blue) luminance (|> (f.+ max min) (f./ +2.0))] @@ -191,28 +158,28 @@ (def .public (of_hsl [hue saturation luminance]) (-> HSL Color) - (if (f.= +0.0 saturation) - ... Achromatic - (let [intensity (..up luminance)] - (of_rgb [#red intensity - #green intensity - #blue intensity])) - ... Chromatic - (let [q (if (f.< +0.5 luminance) - (|> saturation (f.+ +1.0) (f.* luminance)) - (|> luminance (f.+ saturation) (f.- (f.* saturation luminance)))) - p (|> luminance (f.* +2.0) (f.- q)) - third (|> +1.0 (f./ +3.0))] - (of_rgb [#red (|> hue (f.+ third) (hue_rgb p q)) - #green (|> hue (hue_rgb p q)) - #blue (|> hue (f.- third) (hue_rgb p q))])))) + (|> (if (f.= +0.0 saturation) + ... Achromatic + (let [intensity (..up luminance)] + (rgb.rgb intensity intensity intensity)) + ... Chromatic + (let [q (if (f.< +0.5 luminance) + (|> saturation (f.+ +1.0) (f.* luminance)) + (|> luminance (f.+ saturation) (f.- (f.* saturation luminance)))) + p (|> luminance (f.* +2.0) (f.- q)) + third (|> +1.0 (f./ +3.0))] + (rgb.rgb (|> hue (f.+ third) (hue_rgb p q)) + (|> hue (hue_rgb p q)) + (|> hue (f.- third) (hue_rgb p q))))) + try.trusted + of_rgb)) (def .public (hsb color) (-> Color HSB) (let [[red green blue] (rgb color) - red (..down red) - green (..down green) - blue (..down blue) + red (..down (rgb.number red)) + green (..down (rgb.number green)) + blue (..down (rgb.number blue)) max (all f.max red green blue) min (all f.min red green blue) brightness max @@ -252,16 +219,18 @@ red (when mod 0 v 1 q 2 p 3 p 4 t 5 v _ (undefined)) green (when mod 0 t 1 v 2 v 3 q 4 p 5 p _ (undefined)) blue (when mod 0 p 1 p 2 t 3 v 4 v 5 q _ (undefined))] - (of_rgb [#red (..up red) - #green (..up green) - #blue (..up blue)]))) + (|> (rgb.rgb (..up red) + (..up green) + (..up blue)) + try.trusted + of_rgb))) (def .public (cmyk color) (-> Color CMYK) (let [[red green blue] (rgb color) - red (..down red) - green (..down green) - blue (..down blue) + red (..down (rgb.number red)) + green (..down (rgb.number green)) + blue (..down (rgb.number blue)) key (|> +1.0 (f.- (all f.max red green blue))) f (if (f.< +1.0 key) (|> +1.0 (f./ (|> +1.0 (f.- key)))) @@ -277,18 +246,18 @@ (def .public (of_cmyk [cyan magenta yellow key]) (-> CMYK Color) (if (f.= +1.0 key) - (of_rgb [#red 0 - #green 0 - #blue 0]) + ..black (let [red (|> (|> +1.0 (f.- cyan)) (f.* (|> +1.0 (f.- key)))) green (|> (|> +1.0 (f.- magenta)) (f.* (|> +1.0 (f.- key)))) blue (|> (|> +1.0 (f.- yellow)) (f.* (|> +1.0 (f.- key))))] - (of_rgb [#red (..up red) - #green (..up green) - #blue (..up blue)])))) + (|> (rgb.rgb (..up red) + (..up green) + (..up blue)) + try.trusted + of_rgb)))) (def (normal ratio) (-> Frac Frac) @@ -313,9 +282,11 @@ .nat))) [redS greenS blueS] (rgb start) [redE greenE blueE] (rgb end)] - (of_rgb [#red (interpolated' redE redS) - #green (interpolated' greenE greenS) - #blue (interpolated' blueE blueS)]))) + (|> (rgb.rgb (interpolated' (rgb.number redE) (rgb.number redS)) + (interpolated' (rgb.number greenE) (rgb.number greenS)) + (interpolated' (rgb.number blueE) (rgb.number blueS))) + try.trusted + of_rgb))) (with_template [<name> <target>] [(def .public (<name> ratio color) diff --git a/stdlib/source/library/lux/data/color/named.lux b/stdlib/source/library/lux/data/color/named.lux index df8d311cf..29f58b285 100644 --- a/stdlib/source/library/lux/data/color/named.lux +++ b/stdlib/source/library/lux/data/color/named.lux @@ -1,17 +1,22 @@ (.require [library [lux (.except) + [control + ["[0]" try]] [math [number (.only hex)]]]] - ["[0]" // (.only Color)]) + ["[0]" // (.only Color) + ["[0]" rgb]]) ... https://developer.mozilla.org/en-US/docs/Web/CSS/color_value (with_template [<red> <green> <blue> <name>] [(`` (def .public <name> Color - (//.of_rgb [//.#red (hex <red>) - //.#green (hex <green>) - //.#blue (hex <blue>)])))] + (|> (rgb.rgb (hex <red>) + (hex <green>) + (hex <blue>)) + try.trusted + //.of_rgb)))] ["F0" "F8" "FF" alice_blue] ["FA" "EB" "D7" antique_white] diff --git a/stdlib/source/library/lux/data/color/rgb.lux b/stdlib/source/library/lux/data/color/rgb.lux new file mode 100644 index 000000000..23ac52a30 --- /dev/null +++ b/stdlib/source/library/lux/data/color/rgb.lux @@ -0,0 +1,146 @@ +(.require + [library + [lux (.except) + [abstract + [monad (.only do)] + [monoid (.only Monoid)] + [equivalence (.only Equivalence)] + ["[0]" hash (.only Hash)]] + [control + ["[0]" try (.only Try)] + ["[0]" exception (.only Exception)]] + [data + [text + ["%" \\format]]] + [math + [number + ["n" nat] + ["[0]" i64]]] + [meta + [type + ["[0]" primitive]]]]]) + +(def .public limit + Nat + 256) + +(primitive.def .public Value + Nat + + (def .public least + Value + (primitive.abstraction 0)) + + (def .public most + Value + (primitive.abstraction (-- ..limit))) + + (exception.def .public (invalid it) + (Exception Nat) + (exception.report + (list ["Limit" (%.nat ..limit)] + ["Value" (%.nat it)]))) + + (def .public (value it) + (-> Nat + (Try Value)) + (if (n.< ..limit it) + {try.#Success (primitive.abstraction it)} + (exception.except ..invalid [it]))) + + (def .public number + (-> Value Nat) + (|>> primitive.representation)) + + (type .public RGB + (Record + [#red Value + #green Value + #blue Value])) + + (def .public (rgb red green blue) + (-> Nat Nat Nat + (Try RGB)) + (do try.monad + [red (value red) + green (value green) + blue (value blue)] + (in [#red red + #green green + #blue blue]))) + + (def .public equivalence + (Equivalence RGB) + (implementation + (def (= [rR gR bR] [rS gS bS]) + (and (n.= (primitive.representation rR) (primitive.representation rS)) + (n.= (primitive.representation gR) (primitive.representation gS)) + (n.= (primitive.representation bR) (primitive.representation bS)))))) + + (def .public hash + (Hash RGB) + (implementation + (def equivalence + ..equivalence) + + (def (hash [r g b]) + (all i64.or + (i64.left_shifted 16 (primitive.representation r)) + (i64.left_shifted 08 (primitive.representation g)) + (primitive.representation b))))) + + (def (opposite_intensity value) + (-> Nat Nat) + (|> (primitive.representation ..most) + (n.- value))) + + (def .public (complement it) + (-> RGB RGB) + (`` [(,, (with_template [<slot>] + [<slot> (|> it + (the <slot>) + primitive.representation + opposite_intensity + primitive.abstraction)] + + [#red] + [#green] + [#blue] + ))])) + + (def .public black + RGB + [#red ..least + #green ..least + #blue ..least]) + + (def .public white + RGB + [#red ..most + #green ..most + #blue ..most]) + + (with_template [<monoid> <identity> <composite> <left> <right>] + [(def .public <monoid> + (Monoid RGB) + (implementation + (def identity + <identity>) + + (def (composite left right) + (let [left (<left> left) + right (<right> right)] + (`` [(,, (with_template [<slot>] + [<slot> (primitive.abstraction + (<composite> (primitive.representation (the <slot> left)) + (primitive.representation (the <slot> right))))] + + [#red] + [#green] + [#blue] + ))])))))] + + [addition ..black n.max |> |>] + [subtraction ..white n.min ..complement |>] + ) + ) diff --git a/stdlib/source/library/lux/data/format/css/value.lux b/stdlib/source/library/lux/data/format/css/value.lux index a05cabdf5..0a46fddbe 100644 --- a/stdlib/source/library/lux/data/format/css/value.lux +++ b/stdlib/source/library/lux/data/format/css/value.lux @@ -4,8 +4,9 @@ [control ["[0]" maybe]] [data - ["[0]" color] ["[0]" product] + ["[0]" color (.only) + ["[0]" rgb]] ["[0]" text (.only) ["%" \\format (.only Format format)]] [collection @@ -61,11 +62,14 @@ Text (def .public value - (-> (Value Any) Text) + (-> (Value Any) + Text) (|>> representation)) (with_template [<name> <value>] - [(def .public <name> Value (abstraction <value>))] + [(def .public <name> + Value + (abstraction <value>))] [initial "initial"] [inherit "inherit"] @@ -775,10 +779,12 @@ []] ) - (def value_separator ",") + (def value_separator + ",") (def (apply name inputs) - (-> Text (List Text) Value) + (-> Text (List Text) + Value) (|> inputs (text.interposed ..value_separator) (text.enclosed ["(" ")"]) @@ -794,18 +800,21 @@ []) (def .public (steps intervals step) - (-> Nat Step (Value Timing)) + (-> Nat Step + (Value Timing)) (..apply "steps" (list (%.nat intervals) (..step step)))) (def .public (cubic_bezier p0 p1 p2 p3) - (-> Frac Frac Frac Frac (Value Timing)) + (-> Frac Frac Frac Frac + (Value Timing)) (|> (list p0 p1 p2 p3) (list#each %number) (..apply "cubic-bezier"))) (with_template [<name> <brand>] [(def .public <name> - (-> Nat (Value <brand>)) + (-> Nat + (Value <brand>)) (|>> %.nat abstraction))] [iteration Iteration] @@ -815,30 +824,34 @@ ) (def .public animation - (-> Label (Value Animation)) + (-> Label + (Value Animation)) (|>> abstraction)) (def .public (rgb color) - (-> color.Color (Value Color)) + (-> color.Color + (Value Color)) (let [[red green blue] (color.rgb color)] - (..apply "rgb" (list (%.nat red) - (%.nat green) - (%.nat blue))))) + (..apply "rgb" (list (%.nat (rgb.number red)) + (%.nat (rgb.number green)) + (%.nat (rgb.number blue)))))) (def .public (rgba pigment) - (-> color.Pigment (Value Color)) + (-> color.Pigment + (Value Color)) (let [(open "_[0]") pigment [red green blue] (color.rgb _#color)] - (..apply "rgba" (list (%.nat red) - (%.nat green) - (%.nat blue) + (..apply "rgba" (list (%.nat (rgb.number red)) + (%.nat (rgb.number green)) + (%.nat (rgb.number blue)) (if (r.= (at r.interval top) _#alpha) "1.0" (format "0" (%.rev _#alpha))))))) (with_template [<name> <suffix>] [(def .public (<name> value) - (-> Frac (Value Length)) + (-> Frac + (Value Length)) (abstraction (format (%number value) <suffix>)))] [em "em"] @@ -867,7 +880,8 @@ (with_template [<name> <suffix>] [(def .public (<name> value) - (-> Int (Value Time)) + (-> Int + (Value Time)) (abstraction (format (if (i.< +0 value) (%.int value) (%.nat (.nat value))) @@ -879,13 +893,15 @@ ) (def .public thickness - (-> (Value Length) (Value Thickness)) + (-> (Value Length) + (Value Thickness)) (|>> transmutation)) (def slice_separator " ") (def .public (slice_number/2 horizontal vertical) - (-> Nat Nat (Value Slice)) + (-> Nat Nat + (Value Slice)) (abstraction (format (%.nat horizontal) ..slice_separator (%.nat vertical)))) @@ -893,18 +909,22 @@ Text (def .public stop - (-> (Value Color) Stop) + (-> (Value Color) + Stop) (|>> (representation Value) (abstraction Stop))) - (def stop_separator " ") + (def stop_separator + " ") (def .public (single_stop length color) - (-> (Value Length) (Value Color) Stop) + (-> (Value Length) (Value Color) + Stop) (abstraction (format (representation Value color) ..stop_separator (representation Value length)))) (def .public (double_stop start end color) - (-> (Value Length) (Value Length) (Value Color) Stop) + (-> (Value Length) (Value Length) (Value Color) + Stop) (abstraction (format (representation Value color) ..stop_separator (representation Value start) ..stop_separator (representation Value end)))) @@ -913,11 +933,13 @@ Text (def .public hint - (-> (Value Length) Hint) + (-> (Value Length) + Hint) (|>> (representation Value) (abstraction Hint))) (def (with_hint [hint stop]) - (-> [(Maybe Hint) Stop] Text) + (-> [(Maybe Hint) Stop] + Text) (when hint {.#None} (representation Stop stop) @@ -932,17 +954,22 @@ Text (def .public angle - (-> Angle Text) + (-> Angle + Text) (|>> representation)) (def .public (turn value) - (-> Rev Angle) + (-> Rev + Angle) (abstraction (format (%.rev value) "turn"))) - (def degree_limit Nat 360) + (def degree_limit + Nat + 360) (def .public (degree value) - (-> Nat Angle) + (-> Nat + Angle) (abstraction (format (%.nat (n.% ..degree_limit value)) "deg"))) (with_template [<degree> <name>] @@ -958,7 +985,8 @@ (with_template [<name> <function>] [(def .public (<name> angle start next) - (-> Angle Stop (List/1 [(Maybe Hint) Stop]) (Value Image)) + (-> Angle Stop (List/1 [(Maybe Hint) Stop]) + (Value Image)) (let [[now after] next] (..apply <function> (list.partial (representation Angle angle) (with_hint now) @@ -969,25 +997,31 @@ ) ) - (def percentage_limit Nat (.++ 100)) + (def percentage_limit + Nat + (.++ 100)) (def .public (%% value) - (-> Nat (Value Percentage)) + (-> Nat + (Value Percentage)) (abstraction (format (%.nat (n.% percentage_limit value)) "%"))) (def .public slice_percent/1 - (-> (Value Percentage) (Value Slice)) + (-> (Value Percentage) + (Value Slice)) (|>> transmutation)) (def .public (slice_percent/2 horizontal vertical) - (-> (Value Percentage) (Value Percentage) (Value Slice)) + (-> (Value Percentage) (Value Percentage) + (Value Slice)) (abstraction (format (representation horizontal) ..slice_separator (representation vertical)))) (with_template [<input> <pre> <function>+] [(`` (with_template [<name> <function>] [(def .public <name> - (-> <input> (Value Filter)) + (-> <input> + (Value Filter)) (|>> <pre> (list) (..apply <function>)))] (,, (template.spliced <function>+))))] @@ -1007,10 +1041,12 @@ ) (def .public svg_filter - (-> URL (Value Filter)) + (-> URL + (Value Filter)) (|>> (list) (..apply "url"))) - (def default_shadow_length (px +0.0)) + (def default_shadow_length + (px +0.0)) (def .public (drop_shadow horizontal vertical blur spread color) (-> (Value Length) (Value Length) @@ -1026,11 +1062,13 @@ (list) (..apply "drop-shadow"))) - (def length_separator " ") + (def length_separator + " ") (with_template [<name> <type>] [(def .public (<name> horizontal vertical) - (-> (Value Length) (Value Length) (Value <type>)) + (-> (Value Length) (Value Length) + (Value <type>)) (abstraction (format (representation horizontal) ..length_separator (representation vertical))))] @@ -1040,11 +1078,13 @@ ) (def .public (fit/1 length) - (-> (Value Length) (Value Fit)) + (-> (Value Length) + (Value Fit)) (..fit length length)) (def .public image - (-> URL (Value Image)) + (-> URL + (Value Image)) (|>> %.text (list) (..apply "url"))) @@ -1114,30 +1154,36 @@ #left (Value Length)])) (def .public (clip rectangle) - (-> Rectangle (Value Clip)) + (-> Rectangle + (Value Clip)) (`` (..apply "rect" (list (,, (with_template [<side>] [(representation (the <side> rectangle))] [#top] [#right] [#bottom] [#left])))))) (def .public counter - (-> Label (Value Counter)) + (-> Label + (Value Counter)) (|>> abstraction)) (def .public current_count - (-> (Value Counter) (Value Content)) + (-> (Value Counter) + (Value Content)) (|>> representation (list) (..apply "counter"))) (def .public text - (-> Text (Value Content)) + (-> Text + (Value Content)) (|>> %.text abstraction)) (def .public attribute - (-> Label (Value Content)) + (-> Label + (Value Content)) (|>> (list) (..apply "attr"))) (def .public media - (-> URL (Value Content)) + (-> URL + (Value Content)) (|>> (list) (..apply "url"))) (enumeration @@ -1166,35 +1212,42 @@ ..initial))]) (def .public font_size - (-> (Value Length) (Value Font_Size)) + (-> (Value Length) + (Value Font_Size)) (|>> transmutation)) (def .public number - (-> Frac (Value Number)) + (-> Frac + (Value Number)) (|>> %number abstraction)) (def .public grid - (-> Label (Value Grid)) + (-> Label + (Value Grid)) (|>> abstraction)) (def .public fit_content - (-> (Value Length) (Value Grid_Content)) + (-> (Value Length) + (Value Grid_Content)) (|>> representation (list) (..apply "fit-content"))) (def .public (min_max min max) - (-> (Value Grid_Content) (Value Grid_Content) (Value Grid_Content)) + (-> (Value Grid_Content) (Value Grid_Content) + (Value Grid_Content)) (..apply "minmax" (list (representation min) (representation max)))) (def .public grid_span - (-> Nat (Value Grid_Span)) + (-> Nat + (Value Grid_Span)) (|>> %.nat (format "span ") abstraction)) (def grid_column_separator " ") (def grid_row_separator " ") (def .public grid_template - (-> (List (List (Maybe (Value Grid)))) (Value Grid_Template)) + (-> (List (List (Maybe (Value Grid)))) + (Value Grid_Template)) (let [empty (is (Value Grid) (abstraction "."))] (|>> (list#each (|>> (list#each (|>> (maybe.else empty) @@ -1205,11 +1258,13 @@ abstraction))) (def .public (resolution dpi) - (-> Nat (Value Resolution)) + (-> Nat + (Value Resolution)) (abstraction (format (%.nat dpi) "dpi"))) (def .public (ratio numerator denominator) - (-> Nat Nat (Value Ratio)) + (-> Nat Nat + (Value Ratio)) (abstraction (format (%.nat numerator) "/" (%.nat denominator)))) (enumeration @@ -1234,7 +1289,8 @@ (def quote_separator " ") (def .public (quotes [left0 right0] [left1 right1]) - (-> [Quote Quote] [Quote Quote] (Value Quotes)) + (-> [Quote Quote] [Quote Quote] + (Value Quotes)) (|> (list left0 right0 left1 right1) (list#each (|>> ..quote_text %.text)) (text.interposed ..quote_separator) @@ -1261,7 +1317,8 @@ (with_template [<name> <function> <input_types> <input_values>] [(`` (def .public (<name> [(,, (template.spliced <input_values>))]) - (-> [(,, (template.spliced <input_types>))] (Value Transform)) + (-> [(,, (template.spliced <input_types>))] + (Value Transform)) (|> (list (,, (template.spliced <input_values>))) (list#each %number) (..apply <function>))))] @@ -1283,7 +1340,8 @@ (with_template [<name> <function> <input_types> <input_values>] [(`` (def .public (<name> [(,, (template.spliced <input_values>))]) - (-> [(,, (template.spliced <input_types>))] (Value Transform)) + (-> [(,, (template.spliced <input_types>))] + (Value Transform)) (|> (list (,, (template.spliced <input_values>))) (list#each ..angle) (..apply <function>))))] @@ -1299,36 +1357,42 @@ ) (def .public (rotate_3d [x y z angle]) - (-> [Frac Frac Frac Angle] (Value Transform)) + (-> [Frac Frac Frac Angle] + (Value Transform)) (..apply "rotate3d" (list (%number x) (%number y) (%number z) (..angle angle)))) (def origin_separator " ") (def .public (origin_2d x y) - (-> (Value Length) (Value Length) (Value Transform_Origin)) + (-> (Value Length) (Value Length) + (Value Transform_Origin)) (abstraction (format (representation x) ..origin_separator (representation y)))) (def .public (origin_3d x y z) - (-> (Value Length) (Value Length) (Value Length) (Value Transform_Origin)) + (-> (Value Length) (Value Length) (Value Length) + (Value Transform_Origin)) (abstraction (format (representation x) ..origin_separator (representation y) ..origin_separator (representation z)))) (def .public vertical_align - (-> (Value Length) (Value Vertical_Align)) + (-> (Value Length) + (Value Vertical_Align)) (|>> transmutation)) (def .public (z_index index) - (-> Int (Value Z_Index)) + (-> Int + (Value Z_Index)) (abstraction (if (i.< +0 index) (%.int index) (%.nat (.nat index))))) (with_template [<separator> <type> <multi>] [(def .public (<multi> pre post) - (-> (Value <type>) (Value <type>) (Value <type>)) + (-> (Value <type>) (Value <type>) + (Value <type>)) (abstraction (format (representation pre) <separator> (representation post))))] diff --git a/stdlib/source/library/lux/documentation.lux b/stdlib/source/library/lux/documentation.lux index 200daa9eb..e5f23e1ef 100644 --- a/stdlib/source/library/lux/documentation.lux +++ b/stdlib/source/library/lux/documentation.lux @@ -37,7 +37,11 @@ [compiler [language [lux - ["[0]" syntax]]]]]]]) + ["[0]" syntax]]] + [meta + [archive + [module + ["[0]" descriptor]]]]]]]]) (def |recursion_dummy| (template (_) @@ -54,7 +58,8 @@ <code>.any)) (def (reference_column code) - (-> Code Nat) + (-> Code + Nat) (when code (^.with_template [<tag>] [[[_ _ column] {<tag> _}] @@ -78,7 +83,8 @@ )) (def (padding reference_column [_ old_line old_column] [_ new_line new_column]) - (-> Nat Location Location Text) + (-> Nat Location Location + Text) (if (n.= old_line new_line) (if (n.< old_column new_column) "" @@ -91,7 +97,8 @@ (text.together (list.repeated (n.- reference_column new_column) " ")))))) (def (code_documentation expected_module old_location reference_column example) - (-> Text Location Nat Code [Location Text]) + (-> Text Location Nat Code + [Location Text]) (when example [new_location {.#Symbol [module short]}] (let [documentation (cond (text#= expected_module module) @@ -136,13 +143,15 @@ (def .public (comment it module) (-> Text - (-> Text (Markdown Block))) + (-> Text + (Markdown Block))) (<| (md.code "clojure") (format "... " it))) (def (example' it module) (-> Code - (-> Text (Markdown Block))) + (-> Text + (Markdown Block))) (<| (md.code "clojure") (let [reference_column (..reference_column it) [location _] it] @@ -156,11 +165,13 @@ (def .public (deprecated when module) (-> Text - (-> Text (Markdown Block))) + (-> Text + (Markdown Block))) (md.paragraph (md.text (format "Deprecated: " when)))) (def parameter_type_name - (-> Nat Text) + (-> Nat + Text) (|>> %.nat (format "_"))) (def type_variable_names @@ -170,7 +181,8 @@ (with_template [<name> <partition>] [(def (<name> id) - (-> Nat Bit) + (-> Nat + Bit) (<partition> id))] [type_function? n.even?] @@ -178,11 +190,13 @@ ) (def (parameter_id level id) - (-> Nat Nat Nat) + (-> Nat Nat + Nat) (n.- (n./ 2 id) level)) (def (parameter_name [type_function_name type_function_arguments] level id) - (-> [Text (List Text)] Nat Nat Text) + (-> [Text (List Text)] Nat Nat + Text) (if (type_parameter? id) (let [parameter_id (..parameter_id level id)] (when (list.item parameter_id type_function_arguments) @@ -198,7 +212,8 @@ type_function_name)) (def (level_parameters offset level) - (-> Nat Nat (List Text)) + (-> Nat Nat + (List Text)) (if (n.= 0 level) (list) (|> level @@ -207,14 +222,16 @@ (list#each (|>> (n.+ (++ offset)) parameter_type_name))))) (def (nested line_prefix body) - (-> Text Text Text) + (-> Text Text + Text) (|> body (text.all_split_by \n) (list#each (text.prefix line_prefix)) (text.interposed \n))) (def (%type' level type_function_name nestable? module type) - (-> Nat Text Bit Text Type Text) + (-> Nat Text Bit Text Type + Text) (when type {.#Primitive name params} (|> params @@ -296,11 +313,13 @@ )) (def .public type_documentation - (-> Text Type Text) + (-> Text Type + Text) (%type' (-- 0) "?" true)) (def (parameterized_type arity type) - (-> Nat Type (Maybe Type)) + (-> Nat Type + (Maybe Type)) (when arity 0 {.#Some type} _ (when type @@ -311,7 +330,8 @@ {.#None}))) (def (type_definition' nestable? level arity type_function_info tags module type) - (-> Bit Nat Nat [Text (List Text)] (List Text) Text Type Text) + (-> Bit Nat Nat [Text (List Text)] (List Text) Text Type + Text) (when tags (list single_tag) (format "(Record" \n @@ -434,7 +454,8 @@ ))) (def .public (type_definition module [name parameters] tags type) - (-> Text [Text (List Text)] (List Text) Type Text) + (-> Text [Text (List Text)] (List Text) Type + Text) (let [arity (list.size parameters)] (when (parameterized_type arity type) {.#Some type} @@ -551,6 +572,8 @@ (Record [#module Text #description Text + ... https://en.wiktionary.org/wiki/dependee + #dependees (Set descriptor.Module) #coverage (Set Text)])) (.type .public Documentation @@ -573,14 +596,16 @@ (,* extra))))] (macro.with_symbols [g!_] (let [[module short] name] - (in (list (` (.let [(, g!_) (.is (.-> .Any ..Documentation) + (in (list (` (.let [(, g!_) (.is (.-> .Any + ..Documentation) (.function ((, g!_) (, g!_)) {#Definition [..#global [(, (code.text module)) (, (code.text short))] ..#documentation (,* documentation)]}))] ((, g!_) [])))))))))) (def definitions_documentation - (-> (List Definition) (Markdown Block)) + (-> (List Definition) + (Markdown Block)) (|>> (list.sorted (function (_ left right) (text#< (symbol.short (the #global right)) (symbol.short (the #global left))))) @@ -592,7 +617,8 @@ (text.of_char 31)) (def coverage_format - (-> (List Text) Text) + (-> (List Text) + Text) (list#mix (function (_ short aggregate) (when aggregate "" short @@ -603,10 +629,13 @@ (syntax (_ [[name _] ..qualified_symbol description <code>.any]) (do meta.monad - [coverage (meta.exports name)] + [coverage (meta.exports name) + dependees (meta.imported_modules name)] (in (list (` (is Documentation {#Module [..#module (, (code.text name)) ..#description (, description) + ..#dependees (|> (list (,* (list#each code.text dependees))) + (set.of_list text.hash)) ..#coverage (|> (, (code.text (|> coverage (list#each product.left) ..coverage_format))) @@ -614,15 +643,33 @@ (set.of_list text.hash))]})))))))) (def listing - (-> (List Text) (Markdown Block)) + (-> (List Text) + (Markdown Block)) (|>> (list.sorted text#<) (list#each (function (_ definition) [(md.snippet definition) {.#None}])) md.numbered_list)) -(def (module_documentation [module definitions]) - (-> [Module (List Definition)] (Markdown Block)) +(def (dependencies heading it) + (-> descriptor.Module (Set descriptor.Module) + (Markdown Block)) + (if (set.empty? it) + md.empty + (all md.then + (md.heading/2 heading) + (|> (set.list it) + (list.only (|>> (text#= descriptor.runtime) not)) + (list.sorted text#<) + (list#each (function (_ it) + [(md.text it) {.#None}])) + md.bullet_list) + ))) + +(def (module_documentation dependers [module definitions]) + (-> (Dictionary descriptor.Module (Set descriptor.Module)) + [Module (List Definition)] + (Markdown Block)) (let [(open "_[0]") module] (all md.then ... Name @@ -634,8 +681,11 @@ description (<| md.paragraph md.text description)) + + (dependencies "Dependees" (the #dependees module)) + (dependencies "Dependers" (|> (dictionary.value (the #module module) dependers) + (maybe.else (set.empty text.hash)))) - ... Definitions (md.heading/2 "Definitions") (|> definitions (list.only (|>> (the #global) @@ -674,8 +724,20 @@ (..listing un_expected))) ))) +... https://en.wiktionary.org/wiki/depender +(def dependers + (-> (List [descriptor.Module Module]) + (Dictionary descriptor.Module (Set descriptor.Module))) + (list#mix (function (_ [name module] it) + (list#mix (function (_ import it) + (dictionary.revised' import (set.empty text.hash) (set.has name) it)) + it + (set.list (the #dependees module)))) + (dictionary.empty text.hash))) + (def .public (markdown it) - (-> (List Documentation) Text) + (-> (List Documentation) + Text) (let [with_modules (list#mix (function (_ doc it) (if (dictionary.key? it (the #module doc)) it @@ -692,13 +754,18 @@ it) it))) with_modules - (sum.lefts it))] + (sum.lefts it)) + dependers (|> with_modules + dictionary.entries + (list#each (function (_ [name [module definitons]]) + [name module])) + ..dependers)] (|> with_definitions dictionary.values (list.sorted (function (_ left right) (text#< (the #module (product.left right)) (the #module (product.left left))))) - (list#each ..module_documentation) + (list#each (..module_documentation dependers)) (list.interposed md.horizontal_rule) (list#mix md.then (is (Markdown Block) md.empty)) md.markdown))) diff --git a/stdlib/source/library/lux/ffi.lux b/stdlib/source/library/lux/ffi.lux index 17b150560..575809639 100644 --- a/stdlib/source/library/lux/ffi.lux +++ b/stdlib/source/library/lux/ffi.lux @@ -57,9 +57,9 @@ {try.#Success <inputs>} <body>)))))])) -(def generation +(def translation (template (_ <name> <bindings> <inputs> <body>) - [("lux def generation" <name> + [("lux def translation" <name> (.function (_ name phase archive inputs) (.function (_ state) (let [<bindings> [name phase archive state]] @@ -80,10 +80,10 @@ _ {try.#Success [state (extension_analysis name (list))]}) - (generation <undefined> - [name phase archive state] - (list) - {try.#Success [state js.undefined]}) + (translation <undefined> + [name phase archive state] + (list) + {try.#Success [state js.undefined]}) (def .public undefined (template (undefined) @@ -97,12 +97,12 @@ [[state it] (phase archive (` (.is .Any (, it))) state)] (in [state (extension_analysis name (list it))]))) - (generation <undefined?> - [name phase archive state] - (list it) - (do try.monad - [[state it] (phase archive it state)] - (in [state (js.= js.undefined it)]))) + (translation <undefined?> + [name phase archive state] + (list it) + (do try.monad + [[state it] (phase archive it state)] + (in [state (js.= js.undefined it)]))) (def .public undefined? (template (undefined? <it>) @@ -137,23 +137,23 @@ _ (.undefined))) - (generation <object> - [name phase archive state] - (list.partial head_key head_value tail) - (do [! try.monad] - [[state output] (monad.mix ! - (.function (_ [key value] [state output]) - (when key - (text_synthesis key) - (do try.monad - [[state value] (phase archive value state)] - (in [state (list.partial [key value] output)])) - - _ - (.undefined))) - [state (list)] - (pairs (list.partial head_key head_value tail)))] - (in [state (js.object (list.reversed output))]))) + (translation <object> + [name phase archive state] + (list.partial head_key head_value tail) + (do [! try.monad] + [[state output] (monad.mix ! + (.function (_ [key value] [state output]) + (when key + (text_synthesis key) + (do try.monad + [[state value] (phase archive value state)] + (in [state (list.partial [key value] output)])) + + _ + (.undefined))) + [state (list)] + (pairs (list.partial head_key head_value tail)))] + (in [state (js.object (list.reversed output))]))) (def .public object (syntax (_ [it (<>.some <code>.any)]) @@ -169,13 +169,13 @@ [state object] (phase archive (` (.is (..Object .Any) (, object))) state)] (in [state (extension_analysis name (list (text_analysis field) value object))]))) - (generation <set> - [name phase archive state] - (list (text_synthesis field) value object) - (do try.monad - [[state value] (phase archive value state) - [state object] (phase archive object state)] - (in [state (js.set (js.the field object) value)]))) + (translation <set> + [name phase archive state] + (list (text_synthesis field) value object) + (do try.monad + [[state value] (phase archive value state) + [state object] (phase archive object state)] + (in [state (js.set (js.the field object) value)]))) (def .public set (syntax (_ [field <code>.any diff --git a/stdlib/source/library/lux/ffi/export.js.lux b/stdlib/source/library/lux/ffi/export.js.lux index 6b0732c7a..1a54cb8ee 100644 --- a/stdlib/source/library/lux/ffi/export.js.lux +++ b/stdlib/source/library/lux/ffi/export.js.lux @@ -31,7 +31,7 @@ ["[1]" artifact]]]] [language [lux - ["[0]" generation] + ["[0]" translation] ["[0]" declaration] [analysis ["[0]" type]]]]]]]]) @@ -61,17 +61,17 @@ term (declaration.lifted_synthesis (next archive term)) - dependencies (declaration.lifted_generation + dependencies (declaration.lifted_translation (dependency.dependencies archive term)) - next declaration.generation - [interim_artifacts term] (declaration.lifted_generation - (generation.with_interim_artifacts archive + next declaration.translation + [interim_artifacts term] (declaration.lifted_translation + (translation.with_interim_artifacts archive (next archive term))) - _ (declaration.lifted_generation + _ (declaration.lifted_translation (do ! - [@self (generation.learn_custom name (list#mix set.has dependencies interim_artifacts)) + [@self (translation.learn_custom name (list#mix set.has dependencies interim_artifacts)) .let [$module (/.var "module") $exports (/.the "exports" $module) definition (/.define (/.var name) term) @@ -80,9 +80,9 @@ code (all /.then definition export)] - _ (generation.execute! definition) - _ (generation.save! @self {.#None} code)] - (generation.log! (%.format "Export " (%.text name)))))] + _ (translation.execute! definition) + _ (translation.save! @self {.#None} code)] + (translation.log! (%.format "Export " (%.text name)))))] (in declaration.no_requirements))) (def .public export diff --git a/stdlib/source/library/lux/ffi/export.lua.lux b/stdlib/source/library/lux/ffi/export.lua.lux index ce6949ea7..3153f1d47 100644 --- a/stdlib/source/library/lux/ffi/export.lua.lux +++ b/stdlib/source/library/lux/ffi/export.lua.lux @@ -31,7 +31,7 @@ ["[1]" artifact]]]] [language [lux - ["[0]" generation] + ["[0]" translation] ["[0]" declaration] [analysis ["[0]" type]]]]]]]]) @@ -65,17 +65,17 @@ term (declaration.lifted_synthesis (next archive term)) - dependencies (declaration.lifted_generation + dependencies (declaration.lifted_translation (dependency.dependencies archive term)) - next declaration.generation - [interim_artifacts term] (declaration.lifted_generation - (generation.with_interim_artifacts archive + next declaration.translation + [interim_artifacts term] (declaration.lifted_translation + (translation.with_interim_artifacts archive (next archive term))) - _ (declaration.lifted_generation + _ (declaration.lifted_translation (do ! - [@self (generation.learn_custom name (list#mix set.has dependencies interim_artifacts)) + [@self (translation.learn_custom name (list#mix set.has dependencies interim_artifacts)) .let [$exports (/.var "_REQUIREDNAME") $global (/.var "_G") exporting? (/.not (/.= /.nil $exports)) @@ -87,18 +87,18 @@ (list)) (/.var name)) export! (/.when exporting? - (all /.then - (/.when no_exports? - initialize_exports!) - export_definition! - ))] - _ (generation.execute! (all /.then - (/.set (list (/.var name)) term) - export!)) - _ (generation.save! @self {.#None} (all /.then - (/.local/1 (/.var name) term) - export!))] - (generation.log! (%.format "Export " (%.text name)))))] + (all /.then + (/.when no_exports? + initialize_exports!) + export_definition! + ))] + _ (translation.execute! (all /.then + (/.set (list (/.var name)) term) + export!)) + _ (translation.save! @self {.#None} (all /.then + (/.local/1 (/.var name) term) + export!))] + (translation.log! (%.format "Export " (%.text name)))))] (in declaration.no_requirements))) (def .public export diff --git a/stdlib/source/library/lux/ffi/export.py.lux b/stdlib/source/library/lux/ffi/export.py.lux index d67b9539c..6e69e2a51 100644 --- a/stdlib/source/library/lux/ffi/export.py.lux +++ b/stdlib/source/library/lux/ffi/export.py.lux @@ -31,7 +31,7 @@ ["[1]" artifact]]]] [language [lux - ["[0]" generation] + ["[0]" translation] ["[0]" declaration] [analysis ["[0]" type]]]]]]]]) @@ -61,21 +61,21 @@ term (declaration.lifted_synthesis (next archive term)) - dependencies (declaration.lifted_generation + dependencies (declaration.lifted_translation (dependency.dependencies archive term)) - next declaration.generation - [interim_artifacts term] (declaration.lifted_generation - (generation.with_interim_artifacts archive + next declaration.translation + [interim_artifacts term] (declaration.lifted_translation + (translation.with_interim_artifacts archive (next archive term))) - _ (declaration.lifted_generation + _ (declaration.lifted_translation (do ! - [@self (generation.learn_custom name (list#mix set.has dependencies interim_artifacts)) + [@self (translation.learn_custom name (list#mix set.has dependencies interim_artifacts)) .let [code (/.set (list (/.item (/.string name) /.globals/0)) term)] - _ (generation.execute! code) - _ (generation.save! @self {.#None} code)] - (generation.log! (%.format "Export " (%.text name)))))] + _ (translation.execute! code) + _ (translation.save! @self {.#None} code)] + (translation.log! (%.format "Export " (%.text name)))))] (in declaration.no_requirements))) (def .public export diff --git a/stdlib/source/library/lux/ffi/export.rb.lux b/stdlib/source/library/lux/ffi/export.rb.lux index 9798cdb96..5d3fff361 100644 --- a/stdlib/source/library/lux/ffi/export.rb.lux +++ b/stdlib/source/library/lux/ffi/export.rb.lux @@ -33,7 +33,7 @@ ["[1]" artifact]]]] [language [lux - ["[0]" generation] + ["[0]" translation] ["[0]" declaration] ["[0]" analysis ["[1]" type]]]]]]]]) @@ -100,17 +100,17 @@ term (declaration.lifted_synthesis (next archive term)) - dependencies (declaration.lifted_generation + dependencies (declaration.lifted_translation (dependency.dependencies archive term)) - next declaration.generation - [interim_artifacts term] (declaration.lifted_generation - (generation.with_interim_artifacts archive + next declaration.translation + [interim_artifacts term] (declaration.lifted_translation + (translation.with_interim_artifacts archive (next archive term))) - _ (declaration.lifted_generation + _ (declaration.lifted_translation (do ! - [@self (generation.learn_custom name (list#mix set.has dependencies interim_artifacts)) + [@self (translation.learn_custom name (list#mix set.has dependencies interim_artifacts)) .let [[:input:/* :output:] (type.flat_function type) code (if global? (/.set (list (/.manual name)) term) @@ -122,9 +122,9 @@ _ (/.statement (/.apply (list (/.string name) term) {.#None} (/.manual "define_method")))))] - _ (generation.execute! code) - _ (generation.save! @self {.#None} code)] - (generation.log! (%.format "Export " (%.text name)))))] + _ (translation.execute! code) + _ (translation.save! @self {.#None} code)] + (translation.log! (%.format "Export " (%.text name)))))] (in declaration.no_requirements))) (def .public export diff --git a/stdlib/source/library/lux/math.lux b/stdlib/source/library/lux/math.lux index f2c3710f2..a952076c2 100644 --- a/stdlib/source/library/lux/math.lux +++ b/stdlib/source/library/lux/math.lux @@ -109,28 +109,28 @@ ... else (phase.except ..no_arithmetic_for [:it:]))))))))))] - [+ [[.Nat (in (analysis.nat location.dummy 0)) .i64_+#|generation] - [.Int (in (analysis.int location.dummy +0)) .i64_+#|generation] - [.Rev (in (analysis.rev location.dummy .0)) .i64_+#|generation] - [.Frac (in (analysis.frac location.dummy +0.0)) .f64_+#|generation] + [+ [[.Nat (in (analysis.nat location.dummy 0)) .i64_+#|translation] + [.Int (in (analysis.int location.dummy +0)) .i64_+#|translation] + [.Rev (in (analysis.rev location.dummy .0)) .i64_+#|translation] + [.Frac (in (analysis.frac location.dummy +0.0)) .f64_+#|translation] [Ratio (type.expecting Ratio (phase archive (` <ratio/0>))) ratio.+] [Complex (type.expecting Complex (phase archive (` <complex/0>))) complex.+]]] - [- [[.Nat (in (analysis.nat location.dummy 0)) .i64_-#|generation] - [.Int (in (analysis.int location.dummy -0)) .i64_-#|generation] - [.Rev (in (analysis.rev location.dummy .0)) .i64_-#|generation] - [.Frac (in (analysis.frac location.dummy -0.0)) .f64_-#|generation] + [- [[.Nat (in (analysis.nat location.dummy 0)) .i64_-#|translation] + [.Int (in (analysis.int location.dummy -0)) .i64_-#|translation] + [.Rev (in (analysis.rev location.dummy .0)) .i64_-#|translation] + [.Frac (in (analysis.frac location.dummy -0.0)) .f64_-#|translation] [Ratio (type.expecting Ratio (phase archive (` <ratio/0>))) ratio.-] [Complex (type.expecting Complex (phase archive (` <complex/0>))) complex.-]]] [* [[.Nat (in (analysis.nat location.dummy 1)) nat.*] - [.Int (in (analysis.int location.dummy +1)) .int_*#|generation] + [.Int (in (analysis.int location.dummy +1)) .int_*#|translation] [.Rev (in (analysis.rev location.dummy rev./1)) rev.*] - [.Frac (in (analysis.frac location.dummy +1.0)) .f64_*#|generation] + [.Frac (in (analysis.frac location.dummy +1.0)) .f64_*#|translation] [Ratio (type.expecting Ratio (phase archive (` <ratio/1>))) ratio.*] [Complex (type.expecting Complex (phase archive (` <complex/1>))) complex.*]]] [/ [[.Nat (in (analysis.nat location.dummy 1)) nat./] - [.Int (in (analysis.int location.dummy +1)) .int_/#|generation] + [.Int (in (analysis.int location.dummy +1)) .int_/#|translation] [.Rev (in (analysis.rev location.dummy rev./1)) rev./] - [.Frac (in (analysis.frac location.dummy +1.0)) .f64_/#|generation] + [.Frac (in (analysis.frac location.dummy +1.0)) .f64_/#|translation] [Ratio (type.expecting Ratio (phase archive (` <ratio/1>))) ratio./] [Complex (type.expecting Complex (phase archive (` <complex/1>))) complex./]]] ) @@ -159,16 +159,16 @@ ... else (phase.except ..no_arithmetic_for [:it:])))))))))] - [= [[.Nat .i64_=#|generation] - [.Int .i64_=#|generation] - [.Rev .i64_=#|generation] - [.Frac .f64_=#|generation] + [= [[.Nat .i64_=#|translation] + [.Int .i64_=#|translation] + [.Rev .i64_=#|translation] + [.Frac .f64_=#|translation] [Ratio ratio.=] [Complex complex.=]]] [< [[.Nat nat.<] - [.Int .int_<#|generation] + [.Int .int_<#|translation] [.Rev rev.<] - [.Frac .f64_<#|generation] + [.Frac .f64_<#|translation] [Ratio ratio.<]]] [> [[.Nat nat.>] [.Int int.>] @@ -212,9 +212,9 @@ (phase.except ..no_arithmetic_for [:it:])))))))))] [% [[.Nat nat.%] - [.Int .int_%#|generation] + [.Int .int_%#|translation] [.Rev rev.%] - [.Frac .f64_%#|generation] + [.Frac .f64_%#|translation] [Ratio ratio.%] [Complex complex.%]]] ) diff --git a/stdlib/source/library/lux/meta/compiler/default/init.lux b/stdlib/source/library/lux/meta/compiler/default/init.lux index 18d962303..2999dad49 100644 --- a/stdlib/source/library/lux/meta/compiler/default/init.lux +++ b/stdlib/source/library/lux/meta/compiler/default/init.lux @@ -31,7 +31,7 @@ ["[1][0]" syntax (.only Aliases)] ["[1][0]" synthesis] ["[1][0]" declaration (.only Requirements Extender)] - ["[1][0]" generation] + ["[1][0]" translation] ["[1][0]" analysis (.only) [macro (.only Expander)] ["[0]A" module]] @@ -52,22 +52,22 @@ ["[0]" descriptor] ["[0]" document]]]]]]) -(def .public (state target module configuration extender expander host generate) +(def .public (state target module configuration extender expander host translate) (All (_ anchor expression declaration) (-> Target descriptor.Module Configuration extension.Extender Expander - (///generation.Host expression declaration) - (-> extension.Extender Lux (///generation.Phase anchor expression declaration)) + (///translation.Host expression declaration) + (-> extension.Extender Lux (///translation.Phase anchor expression declaration)) (///declaration.State anchor expression declaration))) (let [lux (///analysis.state (///analysis.info version.latest target configuration))] [///declaration.#analysis [///declaration.#state lux ///declaration.#phase (analysisP.phase extender expander)] ///declaration.#synthesis [///declaration.#state ///synthesis.init ///declaration.#phase (synthesisP.phase extender)] - ///declaration.#generation [///declaration.#state (///generation.state host module) - ///declaration.#phase (generate extender)]])) + ///declaration.#translation [///declaration.#state (///translation.state host module) + ///declaration.#phase (translate extender)]])) (type Reader (-> Source (Either [Source Text] [Source Code]))) @@ -96,7 +96,7 @@ (///declaration.Operation anchor expression declaration a))) (type (Payload declaration) - [(///generation.Buffer declaration) + [(///translation.Buffer declaration) Registry]) (def (with_analysis_defaults bundle) @@ -123,9 +123,9 @@ (moduleA.override_definition [.prelude name] [true {.#Default [.Synthesis handler]}])))))] (in []))) -(def (with_generation_defaults bundle) +(def (with_translation_defaults bundle) (All (_ anchor expression declaration) - (-> (///generation.Bundle anchor expression declaration) + (-> (///translation.Bundle anchor expression declaration) (///declaration.Operation anchor expression declaration Any))) (do [! ///phase.monad] [_ (|> bundle @@ -133,7 +133,7 @@ (monad.each ! (function (_ [name handler]) (///declaration.lifted_analysis - (moduleA.override_definition [.prelude name] [true {.#Default [.Generation handler]}])))))] + (moduleA.override_definition [.prelude name] [true {.#Default [.Translation handler]}])))))] (in []))) (def (with_declaration_defaults bundle) @@ -154,10 +154,10 @@ (type .public (Extensions anchor expression declaration) [///analysis.Bundle ///synthesis.Bundle - (///generation.Bundle anchor expression declaration) + (///translation.Bundle anchor expression declaration) (///declaration.Bundle anchor expression declaration)]) -(def .public (with_defaults module [analysis_bundle synthesis_bundle generation_bundle host_declaration_bundle]) +(def .public (with_defaults module [analysis_bundle synthesis_bundle translation_bundle host_declaration_bundle]) (All (_ anchor expression declaration) (-> Text (Extensions anchor expression declaration) (///declaration.Operation anchor expression declaration Any))) @@ -166,7 +166,7 @@ (do ///phase.monad [_ (with_analysis_defaults analysis_bundle) _ (with_synthesis_defaults synthesis_bundle) - _ (with_generation_defaults generation_bundle)] + _ (with_translation_defaults translation_bundle)] (with_declaration_defaults (dictionary.composite host_declaration_bundle luxD.bundle))) @@ -191,7 +191,7 @@ [_ (monad.each ! moduleA.import dependencies) .let [source (///analysis.source (the ///.#module input) (the ///.#code input))] _ (///analysis.set_source_code source)] - (in [source [///generation.empty_buffer + (in [source [///translation.empty_buffer registry.empty]]))))) (def (end module) @@ -204,10 +204,10 @@ analysis_module (<| (is (Operation .Module)) ///declaration.lifted_analysis meta.current_module) - final_buffer (///declaration.lifted_generation - ///generation.buffer) - final_registry (///declaration.lifted_generation - ///generation.get_registry)] + final_buffer (///declaration.lifted_translation + ///translation.buffer) + final_registry (///declaration.lifted_translation + ///translation.get_registry)] (in [analysis_module [final_buffer final_registry]]))) @@ -218,10 +218,10 @@ (///declaration.Operation anchor expression declaration (Payload declaration)))) (do ///phase.monad - [buffer (///declaration.lifted_generation - ///generation.buffer) - registry (///declaration.lifted_generation - ///generation.get_registry)] + [buffer (///declaration.lifted_translation + ///translation.buffer) + registry (///declaration.lifted_translation + ///translation.get_registry)] (in [buffer registry]))) ... TODO: Inline ASAP @@ -232,10 +232,10 @@ [Requirements (Payload declaration)]))) (do ///phase.monad [.let [[pre_buffer pre_registry] pre_payoad] - _ (///declaration.lifted_generation - (///generation.set_buffer pre_buffer)) - _ (///declaration.lifted_generation - (///generation.set_registry pre_registry)) + _ (///declaration.lifted_translation + (///translation.set_buffer pre_buffer)) + _ (///declaration.lifted_translation + (///translation.set_registry pre_registry)) requirements (let [execute! (declarationP.phase wrapper extender expander)] (execute! archive code)) post_payload (..get_current_payload extender)] @@ -285,21 +285,21 @@ (def (define_program! archive program global program_module program_definition) (All (_ <parameters>) (-> Archive - (Program expression declaration) (-> Archive Symbol (///generation.Operation <parameters> expression)) + (Program expression declaration) (-> Archive Symbol (///translation.Operation <parameters> expression)) descriptor.Module Text - (///generation.Operation <parameters> Any))) + (///translation.Operation <parameters> Any))) (do ///phase.monad - [ [@program _] (///generation.definition archive [program_module program_definition]) - @self (///generation.learn [///program.name {.#None}] true (set.has @program (set.empty unit.hash))) + [ [@program _] (///translation.definition archive [program_module program_definition]) + @self (///translation.learn [///program.name {.#None}] true (set.has @program (set.empty unit.hash))) |program| (global archive [program_module program_definition]) @module (///phase.lifted (archive.id program_module archive))] - (///generation.save! @self {.#None} (program [@module @self] |program|)))) + (///translation.save! @self {.#None} (program [@module @self] |program|)))) (def .public (compiler program global wrapper extender expander prelude write_declaration program_module program_definition extensions) (All (_ <parameters>) - (-> (Program expression declaration) (-> Archive Symbol (///generation.Operation <parameters> expression)) + (-> (Program expression declaration) (-> Archive Symbol (///translation.Operation <parameters> expression)) ///phase.Wrapper (Extender <parameters>) Expander descriptor.Module (-> declaration Binary) descriptor.Module (Maybe Text) (Extensions <parameters>) @@ -327,7 +327,7 @@ [_ (if (text#= program_module module) (when program_definition {.#Some program_definition} - (///declaration.lifted_generation + (///declaration.lifted_translation (define_program! archive program global program_module program_definition)) {.#None} @@ -360,10 +360,10 @@ [analysis_module (<| (is (Operation .Module)) ///declaration.lifted_analysis meta.current_module) - _ (///declaration.lifted_generation - (///generation.set_buffer temporary_buffer)) - _ (///declaration.lifted_generation - (///generation.set_registry temporary_registry)) + _ (///declaration.lifted_translation + (///translation.set_buffer temporary_buffer)) + _ (///declaration.lifted_translation + (///translation.set_registry temporary_registry)) _ (|> requirements (the ///declaration.#referrals) (monad.each ! (execute! archive))) diff --git a/stdlib/source/library/lux/meta/compiler/default/platform.lux b/stdlib/source/library/lux/meta/compiler/default/platform.lux index c6f7c892f..0e56f0d61 100644 --- a/stdlib/source/library/lux/meta/compiler/default/platform.lux +++ b/stdlib/source/library/lux/meta/compiler/default/platform.lux @@ -44,7 +44,7 @@ ["$" /] ["[0]" syntax] ["[1][0]" synthesis] - ["[1][0]" generation (.only Buffer)] + ["[1][0]" translation (.only Buffer)] ["[1][0]" declaration (.only Extender)] ["[1][0]" analysis (.only) [macro (.only Expander)] @@ -73,12 +73,12 @@ ["ioW" archive]]]]]) (with_expansions [<type_vars> (these anchor expression declaration) - <Operation> (these ///generation.Operation <type_vars>)] + <Operation> (these ///translation.Operation <type_vars>)] (type .public (Platform <type_vars>) (Record [#file_system (file.System Async) - #host (///generation.Host expression declaration) - #phase (-> extension.Extender Lux (///generation.Phase <type_vars>)) + #host (///translation.Host expression declaration) + #phase (-> extension.Extender Lux (///translation.Phase <type_vars>)) #runtime (<Operation> [Registry Output]) #phase_wrapper phase.Wrapper #write (-> declaration Binary)])) @@ -143,13 +143,13 @@ ... TODO: Inline ASAP (def initialize_buffer! (All (_ <type_vars>) - (///generation.Operation <type_vars> Any)) - (///generation.set_buffer ///generation.empty_buffer)) + (///translation.Operation <type_vars> Any)) + (///translation.set_buffer ///translation.empty_buffer)) ... TODO: Inline ASAP (def (compile_runtime! platform) (All (_ <type_vars>) - (-> <Platform> (///generation.Operation <type_vars> [Registry Output]))) + (-> <Platform> (///translation.Operation <type_vars> [Registry Output]))) (do phase.monad [_ ..initialize_buffer!] (the #runtime platform))) @@ -178,7 +178,7 @@ (///declaration.Operation <type_vars> [Archive (archive.Entry .Module)]))) (do phase.monad - [[registry payload] (///declaration.lifted_generation + [[registry payload] (///declaration.lifted_translation (..compile_runtime! platform)) .let [entry [..runtime_module payload registry]] archive (phase.lifted (if (archive.reserved? archive descriptor.runtime) @@ -259,9 +259,9 @@ (def (module_compilation_log module) (All (_ <type_vars>) (-> descriptor.Module <State> Text)) - (|>> (the [///declaration.#generation + (|>> (the [///declaration.#translation ///declaration.#state - ///generation.#log]) + ///translation.#log]) (sequence#mix (function (_ right left) (%.format left ..compilation_log_separator right)) module))) @@ -269,9 +269,9 @@ (def with_reset_log (All (_ <type_vars>) (-> <State> <State>)) - (has [///declaration.#generation + (has [///declaration.#translation ///declaration.#state - ///generation.#log] + ///translation.#log] sequence.empty)) (def empty @@ -603,7 +603,7 @@ (def (compiler program global phase_wrapper extender expander platform program_module program_definition all_extensions) (All (_ <type_vars>) - (-> (Program expression declaration) (-> Archive Symbol (///generation.Operation <type_vars> expression)) + (-> (Program expression declaration) (-> Archive Symbol (///translation.Operation <type_vars> expression)) phase.Wrapper (Extender <type_vars>) Expander <Platform> Text (Maybe Module) (//init.Extensions <type_vars>) (///.Compiler <State> .Module))) @@ -791,7 +791,7 @@ (def .public (compile program global lux_compiler phase_wrapper import file_context extender expander platform compilation context all_extensions) (All (_ <type_vars>) - (-> (Program expression declaration) (-> Archive Symbol (///generation.Operation <type_vars> expression)) + (-> (Program expression declaration) (-> Archive Symbol (///translation.Operation <type_vars> expression)) (-> Any ..Custom) phase.Wrapper Import context.Context (Extender <type_vars>) Expander <Platform> Compilation Lux_Context (//init.Extensions <type_vars>) Lux_Return)) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/evaluation.lux b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/evaluation.lux index 2e80fdb66..0a6cd7660 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/evaluation.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/evaluation.lux @@ -26,7 +26,7 @@ ["[0]P" analysis] [// ["[0]" synthesis] - ["[0]" generation] + ["[0]" translation] [/// ["[0]" phase] [meta @@ -42,13 +42,13 @@ (def .public (evaluator analysis [synthesis_state synthesis] - [generation_state generation]) + [translation_state translation]) (All (_ anchor expression artifact) (-> //.Phase [synthesis.State (-> Lux synthesis.Phase)] - [(generation.State anchor expression artifact) - (-> Lux (generation.Phase anchor expression artifact))] + [(translation.State anchor expression artifact) + (-> Lux (translation.Phase anchor expression artifact))] Eval)) (function (eval archive type exprC) (do phase.monad @@ -62,18 +62,18 @@ [exprS (|> exprA (synthesis lux archive) (phase.result synthesis_state))]) - (phase.result generation_state) + (phase.result translation_state) (do phase.monad [@module (sharing [anchor expression artifact] - (is (-> Lux (generation.Phase anchor expression artifact)) - generation) - (is (generation.Operation anchor expression artifact module.ID) - (generation.module_id module archive))) + (is (-> Lux (translation.Phase anchor expression artifact)) + translation) + (is (translation.Operation anchor expression artifact module.ID) + (translation.module_id module archive))) .let [[evals _] (io.run! (atom.update! (dictionary.revised' @module 0 ++) ..evals)) @eval (maybe.else 0 (dictionary.value @module evals))] - exprO (<| (generation.with_registry_shift (|> @module - (i64.left_shifted 16) - (i64.or @eval) - (i64.left_shifted 32))) - (generation lux archive exprS))] - (generation.evaluate! [@module @eval] [{.#None} exprO])))))) + exprO (<| (translation.with_registry_shift (|> @module + (i64.left_shifted 16) + (i64.or @eval) + (i64.left_shifted 32))) + (translation lux archive exprS))] + (translation.evaluate! [@module @eval] [{.#None} exprO])))))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/declaration.lux b/stdlib/source/library/lux/meta/compiler/language/lux/declaration.lux index 5e3a91a34..43c7d23a4 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/declaration.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/declaration.lux @@ -11,7 +11,7 @@ [// ["[0]" analysis] ["[0]" synthesis] - ["[0]" generation] + ["[0]" translation] [phase ["[0]" extension]] [/// @@ -32,8 +32,8 @@ analysis.Phase) #synthesis (Component synthesis.State (-> Lux synthesis.Phase)) - #generation (Component (generation.State anchor expression declaration) - (-> Lux (generation.Phase anchor expression declaration)))])) + #translation (Component (translation.State anchor expression declaration) + (-> Lux (translation.Phase anchor expression declaration)))])) (type .public Import (Record @@ -79,7 +79,7 @@ [analysis ..#analysis analysis.Phase] [synthesis ..#synthesis (-> Lux synthesis.Phase)] - [generation ..#generation (-> Lux (generation.Phase anchor expression declaration))] + [translation ..#translation (-> Lux (translation.Phase anchor expression declaration))] ) (with_template [<name> <component> <operation>] @@ -92,7 +92,7 @@ [lifted_analysis ..#analysis analysis.Operation] [lifted_synthesis ..#synthesis synthesis.Operation] - [lifted_generation ..#generation (generation.Operation anchor expression declaration)] + [lifted_translation ..#translation (translation.Operation anchor expression declaration)] ) (def .public (set_current_module module) @@ -100,4 +100,4 @@ (-> Module (Operation anchor expression declaration Any))) (do phase.monad [_ (..lifted_analysis (analysis.set_current_module module))] - (..lifted_generation (generation.enter_module module)))) + (..lifted_translation (translation.enter_module module)))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/declaration.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/declaration.lux index ee14e65bc..0c6da0e7b 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/declaration.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/declaration.lux @@ -94,8 +94,8 @@ compiler_eval ((evaluation.evaluator analysis [(the [/.#synthesis /.#state] state) (the [/.#synthesis /.#phase] state)] - [(the [/.#generation /.#state] state) - (the [/.#generation /.#phase] state)]) + [(the [/.#translation /.#state] state) + (the [/.#translation /.#phase] state)]) archive) extension_eval (as Eval (wrapper (as_expected compiler_eval)))] _ (phase.with (has [/.#analysis /.#state .#eval] extension_eval state))] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux index 4e5b5d435..f6da727d8 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux @@ -63,13 +63,13 @@ ["[1][0]" lux (.only custom install)] ["/[1]" // (.only) ["/[1]" // - [generation + [translation [jvm ["[0]" runtime] ["[0]" function ["[1]" abstract]]]] ["/[1]" // - ["[0]" generation] + ["[0]" translation] ["[0]" declaration] ["[1][0]" analysis (.only Analysis Operation Phase Handler Bundle) ["[0]" complex] @@ -460,7 +460,7 @@ (list)}) (analyse archive arrayC)) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list arrayA)}])))])) (def array::length::object @@ -480,7 +480,7 @@ :write: (typeA.check (check.clean (list) :write:)) arrayJT (jvm_array_type (.type_literal (array.Array' :read: :write:))) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list (/////analysis.text @ (..signature arrayJT)) arrayA)}]))))])) @@ -495,7 +495,7 @@ _ (typeA.inference {.#Primitive (|> (jvm.array primitive_type) ..reflection) (list)}) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list lengthA)}])))])) (def array::new::object @@ -515,7 +515,7 @@ {.#None} (/////analysis.except ..non_array expectedT)) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list (/////analysis.text @ (..signature elementJT)) lengthA)}])))])) @@ -694,7 +694,7 @@ (list)}) (analyse archive arrayC)) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list idxA arrayA)}])))])) (def array::read::object @@ -716,7 +716,7 @@ :write: (typeA.check (check.clean (list) :write:)) arrayJT (jvm_array_type (.type_literal (array.Array' :read: :write:))) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list (/////analysis.text @ (..signature arrayJT)) idxA arrayA)}]))))])) @@ -737,7 +737,7 @@ arrayA (<| (typeA.expecting array_type) (analyse archive arrayC)) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list idxA valueA arrayA)}])))]))) @@ -763,7 +763,7 @@ :write: (typeA.check (check.clean (list) :write:)) arrayJT (jvm_array_type (.type_literal (array.Array' :read: :write:))) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list (/////analysis.text @ (..signature arrayJT)) idxA valueA @@ -822,7 +822,7 @@ [_ :object:] (check_object expectedT) _ (typeA.inference :object:) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list)}])))])) (def object::null? @@ -836,7 +836,7 @@ (analyse archive objectC)) _ (check_object objectT) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list objectA)}])))])) (def object::synchronized @@ -850,7 +850,7 @@ _ (check_object monitorT) exprA (analyse archive exprC) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list monitorA exprA)}])))])) (def (object::throw class_loader) @@ -869,7 +869,7 @@ (in []) (/////analysis.except non_throwable exception_class))) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list exceptionA)}])))])) (def (object::class class_loader) @@ -882,7 +882,7 @@ _ (typeA.inference {.#Primitive "java.lang.Class" (list {.#Primitive class (list)})}) _ (phase.lifted (reflection!.load class_loader class)) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list (/////analysis.text @ class))}])))])) (def (object::instance? class_loader) @@ -899,7 +899,7 @@ ? (phase.lifted (reflection!.sub? class_loader object_class sub_class)) @ meta.location] (if ? - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list (/////analysis.text @ sub_class) objectA)}]) (/////analysis.except cannot_possibly_be_an_instance (format sub_class " !<= " object_class)))))])) @@ -990,7 +990,7 @@ false))))))) @ meta.location] (if can_cast? - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list (/////analysis.text @ from_name) (/////analysis.text @ to_name) fromA)}]) @@ -1023,7 +1023,7 @@ fieldT (reflection_type luxT.fresh fieldJT) _ (typeA.inference fieldT) @ meta.location] - (in (<| [@] {/////analysis.#Extension [.prelude (%.format extension_name "|generation")]} + (in (<| [@] {/////analysis.#Extension [.prelude (%.format extension_name "|translation")]} (list (/////analysis.text @ class) (/////analysis.text @ field) (/////analysis.text @ (..signature fieldJT)))))))])) @@ -1048,7 +1048,7 @@ valueA (<| (typeA.expecting fieldT) (analyse archive valueC)) @ meta.location] - (in (<| [@] {/////analysis.#Extension [.prelude (%.format extension_name "|generation")]} + (in (<| [@] {/////analysis.#Extension [.prelude (%.format extension_name "|translation")]} (list (/////analysis.text @ class) (/////analysis.text @ field) (/////analysis.text @ (..signature fieldJT)) @@ -1074,7 +1074,7 @@ fieldT (reflection_type mapping fieldJT) _ (typeA.inference fieldT) @ meta.location] - (in (<| [@] {/////analysis.#Extension [.prelude (%.format extension_name "|generation")]} + (in (<| [@] {/////analysis.#Extension [.prelude (%.format extension_name "|translation")]} (list (/////analysis.text @ class) (/////analysis.text @ field) (/////analysis.text @ (..signature fieldJT)) @@ -1104,7 +1104,7 @@ valueA (<| (typeA.expecting fieldT) (analyse archive valueC)) @ meta.location] - (in (<| [@] {/////analysis.#Extension [.prelude (%.format extension_name "|generation")]} + (in (<| [@] {/////analysis.#Extension [.prelude (%.format extension_name "|translation")]} (list (/////analysis.text @ class) (/////analysis.text @ field) (/////analysis.text @ (..signature fieldJT)) @@ -1491,7 +1491,7 @@ [outputT argsA] (inference.general archive analyse methodT (list#each product.right argsTC)) outputJT (check_return outputT) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list.partial (/////analysis.text @ (..signature (jvm.class class (list)))) (/////analysis.text @ method) (/////analysis.text @ (..signature outputJT)) @@ -1517,7 +1517,7 @@ (undefined))] outputJT (check_return outputT) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list.partial (/////analysis.text @ (..signature (jvm.class class (list)))) (/////analysis.text @ method) (/////analysis.text @ (..signature outputJT)) @@ -1544,7 +1544,7 @@ (undefined))] outputJT (check_return outputT) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list.partial (/////analysis.text @ (..signature (jvm.class class (list)))) (/////analysis.text @ method) (/////analysis.text @ (..signature outputJT)) @@ -1574,7 +1574,7 @@ (undefined))] outputJT (check_return outputT) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list.partial (/////analysis.text @ (..signature (jvm.class class_name (list)))) (/////analysis.text @ method) (/////analysis.text @ (..signature outputJT)) @@ -1594,7 +1594,7 @@ (not deprecated?)) [outputT argsA] (inference.general archive analyse methodT (list#each product.right argsTC)) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list.partial (/////analysis.text @ (..signature (jvm.class class (list)))) (decorate_inputs @ argsT argsA))}])))])) @@ -2700,7 +2700,7 @@ _ (..require_complete_method_concretion class_loader supers methods) methodsA (monad.each ! (analyse_overriden_method analyse archive selfT mapping supers) methods) @ meta.location] - (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|generation")] + (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list (class_analysis @ super_class) (/////analysis.tuple @ (list#each (class_analysis @) super_interfaces)) (/////analysis.tuple @ (list#each (typed_analysis @) constructor_argsA+)) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux index becc2aad5..adfdc2e52 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux @@ -78,7 +78,7 @@ (analyse archive argC))) (list.zipped_2 inputsT+ args)) @ meta.location] - (in [@ {analysis.#Extension [.prelude (format extension_name "|generation")] argsA}])) + (in [@ {analysis.#Extension [.prelude (format extension_name "|translation")] argsA}])) (analysis.except ..incorrect_arity [num_expected num_actual])))))) (def .public (nullary valueT) @@ -153,7 +153,7 @@ (list (analysis.tuple @ (list#each (|>> (analysis.nat @)) cases)) branch)))) (list.partial input else) - {analysis.#Extension [.prelude (format extension_name "|generation")]} + {analysis.#Extension [.prelude (format extension_name "|translation")]} [@]))))]))) ... .is?# represents reference/pointer equality. @@ -180,7 +180,7 @@ (analyse archive) (typeA.expecting (type_literal (-> .Any :var:))) (at ! each (|>> list - {analysis.#Extension [.prelude (format extension_name "|generation")]} + {analysis.#Extension [.prelude (format extension_name "|translation")]} [@]))))))])) (def lux::in_module diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/jvm.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/jvm.lux index a51e62ed5..63c16cafa 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/jvm.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/jvm.lux @@ -66,7 +66,7 @@ ["[1]" artifact]]]] [language [lux - ["[0]" generation] + ["[0]" translation] ["[0]" declaration (.only Handler Bundle)] ["[0]" analysis (.only Analysis) ["[0]A" type] @@ -74,14 +74,14 @@ ["[0]" synthesis (.only Synthesis) ["<[1]>" \\parser]] [phase - [generation + [translation [jvm ["[0]" runtime (.only Anchor Definition Extender)] ["[0]" value]]] ["[0]" extension (.only) [analysis ["[0]" jvm]] - [generation + [translation [jvm ["[0]" host]]] [declaration @@ -454,19 +454,19 @@ (is [Register (Bytecode Any)] [offset (_#in [])])) product.right)) -(def (constructor_method_generation generate archive super_class method) - (-> (generation.Phase Anchor (Bytecode Any) Definition) Archive (Type Class) (jvm.Constructor Synthesis) (Operation (Resource Method))) +(def (constructor_method_translation translate archive super_class method) + (-> (translation.Phase Anchor (Bytecode Any) Definition) Archive (Type Class) (jvm.Constructor Synthesis) (Operation (Resource Method))) (<| (let [[privacy strict_floating_point? annotations method_tvars exceptions self arguments constructor_argumentsS bodyS] method bodyS (when (list.size arguments) 0 (host.without_fake_parameter bodyS) _ bodyS)]) - declaration.lifted_generation + declaration.lifted_translation (do [! phase.monad] - [constructor_argumentsG (monad.each ! (|>> product.right (generate archive)) + [constructor_argumentsG (monad.each ! (|>> product.right (translate archive)) constructor_argumentsS) - bodyG (generate archive bodyS) + bodyG (translate archive bodyS) .let [[super_name super_vars] (parser.read_class super_class) super_constructorT (type.method [(list) (list#each product.left constructor_argumentsS) @@ -528,17 +528,17 @@ ... (at type.equivalence = type.double returnT) (unwrap_primitive _.dreturn type.double))))))) -(def (overriden_method_generation generate archive method) - (-> (generation.Phase Anchor (Bytecode Any) Definition) Archive (jvm.Overriden_Method Synthesis) (Operation (Resource Method))) +(def (overriden_method_translation translate archive method) + (-> (translation.Phase Anchor (Bytecode Any) Definition) Archive (jvm.Overriden_Method Synthesis) (Operation (Resource Method))) (<| (let [[super method_name strict_floating_point? annotations method_tvars self arguments returnJ exceptionsJ bodyS] method bodyS (when (list.size arguments) 0 (host.without_fake_parameter bodyS) _ bodyS)]) - declaration.lifted_generation + declaration.lifted_translation (do [! phase.monad] - [bodyG (generate archive bodyS) + [bodyG (translate archive bodyS) .let [argumentsT (list#each product.right arguments)]] (in (method.method (all modifier#composite method.public @@ -553,17 +553,17 @@ bodyG (method_return returnJ))}))))) -(def (virtual_method_generation generate archive method) - (-> (generation.Phase Anchor (Bytecode Any) Definition) Archive (jvm.Virtual_Method Synthesis) (Operation (Resource Method))) +(def (virtual_method_translation translate archive method) + (-> (translation.Phase Anchor (Bytecode Any) Definition) Archive (jvm.Virtual_Method Synthesis) (Operation (Resource Method))) (<| (let [[method_name privacy final? strict_floating_point? annotations method_tvars self arguments returnJ exceptionsJ bodyS] method bodyS (when (list.size arguments) 0 (host.without_fake_parameter bodyS) _ bodyS)]) - declaration.lifted_generation + declaration.lifted_translation (do [! phase.monad] - [bodyG (generate archive bodyS) + [bodyG (translate archive bodyS) .let [argumentsT (list#each product.right arguments)]] (in (method.method (all modifier#composite (..method_privacy privacy) @@ -581,14 +581,14 @@ bodyG (method_return returnJ))}))))) -(def (static_method_generation generate archive method) - (-> (generation.Phase Anchor (Bytecode Any) Definition) Archive (jvm.Static_Method Synthesis) (Operation (Resource Method))) +(def (static_method_translation translate archive method) + (-> (translation.Phase Anchor (Bytecode Any) Definition) Archive (jvm.Static_Method Synthesis) (Operation (Resource Method))) (<| (let [[method_name privacy strict_floating_point? annotations method_tvars arguments returnJ exceptionsJ bodyS] method]) - declaration.lifted_generation + declaration.lifted_translation (do [! phase.monad] - [bodyG (generate archive bodyS) + [bodyG (translate archive bodyS) .let [argumentsT (list#each product.right arguments)]] (in (method.method (all modifier#composite (..method_privacy privacy) @@ -604,7 +604,7 @@ bodyG (method_return returnJ))}))))) -(def (abstract_method_generation method) +(def (abstract_method_translation method) (-> (jvm.Abstract_Method Synthesis) (Resource Method)) (let [[name privacy annotations variables arguments return exceptions] method] @@ -616,32 +616,32 @@ (list) {.#None}))) -(def (method_generation generate archive super_class method) - (-> (generation.Phase Anchor (Bytecode Any) Definition) Archive (Type Class) (Method_Definition Synthesis) (Operation (Resource Method))) +(def (method_translation translate archive super_class method) + (-> (translation.Phase Anchor (Bytecode Any) Definition) Archive (Type Class) (Method_Definition Synthesis) (Operation (Resource Method))) (when method {#Constructor method} - (..constructor_method_generation generate archive super_class method) + (..constructor_method_translation translate archive super_class method) {#Overriden_Method method} - (..overriden_method_generation generate archive method) + (..overriden_method_translation translate archive method) {#Virtual_Method method} - (..virtual_method_generation generate archive method) + (..virtual_method_translation translate archive method) {#Static_Method method} - (..static_method_generation generate archive method) + (..static_method_translation translate archive method) {#Abstract_Method method} - (at phase.monad in (..abstract_method_generation method)))) + (at phase.monad in (..abstract_method_translation method)))) -(def (method_definition archive super interfaces [mapping selfT] [analyse synthesize generate]) +(def (method_definition archive super interfaces [mapping selfT] [analyse synthesize translate]) (-> Archive (Type Class) (List (Type Class)) [Mapping .Type] [analysis.Phase synthesis.Phase - (generation.Phase Anchor (Bytecode Any) Definition)] + (translation.Phase Anchor (Bytecode Any) Definition)] (-> (Method_Definition Code) (Operation [(Set unit.ID) (Resource Method)]))) (function (_ methodC) (do phase.monad @@ -665,13 +665,13 @@ methodS (is (Operation Synthesis) (declaration.lifted_synthesis (synthesize archive methodA))) - dependencies (declaration.lifted_generation + dependencies (declaration.lifted_translation (cache.dependencies archive methodS)) methodS' (|> methodS list (<synthesis>.result ..method_synthesis) phase.lifted) - methodG (method_generation generate archive super methodS')] + methodG (method_translation translate archive super methodS')] (in [dependencies methodG])))) (def class_name @@ -843,13 +843,13 @@ (def (save_class! name bytecode dependencies) (-> Text Binary (Set unit.ID) (Operation Any)) - (declaration.lifted_generation + (declaration.lifted_translation (do [! phase.monad] [.let [artifact [name bytecode]] - artifact_id (generation.learn_custom name dependencies) - _ (generation.execute! artifact) - _ (generation.save! artifact_id {.#Some name} artifact) - _ (generation.log! (format "JVM Class " name))] + artifact_id (translation.learn_custom name dependencies) + _ (translation.execute! artifact) + _ (translation.save! artifact_id {.#Some name} artifact) + _ (translation.log! (format "JVM Class " name))] (in [])))) (def jvm::class @@ -885,8 +885,8 @@ fields methods)) ... Necessary for reflection to work properly during analysis. - _ (declaration.lifted_generation - (generation.execute! mock)) + _ (declaration.lifted_translation + (translation.execute! mock)) parameters (declaration.lifted_analysis (typeA.check (jvm.parameter_types parameters))) .let [mapping (list#mix (function (_ [parameterJ parameterT] mapping) @@ -899,7 +899,7 @@ (..method_definition archive super interfaces [mapping selfT] [(the [declaration.#analysis declaration.#phase] state) ((the [declaration.#synthesis declaration.#phase] state) analysis_state) - ((the [declaration.#generation declaration.#phase] state) analysis_state)])) + ((the [declaration.#translation declaration.#phase] state) analysis_state)])) methods) .let [all_dependencies (cache.all (list#each product.left methods))] bytecode (<| (at ! each (\\format.result class.format)) @@ -939,7 +939,7 @@ (<code>.tuple (<>.some ..annotation)) (<>.some jvm.method_declaration)) (function (_ phase archive [[name parameters] supers annotations method_declarations]) - (declaration.lifted_generation + (declaration.lifted_translation (do [! phase.monad] [bytecode (<| (at ! each (\\format.result class.format)) phase.lifted @@ -957,11 +957,11 @@ (list) (list#each ..method_declaration method_declarations) (list))) - artifact_id (generation.learn_custom name unit.none) + artifact_id (translation.learn_custom name unit.none) .let [artifact [name bytecode]] - _ (generation.execute! artifact) - _ (generation.save! artifact_id {.#Some name} artifact) - _ (generation.log! (format "JVM Interface " (%.text name)))] + _ (translation.execute! artifact) + _ (translation.save! artifact_id {.#Some name} artifact) + _ (translation.log! (format "JVM Interface " (%.text name)))] (in declaration.no_requirements))))])) (import java/lang/ClassLoader diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/lux.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/lux.lux index efc224a6d..f9df8a9c7 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/lux.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/lux.lux @@ -41,7 +41,7 @@ ["[0]A" module] ["[0]" scope]] ["[1][0]" synthesis (.only Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["[1][0]" declaration (.only Import Requirements Phase Operation Handler Extender Bundle)] [phase [extension @@ -81,20 +81,20 @@ [@module (n.- (++ @artifact) 0)]) ... TODO: Inline "evaluate!'" into "evaluate!" ASAP -(def (evaluate!' archive generation code//type codeS) +(def (evaluate!' archive translation code//type codeS) (All (_ anchor expression declaration) (-> Archive - (/////generation.Phase anchor expression declaration) + (/////translation.Phase anchor expression declaration) Type Synthesis (Operation anchor expression declaration [Type expression Any]))) - (/////declaration.lifted_generation + (/////declaration.lifted_translation (do phase.monad - [module /////generation.module - id /////generation.next - codeG (generation archive codeS) - @module (/////generation.module_id module archive) - codeV (/////generation.evaluate! (..context [@module id]) [{.#None} codeG])] + [module /////translation.module + id /////translation.next + codeG (translation archive codeS) + @module (/////translation.module_id module archive) + codeV (/////translation.evaluate! (..context [@module id]) [{.#None} codeG])] (in [code//type codeG codeV])))) (def .public (evaluate! archive type codeC) @@ -105,7 +105,7 @@ .let [analysis_state (the [/////declaration.#analysis /////declaration.#state] state) analysis (the [/////declaration.#analysis /////declaration.#phase] state) synthesis ((the [/////declaration.#synthesis /////declaration.#phase] state) analysis_state) - generation ((the [/////declaration.#generation /////declaration.#phase] state) analysis_state)] + translation ((the [/////declaration.#translation /////declaration.#phase] state) analysis_state)] [_ codeA] (<| /////declaration.lifted_analysis scope.with typeA.fresh @@ -113,22 +113,22 @@ (analysis archive codeC)) codeS (/////declaration.lifted_synthesis (synthesis archive codeA))] - (evaluate!' archive generation type codeS))) + (evaluate!' archive translation type codeS))) ... TODO: Inline "definition'" into "definition" ASAP -(def (definition' archive generation [module name] code//type codeS) +(def (definition' archive translation [module name] code//type codeS) (All (_ anchor expression declaration) (-> Archive - (/////generation.Phase anchor expression declaration) + (/////translation.Phase anchor expression declaration) Symbol Type Synthesis (Operation anchor expression declaration [Type expression Any]))) - (/////declaration.lifted_generation + (/////declaration.lifted_translation (do phase.monad [dependencies (cache/artifact.dependencies archive codeS) - [interim_artifacts codeG] (/////generation.with_interim_artifacts archive - (generation archive codeS)) + [interim_artifacts codeG] (/////translation.with_interim_artifacts archive + (translation archive codeS)) .let [@abstraction (when codeS (/////synthesis.function/abstraction @ [env arity body]) (|> interim_artifacts @@ -138,9 +138,9 @@ _ {.#None})] @module (phase.lifted (archive.id module archive)) - @self (/////generation.learn [name @abstraction] false (list#mix set.has dependencies interim_artifacts)) - [target_name value declaration] (/////generation.define! [@module @self] {.#None} [(maybe#each product.right @abstraction) codeG]) - _ (/////generation.save! @self {.#None} declaration)] + @self (/////translation.learn [name @abstraction] false (list#mix set.has dependencies interim_artifacts)) + [target_name value declaration] (/////translation.define! [@module @self] {.#None} [(maybe#each product.right @abstraction) codeG]) + _ (/////translation.save! @self {.#None} declaration)] (in [code//type codeG value])))) (def (definition archive name expected codeC) @@ -152,7 +152,7 @@ .let [analysis_state (the [/////declaration.#analysis /////declaration.#state] state) analysis (the [/////declaration.#analysis /////declaration.#phase] state) synthesis ((the [/////declaration.#synthesis /////declaration.#phase] state) analysis_state) - generation ((the [/////declaration.#generation /////declaration.#phase] state) analysis_state)] + translation ((the [/////declaration.#translation /////declaration.#phase] state) analysis_state)] [_ code//type codeA] (/////declaration.lifted_analysis (scope.with (typeA.fresh @@ -171,29 +171,29 @@ (in [expected codeA])))))) codeS (/////declaration.lifted_synthesis (synthesis archive codeA))] - (definition' archive generation name code//type codeS))) + (definition' archive translation name code//type codeS))) (with_template [<full> <partial> <learn>] [... TODO: Inline "<partial>" into "<full>" ASAP - (def (<partial> archive generation extension codeT codeS) + (def (<partial> archive translation extension codeT codeS) (All (_ anchor expression declaration) (-> Archive - (/////generation.Phase anchor expression declaration) + (/////translation.Phase anchor expression declaration) Text Type Synthesis (Operation anchor expression declaration [expression Any]))) (do phase.monad [current_module (/////declaration.lifted_analysis meta.current_module_name)] - (/////declaration.lifted_generation + (/////declaration.lifted_translation (do phase.monad [dependencies (cache/artifact.dependencies archive codeS) - [interim_artifacts codeG] (/////generation.with_interim_artifacts archive - (generation archive codeS)) + [interim_artifacts codeG] (/////translation.with_interim_artifacts archive + (translation archive codeS)) @module (phase.lifted (archive.id current_module archive)) @self (<learn> extension (list#mix set.has dependencies interim_artifacts)) - [target_name value declaration] (/////generation.define! [@module @self] {.#None} [{.#None} codeG]) - _ (/////generation.save! @self {.#None} declaration)] + [target_name value declaration] (/////translation.define! [@module @self] {.#None} [{.#None} codeG]) + _ (/////translation.save! @self {.#None} declaration)] (in [codeG value]))))) (def .public (<full> archive extension codeT codeC) @@ -205,7 +205,7 @@ .let [analysis_state (the [/////declaration.#analysis /////declaration.#state] state) analysis (the [/////declaration.#analysis /////declaration.#phase] state) synthesis ((the [/////declaration.#synthesis /////declaration.#phase] state) analysis_state) - generation ((the [/////declaration.#generation /////declaration.#phase] state) analysis_state)] + translation ((the [/////declaration.#translation /////declaration.#phase] state) analysis_state)] [_ codeA] (<| /////declaration.lifted_analysis scope.with typeA.fresh @@ -213,12 +213,12 @@ (analysis archive codeC)) codeS (/////declaration.lifted_synthesis (synthesis archive codeA))] - (<partial> archive generation extension codeT codeS)))] + (<partial> archive translation extension codeT codeS)))] - [analyser analyser' /////generation.learn_analyser] - [synthesizer synthesizer' /////generation.learn_synthesizer] - [generator generator' /////generation.learn_generator] - [declaration declaration' /////generation.learn_declaration] + [analyser analyser' /////translation.learn_analyser] + [synthesizer synthesizer' /////translation.learn_synthesizer] + [translator translator' /////translation.learn_translator] + [declaration declaration' /////translation.learn_declaration] ) ... TODO: Get rid of this function ASAP. @@ -230,8 +230,8 @@ .let [eval (analysis/evaluation.evaluator (the [/////declaration.#analysis /////declaration.#phase] state) [(the [/////declaration.#synthesis /////declaration.#state] state) (the [/////declaration.#synthesis /////declaration.#phase] state)] - [(the [/////declaration.#generation /////declaration.#state] state) - (the [/////declaration.#generation /////declaration.#phase] state)])] + [(the [/////declaration.#translation /////declaration.#state] state) + (the [/////declaration.#translation /////declaration.#phase] state)])] _ (/////declaration.lifted_analysis (do ! [_ (moduleA.override_definition [.prelude "is#"] [true {.#Default [.Analysis (analysisE.is#_extension eval "is#")]}]) @@ -242,8 +242,8 @@ (def (announce_definition! short type) (All (_ anchor expression declaration) (-> Text Type (Operation anchor expression declaration Any))) - (/////declaration.lifted_generation - (/////generation.log! (format short " : " (%.type type))))) + (/////declaration.lifted_translation + (/////translation.log! (format short " : " (%.type type))))) (def lux::def Handler diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/synthesis/lux.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/synthesis/lux.lux index 64c98bdfa..5a57a54bd 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/synthesis/lux.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/synthesis/lux.lux @@ -21,9 +21,9 @@ (-> Text Text) (|>> (text.suffix "|synthesis"))) -(def generation +(def translation (-> Text Text) - (text.replaced (synthesis "") "|generation")) + (text.replaced (synthesis "") "|translation")) (def .public (install name anonymous) (-> Text (-> Text Handler) @@ -46,11 +46,11 @@ (def (text::composite self) (-> Text Handler) - (let [generation [.prelude (generation self)]] + (let [translation [.prelude (translation self)]] (function (_ synthesis archive parts) (do [! phase.monad] [parts (monad.each ! (synthesis archive) parts)] - (in [location.dummy {synthesis.#Extension generation (flat_text_composite generation parts)}]))))) + (in [location.dummy {synthesis.#Extension translation (flat_text_composite translation parts)}]))))) (def .public bundle Bundle diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/common_lisp.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/common_lisp.lux index 94afa28d6..9dea25a19 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/common_lisp.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/common_lisp.lux @@ -8,7 +8,7 @@ ["[1][0]" common] ["[1][0]" host] [//// - [generation + [translation [common_lisp [runtime (.only Bundle)]]]]]) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/common_lisp/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/common_lisp/common.lux index 06008de15..4a0f897c3 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/common_lisp/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/common_lisp/common.lux @@ -25,15 +25,15 @@ ["/" bundle] ["/[1]" // ["[0]" extension] - [generation + [translation [extension (.only Nullary Unary Binary Trinary nullary unary binary trinary)] ["[0]" reference] ["//" common_lisp - ["[1][0]" runtime (.only Operation Phase Handler Bundle Generator)] + ["[1][0]" runtime (.only Operation Phase Handler Bundle Translator)] ["[1][0]" when]]] [// - ["[0]" generation] + ["[0]" translation] ["[0]" synthesis (.only %synthesis) ["<s>" \\parser (.only Parser)]] [/// @@ -53,7 +53,7 @@ ... <s>.any)))) ... (function (_ extension_name phase archive [input else conditionals]) ... (do [! /////.monad] -... [@input (at ! each _.var (generation.symbol "input")) +... [@input (at ! each _.var (translation.symbol "input")) ... inputG (phase archive input) ... elseG (phase archive else) ... conditionalsG (is (Operation (List [Expression Expression])) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/common_lisp/host.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/common_lisp/host.lux index 987668fa2..583461e36 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/common_lisp/host.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/common_lisp/host.lux @@ -4,7 +4,7 @@ [//// ["/" bundle] [// - [generation + [translation [common_lisp [runtime (.only Bundle)]]]]]) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/js.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/js.lux index 9dde05bab..8ae7a6a74 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/js.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/js.lux @@ -8,7 +8,7 @@ ["[1][0]" common] ["[1][0]" host] [//// - [generation + [translation [js [runtime (.only Bundle)]]]]]) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/js/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/js/common.lux index 7f7f3be33..d8f690b45 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/js/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/js/common.lux @@ -23,11 +23,11 @@ ["/" bundle] ["/[1]" // ["[0]" extension] - [generation + [translation [extension (.only Nullary Unary Binary Trinary nullary unary binary trinary)] ["//" js - ["[1][0]" runtime (.only Operation Phase Phase! Handler Bundle Generator)] + ["[1][0]" runtime (.only Operation Phase Phase! Handler Bundle Translator)] ["[1][0]" primitive] ["[1][0]" structure] ["[1][0]" reference] @@ -90,7 +90,7 @@ Phase! (when synthesis ... TODO: Get rid of this ASAP - {synthesis.#Extension [.prelude "when_char#|generation"] parameters} + {synthesis.#Extension [.prelude "when_char#|translation"] parameters} (do /////.monad [body (expression archive synthesis)] (in (as Statement body))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/js/host.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/js/host.lux index 2f7766332..dc17f8960 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/js/host.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/js/host.lux @@ -19,14 +19,14 @@ ["/" bundle] ["/[1]" // ["[0]" extension] - [generation + [translation [extension (.only Nullary Unary Binary Trinary nullary unary binary trinary)] ["//" js ["[1][0]" runtime (.only Operation Phase Handler Bundle with_vars)]]] ["/[1]" // - ["[0]" generation] + ["[0]" translation] [synthesis ["<s>" \\parser (.only Parser)]] ["//[1]" /// @@ -135,7 +135,7 @@ (do [! ////////phase.monad] [abstractionG (phase archive abstractionS) .let [variable (is (-> Text (Operation Var)) - (|>> generation.symbol + (|>> translation.symbol (at ! each _.var)))] g!inputs (monad.each ! (function (_ _) (variable "input")) (list.repeated (.nat arity) [])) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/jvm.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/jvm.lux index 6bed843bd..26f6cba97 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/jvm.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/jvm.lux @@ -8,7 +8,7 @@ ["[1][0]" common] ["[1][0]" host] [//// - [generation + [translation [jvm [runtime (.only Bundle)]]]]]) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/jvm/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/jvm/common.lux index 4d8a17afa..034560910 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/jvm/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/jvm/common.lux @@ -27,7 +27,7 @@ [category (.only Primitive Class)]]]]]]] ["[0]" ///// ["[0]" extension] - [generation + [translation [extension (.only Nullary Unary Binary Trinary Variadic nullary unary binary trinary variadic)] ["///" jvm @@ -154,9 +154,9 @@ (def with_basic_extensions (-> Bundle Bundle) - (|>> (dictionary.has "when_char#|generation" ..lux::syntax_char_case!) - (dictionary.has "is?#|generation" (binary ..lux::is)) - (dictionary.has "try#|generation" (unary ..lux::try)))) + (|>> (dictionary.has "when_char#|translation" ..lux::syntax_char_case!) + (dictionary.has "is?#|translation" (binary ..lux::is)) + (dictionary.has "try#|translation" (unary ..lux::try)))) (with_template [<name> <op>] [(def (<name> [maskG inputG]) @@ -264,38 +264,38 @@ (def with_i64_extensions (-> Bundle Bundle) - (|>> (dictionary.has "i64_and#|generation" (binary ..i64::and)) - (dictionary.has "i64_or#|generation" (binary ..i64::or)) - (dictionary.has "i64_xor#|generation" (binary ..i64::xor)) - (dictionary.has "i64_left#|generation" (binary ..i64::left_shifted)) - (dictionary.has "i64_right#|generation" (binary ..i64::right_shifted)) + (|>> (dictionary.has "i64_and#|translation" (binary ..i64::and)) + (dictionary.has "i64_or#|translation" (binary ..i64::or)) + (dictionary.has "i64_xor#|translation" (binary ..i64::xor)) + (dictionary.has "i64_left#|translation" (binary ..i64::left_shifted)) + (dictionary.has "i64_right#|translation" (binary ..i64::right_shifted)) - (dictionary.has "i64_=#|generation" (binary ..i64::=)) - (dictionary.has "i64_+#|generation" (binary ..i64::+)) - (dictionary.has "i64_-#|generation" (binary ..i64::-)))) + (dictionary.has "i64_=#|translation" (binary ..i64::=)) + (dictionary.has "i64_+#|translation" (binary ..i64::+)) + (dictionary.has "i64_-#|translation" (binary ..i64::-)))) (def with_int_extensions (-> Bundle Bundle) - (|>> (dictionary.has "int_<#|generation" (binary ..i64::<)) - (dictionary.has "int_*#|generation" (binary ..i64::*)) - (dictionary.has "int_/#|generation" (binary ..i64::/)) - (dictionary.has "int_%#|generation" (binary ..i64::%)) + (|>> (dictionary.has "int_<#|translation" (binary ..i64::<)) + (dictionary.has "int_*#|translation" (binary ..i64::*)) + (dictionary.has "int_/#|translation" (binary ..i64::/)) + (dictionary.has "int_%#|translation" (binary ..i64::%)) - (dictionary.has "int_f64#|generation" (unary ..i64::f64)) - (dictionary.has "int_char#|generation" (unary ..i64::char)))) + (dictionary.has "int_f64#|translation" (unary ..i64::f64)) + (dictionary.has "int_char#|translation" (unary ..i64::char)))) (def with_frac_extensions (-> Bundle Bundle) - (|>> (dictionary.has "f64_+#|generation" (binary ..f64::+)) - (dictionary.has "f64_-#|generation" (binary ..f64::-)) - (dictionary.has "f64_*#|generation" (binary ..f64::*)) - (dictionary.has "f64_/#|generation" (binary ..f64::/)) - (dictionary.has "f64_%#|generation" (binary ..f64::%)) - (dictionary.has "f64_=#|generation" (binary ..f64::=)) - (dictionary.has "f64_<#|generation" (binary ..f64::<)) - (dictionary.has "f64_int#|generation" (unary ..f64::i64)) - (dictionary.has "f64_encoded#|generation" (unary ..f64::encode)) - (dictionary.has "f64_decoded#|generation" (unary ..f64::decode)))) + (|>> (dictionary.has "f64_+#|translation" (binary ..f64::+)) + (dictionary.has "f64_-#|translation" (binary ..f64::-)) + (dictionary.has "f64_*#|translation" (binary ..f64::*)) + (dictionary.has "f64_/#|translation" (binary ..f64::/)) + (dictionary.has "f64_%#|translation" (binary ..f64::%)) + (dictionary.has "f64_=#|translation" (binary ..f64::=)) + (dictionary.has "f64_<#|translation" (binary ..f64::<)) + (dictionary.has "f64_int#|translation" (unary ..f64::i64)) + (dictionary.has "f64_encoded#|translation" (unary ..f64::encode)) + (dictionary.has "f64_decoded#|translation" (unary ..f64::decode)))) (def $String::length (_.invokevirtual ..$String "length" (type.method [(list) (list) type.int (list)]))) @@ -424,13 +424,13 @@ (def with_text_extensions (-> Bundle Bundle) - (|>> (dictionary.has "text_=#|generation" (binary ..text::=)) - (dictionary.has "text_<#|generation" (binary ..text::<)) - (dictionary.has "text_composite#|generation" (variadic ..text::composite)) - (dictionary.has "text_index#|generation" (trinary ..text::index)) - (dictionary.has "text_size#|generation" (unary ..text::size)) - (dictionary.has "text_char#|generation" (binary ..text::char)) - (dictionary.has "text_clip#|generation" (trinary ..text::clip)))) + (|>> (dictionary.has "text_=#|translation" (binary ..text::=)) + (dictionary.has "text_<#|translation" (binary ..text::<)) + (dictionary.has "text_composite#|translation" (variadic ..text::composite)) + (dictionary.has "text_index#|translation" (trinary ..text::index)) + (dictionary.has "text_size#|translation" (unary ..text::size)) + (dictionary.has "text_char#|translation" (binary ..text::char)) + (dictionary.has "text_clip#|translation" (trinary ..text::clip)))) (def string_method (type.method [(list) (list ..$String) type.void (list)])) (def (io::log messageG) @@ -454,8 +454,8 @@ (def with_io_extensions (-> Bundle Bundle) - (|>> (dictionary.has "log!#|generation" (unary ..io::log)) - (dictionary.has "error#|generation" (unary ..io::error)))) + (|>> (dictionary.has "log!#|translation" (unary ..io::log)) + (dictionary.has "error#|translation" (unary ..io::error)))) (def .public bundle Bundle diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/jvm/host.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/jvm/host.lux index 853c0c0ae..c2eafe2a2 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/jvm/host.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/jvm/host.lux @@ -49,7 +49,7 @@ ["[0]" // [common (.only custom)] ["///[1]" //// - [generation + [translation [extension (.only Nullary Unary Binary Trinary Variadic nullary unary binary trinary variadic)] ["///" jvm (.only) @@ -64,7 +64,7 @@ [analysis ["/" jvm]]] ["/[1]" // - ["[1][0]" generation] + ["[1][0]" translation] ["[0]" synthesis (.only Synthesis Path %synthesis) ["<[1]>" \\parser (.only Parser)]] [analysis (.only Environment) @@ -136,36 +136,36 @@ (def with_conversion_extensions (-> Bundle Bundle) - (|>> (dictionary.has (%.format "jvm_" "conversion_" "double_to_float" "#" "|generation") (unary conversion::double_to_float)) - (dictionary.has (%.format "jvm_" "conversion_" "double_to_int" "#" "|generation") (unary conversion::double_to_int)) - (dictionary.has (%.format "jvm_" "conversion_" "double_to_long" "#" "|generation") (unary conversion::double_to_long)) + (|>> (dictionary.has (%.format "jvm_" "conversion_" "double_to_float" "#" "|translation") (unary conversion::double_to_float)) + (dictionary.has (%.format "jvm_" "conversion_" "double_to_int" "#" "|translation") (unary conversion::double_to_int)) + (dictionary.has (%.format "jvm_" "conversion_" "double_to_long" "#" "|translation") (unary conversion::double_to_long)) - (dictionary.has (%.format "jvm_" "conversion_" "float_to_double" "#" "|generation") (unary conversion::float_to_double)) - (dictionary.has (%.format "jvm_" "conversion_" "float_to_int" "#" "|generation") (unary conversion::float_to_int)) - (dictionary.has (%.format "jvm_" "conversion_" "float_to_long" "#" "|generation") (unary conversion::float_to_long)) + (dictionary.has (%.format "jvm_" "conversion_" "float_to_double" "#" "|translation") (unary conversion::float_to_double)) + (dictionary.has (%.format "jvm_" "conversion_" "float_to_int" "#" "|translation") (unary conversion::float_to_int)) + (dictionary.has (%.format "jvm_" "conversion_" "float_to_long" "#" "|translation") (unary conversion::float_to_long)) - (dictionary.has (%.format "jvm_" "conversion_" "int_to_byte" "#" "|generation") (unary conversion::int_to_byte)) - (dictionary.has (%.format "jvm_" "conversion_" "int_to_char" "#" "|generation") (unary conversion::int_to_char)) - (dictionary.has (%.format "jvm_" "conversion_" "int_to_double" "#" "|generation") (unary conversion::int_to_double)) - (dictionary.has (%.format "jvm_" "conversion_" "int_to_float" "#" "|generation") (unary conversion::int_to_float)) - (dictionary.has (%.format "jvm_" "conversion_" "int_to_long" "#" "|generation") (unary conversion::int_to_long)) - (dictionary.has (%.format "jvm_" "conversion_" "int_to_short" "#" "|generation") (unary conversion::int_to_short)) + (dictionary.has (%.format "jvm_" "conversion_" "int_to_byte" "#" "|translation") (unary conversion::int_to_byte)) + (dictionary.has (%.format "jvm_" "conversion_" "int_to_char" "#" "|translation") (unary conversion::int_to_char)) + (dictionary.has (%.format "jvm_" "conversion_" "int_to_double" "#" "|translation") (unary conversion::int_to_double)) + (dictionary.has (%.format "jvm_" "conversion_" "int_to_float" "#" "|translation") (unary conversion::int_to_float)) + (dictionary.has (%.format "jvm_" "conversion_" "int_to_long" "#" "|translation") (unary conversion::int_to_long)) + (dictionary.has (%.format "jvm_" "conversion_" "int_to_short" "#" "|translation") (unary conversion::int_to_short)) - (dictionary.has (%.format "jvm_" "conversion_" "long_to_double" "#" "|generation") (unary conversion::long_to_double)) - (dictionary.has (%.format "jvm_" "conversion_" "long_to_float" "#" "|generation") (unary conversion::long_to_float)) - (dictionary.has (%.format "jvm_" "conversion_" "long_to_int" "#" "|generation") (unary conversion::long_to_int)) - (dictionary.has (%.format "jvm_" "conversion_" "long_to_short" "#" "|generation") (unary conversion::long_to_short)) - (dictionary.has (%.format "jvm_" "conversion_" "long_to_byte" "#" "|generation") (unary conversion::long_to_byte)) - (dictionary.has (%.format "jvm_" "conversion_" "long_to_char" "#" "|generation") (unary conversion::long_to_char)) + (dictionary.has (%.format "jvm_" "conversion_" "long_to_double" "#" "|translation") (unary conversion::long_to_double)) + (dictionary.has (%.format "jvm_" "conversion_" "long_to_float" "#" "|translation") (unary conversion::long_to_float)) + (dictionary.has (%.format "jvm_" "conversion_" "long_to_int" "#" "|translation") (unary conversion::long_to_int)) + (dictionary.has (%.format "jvm_" "conversion_" "long_to_short" "#" "|translation") (unary conversion::long_to_short)) + (dictionary.has (%.format "jvm_" "conversion_" "long_to_byte" "#" "|translation") (unary conversion::long_to_byte)) + (dictionary.has (%.format "jvm_" "conversion_" "long_to_char" "#" "|translation") (unary conversion::long_to_char)) - (dictionary.has (%.format "jvm_" "conversion_" "char_to_byte" "#" "|generation") (unary conversion::char_to_byte)) - (dictionary.has (%.format "jvm_" "conversion_" "char_to_short" "#" "|generation") (unary conversion::char_to_short)) - (dictionary.has (%.format "jvm_" "conversion_" "char_to_int" "#" "|generation") (unary conversion::char_to_int)) - (dictionary.has (%.format "jvm_" "conversion_" "char_to_long" "#" "|generation") (unary conversion::char_to_long)) + (dictionary.has (%.format "jvm_" "conversion_" "char_to_byte" "#" "|translation") (unary conversion::char_to_byte)) + (dictionary.has (%.format "jvm_" "conversion_" "char_to_short" "#" "|translation") (unary conversion::char_to_short)) + (dictionary.has (%.format "jvm_" "conversion_" "char_to_int" "#" "|translation") (unary conversion::char_to_int)) + (dictionary.has (%.format "jvm_" "conversion_" "char_to_long" "#" "|translation") (unary conversion::char_to_long)) - (dictionary.has (%.format "jvm_" "conversion_" "byte_to_long" "#" "|generation") (unary conversion::byte_to_long)) + (dictionary.has (%.format "jvm_" "conversion_" "byte_to_long" "#" "|translation") (unary conversion::byte_to_long)) - (dictionary.has (%.format "jvm_" "conversion_" "short_to_long" "#" "|generation") (unary conversion::short_to_long)) + (dictionary.has (%.format "jvm_" "conversion_" "short_to_long" "#" "|translation") (unary conversion::short_to_long)) )) (with_template [<name> <op>] @@ -271,68 +271,68 @@ (def with_int_extensions (-> Bundle Bundle) (let [type (reflection.reflection reflection.int)] - (|>> (dictionary.has (%.format "jvm_" type "_" "+" "#" "|generation") (binary int::+)) - (dictionary.has (%.format "jvm_" type "_" "-" "#" "|generation") (binary int::-)) - (dictionary.has (%.format "jvm_" type "_" "*" "#" "|generation") (binary int::*)) - (dictionary.has (%.format "jvm_" type "_" "/" "#" "|generation") (binary int::/)) - (dictionary.has (%.format "jvm_" type "_" "%" "#" "|generation") (binary int::%)) - (dictionary.has (%.format "jvm_" type "_" "=" "#" "|generation") (binary int::=)) - (dictionary.has (%.format "jvm_" type "_" "<" "#" "|generation") (binary int::<)) - (dictionary.has (%.format "jvm_" type "_" "and" "#" "|generation") (binary int::and)) - (dictionary.has (%.format "jvm_" type "_" "or" "#" "|generation") (binary int::or)) - (dictionary.has (%.format "jvm_" type "_" "xor" "#" "|generation") (binary int::xor)) - (dictionary.has (%.format "jvm_" type "_" "shl" "#" "|generation") (binary int::shl)) - (dictionary.has (%.format "jvm_" type "_" "shr" "#" "|generation") (binary int::shr)) - (dictionary.has (%.format "jvm_" type "_" "ushr" "#" "|generation") (binary int::ushr)) + (|>> (dictionary.has (%.format "jvm_" type "_" "+" "#" "|translation") (binary int::+)) + (dictionary.has (%.format "jvm_" type "_" "-" "#" "|translation") (binary int::-)) + (dictionary.has (%.format "jvm_" type "_" "*" "#" "|translation") (binary int::*)) + (dictionary.has (%.format "jvm_" type "_" "/" "#" "|translation") (binary int::/)) + (dictionary.has (%.format "jvm_" type "_" "%" "#" "|translation") (binary int::%)) + (dictionary.has (%.format "jvm_" type "_" "=" "#" "|translation") (binary int::=)) + (dictionary.has (%.format "jvm_" type "_" "<" "#" "|translation") (binary int::<)) + (dictionary.has (%.format "jvm_" type "_" "and" "#" "|translation") (binary int::and)) + (dictionary.has (%.format "jvm_" type "_" "or" "#" "|translation") (binary int::or)) + (dictionary.has (%.format "jvm_" type "_" "xor" "#" "|translation") (binary int::xor)) + (dictionary.has (%.format "jvm_" type "_" "shl" "#" "|translation") (binary int::shl)) + (dictionary.has (%.format "jvm_" type "_" "shr" "#" "|translation") (binary int::shr)) + (dictionary.has (%.format "jvm_" type "_" "ushr" "#" "|translation") (binary int::ushr)) ))) (def with_long_extensions (-> Bundle Bundle) (let [type (reflection.reflection reflection.long)] - (|>> (dictionary.has (%.format "jvm_" type "_" "+" "#" "|generation") (binary long::+)) - (dictionary.has (%.format "jvm_" type "_" "-" "#" "|generation") (binary long::-)) - (dictionary.has (%.format "jvm_" type "_" "*" "#" "|generation") (binary long::*)) - (dictionary.has (%.format "jvm_" type "_" "/" "#" "|generation") (binary long::/)) - (dictionary.has (%.format "jvm_" type "_" "%" "#" "|generation") (binary long::%)) - (dictionary.has (%.format "jvm_" type "_" "=" "#" "|generation") (binary long::=)) - (dictionary.has (%.format "jvm_" type "_" "<" "#" "|generation") (binary long::<)) - (dictionary.has (%.format "jvm_" type "_" "and" "#" "|generation") (binary long::and)) - (dictionary.has (%.format "jvm_" type "_" "or" "#" "|generation") (binary long::or)) - (dictionary.has (%.format "jvm_" type "_" "xor" "#" "|generation") (binary long::xor)) - (dictionary.has (%.format "jvm_" type "_" "shl" "#" "|generation") (binary long::shl)) - (dictionary.has (%.format "jvm_" type "_" "shr" "#" "|generation") (binary long::shr)) - (dictionary.has (%.format "jvm_" type "_" "ushr" "#" "|generation") (binary long::ushr)) + (|>> (dictionary.has (%.format "jvm_" type "_" "+" "#" "|translation") (binary long::+)) + (dictionary.has (%.format "jvm_" type "_" "-" "#" "|translation") (binary long::-)) + (dictionary.has (%.format "jvm_" type "_" "*" "#" "|translation") (binary long::*)) + (dictionary.has (%.format "jvm_" type "_" "/" "#" "|translation") (binary long::/)) + (dictionary.has (%.format "jvm_" type "_" "%" "#" "|translation") (binary long::%)) + (dictionary.has (%.format "jvm_" type "_" "=" "#" "|translation") (binary long::=)) + (dictionary.has (%.format "jvm_" type "_" "<" "#" "|translation") (binary long::<)) + (dictionary.has (%.format "jvm_" type "_" "and" "#" "|translation") (binary long::and)) + (dictionary.has (%.format "jvm_" type "_" "or" "#" "|translation") (binary long::or)) + (dictionary.has (%.format "jvm_" type "_" "xor" "#" "|translation") (binary long::xor)) + (dictionary.has (%.format "jvm_" type "_" "shl" "#" "|translation") (binary long::shl)) + (dictionary.has (%.format "jvm_" type "_" "shr" "#" "|translation") (binary long::shr)) + (dictionary.has (%.format "jvm_" type "_" "ushr" "#" "|translation") (binary long::ushr)) ))) (def with_float_extensions (-> Bundle Bundle) (let [type (reflection.reflection reflection.float)] - (|>> (dictionary.has (%.format "jvm_" type "_" "+" "#" "|generation") (binary float::+)) - (dictionary.has (%.format "jvm_" type "_" "-" "#" "|generation") (binary float::-)) - (dictionary.has (%.format "jvm_" type "_" "*" "#" "|generation") (binary float::*)) - (dictionary.has (%.format "jvm_" type "_" "/" "#" "|generation") (binary float::/)) - (dictionary.has (%.format "jvm_" type "_" "%" "#" "|generation") (binary float::%)) - (dictionary.has (%.format "jvm_" type "_" "=" "#" "|generation") (binary float::=)) - (dictionary.has (%.format "jvm_" type "_" "<" "#" "|generation") (binary float::<)) + (|>> (dictionary.has (%.format "jvm_" type "_" "+" "#" "|translation") (binary float::+)) + (dictionary.has (%.format "jvm_" type "_" "-" "#" "|translation") (binary float::-)) + (dictionary.has (%.format "jvm_" type "_" "*" "#" "|translation") (binary float::*)) + (dictionary.has (%.format "jvm_" type "_" "/" "#" "|translation") (binary float::/)) + (dictionary.has (%.format "jvm_" type "_" "%" "#" "|translation") (binary float::%)) + (dictionary.has (%.format "jvm_" type "_" "=" "#" "|translation") (binary float::=)) + (dictionary.has (%.format "jvm_" type "_" "<" "#" "|translation") (binary float::<)) ))) (def with_double_extensions (-> Bundle Bundle) (let [type (reflection.reflection reflection.float)] - (|>> (dictionary.has (%.format "jvm_" type "_" "+" "#" "|generation") (binary double::+)) - (dictionary.has (%.format "jvm_" type "_" "-" "#" "|generation") (binary double::-)) - (dictionary.has (%.format "jvm_" type "_" "*" "#" "|generation") (binary double::*)) - (dictionary.has (%.format "jvm_" type "_" "/" "#" "|generation") (binary double::/)) - (dictionary.has (%.format "jvm_" type "_" "%" "#" "|generation") (binary double::%)) - (dictionary.has (%.format "jvm_" type "_" "=" "#" "|generation") (binary double::=)) - (dictionary.has (%.format "jvm_" type "_" "<" "#" "|generation") (binary double::<)) + (|>> (dictionary.has (%.format "jvm_" type "_" "+" "#" "|translation") (binary double::+)) + (dictionary.has (%.format "jvm_" type "_" "-" "#" "|translation") (binary double::-)) + (dictionary.has (%.format "jvm_" type "_" "*" "#" "|translation") (binary double::*)) + (dictionary.has (%.format "jvm_" type "_" "/" "#" "|translation") (binary double::/)) + (dictionary.has (%.format "jvm_" type "_" "%" "#" "|translation") (binary double::%)) + (dictionary.has (%.format "jvm_" type "_" "=" "#" "|translation") (binary double::=)) + (dictionary.has (%.format "jvm_" type "_" "<" "#" "|translation") (binary double::<)) ))) (def with_char_extensions (-> Bundle Bundle) (let [type (reflection.reflection reflection.char)] - (|>> (dictionary.has (%.format "jvm_" type "_" "=" "#" "|generation") (binary char::=)) - (dictionary.has (%.format "jvm_" type "_" "<" "#" "|generation") (binary char::<)) + (|>> (dictionary.has (%.format "jvm_" type "_" "=" "#" "|translation") (binary char::=)) + (dictionary.has (%.format "jvm_" type "_" "<" "#" "|translation") (binary char::<)) ))) (with_template [<name> <category> <parser>] @@ -382,9 +382,9 @@ (-> (Type Primitive) Handler) (..custom [<synthesis>.any - (function (_ generate archive arrayS) + (function (_ translate archive arrayS) (do //////.monad - [arrayG (generate archive arrayS)] + [arrayG (translate archive arrayS)] (in (all _.composite arrayG (_.checkcast (type.array jvm_primitive)) @@ -394,9 +394,9 @@ Handler (..custom [(all <>.and ..object_array <synthesis>.any) - (function (_ generate archive [elementJT arrayS]) + (function (_ translate archive [elementJT arrayS]) (do //////.monad - [arrayG (generate archive arrayS)] + [arrayG (translate archive arrayS)] (in (all _.composite arrayG (_.checkcast (type.array elementJT)) @@ -406,9 +406,9 @@ (-> Primitive_Array_Type Handler) (..custom [<synthesis>.any - (function (_ generate archive [lengthS]) + (function (_ translate archive [lengthS]) (do //////.monad - [lengthG (generate archive lengthS)] + [lengthG (translate archive lengthS)] (in (all _.composite lengthG (_.newarray jvm_primitive)))))])) @@ -417,9 +417,9 @@ Handler (..custom [(all <>.and ..object <synthesis>.any) - (function (_ generate archive [objectJT lengthS]) + (function (_ translate archive [objectJT lengthS]) (do //////.monad - [lengthG (generate archive lengthS)] + [lengthG (translate archive lengthS)] (in (all _.composite lengthG (_.anewarray objectJT)))))])) @@ -428,10 +428,10 @@ (-> (Type Primitive) (Bytecode Any) Handler) (..custom [(all <>.and <synthesis>.any <synthesis>.any) - (function (_ generate archive [idxS arrayS]) + (function (_ translate archive [idxS arrayS]) (do //////.monad - [arrayG (generate archive arrayS) - idxG (generate archive idxS)] + [arrayG (translate archive arrayS) + idxG (translate archive idxS)] (in (all _.composite arrayG (_.checkcast (type.array jvm_primitive)) @@ -442,10 +442,10 @@ Handler (..custom [(all <>.and ..object_array <synthesis>.any <synthesis>.any) - (function (_ generate archive [elementJT idxS arrayS]) + (function (_ translate archive [elementJT idxS arrayS]) (do //////.monad - [arrayG (generate archive arrayS) - idxG (generate archive idxS)] + [arrayG (translate archive arrayS) + idxG (translate archive idxS)] (in (all _.composite arrayG (_.checkcast (type.array elementJT)) @@ -456,11 +456,11 @@ (-> (Type Primitive) (Bytecode Any) Handler) (..custom [(all <>.and <synthesis>.any <synthesis>.any <synthesis>.any) - (function (_ generate archive [idxS valueS arrayS]) + (function (_ translate archive [idxS valueS arrayS]) (do //////.monad - [arrayG (generate archive arrayS) - idxG (generate archive idxS) - valueG (generate archive valueS)] + [arrayG (translate archive arrayS) + idxG (translate archive idxS) + valueG (translate archive valueS)] (in (all _.composite arrayG (_.checkcast (type.array jvm_primitive)) @@ -473,11 +473,11 @@ Handler (..custom [(all <>.and ..object_array <synthesis>.any <synthesis>.any <synthesis>.any) - (function (_ generate archive [elementJT idxS valueS arrayS]) + (function (_ translate archive [elementJT idxS valueS arrayS]) (do //////.monad - [arrayG (generate archive arrayS) - idxG (generate archive idxS) - valueG (generate archive valueS)] + [arrayG (translate archive arrayS) + idxG (translate archive idxS) + valueG (translate archive valueS)] (in (all _.composite arrayG (_.checkcast (type.array elementJT)) @@ -488,45 +488,45 @@ (def with_array_extensions (-> Bundle Bundle) - (|>> (dictionary.has (%.format "jvm_" "array_" "length_" (reflection.reflection reflection.boolean) "#" "|generation") (primitive_array_length_handler type.boolean)) - (dictionary.has (%.format "jvm_" "array_" "length_" (reflection.reflection reflection.byte) "#" "|generation") (primitive_array_length_handler type.byte)) - (dictionary.has (%.format "jvm_" "array_" "length_" (reflection.reflection reflection.short) "#" "|generation") (primitive_array_length_handler type.short)) - (dictionary.has (%.format "jvm_" "array_" "length_" (reflection.reflection reflection.int) "#" "|generation") (primitive_array_length_handler type.int)) - (dictionary.has (%.format "jvm_" "array_" "length_" (reflection.reflection reflection.long) "#" "|generation") (primitive_array_length_handler type.long)) - (dictionary.has (%.format "jvm_" "array_" "length_" (reflection.reflection reflection.float) "#" "|generation") (primitive_array_length_handler type.float)) - (dictionary.has (%.format "jvm_" "array_" "length_" (reflection.reflection reflection.double) "#" "|generation") (primitive_array_length_handler type.double)) - (dictionary.has (%.format "jvm_" "array_" "length_" (reflection.reflection reflection.char) "#" "|generation") (primitive_array_length_handler type.char)) - (dictionary.has (%.format "jvm_" "array_" "length_" "object" "#" "|generation") array::length::object) - - (dictionary.has (%.format "jvm_" "array_" "new_" (reflection.reflection reflection.boolean) "#" "|generation") (new_primitive_array_handler __.t_boolean)) - (dictionary.has (%.format "jvm_" "array_" "new_" (reflection.reflection reflection.byte) "#" "|generation") (new_primitive_array_handler __.t_byte)) - (dictionary.has (%.format "jvm_" "array_" "new_" (reflection.reflection reflection.short) "#" "|generation") (new_primitive_array_handler __.t_short)) - (dictionary.has (%.format "jvm_" "array_" "new_" (reflection.reflection reflection.int) "#" "|generation") (new_primitive_array_handler __.t_int)) - (dictionary.has (%.format "jvm_" "array_" "new_" (reflection.reflection reflection.long) "#" "|generation") (new_primitive_array_handler __.t_long)) - (dictionary.has (%.format "jvm_" "array_" "new_" (reflection.reflection reflection.float) "#" "|generation") (new_primitive_array_handler __.t_float)) - (dictionary.has (%.format "jvm_" "array_" "new_" (reflection.reflection reflection.double) "#" "|generation") (new_primitive_array_handler __.t_double)) - (dictionary.has (%.format "jvm_" "array_" "new_" (reflection.reflection reflection.char) "#" "|generation") (new_primitive_array_handler __.t_char)) - (dictionary.has (%.format "jvm_" "array_" "new_" "object" "#" "|generation") array::new::object) - - (dictionary.has (%.format "jvm_" "array_" "read_" (reflection.reflection reflection.boolean) "#" "|generation") (read_primitive_array_handler type.boolean _.baload)) - (dictionary.has (%.format "jvm_" "array_" "read_" (reflection.reflection reflection.byte) "#" "|generation") (read_primitive_array_handler type.byte _.baload)) - (dictionary.has (%.format "jvm_" "array_" "read_" (reflection.reflection reflection.short) "#" "|generation") (read_primitive_array_handler type.short _.saload)) - (dictionary.has (%.format "jvm_" "array_" "read_" (reflection.reflection reflection.int) "#" "|generation") (read_primitive_array_handler type.int _.iaload)) - (dictionary.has (%.format "jvm_" "array_" "read_" (reflection.reflection reflection.long) "#" "|generation") (read_primitive_array_handler type.long _.laload)) - (dictionary.has (%.format "jvm_" "array_" "read_" (reflection.reflection reflection.float) "#" "|generation") (read_primitive_array_handler type.float _.faload)) - (dictionary.has (%.format "jvm_" "array_" "read_" (reflection.reflection reflection.double) "#" "|generation") (read_primitive_array_handler type.double _.daload)) - (dictionary.has (%.format "jvm_" "array_" "read_" (reflection.reflection reflection.char) "#" "|generation") (read_primitive_array_handler type.char _.caload)) - (dictionary.has (%.format "jvm_" "array_" "read_" "object" "#" "|generation") array::read::object) - - (dictionary.has (%.format "jvm_" "array_" "write_" (reflection.reflection reflection.boolean) "#" "|generation") (write_primitive_array_handler type.boolean _.bastore)) - (dictionary.has (%.format "jvm_" "array_" "write_" (reflection.reflection reflection.byte) "#" "|generation") (write_primitive_array_handler type.byte _.bastore)) - (dictionary.has (%.format "jvm_" "array_" "write_" (reflection.reflection reflection.short) "#" "|generation") (write_primitive_array_handler type.short _.sastore)) - (dictionary.has (%.format "jvm_" "array_" "write_" (reflection.reflection reflection.int) "#" "|generation") (write_primitive_array_handler type.int _.iastore)) - (dictionary.has (%.format "jvm_" "array_" "write_" (reflection.reflection reflection.long) "#" "|generation") (write_primitive_array_handler type.long _.lastore)) - (dictionary.has (%.format "jvm_" "array_" "write_" (reflection.reflection reflection.float) "#" "|generation") (write_primitive_array_handler type.float _.fastore)) - (dictionary.has (%.format "jvm_" "array_" "write_" (reflection.reflection reflection.double) "#" "|generation") (write_primitive_array_handler type.double _.dastore)) - (dictionary.has (%.format "jvm_" "array_" "write_" (reflection.reflection reflection.char) "#" "|generation") (write_primitive_array_handler type.char _.castore)) - (dictionary.has (%.format "jvm_" "array_" "write_" "object" "#" "|generation") array::write::object) + (|>> (dictionary.has (%.format "jvm_" "array_" "length_" (reflection.reflection reflection.boolean) "#" "|translation") (primitive_array_length_handler type.boolean)) + (dictionary.has (%.format "jvm_" "array_" "length_" (reflection.reflection reflection.byte) "#" "|translation") (primitive_array_length_handler type.byte)) + (dictionary.has (%.format "jvm_" "array_" "length_" (reflection.reflection reflection.short) "#" "|translation") (primitive_array_length_handler type.short)) + (dictionary.has (%.format "jvm_" "array_" "length_" (reflection.reflection reflection.int) "#" "|translation") (primitive_array_length_handler type.int)) + (dictionary.has (%.format "jvm_" "array_" "length_" (reflection.reflection reflection.long) "#" "|translation") (primitive_array_length_handler type.long)) + (dictionary.has (%.format "jvm_" "array_" "length_" (reflection.reflection reflection.float) "#" "|translation") (primitive_array_length_handler type.float)) + (dictionary.has (%.format "jvm_" "array_" "length_" (reflection.reflection reflection.double) "#" "|translation") (primitive_array_length_handler type.double)) + (dictionary.has (%.format "jvm_" "array_" "length_" (reflection.reflection reflection.char) "#" "|translation") (primitive_array_length_handler type.char)) + (dictionary.has (%.format "jvm_" "array_" "length_" "object" "#" "|translation") array::length::object) + + (dictionary.has (%.format "jvm_" "array_" "new_" (reflection.reflection reflection.boolean) "#" "|translation") (new_primitive_array_handler __.t_boolean)) + (dictionary.has (%.format "jvm_" "array_" "new_" (reflection.reflection reflection.byte) "#" "|translation") (new_primitive_array_handler __.t_byte)) + (dictionary.has (%.format "jvm_" "array_" "new_" (reflection.reflection reflection.short) "#" "|translation") (new_primitive_array_handler __.t_short)) + (dictionary.has (%.format "jvm_" "array_" "new_" (reflection.reflection reflection.int) "#" "|translation") (new_primitive_array_handler __.t_int)) + (dictionary.has (%.format "jvm_" "array_" "new_" (reflection.reflection reflection.long) "#" "|translation") (new_primitive_array_handler __.t_long)) + (dictionary.has (%.format "jvm_" "array_" "new_" (reflection.reflection reflection.float) "#" "|translation") (new_primitive_array_handler __.t_float)) + (dictionary.has (%.format "jvm_" "array_" "new_" (reflection.reflection reflection.double) "#" "|translation") (new_primitive_array_handler __.t_double)) + (dictionary.has (%.format "jvm_" "array_" "new_" (reflection.reflection reflection.char) "#" "|translation") (new_primitive_array_handler __.t_char)) + (dictionary.has (%.format "jvm_" "array_" "new_" "object" "#" "|translation") array::new::object) + + (dictionary.has (%.format "jvm_" "array_" "read_" (reflection.reflection reflection.boolean) "#" "|translation") (read_primitive_array_handler type.boolean _.baload)) + (dictionary.has (%.format "jvm_" "array_" "read_" (reflection.reflection reflection.byte) "#" "|translation") (read_primitive_array_handler type.byte _.baload)) + (dictionary.has (%.format "jvm_" "array_" "read_" (reflection.reflection reflection.short) "#" "|translation") (read_primitive_array_handler type.short _.saload)) + (dictionary.has (%.format "jvm_" "array_" "read_" (reflection.reflection reflection.int) "#" "|translation") (read_primitive_array_handler type.int _.iaload)) + (dictionary.has (%.format "jvm_" "array_" "read_" (reflection.reflection reflection.long) "#" "|translation") (read_primitive_array_handler type.long _.laload)) + (dictionary.has (%.format "jvm_" "array_" "read_" (reflection.reflection reflection.float) "#" "|translation") (read_primitive_array_handler type.float _.faload)) + (dictionary.has (%.format "jvm_" "array_" "read_" (reflection.reflection reflection.double) "#" "|translation") (read_primitive_array_handler type.double _.daload)) + (dictionary.has (%.format "jvm_" "array_" "read_" (reflection.reflection reflection.char) "#" "|translation") (read_primitive_array_handler type.char _.caload)) + (dictionary.has (%.format "jvm_" "array_" "read_" "object" "#" "|translation") array::read::object) + + (dictionary.has (%.format "jvm_" "array_" "write_" (reflection.reflection reflection.boolean) "#" "|translation") (write_primitive_array_handler type.boolean _.bastore)) + (dictionary.has (%.format "jvm_" "array_" "write_" (reflection.reflection reflection.byte) "#" "|translation") (write_primitive_array_handler type.byte _.bastore)) + (dictionary.has (%.format "jvm_" "array_" "write_" (reflection.reflection reflection.short) "#" "|translation") (write_primitive_array_handler type.short _.sastore)) + (dictionary.has (%.format "jvm_" "array_" "write_" (reflection.reflection reflection.int) "#" "|translation") (write_primitive_array_handler type.int _.iastore)) + (dictionary.has (%.format "jvm_" "array_" "write_" (reflection.reflection reflection.long) "#" "|translation") (write_primitive_array_handler type.long _.lastore)) + (dictionary.has (%.format "jvm_" "array_" "write_" (reflection.reflection reflection.float) "#" "|translation") (write_primitive_array_handler type.float _.fastore)) + (dictionary.has (%.format "jvm_" "array_" "write_" (reflection.reflection reflection.double) "#" "|translation") (write_primitive_array_handler type.double _.dastore)) + (dictionary.has (%.format "jvm_" "array_" "write_" (reflection.reflection reflection.char) "#" "|translation") (write_primitive_array_handler type.char _.castore)) + (dictionary.has (%.format "jvm_" "array_" "write_" "object" "#" "|translation") array::write::object) )) (def (object::null _) @@ -575,7 +575,7 @@ Handler (..custom [<synthesis>.text - (function (_ generate archive [class]) + (function (_ translate archive [class]) (do //////.monad [] (in (all _.composite @@ -586,9 +586,9 @@ Handler (..custom [(all <>.and <synthesis>.text <synthesis>.any) - (function (_ generate archive [class objectS]) + (function (_ translate archive [class objectS]) (do //////.monad - [objectG (generate archive objectS)] + [objectG (translate archive objectS)] (in (all _.composite objectG (_.instanceof (type.class class (list))) @@ -598,9 +598,9 @@ Handler (..custom [(all <>.and <synthesis>.text <synthesis>.text <synthesis>.any) - (function (_ generate archive [from to valueS]) + (function (_ translate archive [from to valueS]) (do //////.monad - [valueG (generate archive valueS)] + [valueG (translate archive valueS)] (in (`` (cond (,, (with_template [<object> <type>] [(and (text#= (..reflection <type>) from) (text#= <object> to)) @@ -627,29 +627,29 @@ (def with_object_extensions (-> Bundle Bundle) - (|>> (dictionary.has (%.format "jvm_" "object_" "null" "#" "|generation") (nullary object::null)) - (dictionary.has (%.format "jvm_" "object_" "null?" "#" "|generation") (unary object::null?)) - (dictionary.has (%.format "jvm_" "object_" "synchronized" "#" "|generation") (binary object::synchronized)) - (dictionary.has (%.format "jvm_" "object_" "throw" "#" "|generation") (unary object::throw)) - (dictionary.has (%.format "jvm_" "object_" "class" "#" "|generation") object::class) - (dictionary.has (%.format "jvm_" "object_" "instance?" "#" "|generation") object::instance?) - (dictionary.has (%.format "jvm_" "object_" "cast" "#" "|generation") object::cast) + (|>> (dictionary.has (%.format "jvm_" "object_" "null" "#" "|translation") (nullary object::null)) + (dictionary.has (%.format "jvm_" "object_" "null?" "#" "|translation") (unary object::null?)) + (dictionary.has (%.format "jvm_" "object_" "synchronized" "#" "|translation") (binary object::synchronized)) + (dictionary.has (%.format "jvm_" "object_" "throw" "#" "|translation") (unary object::throw)) + (dictionary.has (%.format "jvm_" "object_" "class" "#" "|translation") object::class) + (dictionary.has (%.format "jvm_" "object_" "instance?" "#" "|translation") object::instance?) + (dictionary.has (%.format "jvm_" "object_" "cast" "#" "|translation") object::cast) )) (def get::static Handler (..custom [(all <>.and <synthesis>.text <synthesis>.text ..value) - (function (_ generate archive [class field :unboxed:]) + (function (_ translate archive [class field :unboxed:]) (at //////.monad in (_.getstatic (type.class class (list)) field :unboxed:)))])) (def put::static Handler (..custom [(all <>.and <synthesis>.text <synthesis>.text ..value <synthesis>.any) - (function (_ generate archive [class field :unboxed: valueS]) + (function (_ translate archive [class field :unboxed: valueS]) (do //////.monad - [valueG (generate archive valueS)] + [valueG (translate archive valueS)] (in (all _.composite valueG (when (parser.object? :unboxed:) @@ -665,9 +665,9 @@ Handler (..custom [(all <>.and <synthesis>.text <synthesis>.text ..value <synthesis>.any) - (function (_ generate archive [class field :unboxed: objectS]) + (function (_ translate archive [class field :unboxed: objectS]) (do //////.monad - [objectG (generate archive objectS) + [objectG (translate archive objectS) .let [:class: (type.class class (list)) getG (_.getfield :class: field :unboxed:)]] (in (all _.composite @@ -679,10 +679,10 @@ Handler (..custom [(all <>.and <synthesis>.text <synthesis>.text ..value <synthesis>.any <synthesis>.any) - (function (_ generate archive [class field :unboxed: valueS objectS]) + (function (_ translate archive [class field :unboxed: valueS objectS]) (do //////.monad - [valueG (generate archive valueS) - objectG (generate archive objectS) + [valueG (translate archive valueS) + objectG (translate archive objectS) .let [:class: (type.class class (list)) putG (when (parser.object? :unboxed:) {.#Some :unboxed:} @@ -706,10 +706,10 @@ (Parser Input) (<synthesis>.tuple (<>.and ..value <synthesis>.any))) -(def (generate_input generate archive [valueT valueS]) +(def (translate_input translate archive [valueT valueS]) (-> Phase Archive Input (Operation (Typed (Bytecode Any)))) (do //////.monad - [valueG (generate archive valueS)] + [valueG (translate archive valueS)] (when (type.primitive? valueT) {.#Right valueT} (in [valueT valueG]) @@ -732,9 +732,9 @@ Handler (..custom [(all <>.and ..class <synthesis>.text ..return (<>.some ..input)) - (function (_ generate archive [class method outputT inputsTS]) + (function (_ translate archive [class method outputT inputsTS]) (do [! //////.monad] - [inputsTG (monad.each ! (generate_input generate archive) inputsTS)] + [inputsTG (monad.each ! (translate_input translate archive) inputsTS)] (in (all _.composite (monad.each _.monad product.right inputsTG) (_.invokestatic class method (type.method [(list) (list#each product.left inputsTG) outputT (list)])) @@ -745,10 +745,10 @@ Handler (..custom [(all <>.and ..class <synthesis>.text ..return <synthesis>.any (<>.some ..input)) - (function (_ generate archive [class method outputT objectS inputsTS]) + (function (_ translate archive [class method outputT objectS inputsTS]) (do [! //////.monad] - [objectG (generate archive objectS) - inputsTG (monad.each ! (generate_input generate archive) inputsTS)] + [objectG (translate archive objectS) + inputsTG (monad.each ! (translate_input translate archive) inputsTS)] (in (all _.composite objectG (if <check_cast?> @@ -767,9 +767,9 @@ Handler (..custom [(all <>.and ..class (<>.some ..input)) - (function (_ generate archive [class inputsTS]) + (function (_ translate archive [class inputsTS]) (do [! //////.monad] - [inputsTG (monad.each ! (generate_input generate archive) inputsTS)] + [inputsTG (monad.each ! (translate_input translate archive) inputsTS)] (in (all _.composite (_.new class) _.dup @@ -778,17 +778,17 @@ (def with_member_extensions (-> Bundle Bundle) - (|>> (dictionary.has (%.format "jvm_" "member_" "get_" "static" "#" "|generation") get::static) - (dictionary.has (%.format "jvm_" "member_" "get_" "virtual" "#" "|generation") get::virtual) + (|>> (dictionary.has (%.format "jvm_" "member_" "get_" "static" "#" "|translation") get::static) + (dictionary.has (%.format "jvm_" "member_" "get_" "virtual" "#" "|translation") get::virtual) - (dictionary.has (%.format "jvm_" "member_" "put_" "static" "#" "|generation") put::static) - (dictionary.has (%.format "jvm_" "member_" "put_" "virtual" "#" "|generation") put::virtual) + (dictionary.has (%.format "jvm_" "member_" "put_" "static" "#" "|translation") put::static) + (dictionary.has (%.format "jvm_" "member_" "put_" "virtual" "#" "|translation") put::virtual) - (dictionary.has (%.format "jvm_" "member_" "invoke_" "static" "#" "|generation") invoke::static) - (dictionary.has (%.format "jvm_" "member_" "invoke_" "virtual" "#" "|generation") invoke::virtual) - (dictionary.has (%.format "jvm_" "member_" "invoke_" "special" "#" "|generation") invoke::special) - (dictionary.has (%.format "jvm_" "member_" "invoke_" "interface" "#" "|generation") invoke::interface) - (dictionary.has (%.format "jvm_" "member_" "invoke_" "constructor" "#" "|generation") invoke::constructor) + (dictionary.has (%.format "jvm_" "member_" "invoke_" "static" "#" "|translation") invoke::static) + (dictionary.has (%.format "jvm_" "member_" "invoke_" "virtual" "#" "|translation") invoke::virtual) + (dictionary.has (%.format "jvm_" "member_" "invoke_" "special" "#" "|translation") invoke::special) + (dictionary.has (%.format "jvm_" "member_" "invoke_" "interface" "#" "|translation") invoke::interface) + (dictionary.has (%.format "jvm_" "member_" "invoke_" "constructor" "#" "|translation") invoke::constructor) )) (def annotation_parameter @@ -1126,10 +1126,10 @@ store_captured! _.return)}))) -(def (anonymous_instance generate archive class env inputsTI) +(def (anonymous_instance translate archive class env inputsTI) (-> Phase Archive (Type category.Class) (Environment Synthesis) (List (Typed (Bytecode Any))) (Operation (Bytecode Any))) (do [! //////.monad] - [captureG+ (monad.each ! (generate archive) env)] + [captureG+ (monad.each ! (translate archive) env)] (in (all _.composite (_.new class) _.dup @@ -1290,7 +1290,7 @@ (-> Phase Archive artifact.ID (/.Overriden_Method Synthesis) (Operation (Resource Method))) (let [[ownerT name strict_fp? annotations vars self_name arguments returnT exceptionsT bodyS] method] (do //////.monad - [bodyG (//////generation.with_context artifact_id + [bodyG (//////translation.with_context artifact_id (phase archive bodyS)) .let [argumentsT (list#each product.right arguments) methodT (type.method [vars argumentsT returnT exceptionsT])]] @@ -1316,22 +1316,22 @@ (<synthesis>.tuple (<>.some ..class)) (<synthesis>.tuple (<>.some ..input)) (<synthesis>.tuple (<>.some ..overriden_method_definition))) - (function (_ generate archive [super_class - super_interfaces - inputsTS - overriden_methods]) + (function (_ translate archive [super_class + super_interfaces + inputsTS + overriden_methods]) (do [! //////.monad] [all_dependencies (anonymous_dependencies archive inputsTS overriden_methods) - [context _] (//////generation.with_new_context archive all_dependencies (in [])) + [context _] (//////translation.with_new_context archive all_dependencies (in [])) .let [[module_id artifact_id] context anonymous_class_name (///runtime.class_name context) class (type.class anonymous_class_name (list)) total_environment (..total_environment overriden_methods) global_mapping (..global_mapping total_environment)] - inputsTI (monad.each ! (generate_input generate archive) inputsTS) + inputsTI (monad.each ! (translate_input translate archive) inputsTS) methods! (|> overriden_methods (list#each (normalized_method global_mapping)) - (monad.each ! (method_definition generate archive artifact_id))) + (monad.each ! (method_definition translate archive artifact_id))) bytecode (<| (at ! each (\\format.result class.format)) //////.lifted (class.class version.v6_0 (all modifier#composite class.public class.final) @@ -1344,13 +1344,13 @@ methods!) (list))) .let [artifact [anonymous_class_name bytecode]] - _ (//////generation.execute! artifact) - _ (//////generation.save! artifact_id {.#None} artifact)] - (anonymous_instance generate archive class total_environment inputsTI)))])) + _ (//////translation.execute! artifact) + _ (//////translation.save! artifact_id {.#None} artifact)] + (anonymous_instance translate archive class total_environment inputsTI)))])) (def with_class_extensions (-> Bundle Bundle) - (dictionary.has (%.format "jvm_" "class_" "anonymous" "#" "|generation") class::anonymous)) + (dictionary.has (%.format "jvm_" "class_" "anonymous" "#" "|translation") class::anonymous)) (def .public bundle Bundle diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/lua.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/lua.lux index 35d3f07b8..65fa90262 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/lua.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/lua.lux @@ -8,7 +8,7 @@ ["[1][0]" common] ["[1][0]" host] [//// - [generation + [translation [lua [runtime (.only Bundle)]]]]]) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/lua/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/lua/common.lux index 4038262df..b332a5639 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/lua/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/lua/common.lux @@ -26,11 +26,11 @@ ["/" bundle] ["/[1]" // ["[0]" extension] - [generation + [translation [extension (.only Nullary Unary Binary Trinary nullary unary binary trinary)] ["//" lua - ["[1][0]" runtime (.only Operation Phase Phase! Handler Bundle Generator)] + ["[1][0]" runtime (.only Operation Phase Phase! Handler Bundle Translator)] ["[1][0]" primitive] ["[1][0]" structure] ["[1][0]" reference] @@ -38,7 +38,7 @@ ["[1][0]" loop] ["[1][0]" function]]] [// - ["[0]" generation] + ["[0]" translation] ["[0]" synthesis (.only %synthesis) ["<s>" \\parser (.only Parser)]] [/// @@ -52,7 +52,7 @@ Phase! (when synthesis ... TODO: Get rid of this ASAP - {synthesis.#Extension [.prelude "when_char#|generation"] parameters} + {synthesis.#Extension [.prelude "when_char#|translation"] parameters} (do /////.monad [body (expression archive synthesis)] (in (as Statement body))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/lua/host.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/lua/host.lux index 5072f1488..97cb5fa8f 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/lua/host.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/lua/host.lux @@ -21,7 +21,7 @@ ["/" bundle] ["/[1]" // ["[0]" extension] - [generation + [translation [extension (.only Nullary Unary Binary Trinary nullary unary binary trinary)] ["[0]" reference] @@ -29,7 +29,7 @@ ["[1][0]" runtime (.only Operation Phase Handler Bundle with_vars)]]] ["/[1]" // - ["[0]" generation] + ["[0]" translation] [synthesis ["<s>" \\parser (.only Parser)]] ["//[1]" /// @@ -173,7 +173,7 @@ (do [! ////////phase.monad] [abstractionG (phase archive abstractionS) .let [variable (is (-> Text (Operation Var)) - (|>> generation.symbol + (|>> translation.symbol (at ! each _.var)))] g!inputs (monad.each ! (function (_ _) (variable "input")) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/php.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/php.lux index 2a76ad856..cae310997 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/php.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/php.lux @@ -8,7 +8,7 @@ ["[1][0]" common] ["[1][0]" host] [//// - [generation + [translation [php [runtime (.only Bundle)]]]]]) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/php/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/php/common.lux index 0fb91a5d3..b6625995e 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/php/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/php/common.lux @@ -25,17 +25,17 @@ ["/" bundle] ["/[1]" // ["[0]" extension] - [generation + [translation [extension (.only Nullary Unary Binary Trinary nullary unary binary trinary)] ["[0]" reference] ["//" php - ["[1][0]" runtime (.only Operation Phase Handler Bundle Generator)] + ["[1][0]" runtime (.only Operation Phase Handler Bundle Translator)] ["[1][0]" when]]] [// ["[0]" synthesis (.only %synthesis) ["<s>" \\parser (.only Parser)]] - ["[0]" generation] + ["[0]" translation] [/// ["[1]" phase]]]]]) @@ -54,9 +54,9 @@ (function (_ extension_name phase archive [input else conditionals]) (do [! /////.monad] [inputG (phase archive input) - [[context_module context_artifact] elseG] (generation.with_new_context archive + [[context_module context_artifact] elseG] (translation.with_new_context archive (phase archive else)) - @input (at ! each _.var (generation.symbol "input")) + @input (at ! each _.var (translation.symbol "input")) conditionalsG (is (Operation (List [Expression Expression])) (monad.each ! (function (_ [chars branch]) (do ! @@ -82,8 +82,8 @@ (_.if test (_.return then) else)) (_.return elseG) conditionalsG))] - _ (generation.execute! declaration) - _ (generation.save! context_artifact declaration)] + _ (translation.execute! declaration) + _ (translation.save! context_artifact declaration)] (in (_.apply (list.partial inputG foreigns) @expression))))])) (def lux_procs diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/php/host.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/php/host.lux index 855f5754d..16a55823f 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/php/host.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/php/host.lux @@ -21,7 +21,7 @@ ["/" bundle] ["/[1]" // ["[0]" extension] - [generation + [translation [extension (.only Nullary Unary Binary Trinary nullary unary binary trinary)] ["[0]" reference] @@ -29,7 +29,7 @@ ["[1][0]" runtime (.only Operation Phase Handler Bundle with_vars)]]] ["/[1]" // - ["[0]" generation] + ["[0]" translation] [synthesis ["<s>" \\parser (.only Parser)]] ["//[1]" /// diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/python.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/python.lux index 8adf1ec86..a84adb1b4 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/python.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/python.lux @@ -8,7 +8,7 @@ ["[1][0]" common] ["[1][0]" host] [//// - [generation + [translation [python [runtime (.only Bundle)]]]]]) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/python/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/python/common.lux index c03a52bc2..ff724bd07 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/python/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/python/common.lux @@ -26,12 +26,12 @@ ["/" bundle] ["/[1]" // ["[0]" extension] - [generation + [translation ["[0]" reference] [extension (.only Nullary Unary Binary Trinary nullary unary binary trinary)] ["//" python - ["[1][0]" runtime (.only Operation Phase Phase! Handler Bundle Generator)] + ["[1][0]" runtime (.only Operation Phase Phase! Handler Bundle Translator)] ["[1][0]" primitive] ["[1][0]" structure] ["[1][0]" reference] @@ -40,7 +40,7 @@ ["[1][0]" loop]]] [// [analysis (.only)] - ["[0]" generation] + ["[0]" translation] ["[0]" synthesis (.only %synthesis) ["<[1]>" \\parser (.only Parser)]] [/// @@ -50,7 +50,7 @@ Phase! (when synthesis ... TODO: Get rid of this ASAP - {synthesis.#Extension [.prelude "when_char#|generation"] parameters} + {synthesis.#Extension [.prelude "when_char#|translation"] parameters} (do /////.monad [body (expression archive synthesis)] (in (as (Statement Any) body))) @@ -76,9 +76,9 @@ (synthesis.branch/when when) (//when.when! false statement expression archive when) - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (<generator> statement expression archive value)]) + (<translator> statement expression archive value)]) ([synthesis.branch/exec //when.exec!] [synthesis.branch/let //when.let!] [synthesis.branch/if //when.if!] @@ -101,7 +101,7 @@ (do [! /////.monad] [inputG (phase archive input) else! (..statement phase archive else) - @input (at ! each _.var (generation.symbol "input")) + @input (at ! each _.var (translation.symbol "input")) conditionals! (is (Operation (List [(Expression Any) (Statement Any)])) (monad.each ! (function (_ [chars branch]) @@ -131,8 +131,8 @@ ... (_.if test then! else!)) ... else! ... conditionals!)))] - ... _ (generation.execute! closure) - ... _ (generation.save! (product.right artifact_id) {.#None} closure) + ... _ (translation.execute! closure) + ... _ (translation.save! (product.right artifact_id) {.#None} closure) ] ... (in (_.apply @closure dependencies)) (in (<| (as (Expression Any)) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/python/host.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/python/host.lux index fde1ab399..d9af74b71 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/python/host.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/python/host.lux @@ -21,14 +21,14 @@ ["/" bundle] ["/[1]" // ["[0]" extension] - [generation + [translation [extension (.only Nullary Unary Binary Trinary nullary unary binary trinary)] ["//" python ["[1][0]" runtime (.only Operation Phase Handler Bundle with_vars)]]] ["/[1]" // - ["[0]" generation] + ["[0]" translation] [synthesis ["<s>" \\parser (.only Parser)]] ["//[1]" /// @@ -135,7 +135,7 @@ (do [! ////////phase.monad] [abstractionG (phase archive abstractionS) .let [variable (is (-> Text (Operation SVar)) - (|>> generation.symbol + (|>> translation.symbol (at ! each _.var)))] g!inputs (monad.each ! (function (_ _) (variable "input")) (list.repeated (.nat arity) []))] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/r.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/r.lux index 1a9b58970..3d44b164f 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/r.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/r.lux @@ -8,7 +8,7 @@ ["[1][0]" common] ["[1][0]" host] [//// - [generation + [translation [r [runtime (.only Bundle)]]]]]) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/r/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/r/common.lux index 0705afd3c..ad16cb2da 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/r/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/r/common.lux @@ -25,17 +25,17 @@ ["/" bundle] ["/[1]" // ["[0]" extension] - [generation + [translation [extension (.only Nullary Unary Binary Trinary nullary unary binary trinary)] ["[0]" reference] ["//" r - ["[1][0]" runtime (.only Operation Phase Handler Bundle Generator)] + ["[1][0]" runtime (.only Operation Phase Handler Bundle Translator)] ["[1][0]" when]]] [// ["[0]" synthesis (.only %synthesis) ["<s>" \\parser (.only Parser)]] - ["[0]" generation] + ["[0]" translation] [/// ["[1]" phase]]]]]) @@ -53,7 +53,7 @@ ... ... <s>.any)))) ... ... (function (_ extension_name phase archive [input else conditionals]) ... ... (do [! /////.monad] -... ... [@input (at ! each _.var (generation.symbol "input")) +... ... [@input (at ! each _.var (translation.symbol "input")) ... ... inputG (phase archive input) ... ... elseG (phase archive else) ... ... conditionalsG (is (Operation (List [Expression Expression])) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/r/host.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/r/host.lux index 31a2e612f..60f5bf54f 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/r/host.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/r/host.lux @@ -21,7 +21,7 @@ ["/" bundle] ["/[1]" // ["[0]" extension] - [generation + [translation [extension (.only Nullary Unary Binary Trinary nullary unary binary trinary)] ["[0]" reference] @@ -29,7 +29,7 @@ ["[1][0]" runtime (.only Operation Phase Handler Bundle with_vars)]]] ["/[1]" // - ["[0]" generation] + ["[0]" translation] [synthesis ["<s>" \\parser (.only Parser)]] ["//[1]" /// diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/ruby.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/ruby.lux index 3852ff8b4..93d22272e 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/ruby.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/ruby.lux @@ -8,7 +8,7 @@ ["[1][0]" common] ["[1][0]" host] [//// - [generation + [translation [ruby [runtime (.only Bundle)]]]]]) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/ruby/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/ruby/common.lux index 6d2087640..a080ff33f 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/ruby/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/ruby/common.lux @@ -26,11 +26,11 @@ ["/" bundle] ["/[1]" // ["[0]" extension] - [generation + [translation [extension (.only Nullary Unary Binary Trinary nullary unary binary trinary)] ["//" ruby - ["[1][0]" runtime (.only Operation Phase Phase! Handler Bundle Generator)] + ["[1][0]" runtime (.only Operation Phase Phase! Handler Bundle Translator)] ["[1][0]" primitive] ["[1][0]" structure] ["[1][0]" reference] @@ -38,7 +38,7 @@ ["[1][0]" when] ["[1][0]" loop]]] [// - ["[0]" generation] + ["[0]" translation] ["[0]" synthesis (.only %synthesis) ["<s>" \\parser (.only Parser)]] [/// @@ -48,7 +48,7 @@ Phase! (when synthesis ... TODO: Get rid of this ASAP - {synthesis.#Extension [.prelude "when_char#|generation"] parameters} + {synthesis.#Extension [.prelude "when_char#|translation"] parameters} (do /////.monad [body (expression archive synthesis)] (in (as Statement @@ -75,9 +75,9 @@ (synthesis.branch/when when) (//when.when! false statement expression archive when) - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (<generator> statement expression archive value)]) + (<translator> statement expression archive value)]) ([synthesis.branch/exec //when.exec!] [synthesis.branch/let //when.let!] [synthesis.branch/if //when.if!] @@ -100,7 +100,7 @@ (do [! /////.monad] [inputG (phase archive input) else! (statement phase archive else) - @input (at ! each _.local (generation.symbol "input")) + @input (at ! each _.local (translation.symbol "input")) conditionals! (is (Operation (List [Expression Statement])) (monad.each ! (function (_ [chars branch]) (do ! diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/ruby/host.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/ruby/host.lux index bbff556ec..b4a2ef91d 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/ruby/host.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/ruby/host.lux @@ -21,7 +21,7 @@ ["/" bundle] ["/[1]" // ["[0]" extension] - [generation + [translation [extension (.only Nullary Unary Binary Trinary nullary unary binary trinary)] ["[0]" reference] @@ -29,7 +29,6 @@ ["[1][0]" runtime (.only Operation Phase Handler Bundle with_vars)]]] ["/[1]" // - ["[0]" generation] [synthesis ["<s>" \\parser (.only Parser)]] ["//[1]" /// diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/scheme.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/scheme.lux index e2a5ce49f..606200c82 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/scheme.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/scheme.lux @@ -8,7 +8,7 @@ ["[1][0]" common] ["[1][0]" host] [//// - [generation + [translation [scheme [runtime (.only Bundle)]]]]]) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/scheme/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/scheme/common.lux index 894906ea0..7719f82cf 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/scheme/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/scheme/common.lux @@ -25,15 +25,15 @@ ["/" bundle] ["/[1]" // ["[0]" extension] - [generation + [translation [extension (.only Nullary Unary Binary Trinary nullary unary binary trinary)] ["[0]" reference] ["//" scheme - ["[1][0]" runtime (.only Operation Phase Handler Bundle Generator)] + ["[1][0]" runtime (.only Operation Phase Handler Bundle Translator)] ["[1][0]" when]]] [// - ["[0]" generation] + ["[0]" translation] ["[0]" synthesis (.only %synthesis) ["<s>" \\parser (.only Parser)]] [/// @@ -53,7 +53,7 @@ <s>.any)))) (function (_ extension_name phase archive [input else conditionals]) (do [! /////.monad] - [@input (at ! each _.var (generation.symbol "input")) + [@input (at ! each _.var (translation.symbol "input")) inputG (phase archive input) elseG (phase archive else) conditionalsG (is (Operation (List [Expression Expression])) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/scheme/host.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/scheme/host.lux index d48dc1e11..2a93c30b6 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/scheme/host.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/scheme/host.lux @@ -21,7 +21,7 @@ ["/" bundle] ["/[1]" // ["[0]" extension] - [generation + [translation [extension (.only Nullary Unary Binary Trinary nullary unary binary trinary)] ["[0]" reference] @@ -29,7 +29,6 @@ ["[1][0]" runtime (.only Operation Phase Handler Bundle with_vars)]]] ["/[1]" // - ["[0]" generation] [synthesis ["<s>" \\parser (.only Parser)]] ["//[1]" /// diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/loop.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/loop.lux index effe78818..60619b13b 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/loop.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/loop.lux @@ -187,7 +187,7 @@ <application>))) ... TODO: Stop relying on this custom code. - [@ {/.#Extension [[.prelude "when_char#|generation"] (list.partial input else matches)]}] + [@ {/.#Extension [[.prelude "when_char#|translation"] (list.partial input else matches)]}] (if return? (do [! maybe.monad] [input (again false input) @@ -205,7 +205,7 @@ (again false match)))) matches) else (again return? else)] - (in [@ {/.#Extension [[.prelude "when_char#|generation"] (list.partial input else matches)]}])) + (in [@ {/.#Extension [[.prelude "when_char#|translation"] (list.partial input else matches)]}])) {.#None}) [@ {/.#Extension [name args]}] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp.lux index 0f1867ff7..06f2d8de2 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp.lux @@ -26,12 +26,12 @@ [reference (.only) [variable (.only)]]]]]]]) -(def .public (generate archive synthesis) +(def .public (translate archive synthesis) Phase (when synthesis - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (//////phase#in (<generator> value))]) + (//////phase#in (<translator> value))]) ([////synthesis.bit /primitive.bit] [////synthesis.i64 /primitive.i64] [////synthesis.f64 /primitive.f64] @@ -40,9 +40,9 @@ {////synthesis.#Reference value} (//reference.reference /reference.system archive value) - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (<generator> generate archive value)]) + (<translator> translate archive value)]) ([////synthesis.variant /structure.variant] [////synthesis.tuple /structure.tuple] [////synthesis.branch/let /when.let] @@ -56,5 +56,5 @@ [////synthesis.function/abstraction /function.function]) {////synthesis.#Extension extension} - (///extension.apply archive generate extension) + (///extension.apply archive translate extension) )) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/extension.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/extension.lux index 1d1c8473f..1d1c8473f 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/extension.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/extension.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/extension/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/extension/common.lux index bb57efc5b..bb57efc5b 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/extension/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/extension/common.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/function.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/function.lux index 5a9e65883..608a865d9 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/function.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/function.lux @@ -15,7 +15,7 @@ [target ["_" common_lisp (.only Expression Var/1)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Generator)] + ["[1][0]" runtime (.only Operation Phase Translator)] ["[1][0]" reference] ["[1][0]" when] ["/[1]" // @@ -23,7 +23,7 @@ ["//[1]" /// [analysis (.only Variant Tuple Abstraction Application Analysis)] [synthesis (.only Synthesis)] - ["[1][0]" generation (.only Context)] + ["[1][0]" translation (.only Context)] ["//[1]" /// [arity (.only Arity)] ["[1][0]" phase (.use "[1]#[0]" monad)] @@ -31,7 +31,7 @@ [variable (.only Register Variable)]]]]]]) (def .public (apply expression archive [functionS argsS+]) - (Generator (Application Synthesis)) + (Translator (Application Synthesis)) (do [! ///////phase.monad] [functionG (expression archive functionS) argsG+ (monad.each ! (expression archive) argsS+)] @@ -49,7 +49,7 @@ _ (do [! ///////phase.monad] - [@closure (at ! each _.var (/////generation.symbol "closure"))] + [@closure (at ! each _.var (/////translation.symbol "closure"))] (in (_.labels (list [@closure [(|> (list.enumeration inits) (list#each (|>> product.left ..capture)) _.args) @@ -60,12 +60,12 @@ (|>> ++ //when.register)) (def .public (function expression archive [environment arity bodyS]) - (Generator (Abstraction Synthesis)) + (Translator (Abstraction Synthesis)) (do [! ///////phase.monad] - [@scope (at ! each (|>> %.nat (format "function_scope") _.tag) /////generation.next) - @output (at ! each (|>> %.nat (format "loop_output") _.var) /////generation.next) - [function_name bodyG] (/////generation.with_new_context archive - (/////generation.with_anchor [@scope 1] + [@scope (at ! each (|>> %.nat (format "function_scope") _.tag) /////translation.next) + @output (at ! each (|>> %.nat (format "loop_output") _.var) /////translation.next) + [function_name bodyG] (/////translation.with_new_context archive + (/////translation.with_anchor [@scope 1] (expression archive bodyS))) closureG+ (monad.each ! (expression archive) environment) .let [@curried (_.var "curried") diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/loop.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/loop.lux index d2dcb8802..299f7611d 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/loop.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/loop.lux @@ -16,7 +16,7 @@ [target ["_" common_lisp (.only Expression)]]]]] ["[0]" // - [runtime (.only Operation Phase Generator)] + [runtime (.only Operation Phase Translator)] ["[1][0]" when] ["/[1]" // ["[1][0]" reference] @@ -25,7 +25,7 @@ ["[0]" when]] ["/[1]" // ["[0]"synthesis (.only Scope Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// ["[1][0]" phase] [meta @@ -34,7 +34,7 @@ [variable (.only Register)]]]]]]]) (def .public (scope expression archive [start initsS+ bodyS]) - (Generator (Scope Synthesis)) + (Translator (Scope Synthesis)) (when initsS+ ... function/false/non-independent loop {.#End} @@ -43,10 +43,10 @@ ... true loop _ (do [! ///////phase.monad] - [@scope (at ! each (|>> %.nat (format "loop_scope") _.tag) /////generation.next) - @output (at ! each (|>> %.nat (format "loop_output") _.var) /////generation.next) + [@scope (at ! each (|>> %.nat (format "loop_scope") _.tag) /////translation.next) + @output (at ! each (|>> %.nat (format "loop_output") _.var) /////translation.next) initsG+ (monad.each ! (expression archive) initsS+) - bodyG (/////generation.with_anchor [@scope start] + bodyG (/////translation.with_anchor [@scope start] (expression archive bodyS))] ... TODO: There is a bug in the way the variables are updated. Do a _.multiple_value_setq instead. (in (_.let (|> initsG+ @@ -60,9 +60,9 @@ @output)))))) (def .public (again expression archive argsS+) - (Generator (List Synthesis)) + (Translator (List Synthesis)) (do [! ///////phase.monad] - [[tag offset] /////generation.anchor + [[tag offset] /////translation.anchor argsO+ (monad.each ! (expression archive) argsS+) .let [bindings (|> argsO+ list.enumeration diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/primitive.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/primitive.lux index a85bbb625..a85bbb625 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/primitive.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/primitive.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/reference.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/reference.lux index 4f70ce907..4f70ce907 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/reference.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/reference.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/runtime.lux index 9294d4335..12fb47c17 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/runtime.lux @@ -29,7 +29,7 @@ ["//[1]" /// [analysis (.only Variant)] ["[1][0]" synthesis (.only Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// (.only) ["[1][0]" phase] [reference @@ -45,13 +45,13 @@ [(type .public <name> (<base> [_.Tag Register] (Expression Any) (Expression Any)))] - [Operation /////generation.Operation] - [Phase /////generation.Phase] - [Handler /////generation.Handler] - [Bundle /////generation.Bundle] + [Operation /////translation.Operation] + [Phase /////translation.Phase] + [Handler /////translation.Handler] + [Bundle /////translation.Bundle] ) -(type .public (Generator i) +(type .public (Translator i) (-> Phase Archive i (Operation (Expression Any)))) (def .public unit @@ -291,11 +291,11 @@ runtime//text runtime//io))) -(def .public generate +(def .public translate (Operation [Registry Output]) (do ///////phase.monad - [_ (/////generation.execute! ..runtime) - _ (/////generation.save! (%.nat ..module_id) ..runtime)] + [_ (/////translation.execute! ..runtime) + _ (/////translation.save! (%.nat ..module_id) ..runtime)] (in [(|> artifact.empty artifact.resource product.right) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/structure.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/structure.lux index c4aabc6f2..27c6110b1 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/structure.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/structure.lux @@ -7,7 +7,7 @@ [target ["_" common_lisp (.only Expression)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Generator)] + ["[1][0]" runtime (.only Operation Phase Translator)] ["[1][0]" primitive] ["///[1]" //// [analysis (.only Variant Tuple)] @@ -16,7 +16,7 @@ ["[1][0]" phase (.use "[1]#[0]" monad)]]]]) (def .public (tuple expression archive elemsS+) - (Generator (Tuple Synthesis)) + (Translator (Tuple Synthesis)) (when elemsS+ {.#End} (///////phase#in (//primitive.text /////synthesis.unit)) @@ -30,7 +30,7 @@ (///////phase#each _.vector/*)))) (def .public (variant expression archive [lefts right? valueS]) - (Generator (Variant Synthesis)) + (Translator (Variant Synthesis)) (let [tag (if right? (++ lefts) lefts)] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/when.lux index 731102b94..268508d6d 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/common_lisp/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/when.lux @@ -18,7 +18,7 @@ [target ["_" common_lisp (.only Expression Var/1)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Generator)] + ["[1][0]" runtime (.only Operation Phase Translator)] ["[1][0]" reference] ["[1][0]" primitive] ["/[1]" // @@ -28,7 +28,7 @@ ["[1]/[0]" when]] ["/[1]" // ["[1][0]" synthesis (.only Member Synthesis Path)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// [reference ["[1][0]" variable (.only Register)]] @@ -45,7 +45,7 @@ (|>> (///reference.foreign //reference.system) as_expected)) (def .public (let expression archive [valueS register bodyS]) - (Generator [Synthesis Register Synthesis]) + (Translator [Synthesis Register Synthesis]) (do ///////phase.monad [valueG (expression archive valueS) bodyG (expression archive bodyS)] @@ -53,7 +53,7 @@ (list bodyG))))) (def .public (if expression archive [testS thenS elseS]) - (Generator [Synthesis Synthesis Synthesis]) + (Translator [Synthesis Synthesis Synthesis]) (do ///////phase.monad [testG (expression archive testS) thenG (expression archive thenS) @@ -61,7 +61,7 @@ (in (_.if testG thenG elseG)))) (def .public (get expression archive [pathP valueS]) - (Generator [(List Member) Synthesis]) + (Translator [(List Member) Synthesis]) (do ///////phase.monad [valueG (expression archive valueS)] (in (list#mix (function (_ side source) @@ -138,7 +138,7 @@ (list post!)))) (def (pattern_matching' expression archive) - (Generator [Var/1 _.Tag _.Tag Path]) + (Translator [Var/1 _.Tag _.Tag Path]) (function (again [$output @done @fail pathP]) (.when pathP (/////synthesis.path/then bodyS) @@ -218,7 +218,7 @@ (/////synthesis.path/alt preP postP) (do [! ///////phase.monad] - [@otherwise (at ! each (|>> %.nat (format "lux_when_otherwise") _.tag) /////generation.next) + [@otherwise (at ! each (|>> %.nat (format "lux_when_otherwise") _.tag) /////translation.next) pre! (again [$output @done @otherwise preP]) post! (again [$output @done @fail postP])] (in (..alternation @otherwise pre! post!))) @@ -230,10 +230,10 @@ (in (_.progn (list pre! post!))))))) (def (pattern_matching $output expression archive pathP) - (-> Var/1 (Generator Path)) + (-> Var/1 (Translator Path)) (do [! ///////phase.monad] - [@done (at ! each (|>> %.nat (format "lux_when_done") _.tag) /////generation.next) - @fail (at ! each (|>> %.nat (format "lux_when_fail") _.tag) /////generation.next) + [@done (at ! each (|>> %.nat (format "lux_when_done") _.tag) /////translation.next) + @fail (at ! each (|>> %.nat (format "lux_when_fail") _.tag) /////translation.next) pattern_matching! (pattern_matching' expression archive [$output @done @fail pathP])] (in (_.tagbody (list pattern_matching! @@ -242,10 +242,10 @@ @done))))) (def .public (when expression archive [valueS pathP]) - (Generator [Synthesis Path]) + (Translator [Synthesis Path]) (do [! ///////phase.monad] [initG (expression archive valueS) - $output (at ! each (|>> %.nat (format "lux_when_output") _.var) /////generation.next) + $output (at ! each (|>> %.nat (format "lux_when_output") _.var) /////translation.next) pattern_matching! (pattern_matching $output expression archive pathP) .let [storage (|> pathP ////synthesis/when.storage diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/extension.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/extension.lux index 9c8dbf379..410675ec4 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/extension.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/extension.lux @@ -19,7 +19,7 @@ ["[1][0]" extension] [// [synthesis (.only Synthesis)] - ["[0]" generation] + ["[0]" translation] [/// ["[1]" phase]]]]) @@ -46,7 +46,7 @@ [g!input+ (monad.all ! (list.repeated arity (macro.symbol "input")))] (in (list (` (is (All ((, g!_) (, g!anchor) (, g!expression) (, g!declaration)) (-> ((Arity (, (code.nat arity))) (, g!expression)) - (generation.Handler (, g!anchor) (, g!expression) (, g!declaration)))) + (translation.Handler (, g!anchor) (, g!expression) (, g!declaration)))) (function ((, g!_) (, g!extension)) (function ((, g!_) (, g!phase) (, g!archive) (, g!inputs)) (when (, g!inputs) @@ -77,7 +77,7 @@ (def .public (variadic extension) (All (_ anchor expression declaration) - (-> (Variadic expression) (generation.Handler anchor expression declaration))) + (-> (Variadic expression) (translation.Handler anchor expression declaration))) (function (_ phase archive inputsS) (let [! ///.monad] (|> inputsS diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js.lux index 911215b10..b8e01bea6 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js.lux @@ -22,7 +22,7 @@ ["[1][0]" reference] ["/[1]" // ["[1][0]" extension (.only) - [generation + [translation [js ["[1]/[0]" common]]]] ["/[1]" // @@ -38,9 +38,9 @@ (def (expression archive synthesis) Phase (when synthesis - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (//////phase#in (<generator> value))]) + (//////phase#in (<translator> value))]) ([synthesis.bit /primitive.bit] [synthesis.i64 /primitive.i64] [synthesis.f64 /primitive.f64] @@ -85,6 +85,6 @@ {synthesis.#Extension extension} (///extension.apply archive expression extension))) -(def .public generate +(def .public translate Phase ..expression) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/function.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/function.lux index f0bb48d3d..6c88699b5 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/function.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/function.lux @@ -13,7 +13,7 @@ [target ["_" js (.only Expression Computation Var Statement)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Phase! Generator)] + ["[1][0]" runtime (.only Operation Phase Phase! Translator)] ["[1][0]" reference] ["[1][0]" when] ["/[1]" // @@ -21,7 +21,7 @@ ["//[1]" /// [analysis (.only Abstraction Reification Analysis)] [synthesis (.only Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// [arity (.only Arity)] ["[1][0]" phase (.use "[1]#[0]" monad)] @@ -35,7 +35,7 @@ ["[1]" artifact]]]]]]]]) (def .public (apply expression archive [functionS argsS+]) - (Generator (Reification Synthesis)) + (Translator (Reification Synthesis)) (do [! ///////phase.monad] [functionO (expression archive functionS) argsO+ (monad.each ! (expression archive) argsS+)] @@ -73,14 +73,14 @@ (format (///reference.artifact function_name) "_scope")) (def .public (function statement expression archive [environment arity bodyS]) - (-> Phase! (Generator (Abstraction Synthesis))) + (-> Phase! (Translator (Abstraction Synthesis))) (do [! ///////phase.monad] [dependencies (cache.dependencies archive bodyS) - [function_name body!] (/////generation.with_new_context archive dependencies + [function_name body!] (/////translation.with_new_context archive dependencies (do ! [scope (at ! each ..@scope - (/////generation.context archive))] - (/////generation.with_anchor [1 scope] + (/////translation.context archive))] + (/////translation.with_anchor [1 scope] (statement expression archive bodyS)))) .let [arityO (|> arity .int _.i32) @num_args (_.var "num_args") @@ -126,6 +126,6 @@ (_.return (apply_poly (_.do "concat" (list @missing) @curried) @self)))))))) ))] - _ (/////generation.execute! definition) - _ (/////generation.save! (product.right function_name) {.#None} definition)] + _ (/////translation.execute! definition) + _ (/////translation.save! (product.right function_name) {.#None} definition)] (in instantiation))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/loop.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/loop.lux index 92811921c..8ad637f31 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/loop.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/loop.lux @@ -16,11 +16,11 @@ [target ["_" js (.only Computation Var Expression Statement)]]]]] ["[0]" // - [runtime (.only Operation Phase Phase! Generator Generator!)] + [runtime (.only Operation Phase Phase! Translator Translator!)] ["[1][0]" when] ["///[1]" //// [synthesis (.only Scope Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// ["[1][0]" phase] [reference @@ -62,7 +62,7 @@ (_.then (_.define $iteration (_.array bindings)))))) (def .public (scope! statement expression archive [start initsS+ bodyS]) - (Generator! (Scope Synthesis)) + (Translator! (Scope Synthesis)) (when initsS+ ... function/false/non-independent loop {.#End} @@ -71,11 +71,11 @@ ... true loop _ (do [! ///////phase.monad] - [@scope (at ! each ..@scope /////generation.next) + [@scope (at ! each ..@scope /////translation.next) initsO+ (monad.each ! (expression archive) initsS+) - body! (/////generation.with_anchor [start @scope] + body! (/////translation.with_anchor [start @scope] (statement expression archive bodyS)) - $iteration (at ! each ..$iteration /////generation.next)] + $iteration (at ! each ..$iteration /////translation.next)] (in (..setup $iteration true start initsO+ @@ -84,7 +84,7 @@ body!))))))) (def .public (scope statement expression archive [start initsS+ bodyS]) - (-> Phase! (Generator (Scope Synthesis))) + (-> Phase! (Translator (Scope Synthesis))) (when initsS+ ... function/false/non-independent loop {.#End} @@ -100,11 +100,11 @@ (_.var "lux_again_values")) (def .public (again! statement expression archive argsS+) - (Generator! (List Synthesis)) + (Translator! (List Synthesis)) (do [! ///////phase.monad] - [[offset @scope] /////generation.anchor + [[offset @scope] /////translation.anchor argsO+ (monad.each ! (expression archive) argsS+) - $iteration (at ! each ..$iteration /////generation.next)] + $iteration (at ! each ..$iteration /////translation.next)] (in (all _.then (_.define @temp (_.array argsO+)) (..setup $iteration diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/primitive.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/primitive.lux index 509108682..509108682 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/primitive.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/primitive.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/reference.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/reference.lux index 95393bf91..95393bf91 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/reference.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/reference.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/runtime.lux index ad0ee82b2..d729f96fb 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/runtime.lux @@ -29,7 +29,7 @@ ["[1][0]" reference] ["//[1]" /// ["[1][0]" synthesis (.only Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// (.only) ["[1][0]" phase] [reference @@ -52,19 +52,19 @@ [(type .public <name> (<base> Anchor Value Declaration))] - [Operation /////generation.Operation] - [Phase /////generation.Phase] - [Handler /////generation.Handler] - [Bundle /////generation.Bundle] + [Operation /////translation.Operation] + [Phase /////translation.Phase] + [Handler /////translation.Handler] + [Bundle /////translation.Bundle] ) -(type .public (Generator i) +(type .public (Translator i) (-> Phase Archive i (Operation Expression))) (type .public Phase! (-> Phase Archive Synthesis (Operation Statement))) -(type .public (Generator! i) +(type .public (Translator! i) (-> Phase! Phase Archive i (Operation Statement))) (def .public high @@ -823,11 +823,11 @@ (def module_id 0) -(def .public generate +(def .public translate (Operation [Registry Output]) (do ///////phase.monad - [_ (/////generation.execute! ..full) - _ (/////generation.save! ..module_id {.#None} ..full)] + [_ (/////translation.execute! ..full) + _ (/////translation.save! ..module_id {.#None} ..full)] (in [(|> registry.empty (registry.resource true unit.none) product.right) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/structure.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/structure.lux index ee1ae1a03..fef967449 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/structure.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/structure.lux @@ -7,7 +7,7 @@ [target ["_" js (.only Expression)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Generator)] + ["[1][0]" runtime (.only Operation Phase Translator)] ["[1][0]" primitive] ["///[1]" //// ["[1][0]" synthesis (.only Synthesis)] @@ -16,22 +16,22 @@ ["//[1]" /// (.only) ["[1][0]" phase (.use "[1]#[0]" monad)]]]]) -(def .public (tuple generate archive elemsS+) - (Generator (Tuple Synthesis)) +(def .public (tuple translate archive elemsS+) + (Translator (Tuple Synthesis)) (when elemsS+ {.#End} (///////phase#in //runtime.unit) {.#Item singletonS {.#End}} - (generate archive singletonS) + (translate archive singletonS) _ (do [! ///////phase.monad] - [elemsT+ (monad.each ! (generate archive) elemsS+)] + [elemsT+ (monad.each ! (translate archive) elemsS+)] (in (_.array elemsT+))))) -(def .public (variant generate archive [lefts right? valueS]) - (Generator (Variant Synthesis)) +(def .public (variant translate archive [lefts right? valueS]) + (Translator (Variant Synthesis)) (///////phase#each (//runtime.variant (_.i32 (.int lefts)) (//runtime.flag right?)) - (generate archive valueS))) + (translate archive valueS))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/when.lux index c7790d6d1..2e959853a 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/when.lux @@ -18,7 +18,7 @@ [target ["_" js (.only Expression Computation Var Statement)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Phase! Generator Generator!)] + ["[1][0]" runtime (.only Operation Phase Phase! Translator Translator!)] ["[1][0]" reference] ["[1][0]" primitive] ["/[1]" // @@ -42,7 +42,7 @@ (|>> (///reference.local //reference.system) as_expected)) (def .public (exec expression archive [this that]) - (Generator [Synthesis Synthesis]) + (Translator [Synthesis Synthesis]) (do ///////phase.monad [this (expression archive this) that (expression archive that)] @@ -50,7 +50,7 @@ (_.at (_.int +1)))))) (def .public (exec! statement expression archive [this that]) - (Generator! [Synthesis Synthesis]) + (Translator! [Synthesis Synthesis]) (do ///////phase.monad [this (expression archive this) that (statement expression archive that)] @@ -59,7 +59,7 @@ that)))) (def .public (let expression archive [valueS register bodyS]) - (Generator [Synthesis Register Synthesis]) + (Translator [Synthesis Register Synthesis]) (do ///////phase.monad [valueO (expression archive valueS) bodyO (expression archive bodyS)] @@ -69,7 +69,7 @@ (list valueO))))) (def .public (let! statement expression archive [valueS register bodyS]) - (Generator! [Synthesis Register Synthesis]) + (Translator! [Synthesis Register Synthesis]) (do ///////phase.monad [valueO (expression archive valueS) bodyO (statement expression archive bodyS)] @@ -78,7 +78,7 @@ bodyO)))) (def .public (if expression archive [testS thenS elseS]) - (Generator [Synthesis Synthesis Synthesis]) + (Translator [Synthesis Synthesis Synthesis]) (do ///////phase.monad [testO (expression archive testS) thenO (expression archive thenS) @@ -86,7 +86,7 @@ (in (_.? testO thenO elseO)))) (def .public (if! statement expression archive [testS thenS elseS]) - (Generator! [Synthesis Synthesis Synthesis]) + (Translator! [Synthesis Synthesis Synthesis]) (do ///////phase.monad [testO (expression archive testS) thenO (statement expression archive thenS) @@ -96,7 +96,7 @@ elseO)))) (def .public (get expression archive [pathP valueS]) - (Generator [(List Member) Synthesis]) + (Translator [(List Member) Synthesis]) (do ///////phase.monad [valueO (expression archive valueS)] (in (list#mix (function (_ side source) @@ -329,7 +329,7 @@ (_.throw (_.string ////synthesis/when.pattern_matching_error)))))) (def .public (when! statement expression archive [valueS pathP]) - (Generator! [Synthesis Path]) + (Translator! [Synthesis Path]) (do ///////phase.monad [stack_init (expression archive valueS) pattern_matching! (pattern_matching statement expression archive pathP)] @@ -340,7 +340,7 @@ pattern_matching!)))) (def .public (when statement expression archive [valueS pathP]) - (-> Phase! (Generator [Synthesis Path])) + (-> Phase! (Translator [Synthesis Path])) (do ///////phase.monad [pattern_matching! (..when! statement expression archive [valueS pathP])] (in (_.apply (_.closure (list) pattern_matching!) (list))))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm.lux index 3c4de2531..bfbe24cd2 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm.lux @@ -35,7 +35,7 @@ ["[0]" extension] [// ["[0]" synthesis (.only Synthesis)] - ["[0]" generation] + ["[0]" translation] [/// ["[0]" reference] ["[0]" phase (.use "[1]#[0]" monad)]]]]]) @@ -46,7 +46,7 @@ (Operation (Bytecode of)))) (do [! phase.monad] [.let [[expected_module line column] @] - actual_module generation.module + actual_module translation.module it it] (in (if (text#= expected_module actual_module) (do _.monad @@ -54,14 +54,14 @@ it) it)))) -(def .public (generate extender lux) +(def .public (translate extender lux) (-> extension.Extender Lux Phase) (function (phase archive synthesis) (when synthesis - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> @ value) (with_source_mapping @ - (phase#in (<generator> value)))]) + (phase#in (<translator> value)))]) ([synthesis.bit /primitive.bit] [synthesis.i64 /primitive.i64] [synthesis.f64 /primitive.f64] @@ -122,7 +122,7 @@ [@ {synthesis.#Extension [name parameters]}] (with_source_mapping @ - (extension.application extender lux phase archive .Generation false name parameters + (extension.application extender lux phase archive .Translation false name parameters (|>>) (function (_ _) {.#None}))) ))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/debug.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/debug.lux index 51ae831e0..51ae831e0 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/debug.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/debug.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function.lux index 0f4221157..f009e3fe3 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function.lux @@ -55,12 +55,12 @@ ["[1][0]" reset] ["[1][0]" apply]] ["/[1]" // - ["[1][0]" runtime (.only Operation Phase Generator)] + ["[1][0]" runtime (.only Operation Phase Translator)] ["[1][0]" reference] [//// [analysis (.only Environment)] ["[0]" synthesis (.only Synthesis Abstraction Apply)] - ["[0]" generation] + ["[0]" translation] [/// ["[0]" arity (.only Arity)] ["[0]" phase] @@ -70,7 +70,7 @@ [reference [variable (.only Register)]]]]]]) -(def .public (with generate archive @begin class environment arity body) +(def .public (with translate archive @begin class environment arity body) (-> Phase Archive Label External (Environment Synthesis) Arity (Bytecode Any) (Operation [(List (Resource Field)) (List (Resource Method)) @@ -90,7 +90,7 @@ (list (/implementation.method classT arity @begin body) (/apply.method classT environment arity @begin 1)))))] (do phase.monad - [instance (/new.instance generate archive classT environment arity)] + [instance (/new.instance translate archive classT environment arity)] (in [fields methods instance])))) (def modifier @@ -110,17 +110,17 @@ reflection.reflection name.internal)) -(def .public (abstraction generate archive [environment arity bodyS]) - (Generator Abstraction) +(def .public (abstraction translate archive [environment arity bodyS]) + (Translator Abstraction) (do phase.monad [dependencies (cache/artifact.dependencies archive bodyS) @begin //runtime.forge_label - [function_context bodyG] (<| (generation.with_new_context archive dependencies) - (generation.with_anchor [@begin ..this_offset]) - (generate archive bodyS)) + [function_context bodyG] (<| (translation.with_new_context archive dependencies) + (translation.with_anchor [@begin ..this_offset]) + (translate archive bodyS)) .let [function_class (//runtime.class_name function_context)] - [fields methods instance] (..with generate archive @begin function_class environment arity bodyG) - module generation.module + [fields methods instance] (..with translate archive @begin function_class environment arity bodyG) + module translation.module class (phase.lifted (class.class version.v6_0 ..modifier (name.internal function_class) @@ -130,14 +130,14 @@ methods (list (attribute.source_file module)))) .let [bytecode [function_class (\\format.result class.format class)]] - _ (generation.execute! bytecode) - _ (generation.save! (product.right function_context) {.#None} bytecode)] + _ (translation.execute! bytecode) + _ (translation.save! (product.right function_context) {.#None} bytecode)] (in instance))) -(def (apply/?' generate archive [abstractionG inputsS]) - (Generator [(Bytecode Any) (List Synthesis)]) +(def (apply/?' translate archive [abstractionG inputsS]) + (Translator [(Bytecode Any) (List Synthesis)]) (do [! phase.monad] - [inputsG (monad.each ! (generate archive) inputsS)] + [inputsG (monad.each ! (translate archive) inputsS)] (in (all _.composite abstractionG (|> inputsG @@ -151,50 +151,50 @@ )))) )))) -(def (apply/? generate archive [abstractionS inputsS]) - (Generator Apply) +(def (apply/? translate archive [abstractionS inputsS]) + (Translator Apply) (do [! phase.monad] - [abstractionG (generate archive abstractionS)] - (apply/?' generate archive [abstractionG inputsS]))) + [abstractionG (translate archive abstractionS)] + (apply/?' translate archive [abstractionG inputsS]))) -(def (apply/= generate archive [$abstraction @abstraction arity inputsS]) - (Generator [Symbol unit.ID Arity (List Synthesis)]) +(def (apply/= translate archive [$abstraction @abstraction arity inputsS]) + (Translator [Symbol unit.ID Arity (List Synthesis)]) (do [! phase.monad] [.let [:abstraction: (type.class (//runtime.class_name @abstraction) (list))] abstractionG (//reference.constant archive $abstraction) - inputsG (monad.each ! (generate archive) inputsS)] + inputsG (monad.each ! (translate archive) inputsS)] (in (all _.composite abstractionG (monad.all _.monad inputsG) (/implementation.call :abstraction: arity) )))) -(def (apply/> generate archive [$abstraction @abstraction arity inputsS]) - (Generator [Symbol unit.ID Arity (List Synthesis)]) +(def (apply/> translate archive [$abstraction @abstraction arity inputsS]) + (Translator [Symbol unit.ID Arity (List Synthesis)]) (do [! phase.monad] - [=G (apply/= generate archive [$abstraction @abstraction arity (list.first arity inputsS)])] - (apply/?' generate archive [=G (list.after arity inputsS)]))) + [=G (apply/= translate archive [$abstraction @abstraction arity (list.first arity inputsS)])] + (apply/?' translate archive [=G (list.after arity inputsS)]))) -(def .public (apply generate archive [abstractionS inputsS]) - (Generator Apply) +(def .public (apply translate archive [abstractionS inputsS]) + (Translator Apply) (when abstractionS (synthesis.constant @ $abstraction) (do [! phase.monad] - [[@definition |abstraction|] (generation.definition archive $abstraction) + [[@definition |abstraction|] (translation.definition archive $abstraction) .let [actual_arity (list.size inputsS)]] (when |abstraction| {.#Some [_ {.#Some [expected_arity @abstraction]}]} (cond (n.< expected_arity actual_arity) - (apply/? generate archive [abstractionS inputsS]) + (apply/? translate archive [abstractionS inputsS]) (n.= expected_arity actual_arity) - (apply/= generate archive [$abstraction @abstraction expected_arity inputsS]) + (apply/= translate archive [$abstraction @abstraction expected_arity inputsS]) ... (n.> expected_arity actual_arity) - (apply/> generate archive [$abstraction @abstraction expected_arity inputsS])) + (apply/> translate archive [$abstraction @abstraction expected_arity inputsS])) _ - (apply/? generate archive [abstractionS inputsS]))) + (apply/? translate archive [abstractionS inputsS]))) _ - (apply/? generate archive [abstractionS inputsS]))) + (apply/? translate archive [abstractionS inputsS]))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/abstract.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/abstract.lux index ea783b42a..ea783b42a 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/abstract.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/abstract.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/constant.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/constant.lux index cd54bb0f8..cd54bb0f8 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/constant.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/constant.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/constant/arity.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/constant/arity.lux index 0f7856172..0f7856172 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/constant/arity.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/constant/arity.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/variable.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/variable.lux index 17ef0b605..17ef0b605 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/variable.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/variable.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/variable/count.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/variable/count.lux index c58fad6cf..c58fad6cf 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/variable/count.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/variable/count.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/variable/foreign.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/variable/foreign.lux index ae7170923..ae7170923 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/variable/foreign.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/variable/foreign.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/variable/partial.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/variable/partial.lux index 7310e30ce..7310e30ce 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/variable/partial.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/variable/partial.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/method.lux index b00454753..b00454753 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/method.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/apply.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/method/apply.lux index 34a552ba6..34a552ba6 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/apply.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/method/apply.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/implementation.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/method/implementation.lux index 420872a39..420872a39 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/implementation.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/method/implementation.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/init.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/method/init.lux index 220755282..220755282 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/init.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/method/init.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/new.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/method/new.lux index fc53686f7..822c3b9eb 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/new.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/method/new.lux @@ -52,10 +52,10 @@ (///partial.new arity) (_.invokespecial class //init.name (//init.type environment arity)))) -(def .public (instance generate archive class environment arity) +(def .public (instance translate archive class environment arity) (-> Phase Archive (Type Class) (Environment Synthesis) Arity (Operation (Bytecode Any))) (do [! phase.monad] - [foreign* (monad.each ! (generate archive) environment)] + [foreign* (monad.each ! (translate archive) environment)] (in (instance' foreign* class environment arity)))) (def .public (method class environment arity) @@ -68,15 +68,15 @@ after_arity (is (-> Nat Nat) (|>> after_environment (n.+ 1)))] (method.method //.modifier //init.name - false (//init.type environment arity) - (list) - {.#Some (all _.composite - ////reference.this - (//init.super environment_size arity) - (monad.each _.monad (function (_ register) - (///foreign.put class register (_.aload (after_this register)))) - (list.indices environment_size)) - (monad.each _.monad (function (_ register) - (///partial.put class register (_.aload (after_arity register)))) - (list.indices (n.- ///arity.minimum arity))) - _.areturn)}))) + false (//init.type environment arity) + (list) + {.#Some (all _.composite + ////reference.this + (//init.super environment_size arity) + (monad.each _.monad (function (_ register) + (///foreign.put class register (_.aload (after_this register)))) + (list.indices environment_size)) + (monad.each _.monad (function (_ register) + (///partial.put class register (_.aload (after_arity register)))) + (list.indices (n.- ///arity.minimum arity))) + _.areturn)}))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/reset.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/method/reset.lux index 7f8154ed8..7f8154ed8 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/reset.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function/method/reset.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/host.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/host.lux index ea6b16da0..ea6b16da0 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/host.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/host.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/loop.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/loop.lux index 1a6682f08..edfc2c7d7 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/loop.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/loop.lux @@ -17,11 +17,11 @@ [jvm ["_" bytecode (.only Bytecode) (.use "[1]#[0]" monad)]]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Generator)] + ["[1][0]" runtime (.only Operation Phase Translator)] ["[1][0]" value] [//// ["[0]" synthesis (.only Path Synthesis)] - ["[0]" generation] + ["[0]" translation] [/// ["[0]" phase] [reference @@ -40,9 +40,9 @@ (_#in [])) (def .public (again translate archive updatesS) - (Generator (List Synthesis)) + (Translator (List Synthesis)) (do [! phase.monad] - [[@begin offset] generation.anchor + [[@begin offset] translation.anchor updatesG (|> updatesS list.enumeration (list#each (function (_ [index updateS]) @@ -74,11 +74,11 @@ (_.goto @begin))))) (def .public (scope translate archive [offset initsS+ iterationS]) - (Generator [Nat (List Synthesis) Synthesis]) + (Translator [Nat (List Synthesis) Synthesis]) (do [! phase.monad] [@begin //runtime.forge_label initsI+ (monad.each ! (translate archive) initsS+) - iterationG (generation.with_anchor [@begin offset] + iterationG (translation.with_anchor [@begin offset] (translate archive iterationS)) .let [initializationG (list#each (function (_ [index initG]) [initG (_.astore (n.+ offset index))]) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/primitive.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/primitive.lux index 5c9677bb7..5c9677bb7 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/primitive.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/primitive.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/program.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/program.lux index de928bd0b..de928bd0b 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/program.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/program.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/reference.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/reference.lux index 9f4a1c945..872083d50 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/reference.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/reference.lux @@ -19,7 +19,7 @@ ["[1][0]" type] ["//[1]" /// [// - ["[0]" generation] + ["[0]" translation] [/// ["[1]" phase (.use "operation#[0]" monad)] [reference @@ -44,7 +44,7 @@ (-> Archive Register (Operation (Bytecode Any))) (do [! ////.monad] [bytecode_name (at ! each //runtime.class_name - (generation.context archive))] + (translation.context archive))] (in (all _.composite ..this (_.getfield (type.class bytecode_name (list)) @@ -63,7 +63,7 @@ (def .public (constant archive name) (-> Archive Symbol (Operation (Bytecode Any))) (do ////.monad - [[@definition |abstraction|] (generation.definition archive name) + [[@definition |abstraction|] (translation.definition archive name) .let [:definition: (type.class (//runtime.class_name @definition) (list))]] (in (when |abstraction| {.#Some [_ {.#Some [expected_arity @abstraction]}]} diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/runtime.lux index 9966acbd6..efd4999c2 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/runtime.lux @@ -50,7 +50,7 @@ ["//[1]" /// [// ["[0]" synthesis] - ["[0]" generation] + ["[0]" translation] [/// ["[1]" phase] [arity (.only Arity)] @@ -82,18 +82,18 @@ [(type .public <name> (<base> Anchor Value Declaration))] - [Operation generation.Operation] - [Phase generation.Phase] - [Handler generation.Handler] - [Bundle generation.Bundle] - [Extender generation.Extender] + [Operation translation.Operation] + [Phase translation.Phase] + [Handler translation.Handler] + [Bundle translation.Bundle] + [Extender translation.Extender] ) -(type .public (Generator i) +(type .public (Translator i) (-> Phase Archive i (Operation (Bytecode Any)))) (type .public Host - (generation.Host (Bytecode Any) Definition)) + (translation.Host (Bytecode Any) Definition)) (def .public (class_name [module id]) (-> unit.ID Text) @@ -558,7 +558,7 @@ (def ^Object (type.class "java.lang.Object" (list))) -(def generate_runtime +(def translate_runtime (Operation [artifact.ID (Maybe Text) Binary]) (let [class (..reflection ..class) modifier (is (Modifier Class) @@ -588,11 +588,11 @@ ..throw::method)) (list)))] (do ////.monad - [_ (generation.execute! [class bytecode]) - _ (generation.save! ..artifact_id {.#None} [class bytecode])] + [_ (translation.execute! [class bytecode]) + _ (translation.save! ..artifact_id {.#None} [class bytecode])] (in [..artifact_id {.#None} bytecode])))) -(def generate_function +(def translate_function (Operation Any) (let [apply::method+ (|> (enum.range n.enum (++ //function/arity.minimum) @@ -650,16 +650,16 @@ (list.partial <init>::method apply::method+) (list)))] (do ////.monad - [_ (generation.execute! [class bytecode]) - ... _ (generation.save! //function.artifact_id {.#None} [class bytecode]) + [_ (translation.execute! [class bytecode]) + ... _ (translation.save! //function.artifact_id {.#None} [class bytecode]) ] (in [])))) -(def .public generate +(def .public translate (Operation [Registry Output]) (do ////.monad - [runtime_payload ..generate_runtime - ... _ ..generate_function + [runtime_payload ..translate_runtime + ... _ ..translate_function ] (in [(|> registry.empty (registry.resource .true unit.none) @@ -677,4 +677,4 @@ ... This shift is done to avoid the possibility of forged labels ... to be in the range of the labels that are generated automatically ... during the evaluation of Bytecode expressions. - (at ////.monad each (|>> ++ (i64.left_shifted shift)) generation.next))) + (at ////.monad each (|>> ++ (i64.left_shifted shift)) translation.next))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/structure.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/structure.lux index a05e38434..8f1f7696d 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/structure.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/structure.lux @@ -20,7 +20,7 @@ ["[0]" signed]]]]]]] ["[0]" // ["[1][0]" type] - ["[1][0]" runtime (.only Operation Phase Generator)] + ["[1][0]" runtime (.only Operation Phase Translator)] ["[1][0]" primitive] ["///[1]" //// ["[1][0]" synthesis (.only Synthesis)] @@ -30,7 +30,7 @@ ["[0]" phase]]]]) (def .public (tuple phase archive membersS) - (Generator (Tuple Synthesis)) + (Translator (Tuple Synthesis)) (when membersS {.#End} (at phase.monad in //runtime.unit) @@ -83,7 +83,7 @@ //runtime.left_right?)) (def .public (variant phase archive [lefts right? valueS]) - (Generator (Variant Synthesis)) + (Translator (Variant Synthesis)) (do phase.monad [valueI (phase archive valueS)] (in (do _.monad diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/type.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/type.lux index c178701b3..c178701b3 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/type.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/type.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/value.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/value.lux index 3d914a0e7..3d914a0e7 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/value.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/value.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/when.lux index e66312fbd..7629e3031 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/when.lux @@ -27,11 +27,11 @@ [category (.only Method)]]]]]]] ["[0]" // ["[1][0]" type] - ["[1][0]" runtime (.only Operation Phase Generator)] + ["[1][0]" runtime (.only Operation Phase Translator)] ["[1][0]" value] ["[1][0]" structure] [//// - ["[0]" generation] + ["[0]" translation] ["[0]" synthesis (.only Path Fork Synthesis) [access ["[0]" member (.only Member)]]] @@ -159,7 +159,7 @@ ) (def (path' stack_depth @else @end phase archive) - (-> Nat Label Label (Generator Path)) + (-> Nat Label Label (Translator Path)) (function (again path) (.when path {synthesis.#Pop} @@ -244,7 +244,7 @@ ))) (def (path @end phase archive path) - (-> Label (Generator Path)) + (-> Label (Translator Path)) (do phase.monad [@else //runtime.forge_label path! (..path' 1 @else @end phase archive path)] @@ -259,7 +259,7 @@ )))) (def .public (if phase archive [testS thenS elseS]) - (Generator [Synthesis Synthesis Synthesis]) + (Translator [Synthesis Synthesis Synthesis]) (do phase.monad [test! (phase archive testS) then! (phase archive thenS) @@ -279,7 +279,7 @@ (_.set_label @end))))))) (def .public (exec phase archive [this that]) - (Generator [Synthesis Synthesis]) + (Translator [Synthesis Synthesis]) (do phase.monad [this! (phase archive this) that! (phase archive that)] @@ -289,7 +289,7 @@ that!)))) (def .public (let phase archive [inputS register bodyS]) - (Generator [Synthesis Register Synthesis]) + (Translator [Synthesis Register Synthesis]) (do phase.monad [input! (phase archive inputS) body! (phase archive bodyS)] @@ -299,7 +299,7 @@ body!)))) (def .public (get phase archive [path recordS]) - (Generator [(List Member) Synthesis]) + (Translator [(List Member) Synthesis]) (do phase.monad [record! (phase archive recordS)] (in (list#mix (function (_ step so_far!) @@ -313,7 +313,7 @@ (list.reversed path))))) (def .public (when phase archive [valueS path]) - (Generator [Synthesis Path]) + (Translator [Synthesis Path]) (do phase.monad [@end //runtime.forge_label value! (phase archive valueS) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua.lux index ef70e5688..7efaa9bc8 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua.lux @@ -22,7 +22,7 @@ ["[1][0]" reference] ["/[1]" // ["[1][0]" extension (.only) - [generation + [translation [lua ["[1]/[0]" common]]]] ["/[1]" // @@ -38,9 +38,9 @@ (def (expression archive synthesis) Phase (when synthesis - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (//////phase#in (<generator> value))]) + (//////phase#in (<translator> value))]) ([synthesis.bit /primitive.bit] [synthesis.i64 /primitive.i64] [synthesis.f64 /primitive.f64] @@ -85,6 +85,6 @@ {synthesis.#Extension extension} (///extension.apply archive expression extension))) -(def .public generate +(def .public translate Phase ..expression) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/function.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/function.lux index 0e7b19de8..a9ed9d0fe 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/function.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/function.lux @@ -13,7 +13,7 @@ [target ["_" lua (.only Var Expression Label Statement)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Phase! Generator)] + ["[1][0]" runtime (.only Operation Phase Phase! Translator)] ["[1][0]" reference] ["[1][0]" when] ["/[1]" // @@ -21,7 +21,7 @@ ["//[1]" /// [analysis (.only Abstraction Reification Analysis)] [synthesis (.only Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// [arity (.only Arity)] ["[1][0]" phase (.use "[1]#[0]" monad)] @@ -35,7 +35,7 @@ [variable (.only Register Variable)]]]]]]) (def .public (apply expression archive [functionS argsS+]) - (Generator (Reification Synthesis)) + (Translator (Reification Synthesis)) (do [! ///////phase.monad] [functionO (expression archive functionS) argsO+ (monad.each ! (expression archive) argsS+)] @@ -69,14 +69,14 @@ (_.label (format (///reference.artifact function_name) "_scope"))) (def .public (function statement expression archive [environment arity bodyS]) - (-> Phase! (Generator (Abstraction Synthesis))) + (-> Phase! (Translator (Abstraction Synthesis))) (do [! ///////phase.monad] [dependencies (cache.dependencies archive bodyS) - [function_name body!] (/////generation.with_new_context archive dependencies + [function_name body!] (/////translation.with_new_context archive dependencies (do ! [@scope (at ! each ..@scope - (/////generation.context archive))] - (/////generation.with_anchor [1 @scope] + (/////translation.context archive))] + (/////translation.with_anchor [1 @scope] (statement expression archive bodyS)))) closureO+ (monad.each ! (expression archive) environment) .let [@curried (_.var "curried") @@ -139,6 +139,6 @@ (_.var "table.move")))) @self))))))) ))] - _ (/////generation.execute! definition) - _ (/////generation.save! (product.right function_name) {.#None} definition)] + _ (/////translation.execute! definition) + _ (/////translation.save! (product.right function_name) {.#None} definition)] (in instantiation))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/loop.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/loop.lux index f3532770a..5574b06a1 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/loop.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/loop.lux @@ -17,13 +17,13 @@ [target ["_" lua (.only Var Expression Label Statement)]]]]] ["[0]" // - [runtime (.only Operation Phase Phase! Generator Generator!)] + [runtime (.only Operation Phase Phase! Translator Translator!)] ["[1][0]" when] ["/[1]" // ["[1][0]" reference] ["//[1]" /// ["[0]"synthesis (.only Scope Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// ["[1][0]" phase] [meta @@ -52,7 +52,7 @@ body)))) (def .public (scope! statement expression archive as_expression? [start initsS+ bodyS]) - ... (Generator! (Scope Synthesis)) + ... (Translator! (Scope Synthesis)) (-> Phase! Phase Archive Bit (Scope Synthesis) (Operation [(List Expression) Statement])) (when initsS+ @@ -65,9 +65,9 @@ ... true loop _ (do [! ///////phase.monad] - [@scope (at ! each ..@scope /////generation.next) + [@scope (at ! each ..@scope /////translation.next) initsO+ (monad.each ! (expression archive) initsS+) - body! (/////generation.with_anchor [start @scope] + body! (/////translation.with_anchor [start @scope] (statement expression archive bodyS))] (in [initsO+ (..setup true start initsO+ as_expression? @@ -76,7 +76,7 @@ body!))])))) (def .public (scope statement expression archive [start initsS+ bodyS]) - (-> Phase! (Generator (Scope Synthesis))) + (-> Phase! (Translator (Scope Synthesis))) (when initsS+ ... function/false/non-independent loop {.#End} @@ -86,7 +86,7 @@ _ (do [! ///////phase.monad] [dependencies (cache.dependencies archive bodyS) - [[artifact_module artifact_id] [initsO+ scope!]] (/////generation.with_new_context archive dependencies + [[artifact_module artifact_id] [initsO+ scope!]] (/////translation.with_new_context archive dependencies (scope! statement expression archive true [start initsS+ bodyS])) .let [@loop (_.var (///reference.artifact [artifact_module artifact_id])) locals (|> initsO+ @@ -112,13 +112,13 @@ (_.return @loop) )) (_.apply foreigns @context)])))] - _ (/////generation.execute! declaration) - _ (/////generation.save! artifact_id {.#None} declaration)] + _ (/////translation.execute! declaration) + _ (/////translation.save! artifact_id {.#None} declaration)] (in (_.apply initsO+ instantiation))))) (def .public (again! statement expression archive argsS+) - (Generator! (List Synthesis)) + (Translator! (List Synthesis)) (do [! ///////phase.monad] - [[offset @scope] /////generation.anchor + [[offset @scope] /////translation.anchor argsO+ (monad.each ! (expression archive) argsS+)] (in (..setup false offset argsO+ false (_.go_to @scope))))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/primitive.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/primitive.lux index 48c05d948..48c05d948 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/primitive.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/primitive.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/reference.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/reference.lux index f7309bb8c..f7309bb8c 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/reference.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/reference.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/runtime.lux index c16856732..354619c27 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/runtime.lux @@ -29,7 +29,7 @@ ["[1][0]" reference] ["//[1]" /// ["[1][0]" synthesis (.only Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// (.only) ["[1][0]" phase] [reference @@ -52,19 +52,19 @@ [(type .public <name> (<base> Anchor Value Declaration))] - [Operation /////generation.Operation] - [Phase /////generation.Phase] - [Handler /////generation.Handler] - [Bundle /////generation.Bundle] + [Operation /////translation.Operation] + [Phase /////translation.Phase] + [Handler /////translation.Handler] + [Bundle /////translation.Bundle] ) -(type .public (Generator i) +(type .public (Translator i) (-> Phase Archive i (Operation Expression))) (type .public Phase! (-> Phase Archive Synthesis (Operation Statement))) -(type .public (Generator! i) +(type .public (Translator! i) (-> Phase! Phase Archive i (Operation Statement))) (def .public unit @@ -446,11 +446,11 @@ ..runtime//array )) -(def .public generate +(def .public translate (Operation [Registry Output]) (do ///////phase.monad - [_ (/////generation.execute! ..full) - _ (/////generation.save! ..module_id {.#None} ..full)] + [_ (/////translation.execute! ..full) + _ (/////translation.save! ..module_id {.#None} ..full)] (in [(|> registry.empty (registry.resource true unit.none) product.right) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/structure.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/structure.lux index c623bd592..d9c24bbd8 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/structure.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/structure.lux @@ -7,7 +7,7 @@ [target ["_" lua (.only Expression)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Generator)] + ["[1][0]" runtime (.only Operation Phase Translator)] ["[1][0]" primitive] ["///[1]" //// ["[1][0]" synthesis (.only Synthesis)] @@ -17,7 +17,7 @@ ["[1][0]" phase (.use "[1]#[0]" monad)]]]]) (def .public (tuple phase archive elemsS+) - (Generator (Tuple Synthesis)) + (Translator (Tuple Synthesis)) (when elemsS+ {.#End} (///////phase#in (//primitive.text /////synthesis.unit)) @@ -31,6 +31,6 @@ (///////phase#each _.array)))) (def .public (variant phase archive [lefts right? valueS]) - (Generator (Variant Synthesis)) + (Translator (Variant Synthesis)) (///////phase#each (//runtime.variant lefts right?) (phase archive valueS))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/when.lux index 7e9e383ca..318fde486 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/when.lux @@ -15,7 +15,7 @@ [target ["_" lua (.only Expression Var Statement)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Phase! Generator Generator!)] + ["[1][0]" runtime (.only Operation Phase Phase! Translator Translator!)] ["[1][0]" reference] ["[1][0]" primitive] ["/[1]" // @@ -27,7 +27,7 @@ ["[1][0]" synthesis (.only Synthesis Path) [access ["[0]" member (.only Member)]]] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// [reference ["[1][0]" variable (.only Register)]] @@ -44,7 +44,7 @@ (|>> (///reference.foreign //reference.system) as_expected)) (def .public (exec expression archive [this that]) - (Generator [Synthesis Synthesis]) + (Translator [Synthesis Synthesis]) (do ///////phase.monad [this (expression archive this) that (expression archive that)] @@ -52,17 +52,17 @@ (_.item (_.int +2)))))) (def .public (exec! statement expression archive [this that]) - (Generator! [Synthesis Synthesis]) + (Translator! [Synthesis Synthesis]) (do [! ///////phase.monad] [this (expression archive this) that (statement expression archive that) - $dummy (at ! each _.var (/////generation.symbol "_exec"))] + $dummy (at ! each _.var (/////translation.symbol "_exec"))] (in (all _.then (_.set (list $dummy) this) that)))) (def .public (let expression archive [valueS register bodyS]) - (Generator [Synthesis Register Synthesis]) + (Translator [Synthesis Register Synthesis]) (do ///////phase.monad [valueO (expression archive valueS) bodyO (expression archive bodyS)] @@ -73,7 +73,7 @@ (_.apply (list valueO)))))) (def .public (let! statement expression archive [valueS register bodyS]) - (Generator! [Synthesis Register Synthesis]) + (Translator! [Synthesis Register Synthesis]) (do ///////phase.monad [valueO (expression archive valueS) bodyO (statement expression archive bodyS)] @@ -82,7 +82,7 @@ bodyO)))) (def .public (get expression archive [pathP valueS]) - (Generator [(List Member) Synthesis]) + (Translator [(List Member) Synthesis]) (do ///////phase.monad [valueO (expression archive valueS)] (in (list#mix (function (_ side source) @@ -94,7 +94,7 @@ (list.reversed pathP))))) (def .public (if expression archive [testS thenS elseS]) - (Generator [Synthesis Synthesis Synthesis]) + (Translator [Synthesis Synthesis Synthesis]) (do ///////phase.monad [testO (expression archive testS) thenO (expression archive thenS) @@ -106,7 +106,7 @@ (_.apply (list)))))) (def .public (if! statement expression archive [testS thenS elseS]) - (Generator! [Synthesis Synthesis Synthesis]) + (Translator! [Synthesis Synthesis Synthesis]) (do ///////phase.monad [testO (expression archive testS) thenO (statement expression archive thenS) @@ -285,7 +285,7 @@ (..capture register)))))) (def .public (when! statement expression archive [valueS pathP]) - (Generator! [Synthesis Path]) + (Translator! [Synthesis Path]) (do ///////phase.monad [stack_init (expression archive valueS) pattern_matching! (pattern_matching statement expression archive pathP)] @@ -296,7 +296,7 @@ pattern_matching!)))) (def .public (when statement expression archive [valueS pathP]) - (-> Phase! (Generator [Synthesis Path])) + (-> Phase! (Translator [Synthesis Path])) (|> [valueS pathP] (..when! statement expression archive) (at ///////phase.monad each diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php.lux index b78a425d9..ad1eb6e86 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php.lux @@ -54,9 +54,9 @@ (////synthesis.branch/when when) (/when.when! statement expression archive when) - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (<generator> statement expression archive value)]) + (<translator> statement expression archive value)]) ([////synthesis.branch/let /when.let!] [////synthesis.branch/if /when.if!] [////synthesis.loop/scope /loop.scope!] @@ -71,9 +71,9 @@ (def .public (expression archive synthesis) Phase (when synthesis - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (//////phase#in (<generator> value))]) + (//////phase#in (<translator> value))]) ([////synthesis.bit /primitive.bit] [////synthesis.i64 /primitive.i64] [////synthesis.f64 /primitive.f64] @@ -82,9 +82,9 @@ {////synthesis.#Reference value} (//reference.reference /reference.system archive value) - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (<generator> expression archive value)]) + (<translator> expression archive value)]) ([////synthesis.variant /structure.variant] [////synthesis.tuple /structure.tuple] [////synthesis.branch/let /when.let] @@ -92,9 +92,9 @@ [////synthesis.branch/get /when.get] [////synthesis.function/apply /function.apply]) - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (<generator> statement expression archive value)]) + (<translator> statement expression archive value)]) ([////synthesis.branch/when /when.when] [////synthesis.loop/scope /loop.scope] [////synthesis.function/abstraction /function.function]) @@ -105,6 +105,6 @@ {////synthesis.#Extension extension} (///extension.apply archive expression extension))) -(def .public generate +(def .public translate Phase ..expression) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/extension.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/extension.lux index 1d1c8473f..1d1c8473f 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/extension.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/extension.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/extension/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/extension/common.lux index 26e582da3..26e582da3 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/extension/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/extension/common.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/function.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/function.lux index e4195f3d4..abbe8d677 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/function.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/function.lux @@ -15,7 +15,7 @@ [target ["_" php (.only Var Global Expression Argument Label Statement)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Phase! Generator)] + ["[1][0]" runtime (.only Operation Phase Phase! Translator)] ["[1][0]" reference] ["[1][0]" when] ["/[1]" // @@ -23,7 +23,7 @@ ["//[1]" /// [analysis (.only Variant Tuple Abstraction Application Analysis)] [synthesis (.only Synthesis)] - ["[1][0]" generation (.only Context)] + ["[1][0]" translation (.only Context)] ["//[1]" /// [arity (.only Arity)] ["[1][0]" phase (.use "[1]#[0]" monad)] @@ -31,7 +31,7 @@ [variable (.only Register Variable)]]]]]]) (def .public (apply expression archive [functionS argsS+]) - (Generator (Application Synthesis)) + (Translator (Application Synthesis)) (do [! ///////phase.monad] [functionG (expression archive functionS) argsG+ (monad.each ! (expression archive) argsS+)] @@ -69,13 +69,13 @@ (_.apply inits @selfG)]))) (def .public (function statement expression archive [environment arity bodyS]) - (-> Phase! (Generator (Abstraction Synthesis))) + (-> Phase! (Translator (Abstraction Synthesis))) (do [! ///////phase.monad] - [[function_name body!] (/////generation.with_new_context archive + [[function_name body!] (/////translation.with_new_context archive (do ! [@scope (at ! each ..@scope - (/////generation.context archive))] - (/////generation.with_anchor [1 @scope] + (/////translation.context archive))] + (/////translation.with_anchor [1 @scope] (statement expression archive bodyS)))) closureG+ (monad.each ! (expression archive) environment) .let [@curried (_.var "curried") @@ -112,6 +112,6 @@ (_.set! @missing (_.func_get_args/0 [])) (_.return (_.call_user_func_array/2 [@selfL (_.array_merge/+ @curried (list @missing))]))))))) ))] - _ (/////generation.execute! definition) - _ (/////generation.save! (product.right function_name) definition)] + _ (/////translation.execute! definition) + _ (/////translation.save! (product.right function_name) definition)] (in instantiation))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/loop.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/loop.lux index b4c3804e8..3c8d784ab 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/loop.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/loop.lux @@ -17,7 +17,7 @@ [target ["_" php (.only Var Expression Label Statement)]]]]] ["[0]" // - [runtime (.only Operation Phase Phase! Generator Generator!)] + [runtime (.only Operation Phase Phase! Translator Translator!)] ["[1][0]" when] ["/[1]" // ["[1][0]" reference] @@ -26,7 +26,7 @@ ["[0]" when]] ["/[1]" // ["[0]" synthesis (.only Scope Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// ["[1][0]" phase] [meta @@ -50,7 +50,7 @@ (list#mix _.then body))) (def .public (scope! statement expression archive [start initsS+ bodyS]) - (Generator! (Scope Synthesis)) + (Translator! (Scope Synthesis)) (when initsS+ ... function/false/non-independent loop {.#End} @@ -59,9 +59,9 @@ ... true loop _ (do [! ///////phase.monad] - [@scope (at ! each ..@scope /////generation.next) + [@scope (at ! each ..@scope /////translation.next) initsO+ (monad.each ! (expression archive) initsS+) - body! (/////generation.with_anchor [start @scope] + body! (/////translation.with_anchor [start @scope] (statement expression archive bodyS))] (in (..setup start initsO+ (all _.then @@ -69,7 +69,7 @@ body!)))))) (def .public (scope statement expression archive [start initsS+ bodyS]) - (-> Phase! (Generator (Scope Synthesis))) + (-> Phase! (Translator (Scope Synthesis))) (when initsS+ ... function/false/non-independent loop {.#End} @@ -78,7 +78,7 @@ ... true loop _ (do [! ///////phase.monad] - [[[loop_module loop_artifact] scope!] (/////generation.with_new_context archive + [[[loop_module loop_artifact] scope!] (/////translation.with_new_context archive (..scope! statement expression archive [start initsS+ bodyS])) .let [locals (|> initsS+ list.enumeration @@ -102,18 +102,18 @@ [(<| (_.define_function @loop (list#each _.parameter foreigns)) (_.return (_.closure (list#each _.parameter foreigns) (list) scope!))) (_.apply foreigns @loop)]))] - _ (/////generation.execute! declaration) - _ (/////generation.save! loop_artifact declaration)] + _ (/////translation.execute! declaration) + _ (/////translation.save! loop_artifact declaration)] (in (_.apply (list) instantiation))))) -... TODO: Stop using a constant hard-coded variable. Generate a new one each time. +... TODO: Stop using a constant hard-coded variable. Translate a new one each time. (def @temp (_.var "lux_again_values")) (def .public (again! statement expression archive argsS+) - (Generator! (List Synthesis)) + (Translator! (List Synthesis)) (do [! ///////phase.monad] - [[offset @scope] /////generation.anchor + [[offset @scope] /////translation.anchor argsO+ (monad.each ! (expression archive) argsS+)] (in (all _.then (_.set! @temp (_.array/* argsO+)) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/primitive.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/primitive.lux index eaf53dada..eaf53dada 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/primitive.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/primitive.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/reference.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/reference.lux index 2dbdfad8a..2dbdfad8a 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/reference.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/reference.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/runtime.lux index b1d1abe87..e40c8110c 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/runtime.lux @@ -29,7 +29,7 @@ ["[1][0]" reference] ["//[1]" /// ["[1][0]" synthesis (.only Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// (.only) ["[1][0]" phase] [reference @@ -42,19 +42,19 @@ [(type .public <name> (<base> [Nat Label] Expression Statement))] - [Operation /////generation.Operation] - [Phase /////generation.Phase] - [Handler /////generation.Handler] - [Bundle /////generation.Bundle] + [Operation /////translation.Operation] + [Phase /////translation.Phase] + [Handler /////translation.Handler] + [Bundle /////translation.Bundle] ) -(type .public (Generator i) +(type .public (Translator i) (-> Phase Archive i (Operation Expression))) (type .public Phase! (-> Phase Archive Synthesis (Operation Statement))) -(type .public (Generator! i) +(type .public (Translator! i) (-> Phase! Phase Archive i (Operation Statement))) (def .public unit @@ -621,11 +621,11 @@ runtime//io )) -(def .public generate +(def .public translate (Operation [Registry Output]) (do ///////phase.monad - [_ (/////generation.execute! ..runtime) - _ (/////generation.save! ..module_id ..runtime)] + [_ (/////translation.execute! ..runtime) + _ (/////translation.save! ..module_id ..runtime)] (in [(|> artifact.empty artifact.resource product.right) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/structure.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/structure.lux index 239d34609..ecb5cde47 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/structure.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/structure.lux @@ -9,7 +9,7 @@ [target ["_" php (.only Expression)]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Generator)] + ["[1][0]" runtime (.only Operation Phase Translator)] ["[1][0]" primitive] ["///[1]" //// [analysis (.only Variant Tuple)] @@ -18,7 +18,7 @@ ["[1][0]" phase (.use "[1]#[0]" monad)]]]]) (def .public (tuple expression archive elemsS+) - (Generator (Tuple Synthesis)) + (Translator (Tuple Synthesis)) (when elemsS+ {.#End} (///////phase#in (//primitive.text /////synthesis.unit)) @@ -34,7 +34,7 @@ (//runtime.tuple//make size))))))) (def .public (variant expression archive [lefts right? valueS]) - (Generator (Variant Synthesis)) + (Translator (Variant Synthesis)) (let [tag (if right? (++ lefts) lefts)] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/when.lux index fc703eb8b..3bab8fc81 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/when.lux @@ -19,7 +19,7 @@ [target ["_" php (.only Expression Var Statement)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Phase! Generator Generator!)] + ["[1][0]" runtime (.only Operation Phase Phase! Translator Translator!)] ["[1][0]" reference] ["[1][0]" primitive] ["/[1]" // @@ -29,7 +29,7 @@ ["[1]/[0]" when]] ["/[1]" // ["[1][0]" synthesis (.only Member Synthesis Path)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// [reference ["[1][0]" variable (.only Register)]] @@ -46,7 +46,7 @@ (|>> (///reference.foreign //reference.system) as_expected)) (def .public (let expression archive [valueS register bodyS]) - (Generator [Synthesis Register Synthesis]) + (Translator [Synthesis Register Synthesis]) (do ///////phase.monad [valueG (expression archive valueS) bodyG (expression archive bodyS)] @@ -56,7 +56,7 @@ (_.item (_.int +1)))))) (def .public (let! statement expression archive [valueS register bodyS]) - (Generator! [Synthesis Register Synthesis]) + (Translator! [Synthesis Register Synthesis]) (do ///////phase.monad [valueO (expression archive valueS) body! (statement expression archive bodyS)] @@ -65,7 +65,7 @@ body!)))) (def .public (if expression archive [testS thenS elseS]) - (Generator [Synthesis Synthesis Synthesis]) + (Translator [Synthesis Synthesis Synthesis]) (do ///////phase.monad [testG (expression archive testS) thenG (expression archive thenS) @@ -73,7 +73,7 @@ (in (_.? testG thenG elseG)))) (def .public (if! statement expression archive [testS thenS elseS]) - (Generator! [Synthesis Synthesis Synthesis]) + (Translator! [Synthesis Synthesis Synthesis]) (do ///////phase.monad [test! (expression archive testS) then! (statement expression archive thenS) @@ -83,7 +83,7 @@ else!)))) (def .public (get expression archive [pathP valueS]) - (Generator [(List Member) Synthesis]) + (Translator [(List Member) Synthesis]) (do ///////phase.monad [valueG (expression archive valueS)] (in (list#mix (function (_ side source) @@ -163,7 +163,7 @@ post!))) (def (pattern_matching' statement expression archive) - (Generator! Path) + (Translator! Path) (function (again pathP) (.when pathP {/////synthesis.#Then bodyS} @@ -252,7 +252,7 @@ [/////synthesis.path/alt ..alternation])))) (def (pattern_matching statement expression archive pathP) - (Generator! Path) + (Translator! Path) (do ///////phase.monad [iteration! (pattern_matching' statement expression archive pathP)] (in (all _.then @@ -274,7 +274,7 @@ (..capture register)))))) (def .public (when! statement expression archive [valueS pathP]) - (Generator! [Synthesis Path]) + (Translator! [Synthesis Path]) (do ///////phase.monad [stack_init (expression archive valueS) pattern_matching! (pattern_matching statement expression archive pathP)] @@ -284,14 +284,14 @@ pattern_matching!)))) (def .public (when statement expression archive [valueS pathP]) - (-> Phase! (Generator [Synthesis Path])) + (-> Phase! (Translator [Synthesis Path])) (do [! ///////phase.monad] - [[[when_module when_artifact] when!] (/////generation.with_new_context archive + [[[when_module when_artifact] when!] (/////translation.with_new_context archive (when! statement expression archive [valueS pathP])) .let [@when (_.constant (///reference.artifact [when_module when_artifact])) @dependencies+ (..dependencies (/////synthesis.path/seq (/////synthesis.path/then valueS) pathP)) declaration (_.define_function @when (list#each _.parameter @dependencies+) when!)] - _ (/////generation.execute! declaration) - _ (/////generation.save! when_artifact declaration)] + _ (/////translation.execute! declaration) + _ (/////translation.save! when_artifact declaration)] (in (_.apply @dependencies+ @when)))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python.lux index 4f2ead520..4555c1b6a 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python.lux @@ -22,7 +22,7 @@ ["[1][0]" reference] ["/[1]" // ["[1][0]" extension (.only) - [generation + [translation [python ["[1]/[0]" common]]]] ["/[1]" // @@ -38,17 +38,17 @@ (def .public (expression archive synthesis) Phase (when synthesis - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (//////phase#in (<generator> value))]) + (//////phase#in (<translator> value))]) ([////synthesis.bit /primitive.bit] [////synthesis.i64 /primitive.i64] [////synthesis.f64 /primitive.f64] [////synthesis.text /primitive.text]) - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (<generator> expression archive value)]) + (<translator> expression archive value)]) ([////synthesis.variant /structure.variant] [////synthesis.tuple /structure.tuple] @@ -59,9 +59,9 @@ [////synthesis.function/apply /function.apply]) - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (<generator> ///extension/common.statement expression archive value)]) + (<translator> ///extension/common.statement expression archive value)]) ([////synthesis.branch/when /when.when] [////synthesis.loop/scope /loop.scope] [////synthesis.function/abstraction /function.function]) @@ -75,6 +75,6 @@ {////synthesis.#Extension extension} (///extension.apply archive expression extension))) -(def .public generate +(def .public translate Phase ..expression) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/function.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/function.lux index 7afc45ccb..5ee68797a 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/function.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/function.lux @@ -13,7 +13,7 @@ [target ["_" python (.only SVar Expression Statement)]]]]] ["[0]" // - [runtime (.only Operation Phase Generator Phase! Generator!)] + [runtime (.only Operation Phase Translator Phase! Translator!)] ["[1][0]" reference] ["[1][0]" when] ["[1][0]" loop] @@ -22,7 +22,7 @@ ["//[1]" /// [analysis (.only Environment Abstraction Reification Analysis)] [synthesis (.only Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// [arity (.only Arity)] ["[1][0]" phase] @@ -36,7 +36,7 @@ ["[1]" artifact]]]]]]]]) (def .public (apply expression archive [functionS argsS+]) - (Generator (Reification Synthesis)) + (Translator (Reification Synthesis)) (do [! ///////phase.monad] [functionO (expression archive functionS) argsO+ (monad.each ! (expression archive) argsS+)] @@ -51,8 +51,8 @@ (when inits {.#End} (do ///////phase.monad - [_ (/////generation.execute! function_definition) - _ (/////generation.save! function_id {.#None} function_definition)] + [_ (/////translation.execute! function_definition) + _ (/////translation.save! function_id {.#None} function_definition)] (in @function)) _ @@ -63,19 +63,19 @@ (all _.then function_definition (_.return @function)))] - _ (/////generation.execute! declaration) - _ (/////generation.save! function_id {.#None} declaration)] + _ (/////translation.execute! declaration) + _ (/////translation.save! function_id {.#None} declaration)] (in (_.apply inits @function))))) (def input (|>> ++ //when.register)) (def .public (function statement expression archive [environment arity bodyS]) - (-> Phase! (Generator (Abstraction Synthesis))) + (-> Phase! (Translator (Abstraction Synthesis))) (do [! ///////phase.monad] [dependencies (cache.dependencies archive bodyS) - [[function_module function_artifact] body!] (/////generation.with_new_context archive dependencies - (/////generation.with_anchor 1 + [[function_module function_artifact] body!] (/////translation.with_new_context archive dependencies + (/////translation.with_anchor 1 (statement expression archive bodyS))) environment (monad.each ! (expression archive) environment) .let [@curried (_.var "curried") diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/loop.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/loop.lux index 16df5397a..3d4943710 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/loop.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/loop.lux @@ -17,7 +17,7 @@ [target ["_" python (.only Expression SVar Statement)]]]]] ["[0]" // - [runtime (.only Operation Phase Generator Phase! Generator!)] + [runtime (.only Operation Phase Translator Phase! Translator!)] ["[1][0]" when] ["/[1]" // ["[1][0]" reference] @@ -26,7 +26,7 @@ ["[0]" when]] ["/[1]" // ["[0]" synthesis (.only Scope Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// ["[1][0]" phase] [meta @@ -52,7 +52,7 @@ {.#None})) (def .public (scope! statement expression archive [start initsS+ bodyS]) - (Generator! (Scope Synthesis)) + (Translator! (Scope Synthesis)) (when initsS+ ... function/false/non-independent loop {.#End} @@ -62,14 +62,14 @@ _ (do [! ///////phase.monad] [initsO+ (monad.each ! (expression archive) initsS+) - body! (/////generation.with_anchor start + body! (/////translation.with_anchor start (statement expression archive bodyS))] (in (<| (..setup start initsO+) ..set_scope body!))))) (def .public (scope statement expression archive [start initsS+ bodyS]) - (-> Phase! (Generator (Scope Synthesis))) + (-> Phase! (Translator (Scope Synthesis))) (when initsS+ ... function/false/non-independent loop {.#End} @@ -80,8 +80,8 @@ (do [! ///////phase.monad] [dependencies (cache.dependencies archive bodyS) initsO+ (monad.each ! (expression archive) initsS+) - [[loop_module loop_artifact] body!] (/////generation.with_new_context archive dependencies - (/////generation.with_anchor start + [[loop_module loop_artifact] body!] (/////translation.with_new_context archive dependencies + (/////translation.with_anchor start (statement expression archive bodyS))) .let [@loop (_.var (///reference.artifact [loop_module loop_artifact])) locals (|> initsS+ @@ -107,14 +107,14 @@ (_.return @loop) )) (_.apply foreigns @loop)]))] - _ (/////generation.execute! declaration) - _ (/////generation.save! loop_artifact {.#None} declaration)] + _ (/////translation.execute! declaration) + _ (/////translation.save! loop_artifact {.#None} declaration)] (in (_.apply initsO+ instantiation))))) (def .public (again! statement expression archive argsS+) - (Generator! (List Synthesis)) + (Translator! (List Synthesis)) (do [! ///////phase.monad] - [offset /////generation.anchor + [offset /////translation.anchor @temp (//when.symbol "lux_again_values") argsO+ (monad.each ! (expression archive) argsS+) .let [re_binds (|> argsO+ diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/primitive.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/primitive.lux index b50c2c965..b50c2c965 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/primitive.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/primitive.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/reference.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/reference.lux index 9b105605e..9b105605e 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/reference.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/reference.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/runtime.lux index 2c2ca91fc..85d90795c 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/runtime.lux @@ -31,7 +31,7 @@ ["[1][0]" reference] ["//[1]" /// ["[1][0]" synthesis (.only Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// (.only) ["[1][0]" phase] [reference @@ -54,19 +54,19 @@ [(type .public <name> (<base> Anchor Value Declaration))] - [Operation /////generation.Operation] - [Phase /////generation.Phase] - [Handler /////generation.Handler] - [Bundle /////generation.Bundle] + [Operation /////translation.Operation] + [Phase /////translation.Phase] + [Handler /////translation.Handler] + [Bundle /////translation.Bundle] ) (type .public Phase! (-> Phase Archive Synthesis (Operation (Statement Any)))) -(type .public (Generator! i) +(type .public (Translator! i) (-> Phase! Phase Archive i (Operation (Statement Any)))) -(type .public (Generator i) +(type .public (Translator i) (-> Phase Archive i (Operation (Expression Any)))) (def prefix @@ -480,11 +480,11 @@ (def module_id 0) -(def .public generate +(def .public translate (Operation [Registry Output]) (do ///////phase.monad - [_ (/////generation.execute! ..full_runtime) - _ (/////generation.save! ..module_id {.#None} ..full_runtime)] + [_ (/////translation.execute! ..full_runtime) + _ (/////translation.save! ..module_id {.#None} ..full_runtime)] (in [(|> registry.empty (registry.resource true unit.none) product.right) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/structure.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/structure.lux index f89cf244b..723796d21 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/structure.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/structure.lux @@ -7,7 +7,7 @@ [target ["_" python (.only Expression)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Generator)] + ["[1][0]" runtime (.only Operation Phase Translator)] ["[1][0]" primitive] ["///[1]" //// [analysis @@ -16,21 +16,21 @@ ["//[1]" /// ["[1][0]" phase (.use "[1]#[0]" monad)]]]]) -(def .public (tuple generate archive elemsS+) - (Generator (Tuple Synthesis)) +(def .public (tuple translate archive elemsS+) + (Translator (Tuple Synthesis)) (when elemsS+ {.#End} (///////phase#in (//primitive.text /////synthesis.unit)) {.#Item singletonS {.#End}} - (generate archive singletonS) + (translate archive singletonS) _ (|> elemsS+ - (monad.each ///////phase.monad (generate archive)) + (monad.each ///////phase.monad (translate archive)) (///////phase#each _.list)))) -(def .public (variant generate archive [lefts right? valueS]) - (Generator (Variant Synthesis)) +(def .public (variant translate archive [lefts right? valueS]) + (Translator (Variant Synthesis)) (///////phase#each (//runtime.variant lefts right?) - (generate archive valueS))) + (translate archive valueS))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/when.lux index 3666dc9fc..4a92d11ef 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/when.lux @@ -19,7 +19,7 @@ [target ["_" python (.only Expression SVar Statement)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Generator Phase! Generator!)] + ["[1][0]" runtime (.only Operation Phase Translator Phase! Translator!)] ["[1][0]" reference] ["[1][0]" primitive] ["/[1]" // @@ -28,7 +28,7 @@ [synthesis ["[0]" when]] ["/[1]" // - ["[1][0]" generation] + ["[1][0]" translation] ["[1][0]" synthesis (.only Synthesis Path) [access ["[0]" member (.only Member)]]] @@ -45,7 +45,7 @@ (def .public (symbol prefix) (-> Text (Operation SVar)) (///////phase#each (|>> %.nat (format prefix) _.var) - /////generation.next)) + /////translation.next)) (def .public register (-> Register SVar) @@ -56,7 +56,7 @@ (|>> (///reference.foreign //reference.system) as_expected)) (def .public (let expression archive [valueS register bodyS]) - (Generator [Synthesis Register Synthesis]) + (Translator [Synthesis Register Synthesis]) (do ///////phase.monad [valueO (expression archive valueS) bodyO (expression archive bodyS)] @@ -66,7 +66,7 @@ bodyO))))) (def .public (let! statement expression archive [valueS register bodyS]) - (Generator! [Synthesis Register Synthesis]) + (Translator! [Synthesis Register Synthesis]) (do ///////phase.monad [valueO (expression archive valueS) bodyO (statement expression archive bodyS)] @@ -75,14 +75,14 @@ bodyO)))) (def .public (exec expression archive [pre post]) - (Generator [Synthesis Synthesis]) + (Translator [Synthesis Synthesis]) (do ///////phase.monad [pre (expression archive pre) post (expression archive post)] (in (_.item (_.int +1) (_.tuple (list pre post)))))) (def .public (exec! statement expression archive [pre post]) - (Generator! [Synthesis Synthesis]) + (Translator! [Synthesis Synthesis]) (do ///////phase.monad [pre (expression archive pre) post (statement expression archive post)] @@ -91,7 +91,7 @@ post)))) (def .public (if expression archive [testS thenS elseS]) - (Generator [Synthesis Synthesis Synthesis]) + (Translator [Synthesis Synthesis Synthesis]) (do ///////phase.monad [testO (expression archive testS) thenO (expression archive thenS) @@ -99,7 +99,7 @@ (in (_.? testO thenO elseO)))) (def .public (if! statement expression archive [testS thenS elseS]) - (Generator! [Synthesis Synthesis Synthesis]) + (Translator! [Synthesis Synthesis Synthesis]) (do ///////phase.monad [test! (expression archive testS) then! (statement expression archive thenS) @@ -109,7 +109,7 @@ else!)))) (def .public (get expression archive [pathP valueS]) - (Generator [(List Member) Synthesis]) + (Translator [(List Member) Synthesis]) (do ///////phase.monad [valueO (expression archive valueS)] (in (list#mix (function (_ side source) @@ -117,7 +117,7 @@ //runtime.tuple::right //runtime.tuple::left)] (method (_.int (.int (the member.#lefts side))) - source))) + source))) valueO (list.reversed pathP))))) @@ -334,7 +334,7 @@ (..capture register)))))) (def .public (when! in_closure? statement expression archive [valueS pathP]) - (-> Bit (Generator! [Synthesis Path])) + (-> Bit (Translator! [Synthesis Path])) (do ///////phase.monad [stack_init (expression archive valueS) pattern_matching! (pattern_matching in_closure? statement expression archive pathP)] @@ -345,10 +345,10 @@ )))) (def .public (when statement expression archive [valueS pathP]) - (-> Phase! (Generator [Synthesis Path])) + (-> Phase! (Translator [Synthesis Path])) (do ///////phase.monad [dependencies (cache.path_dependencies archive pathP) - [[when_module when_artifact] pattern_matching!] (/////generation.with_new_context + [[when_module when_artifact] pattern_matching!] (/////translation.with_new_context archive dependencies (when! true statement expression archive [valueS pathP])) @@ -357,6 +357,6 @@ pathP)) declaration (_.def @when @dependencies+ pattern_matching!)] - _ (/////generation.execute! declaration) - _ (/////generation.save! when_artifact {.#None} declaration)] + _ (/////translation.execute! declaration) + _ (/////translation.save! when_artifact {.#None} declaration)] (in (_.apply @dependencies+ @when)))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r.lux index cf20229d8..28673566c 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r.lux @@ -28,12 +28,12 @@ [reference (.only) [variable (.only)]]]]]]]) -(def .public (generate archive synthesis) +(def .public (translate archive synthesis) Phase (when synthesis - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (//////phase#in (<generator> value))]) + (//////phase#in (<translator> value))]) ([////synthesis.bit /primitive.bit] [////synthesis.i64 /primitive.i64] [////synthesis.f64 /primitive.f64] @@ -42,9 +42,9 @@ {////synthesis.#Reference value} (//reference.reference /reference.system archive value) - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (<generator> generate archive value)]) + (<translator> translate archive value)]) ([////synthesis.variant /structure.variant] [////synthesis.tuple /structure.tuple] [////synthesis.branch/let /when.let] @@ -58,5 +58,5 @@ [////synthesis.function/abstraction /function.function]) {////synthesis.#Extension extension} - (///extension.apply archive generate extension) + (///extension.apply archive translate extension) )) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/function.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/function.lux index bf6d09b19..5ad9140aa 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/function.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/function.lux @@ -15,7 +15,7 @@ [target ["_" r (.only Expression SVar)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Generator)] + ["[1][0]" runtime (.only Operation Phase Translator)] ["[1][0]" reference] ["[1][0]" when] ["/[1]" // @@ -23,7 +23,7 @@ ["//[1]" /// [analysis (.only Variant Tuple Abstraction Application Analysis)] [synthesis (.only Synthesis)] - ["[1][0]" generation (.only Context)] + ["[1][0]" translation (.only Context)] ["//[1]" /// [arity (.only Arity)] ["[1][0]" phase (.use "[1]#[0]" monad)] @@ -34,7 +34,7 @@ ["[0]" artifact]]]]]]]) (def .public (apply expression archive [functionS argsS+]) - (Generator (Application Synthesis)) + (Translator (Application Synthesis)) (do [! ///////phase.monad] [functionO (expression archive functionS) argsO+ (monad.each ! (expression archive) argsS+)] @@ -45,9 +45,9 @@ (when inits {.#End} (do ///////phase.monad - [_ (/////generation.execute! function_definition) - _ (/////generation.save! (%.nat function_id) - function_definition)] + [_ (/////translation.execute! function_definition) + _ (/////translation.save! (%.nat function_id) + function_definition)] (in $function)) _ @@ -60,8 +60,8 @@ (all _.then function_definition $function)))] - _ (/////generation.execute! closure_definition) - _ (/////generation.save! (%.nat function_id) closure_definition)] + _ (/////translation.execute! closure_definition) + _ (/////translation.save! (%.nat function_id) closure_definition)] (in (_.apply inits $function))))) (def $curried (_.var "curried")) @@ -73,13 +73,13 @@ (|> $curried (_.item (|> register ++ .int _.int))))) (def .public (function expression archive [environment arity bodyS]) - (Generator (Abstraction Synthesis)) + (Translator (Abstraction Synthesis)) (do [! ///////phase.monad] - [[[function_module function_artifact] bodyO] (/////generation.with_new_context archive + [[[function_module function_artifact] bodyO] (/////translation.with_new_context archive (do ! [$self (at ! each (|>> ///reference.artifact _.var) - (/////generation.context archive))] - (/////generation.with_anchor $self + (/////translation.context archive))] + (/////translation.with_anchor $self (expression archive bodyS)))) closureO+ (monad.each ! (expression archive) environment) .let [arityO (|> arity .int _.int) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/loop.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/loop.lux index 7a72081e9..184aa6516 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/loop.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/loop.lux @@ -17,7 +17,7 @@ [target ["_" r]]]]] ["[0]" // - [runtime (.only Operation Phase Generator)] + [runtime (.only Operation Phase Translator)] ["[1][0]" when] ["/[1]" // ["[1][0]" reference] @@ -26,7 +26,7 @@ ["[0]" when]] ["/[1]" // ["[0]" synthesis (.only Scope Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// ["[1][0]" phase] [meta @@ -35,7 +35,7 @@ [variable (.only Register)]]]]]]]) (def .public (scope expression archive [offset initsS+ bodyS]) - (Generator (Scope Synthesis)) + (Translator (Scope Synthesis)) (when initsS+ ... function/false/non-independent loop {.#End} @@ -44,9 +44,9 @@ ... true loop _ (do [! ///////phase.monad] - [$scope (at ! each _.var (/////generation.symbol "loop_scope")) + [$scope (at ! each _.var (/////translation.symbol "loop_scope")) initsO+ (monad.each ! (expression archive) initsS+) - bodyO (/////generation.with_anchor $scope + bodyO (/////translation.with_anchor $scope (expression archive bodyS))] (in (_.block (all _.then @@ -59,8 +59,8 @@ (_.apply initsO+ $scope))))))) (def .public (again expression archive argsS+) - (Generator (List Synthesis)) + (Translator (List Synthesis)) (do [! ///////phase.monad] - [$scope /////generation.anchor + [$scope /////translation.anchor argsO+ (monad.each ! (expression archive) argsS+)] (in (_.apply argsO+ $scope)))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/primitive.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/primitive.lux index ffd4625bb..ffd4625bb 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/primitive.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/primitive.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/procedure/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/procedure/common.lux index f1ce04dee..f1ce04dee 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/procedure/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/procedure/common.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/procedure/host.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/procedure/host.lux index 1b588bc61..1b588bc61 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/procedure/host.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/procedure/host.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/reference.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/reference.lux index b80350acf..b80350acf 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/reference.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/reference.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/runtime.lux index 261cba579..ca464073b 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/runtime.lux @@ -32,7 +32,7 @@ ["//[1]" /// [analysis (.only Variant)] ["[1][0]" synthesis (.only Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// (.only) ["[1][0]" phase] [reference @@ -48,13 +48,13 @@ [(type .public <name> (<base> _.SVar _.Expression _.Expression))] - [Operation /////generation.Operation] - [Phase /////generation.Phase] - [Handler /////generation.Handler] - [Bundle /////generation.Bundle] + [Operation /////translation.Operation] + [Phase /////translation.Phase] + [Handler /////translation.Handler] + [Bundle /////translation.Bundle] ) -(type .public (Generator i) +(type .public (Translator i) (-> Phase Archive i (Operation Expression))) (def .public unit @@ -868,11 +868,11 @@ runtime//io )) -(def .public generate +(def .public translate (Operation [Registry Output]) (do ///////phase.monad - [_ (/////generation.execute! ..full_runtime) - _ (/////generation.save! (%.nat ..module_id) ..full_runtime)] + [_ (/////translation.execute! ..full_runtime) + _ (/////translation.save! (%.nat ..module_id) ..full_runtime)] (in [(|> artifact.empty artifact.resource product.right) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/structure.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/structure.lux index 77b7a3f62..e97fbe653 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/structure.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/structure.lux @@ -10,7 +10,7 @@ [target ["_" r (.only Expression)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Generator)] + ["[1][0]" runtime (.only Operation Phase Translator)] ["[1][0]" primitive] ["///[1]" //// [analysis (.only Variant Tuple)] @@ -19,7 +19,7 @@ ["[1][0]" phase (.use "[1]#[0]" monad)]]]]) (def .public (tuple expression archive elemsS+) - (Generator (Tuple Synthesis)) + (Translator (Tuple Synthesis)) (when elemsS+ {.#End} (///////phase#in (//primitive.text /////synthesis.unit)) @@ -33,7 +33,7 @@ (///////phase#each _.list)))) (def .public (variant expression archive [lefts right? valueS]) - (Generator (Variant Synthesis)) + (Translator (Variant Synthesis)) (let [tag (if right? (++ lefts) lefts)] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/when.lux index 0f2a0954c..09638b0f5 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/when.lux @@ -20,7 +20,7 @@ [target ["_" r (.only Expression SVar)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Generator)] + ["[1][0]" runtime (.only Operation Phase Translator)] ["[1][0]" reference] ["[1][0]" primitive] ["/[1]" // @@ -30,7 +30,7 @@ ["[1]/[0]" when]] ["/[1]" // ["[1][0]" synthesis (.only Member Synthesis Path)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// [reference ["[1][0]" variable (.only Register)]] @@ -47,7 +47,7 @@ (|>> (///reference.foreign //reference.system) as_expected)) (def .public (let expression archive [valueS register bodyS]) - (Generator [Synthesis Register Synthesis]) + (Translator [Synthesis Register Synthesis]) (do ///////phase.monad [valueO (expression archive valueS) bodyO (expression archive bodyS)] @@ -57,7 +57,7 @@ bodyO))))) (def .public (if expression archive [testS thenS elseS]) - (Generator [Synthesis Synthesis Synthesis]) + (Translator [Synthesis Synthesis Synthesis]) (do ///////phase.monad [testO (expression archive testS) thenO (expression archive thenS) @@ -65,7 +65,7 @@ (in (_.if testO thenO elseO)))) (def .public (get expression archive [pathP valueS]) - (Generator [(List Member) Synthesis]) + (Translator [(List Member) Synthesis]) (do ///////phase.monad [valueO (expression archive valueS)] (in (list#mix (function (_ side source) @@ -134,7 +134,7 @@ (_.stop $alt_error)))) (def (pattern_matching' expression archive) - (Generator Path) + (Translator Path) (function (again pathP) (.when pathP {/////synthesis.#Then bodyS} @@ -223,7 +223,7 @@ ))) (def (pattern_matching expression archive pathP) - (Generator Path) + (Translator Path) (do ///////phase.monad [pattern_matching! (pattern_matching' expression archive pathP)] (in (_.try pattern_matching! @@ -232,7 +232,7 @@ {.#None})))) (def .public (when expression archive [valueS pathP]) - (Generator [Synthesis Path]) + (Translator [Synthesis Path]) (do [! ///////phase.monad] [valueO (expression archive valueS)] (<| (at ! each (|>> (all _.then diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/reference.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/reference.lux index 2ec80b679..4816ea1e5 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/reference.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/reference.lux @@ -8,7 +8,7 @@ ["@" target] ["[0]" version]]]] ["[0]" //// - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// ["[0]" phase (.use "[1]#[0]" monad)] ["[0]" reference (.only Reference) @@ -65,9 +65,9 @@ (def .public (constant system archive name) (All (_ anchor expression declaration) (-> (System expression) Archive Symbol - (////generation.Operation anchor expression declaration expression))) + (////translation.Operation anchor expression declaration expression))) (phase#each (|>> ..artifact (at system constant')) - (////generation.remember archive name))) + (////translation.remember archive name))) (with_template [<sigil> <name>] [(def .public (<name> system) @@ -92,7 +92,7 @@ (def .public (reference system archive reference) (All (_ anchor expression declaration) - (-> (System expression) Archive Reference (////generation.Operation anchor expression declaration expression))) + (-> (System expression) Archive Reference (////translation.Operation anchor expression declaration expression))) (when reference {reference.#Constant value} (..constant system archive value) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby.lux index 8d89f45cd..0be9676bc 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby.lux @@ -22,7 +22,7 @@ ["[1][0]" reference] ["/[1]" // ["[1][0]" extension (.only) - [generation + [translation [ruby ["[1]/[0]" common]]]] ["/[1]" // @@ -38,17 +38,17 @@ (def (expression archive synthesis) Phase (when synthesis - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (//////phase#in (<generator> value))]) + (//////phase#in (<translator> value))]) ([////synthesis.bit /primitive.bit] [////synthesis.i64 /primitive.i64] [////synthesis.f64 /primitive.f64] [////synthesis.text /primitive.text]) - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (<generator> expression archive value)]) + (<translator> expression archive value)]) ([////synthesis.variant /structure.variant] [////synthesis.tuple /structure.tuple] @@ -59,9 +59,9 @@ [////synthesis.function/apply /function.apply]) - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (<generator> ///extension/common.statement expression archive value)]) + (<translator> ///extension/common.statement expression archive value)]) ([////synthesis.branch/when /when.when] [////synthesis.loop/scope /loop.scope] [////synthesis.function/abstraction /function.function]) @@ -75,6 +75,6 @@ {////synthesis.#Extension extension} (///extension.apply archive expression extension))) -(def .public generate +(def .public translate Phase ..expression) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/function.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/function.lux index fc63bb4fa..0871e05bb 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/function.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/function.lux @@ -13,7 +13,7 @@ [target ["_" ruby (.only LVar GVar Expression Statement)]]]]] ["[0]" // - [runtime (.only Operation Phase Generator Phase! Generator!)] + [runtime (.only Operation Phase Translator Phase! Translator!)] ["[1][0]" reference] ["[1][0]" when] ["[1][0]" loop] @@ -22,7 +22,7 @@ ["//[1]" /// [synthesis (.only Synthesis)] [analysis (.only Environment Abstraction Reification Analysis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// [arity (.only Arity)] ["[1][0]" phase] @@ -34,7 +34,7 @@ ["[1]/[0]" artifact]]]]]]]]) (def .public (apply expression archive [functionS argsS+]) - (Generator (Reification Synthesis)) + (Translator (Reification Synthesis)) (do [! ///////phase.monad] [functionO (expression archive functionS) argsO+ (monad.each ! (expression archive) argsS+)] @@ -66,11 +66,11 @@ (|>> ++ //when.register)) (def .public (function statement expression archive [environment arity bodyS]) - (-> Phase! (Generator (Abstraction Synthesis))) + (-> Phase! (Translator (Abstraction Synthesis))) (do [! ///////phase.monad] [dependencies (cache/artifact.dependencies archive bodyS) - [[function_module function_artifact] body!] (/////generation.with_new_context archive dependencies - (/////generation.with_anchor 1 + [[function_module function_artifact] body!] (/////translation.with_new_context archive dependencies + (/////translation.with_anchor 1 (statement expression archive bodyS))) closureO+ (monad.each ! (expression archive) environment) .let [function_name (///reference.artifact [function_module function_artifact]) @@ -118,6 +118,6 @@ (_.do "concat" (list @curried) {.#None}) (_.do "concat" (list @missing) {.#None})))))))])))) )]))] - _ (/////generation.execute! declaration) - _ (/////generation.save! function_artifact {.#None} declaration)] + _ (/////translation.execute! declaration) + _ (/////translation.save! function_artifact {.#None} declaration)] (in instatiation))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/loop.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/loop.lux index 25feac999..045789f91 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/loop.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/loop.lux @@ -17,7 +17,7 @@ [target ["_" ruby (.only Expression LVar Statement)]]]]] ["[0]" // - [runtime (.only Operation Phase Generator Phase! Generator!)] + [runtime (.only Operation Phase Translator Phase! Translator!)] ["[1][0]" when] ["/[1]" // ["[1][0]" reference] @@ -26,7 +26,7 @@ ["[0]" when]] ["/[1]" // ["[0]" synthesis (.only Scope Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// ["[1][0]" phase] [reference @@ -49,7 +49,7 @@ (_.while (_.bool true))) (def .public (scope! statement expression archive [start initsS+ bodyS]) - (Generator! (Scope Synthesis)) + (Translator! (Scope Synthesis)) (when initsS+ ... function/false/non-independent loop {.#End} @@ -59,14 +59,14 @@ _ (do [! ///////phase.monad] [initsO+ (monad.each ! (expression archive) initsS+) - body! (/////generation.with_anchor start + body! (/////translation.with_anchor start (statement expression archive bodyS))] (in (<| (..setup start initsO+) ..with_scope body!))))) (def .public (scope statement expression archive [start initsS+ bodyS]) - (-> Phase! (Generator (Scope Synthesis))) + (-> Phase! (Translator (Scope Synthesis))) (when initsS+ ... function/false/non-independent loop {.#End} @@ -81,9 +81,9 @@ (_.apply_lambda (list))))))) (def .public (again! statement expression archive argsS+) - (Generator! (List Synthesis)) + (Translator! (List Synthesis)) (do [! ///////phase.monad] - [offset /////generation.anchor + [offset /////translation.anchor @temp (//when.symbol "lux_again_values") argsO+ (monad.each ! (expression archive) argsS+) .let [re_binds (|> argsO+ diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/primitive.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/primitive.lux index 06b100bc5..06b100bc5 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/primitive.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/primitive.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/reference.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/reference.lux index 28629dc19..28629dc19 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/reference.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/reference.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/runtime.lux index 2766c41e1..286e897da 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/runtime.lux @@ -30,7 +30,7 @@ ["[1][0]" reference] ["//[1]" /// ["[1][0]" synthesis (.only Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// (.only) ["[1][0]" phase] [reference @@ -53,19 +53,19 @@ [(type .public <name> (<base> Anchor Value Declaration))] - [Operation /////generation.Operation] - [Phase /////generation.Phase] - [Handler /////generation.Handler] - [Bundle /////generation.Bundle] + [Operation /////translation.Operation] + [Phase /////translation.Phase] + [Handler /////translation.Handler] + [Bundle /////translation.Bundle] ) -(type .public (Generator i) +(type .public (Translator i) (-> Phase Archive i (Operation Expression))) (type .public Phase! (-> Phase Archive Synthesis (Operation Statement))) -(type .public (Generator! i) +(type .public (Translator! i) (-> Phase! Phase Archive i (Operation Statement))) (def .public unit @@ -623,11 +623,11 @@ runtime//array )) -(def .public generate +(def .public translate (Operation [Registry Output]) (do ///////phase.monad - [_ (/////generation.execute! ..full) - _ (/////generation.save! ..module_id {.#None} ..full)] + [_ (/////translation.execute! ..full) + _ (/////translation.save! ..module_id {.#None} ..full)] (in [(|> registry.empty (registry.resource true unit.none) product.right) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/structure.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/structure.lux index a879af9d3..2da3e556a 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/structure.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/structure.lux @@ -7,7 +7,7 @@ [target ["_" ruby (.only Expression)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Generator)] + ["[1][0]" runtime (.only Operation Phase Translator)] ["[1][0]" primitive] ["///[1]" //// [analysis @@ -16,21 +16,21 @@ ["//[1]" /// ["[1][0]" phase (.use "[1]#[0]" monad)]]]]) -(def .public (tuple generate archive elemsS+) - (Generator (Tuple Synthesis)) +(def .public (tuple translate archive elemsS+) + (Translator (Tuple Synthesis)) (when elemsS+ {.#End} (///////phase#in (//primitive.text /////synthesis.unit)) {.#Item singletonS {.#End}} - (generate archive singletonS) + (translate archive singletonS) _ (|> elemsS+ - (monad.each ///////phase.monad (generate archive)) + (monad.each ///////phase.monad (translate archive)) (///////phase#each _.array)))) -(def .public (variant generate archive [lefts right? valueS]) - (Generator (Variant Synthesis)) +(def .public (variant translate archive [lefts right? valueS]) + (Translator (Variant Synthesis)) (///////phase#each (//runtime.variant lefts right?) - (generate archive valueS))) + (translate archive valueS))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/when.lux index 28599463f..9e6575e64 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/when.lux @@ -19,7 +19,7 @@ [target ["_" ruby (.only Expression LVar Statement)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Generator Phase! Generator!)] + ["[1][0]" runtime (.only Operation Phase Translator Phase! Translator!)] ["[1][0]" reference] ["[1][0]" primitive] ["/[1]" // @@ -28,7 +28,7 @@ [synthesis ["[0]" when]] ["/[1]" // - ["[1][0]" generation] + ["[1][0]" translation] ["[1][0]" synthesis (.only Synthesis Path) [access ["[0]" member (.only Member)]]] @@ -41,7 +41,7 @@ (def .public (symbol prefix) (-> Text (Operation LVar)) - (///////phase#each (|>> %.nat (format prefix) _.local) /////generation.next)) + (///////phase#each (|>> %.nat (format prefix) _.local) /////translation.next)) (def .public register (-> Register LVar) @@ -52,7 +52,7 @@ (|>> (///reference.foreign //reference.system) as_expected)) (def .public (exec expression archive [this that]) - (Generator [Synthesis Synthesis]) + (Translator [Synthesis Synthesis]) (do ///////phase.monad [this (expression archive this) that (expression archive that)] @@ -60,7 +60,7 @@ (_.item (_.int +1)))))) (def .public (exec! statement expression archive [this that]) - (Generator! [Synthesis Synthesis]) + (Translator! [Synthesis Synthesis]) (do ///////phase.monad [this (expression archive this) that (statement expression archive that)] @@ -70,7 +70,7 @@ )))) (def .public (let expression archive [valueS register bodyS]) - (Generator [Synthesis Register Synthesis]) + (Translator [Synthesis Register Synthesis]) (do ///////phase.monad [valueO (expression archive valueS) bodyO (expression archive bodyS)] @@ -81,7 +81,7 @@ (_.apply_lambda (list valueO)))))) (def .public (let! statement expression archive [valueS register bodyS]) - (Generator! [Synthesis Register Synthesis]) + (Translator! [Synthesis Register Synthesis]) (do ///////phase.monad [valueO (expression archive valueS) bodyO (statement expression archive bodyS)] @@ -90,7 +90,7 @@ bodyO)))) (def .public (if expression archive [testS thenS elseS]) - (Generator [Synthesis Synthesis Synthesis]) + (Translator [Synthesis Synthesis Synthesis]) (do ///////phase.monad [testO (expression archive testS) thenO (expression archive thenS) @@ -98,7 +98,7 @@ (in (_.? testO thenO elseO)))) (def .public (if! statement expression archive [testS thenS elseS]) - (Generator! [Synthesis Synthesis Synthesis]) + (Translator! [Synthesis Synthesis Synthesis]) (do ///////phase.monad [test! (expression archive testS) then! (statement expression archive thenS) @@ -108,7 +108,7 @@ else!)))) (def .public (get expression archive [pathP valueS]) - (Generator [(List Member) Synthesis]) + (Translator [(List Member) Synthesis]) (do ///////phase.monad [valueO (expression archive valueS)] (in (list#mix (function (_ side source) @@ -247,7 +247,7 @@ (at ///////phase.monad in {.#None}))) (def (pattern_matching' in_closure? statement expression archive) - (-> Bit (Generator! Path)) + (-> Bit (Translator! Path)) (function (again pathP) (do ///////phase.monad [?output (primitive_pattern_matching again pathP)] @@ -352,7 +352,7 @@ (in (..alternation in_closure? g!once g!continue? pre! post!)))))))) (def (pattern_matching in_closure? statement expression archive pathP) - (-> Bit (Generator! Path)) + (-> Bit (Translator! Path)) (do ///////phase.monad [pattern_matching! (pattern_matching' in_closure? statement expression archive pathP) g!once (..symbol "once") @@ -363,7 +363,7 @@ (_.statement (_.raise (_.string when.pattern_matching_error))))))) (def .public (when! in_closure? statement expression archive [valueS pathP]) - (-> Bit (Generator! [Synthesis Path])) + (-> Bit (Translator! [Synthesis Path])) (do ///////phase.monad [stack_init (expression archive valueS) pattern_matching! (pattern_matching in_closure? statement expression archive pathP)] @@ -374,7 +374,7 @@ )))) (def .public (when statement expression archive when) - (-> Phase! (Generator [Synthesis Path])) + (-> Phase! (Translator [Synthesis Path])) (|> when (when! true statement expression archive) (at ///////phase.monad each diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme.lux index e62788463..86f273a4d 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme.lux @@ -28,12 +28,12 @@ [reference (.only) [variable (.only)]]]]]]]) -(def .public (generate archive synthesis) +(def .public (translate archive synthesis) Phase (when synthesis - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (//////phase#in (<generator> value))]) + (//////phase#in (<translator> value))]) ([////synthesis.bit /primitive.bit] [////synthesis.i64 /primitive.i64] [////synthesis.f64 /primitive.f64] @@ -42,9 +42,9 @@ {////synthesis.#Reference value} (//reference.reference /reference.system archive value) - (^.with_template [<tag> <generator>] + (^.with_template [<tag> <translator>] [(<tag> value) - (<generator> generate archive value)]) + (<translator> translate archive value)]) ([////synthesis.variant /structure.variant] [////synthesis.tuple /structure.tuple] [////synthesis.branch/let /when.let] @@ -58,5 +58,5 @@ [////synthesis.function/abstraction /function.function]) {////synthesis.#Extension extension} - (///extension.apply archive generate extension) + (///extension.apply archive translate extension) )) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/extension.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/extension.lux index 1d1c8473f..1d1c8473f 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/extension.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/extension.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/extension/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/extension/common.lux index 0c86e0ee3..0c86e0ee3 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/extension/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/extension/common.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/function.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/function.lux index 5688d5457..e8def4c7b 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/function.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/function.lux @@ -15,7 +15,7 @@ [target ["_" scheme (.only Expression Computation Var)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Generator)] + ["[1][0]" runtime (.only Operation Phase Translator)] ["[1][0]" reference] ["[1][0]" when] ["/[1]" // @@ -23,7 +23,7 @@ ["//[1]" /// [analysis (.only Variant Tuple Abstraction Application Analysis)] [synthesis (.only Synthesis)] - ["[1][0]" generation (.only Context)] + ["[1][0]" translation (.only Context)] ["//[1]" /// [arity (.only Arity)] ["[1][0]" phase (.use "[1]#[0]" monad)] @@ -31,7 +31,7 @@ [variable (.only Register Variable)]]]]]]) (def .public (apply expression archive [functionS argsS+]) - (Generator (Application Synthesis)) + (Translator (Application Synthesis)) (do [! ///////phase.monad] [functionO (expression archive functionS) argsO+ (monad.each ! (expression archive) argsS+)] @@ -62,13 +62,13 @@ (|>> ++ //when.register)) (def .public (function expression archive [environment arity bodyS]) - (Generator (Abstraction Synthesis)) + (Translator (Abstraction Synthesis)) (do [! ///////phase.monad] - [[function_name bodyO] (/////generation.with_new_context archive + [[function_name bodyO] (/////translation.with_new_context archive (do ! [@self (at ! each (|>> ///reference.artifact _.var) - (/////generation.context archive))] - (/////generation.with_anchor @self + (/////translation.context archive))] + (/////translation.with_anchor @self (expression archive bodyS)))) closureO+ (monad.each ! (expression archive) environment) .let [arityO (|> arity .int _.int) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/loop.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/loop.lux index 451de1c90..5ad5dd7b9 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/loop.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/loop.lux @@ -17,7 +17,7 @@ [target ["_" scheme]]]]] ["[0]" // - [runtime (.only Operation Phase Generator)] + [runtime (.only Operation Phase Translator)] ["[1][0]" when] ["/[1]" // ["[1][0]" reference] @@ -26,7 +26,7 @@ ["[0]" when]] ["/[1]" // ["[0]" synthesis (.only Scope Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// ["[1][0]" phase] [meta @@ -38,7 +38,7 @@ (_.var "scope")) (def .public (scope expression archive [start initsS+ bodyS]) - (Generator (Scope Synthesis)) + (Translator (Scope Synthesis)) (when initsS+ ... function/false/non-independent loop {.#End} @@ -48,7 +48,7 @@ _ (do [! ///////phase.monad] [initsO+ (monad.each ! (expression archive) initsS+) - bodyO (/////generation.with_anchor @scope + bodyO (/////translation.with_anchor @scope (expression archive bodyS))] (in (_.letrec (list [@scope (_.lambda [(|> initsS+ list.enumeration @@ -58,8 +58,8 @@ (_.apply initsO+ @scope)))))) (def .public (again expression archive argsS+) - (Generator (List Synthesis)) + (Translator (List Synthesis)) (do [! ///////phase.monad] - [@scope /////generation.anchor + [@scope /////translation.anchor argsO+ (monad.each ! (expression archive) argsS+)] (in (_.apply argsO+ @scope)))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/primitive.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/primitive.lux index 707968187..707968187 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/primitive.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/primitive.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/reference.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/reference.lux index 94bbd7702..94bbd7702 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/reference.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/reference.lux diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/runtime.lux index e0eb242ec..1c4494fc5 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/runtime.lux @@ -30,7 +30,7 @@ ["//[1]" /// [analysis (.only Variant)] ["[1][0]" synthesis (.only Synthesis)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// (.only) ["[1][0]" phase] [reference @@ -46,13 +46,13 @@ [(type .public <name> (<base> Var Expression Expression))] - [Operation /////generation.Operation] - [Phase /////generation.Phase] - [Handler /////generation.Handler] - [Bundle /////generation.Bundle] + [Operation /////translation.Operation] + [Phase /////translation.Phase] + [Handler /////translation.Handler] + [Bundle /////translation.Bundle] ) -(type .public (Generator i) +(type .public (Translator i) (-> Phase Archive i (Operation Expression))) (def .public unit @@ -375,11 +375,11 @@ runtime//array ))) -(def .public generate +(def .public translate (Operation [Registry Output]) (do ///////phase.monad - [_ (/////generation.execute! ..runtime) - _ (/////generation.save! (%.nat ..module_id) ..runtime)] + [_ (/////translation.execute! ..runtime) + _ (/////translation.save! (%.nat ..module_id) ..runtime)] (in [(|> artifact.empty artifact.resource product.right) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/structure.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/structure.lux index 526b833ff..658487d56 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/structure.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/structure.lux @@ -10,7 +10,7 @@ [target ["_" scheme (.only Expression)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Generator)] + ["[1][0]" runtime (.only Operation Phase Translator)] ["[1][0]" primitive] ["///[1]" //// [analysis (.only Variant Tuple)] @@ -19,7 +19,7 @@ ["[1][0]" phase (.use "[1]#[0]" monad)]]]]) (def .public (tuple expression archive elemsS+) - (Generator (Tuple Synthesis)) + (Translator (Tuple Synthesis)) (when elemsS+ {.#End} (///////phase#in (//primitive.text /////synthesis.unit)) @@ -33,7 +33,7 @@ (///////phase#each _.vector/*)))) (def .public (variant expression archive [lefts right? valueS]) - (Generator (Variant Synthesis)) + (Translator (Variant Synthesis)) (let [tag (if right? (++ lefts) lefts)] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/when.lux index b70ccef33..9e6baef9a 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/scheme/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/when.lux @@ -20,7 +20,7 @@ [target ["_" scheme (.only Expression Computation Var)]]]]] ["[0]" // - ["[1][0]" runtime (.only Operation Phase Generator)] + ["[1][0]" runtime (.only Operation Phase Translator)] ["[1][0]" reference] ["[1][0]" primitive] ["/[1]" // @@ -30,7 +30,7 @@ ["[1]/[0]" when]] ["/[1]" // ["[1][0]" synthesis (.only Member Synthesis Path)] - ["[1][0]" generation] + ["[1][0]" translation] ["//[1]" /// [reference ["[1][0]" variable (.only Register)]] @@ -47,7 +47,7 @@ (|>> (///reference.foreign //reference.system) as_expected)) (def .public (let expression archive [valueS register bodyS]) - (Generator [Synthesis Register Synthesis]) + (Translator [Synthesis Register Synthesis]) (do ///////phase.monad [valueO (expression archive valueS) bodyO (expression archive bodyS)] @@ -55,7 +55,7 @@ bodyO)))) (def .public (if expression archive [testS thenS elseS]) - (Generator [Synthesis Synthesis Synthesis]) + (Translator [Synthesis Synthesis Synthesis]) (do ///////phase.monad [testO (expression archive testS) thenO (expression archive thenS) @@ -63,7 +63,7 @@ (in (_.if testO thenO elseO)))) (def .public (get expression archive [pathP valueS]) - (Generator [(List Member) Synthesis]) + (Translator [(List Member) Synthesis]) (do ///////phase.monad [valueO (expression archive valueS)] (in (list#mix (function (_ side source) @@ -128,7 +128,7 @@ happy_path)) (def (pattern_matching' expression archive) - (Generator Path) + (Translator Path) (function (again pathP) (.when pathP {/////synthesis.#Then bodyS} @@ -211,13 +211,13 @@ ))) (def (pattern_matching expression archive pathP) - (Generator Path) + (Translator Path) (at ///////phase.monad each (try_pm (_.raise/1 (_.string "Invalid expression for pattern-matching."))) (pattern_matching' expression archive pathP))) (def .public (when expression archive [valueS pathP]) - (Generator [Synthesis Path]) + (Translator [Synthesis Path]) (do [! ///////phase.monad] [valueO (expression archive valueS)] (<| (at ! each (_.let (list [@cursor (_.list/* (list valueO))] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/synthesis.lux b/stdlib/source/library/lux/meta/compiler/language/lux/synthesis.lux index 957296e67..35e6db28c 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/synthesis.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/synthesis.lux @@ -752,7 +752,7 @@ ... become POPs. ... After re-implementing unused-variable-elimination, must add those ... pattern-optimizations again, since a lot of BINDs will become POPs -... and thus will result in useless code being generated. +... and thus will result in useless code being translated. (with_template [<name> <side>] [(def .public <name> (template (<name> idx nextP) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/generation.lux b/stdlib/source/library/lux/meta/compiler/language/lux/translation.lux index d34049cf6..bf2e4f0f3 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/generation.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/translation.lux @@ -268,7 +268,7 @@ [Text #1 [] [] learn_custom registry.custom] [Text #0 [] [] learn_analyser registry.analyser] [Text #0 [] [] learn_synthesizer registry.synthesizer] - [Text #0 [] [] learn_generator registry.generator] + [Text #0 [] [] learn_translator registry.translator] [Text #0 [] [] learn_declaration registry.declaration] ) diff --git a/stdlib/source/library/lux/meta/compiler/meta/archive/artifact/category.lux b/stdlib/source/library/lux/meta/compiler/meta/archive/artifact/category.lux index 5c547a425..7ce614c92 100644 --- a/stdlib/source/library/lux/meta/compiler/meta/archive/artifact/category.lux +++ b/stdlib/source/library/lux/meta/compiler/meta/archive/artifact/category.lux @@ -37,7 +37,7 @@ {#Definition Definition} {#Analyser Text} {#Synthesizer Text} - {#Generator Text} + {#Translator Text} {#Declaration Text} {#Custom Text})) @@ -57,7 +57,7 @@ (text#= left right)]) ([#Analyser] [#Synthesizer] - [#Generator] + [#Translator] [#Declaration] [#Custom]) diff --git a/stdlib/source/library/lux/meta/compiler/meta/archive/registry.lux b/stdlib/source/library/lux/meta/compiler/meta/archive/registry.lux index 2bdb6c8d4..ff6424658 100644 --- a/stdlib/source/library/lux/meta/compiler/meta/archive/registry.lux +++ b/stdlib/source/library/lux/meta/compiler/meta/archive/registry.lux @@ -90,7 +90,7 @@ product.left {.#Some it}] [//category.#Analyser analyser analysers Text |> {.#None}] [//category.#Synthesizer synthesizer synthesizers Text |> {.#None}] - [//category.#Generator generator generators Text |> {.#None}] + [//category.#Translator translator translators Text |> {.#None}] [//category.#Declaration declaration declarations Text |> {.#None}] [//category.#Custom custom customs Text |> {.#None}] ) @@ -127,7 +127,7 @@ [1 //category.#Definition definition] [2 //category.#Analyser binary.text] [3 //category.#Synthesizer binary.text] - [4 //category.#Generator binary.text] + [4 //category.#Translator binary.text] [5 //category.#Declaration binary.text] [6 //category.#Custom binary.text])))) mandatory? binary.bit @@ -173,7 +173,7 @@ [1 //category.#Definition definition] [2 //category.#Analyser <binary>.text] [3 //category.#Synthesizer <binary>.text] - [4 //category.#Generator <binary>.text] + [4 //category.#Translator <binary>.text] [5 //category.#Declaration <binary>.text] [6 //category.#Custom <binary>.text]) @@ -196,7 +196,7 @@ ([//category.#Definition ..definition] [//category.#Analyser ..analyser] [//category.#Synthesizer ..synthesizer] - [//category.#Generator ..generator] + [//category.#Translator ..translator] [//category.#Declaration ..declaration] [//category.#Custom ..custom]) ))) diff --git a/stdlib/source/library/lux/meta/compiler/meta/cache/dependency/artifact.lux b/stdlib/source/library/lux/meta/compiler/meta/cache/dependency/artifact.lux index fc15276d7..512efe54f 100644 --- a/stdlib/source/library/lux/meta/compiler/meta/cache/dependency/artifact.lux +++ b/stdlib/source/library/lux/meta/compiler/meta/cache/dependency/artifact.lux @@ -25,7 +25,7 @@ [language [lux ["[0]" synthesis (.only Synthesis Path)] - ["[0]" generation (.only Operation)] + ["[0]" translation (.only Operation)] ["[0]" analysis ["[1]/[0]" complex]]]] [meta @@ -169,7 +169,7 @@ ..references (set.of_list symbol.hash) set.list - (monad.each ! (generation.remember archive)) + (monad.each ! (translation.remember archive)) (at ! each (set.of_list unit.hash))))) (def .public (path_dependencies archive value) @@ -180,7 +180,7 @@ (..path_references ..references) (set.of_list symbol.hash) set.list - (monad.each ! (generation.remember archive)) + (monad.each ! (translation.remember archive)) (at ! each (set.of_list unit.hash))))) (def .public all diff --git a/stdlib/source/library/lux/meta/compiler/meta/io/archive.lux b/stdlib/source/library/lux/meta/compiler/meta/io/archive.lux index ae2df0fda..02a205b27 100644 --- a/stdlib/source/library/lux/meta/compiler/meta/io/archive.lux +++ b/stdlib/source/library/lux/meta/compiler/meta/io/archive.lux @@ -52,7 +52,7 @@ ["$" lux (.only) ["[0]" analysis] ["[0]" synthesis] - ["[0]" generation] + ["[0]" translation] ["[0]" declaration] ["[1]/[0]" program]]]]]]) @@ -92,13 +92,13 @@ (type Definitions (Dictionary Text Any)) (type Analysers (Dictionary Text analysis.Handler)) (type Synthesizers (Dictionary Text synthesis.Handler)) -(type Generators (Dictionary Text generation.Handler)) +(type Translators (Dictionary Text translation.Handler)) (type Declarations (Dictionary Text declaration.Handler)) (type Bundles [Analysers Synthesizers - Generators + Translators Declarations]) (def empty_bundles @@ -110,7 +110,7 @@ (def (loaded_document extension host @module expected actual document) (All (_ expression declaration) - (-> Text (generation.Host expression declaration) module.ID (Sequence [Artifact (Set unit.ID)]) (Dictionary Text Binary) (Document .Module) + (-> Text (translation.Host expression declaration) module.ID (Sequence [Artifact (Set unit.ID)]) (Dictionary Text Binary) (Document .Module) (Try [(Document .Module) Bundles Output]))) (do [! try.monad] [[definitions bundles] (is (Try [Definitions Bundles Output]) @@ -119,7 +119,7 @@ (dictionary.empty text.hash)) bundles ..empty_bundles output (is Output sequence.empty)]) - (let [[analysers synthesizers generators declarations] bundles] + (let [[analysers synthesizers translators declarations] bundles] (when input {.#Item [[[@artifact artifact_category mandatory_artifact?] artifact_dependencies] input']} (when (do ! @@ -134,7 +134,7 @@ (in [definitions [analysers synthesizers - generators + translators declarations] output])) @@ -144,7 +144,7 @@ (in [definitions [analysers synthesizers - generators + translators declarations] output]) (do ! @@ -152,7 +152,7 @@ (in [(dictionary.has name value definitions) [analysers synthesizers - generators + translators declarations] output])))) @@ -163,7 +163,7 @@ (in [definitions [(dictionary.has extension (as analysis.Handler value) analysers) synthesizers - generators + translators declarations] output])) @@ -174,18 +174,18 @@ (in [definitions [analysers (dictionary.has extension (as synthesis.Handler value) synthesizers) - generators + translators declarations] output])) - {category.#Generator extension} + {category.#Translator extension} (do ! [.let [output (sequence.suffix [@artifact {.#None} data] output)] value (at host re_load context {.#None} declaration)] (in [definitions [analysers synthesizers - (dictionary.has extension (as generation.Handler value) generators) + (dictionary.has extension (as translation.Handler value) translators) declarations] output])) @@ -196,7 +196,7 @@ (in [definitions [analysers synthesizers - generators + translators (dictionary.has extension (as declaration.Handler value) declarations)] output])) @@ -207,7 +207,7 @@ (in [definitions [analysers synthesizers - generators + translators declarations] output])))) {try.#Success [definitions' bundles' output']} @@ -242,7 +242,7 @@ (def (load_definitions fs context @module host_environment entry) (All (_ expression declaration) - (-> (file.System Async) Context module.ID (generation.Host expression declaration) + (-> (file.System Async) Context module.ID (translation.Host expression declaration) (archive.Entry .Module) (Async (Try [(archive.Entry .Module) Bundles])))) (do (try.with async.monad) @@ -317,7 +317,7 @@ (def (loaded_caches host_environment fs context purge load_order) (All (_ expression declaration) - (-> (generation.Host expression declaration) (file.System Async) Context + (-> (translation.Host expression declaration) (file.System Async) Context Purge (dependency.Order .Module) (Async (Try (List [[descriptor.Module (archive.Entry .Module)] Bundles]))))) (do [! (try.with async.monad)] @@ -339,7 +339,7 @@ (def (load_every_reserved_module customs configuration host_environment fs context import contexts archive) (All (_ expression declaration) - (-> (List Custom) Configuration (generation.Host expression declaration) (file.System Async) Context Import (List //.Context) Archive + (-> (List Custom) Configuration (translation.Host expression declaration) (file.System Async) Context Import (List //.Context) Archive (Async (Try [Archive .Lux Bundles])))) (do [! (try.with async.monad)] [pre_loaded_caches (..pre_loaded_caches customs fs context import contexts archive) @@ -359,18 +359,18 @@ analysis_state (..analysis_state (the context.#host context) configuration archive)] (in [archive analysis_state - (list#mix (function (_ [_ [+analysers +synthesizers +generators +declarations]] - [analysers synthesizers generators declarations]) + (list#mix (function (_ [_ [+analysers +synthesizers +translators +declarations]] + [analysers synthesizers translators declarations]) [(dictionary.composite +analysers analysers) (dictionary.composite +synthesizers synthesizers) - (dictionary.composite +generators generators) + (dictionary.composite +translators translators) (dictionary.composite +declarations declarations)]) ..empty_bundles loaded_caches)]))))) (def .public (thaw customs configuration host_environment fs context import contexts) (All (_ expression declaration) - (-> (List Custom) Configuration (generation.Host expression declaration) (file.System Async) Context Import (List //.Context) + (-> (List Custom) Configuration (translation.Host expression declaration) (file.System Async) Context Import (List //.Context) (Async (Try [Archive .Lux Bundles])))) (do async.monad [binary (at fs read (cache/archive.descriptor fs context))] diff --git a/stdlib/source/library/lux/meta/compiler/meta/packager/jvm.lux b/stdlib/source/library/lux/meta/compiler/meta/packager/jvm.lux index 1fbba7497..845fcbb83 100644 --- a/stdlib/source/library/lux/meta/compiler/meta/packager/jvm.lux +++ b/stdlib/source/library/lux/meta/compiler/meta/packager/jvm.lux @@ -45,7 +45,7 @@ [language ["$" lux (.only) [phase - [generation + [translation [jvm ["[0]" runtime (.only Definition)]]]]]]]]]) diff --git a/stdlib/source/library/lux/meta/compiler/meta/packager/scheme.lux b/stdlib/source/library/lux/meta/compiler/meta/packager/scheme.lux index 29dfd6b81..e23dfd312 100644 --- a/stdlib/source/library/lux/meta/compiler/meta/packager/scheme.lux +++ b/stdlib/source/library/lux/meta/compiler/meta/packager/scheme.lux @@ -43,7 +43,7 @@ [// [language ["$" lux (.only) - [generation (.only Context)]]]]]]) + [translation (.only Context)]]]]]]) ... TODO: Delete ASAP (type (Action ! a) diff --git a/stdlib/source/library/lux/meta/extension.lux b/stdlib/source/library/lux/meta/extension.lux index 913acaec9..4169598cd 100644 --- a/stdlib/source/library/lux/meta/extension.lux +++ b/stdlib/source/library/lux/meta/extension.lux @@ -26,10 +26,10 @@ ["<a>" \\parser]] ["[0]" synthesis (.only) ["<s>" \\parser]] - ["[0]" generation] + ["[0]" translation] ["[0]" declaration] [phase - [generation + [translation ["[0]" jvm ["[1]" runtime]] ["[0]" js @@ -71,12 +71,12 @@ [<c>.any <c>.end <c>.and <c>.result analysis .Analysis analysis.Handler] [<a>.any <a>.end <a>.and <a>.result synthesis .Synthesis synthesis.Handler] - [<s>.any <s>.end <s>.and <s>.result generation .Generation - (for @.jvm (generation.Handler jvm.Anchor jvm.Value jvm.Declaration) - @.js (generation.Handler js.Anchor js.Value js.Declaration) - @.lua (generation.Handler lua.Anchor lua.Value lua.Declaration) - @.python (generation.Handler python.Anchor python.Value python.Declaration) - @.ruby (generation.Handler ruby.Anchor ruby.Value ruby.Declaration))] + [<s>.any <s>.end <s>.and <s>.result translation .Translation + (for @.jvm (translation.Handler jvm.Anchor jvm.Value jvm.Declaration) + @.js (translation.Handler js.Anchor js.Value js.Declaration) + @.lua (translation.Handler lua.Anchor lua.Value lua.Declaration) + @.python (translation.Handler python.Anchor python.Value python.Declaration) + @.ruby (translation.Handler ruby.Anchor ruby.Value ruby.Declaration))] [<c>.any <c>.end <c>.and <c>.result declaration .Declaration (for @.jvm (declaration.Handler jvm.Anchor jvm.Value jvm.Declaration) @.js (declaration.Handler js.Anchor js.Value js.Declaration) diff --git a/stdlib/source/library/lux/meta/type/resource.lux b/stdlib/source/library/lux/meta/type/linear.lux index 25b8a52fe..25b8a52fe 100644 --- a/stdlib/source/library/lux/meta/type/resource.lux +++ b/stdlib/source/library/lux/meta/type/linear.lux diff --git a/stdlib/source/program/compositor.lux b/stdlib/source/program/compositor.lux index 99a4faa4a..873c4c08d 100644 --- a/stdlib/source/program/compositor.lux +++ b/stdlib/source/program/compositor.lux @@ -28,7 +28,7 @@ ["$" lux (.only) ["[1]/[0]" program (.only Program)] ["[0]" syntax] - ["[0]" generation] + ["[0]" translation] ["[0]" declaration] ["[0]" analysis (.only) [macro (.only Expander)]] @@ -135,7 +135,7 @@ (with_expansions [<parameters> (these anchor expression artifact)] (def .public (compiler lux_compiler file_context - expander host_analysis platform generation_bundle host_declaration_bundle program global extender + expander host_analysis platform translation_bundle host_declaration_bundle program global extender service packager,package) (All (_ <parameters>) @@ -144,9 +144,9 @@ Expander analysis.Bundle (IO (Platform <parameters>)) - (generation.Bundle <parameters>) + (translation.Bundle <parameters>) (declaration.Bundle <parameters>) - (Program expression artifact) (-> Archive Symbol (generation.Operation <parameters> expression)) + (Program expression artifact) (-> Archive Symbol (translation.Operation <parameters> expression)) Extender Service [Packager file.Path] @@ -161,7 +161,7 @@ [import (import.import (the platform.#file_system platform) (the cli.#libraries compilation)) .let [all_extensions [(analysisE.bundle host_analysis) synthesisE.bundle - generation_bundle + translation_bundle host_declaration_bundle]] [state archive phase_wrapper] (sharing [<parameters>] (is (Platform <parameters>) @@ -225,5 +225,5 @@ ... [console (|> console.default ... async.future ... (at ! each (|>> try.trusted console.async)))] - ... (interpreter.run! (try.with async.monad) console platform interpretation generation_bundle))) + ... (interpreter.run! (try.with async.monad) console platform interpretation translation_bundle))) )))) diff --git a/stdlib/source/specification/compositor.lux b/stdlib/source/specification/compositor.lux index 7afe706c1..f6fb3f280 100644 --- a/stdlib/source/specification/compositor.lux +++ b/stdlib/source/specification/compositor.lux @@ -14,7 +14,7 @@ ["[0]" declaration] [phase [macro (.only Expander)] - [generation (.only Bundle)]] + [translation (.only Bundle)]] [default [platform (.only Platform)]]]] [test @@ -23,7 +23,7 @@ ["[1][0]" common (.only Runner Definer)] ["[1]./" analysis ["[1][0]" type]] - ["[1]./" generation + ["[1]./" translation ["[1][0]" primitive] ["[1][0]" structure] ["[1][0]" reference] @@ -35,12 +35,12 @@ (-> Runner Definer analysis.State Expander Test) (all _.and (/analysis/type.spec expander state) - (/generation/primitive.spec runner) - (/generation/structure.spec runner) - (/generation/reference.spec runner definer) - (/generation/when.spec runner) - (/generation/function.spec runner) - (/generation/common.spec runner) + (/translation/primitive.spec runner) + (/translation/structure.spec runner) + (/translation/reference.spec runner definer) + (/translation/when.spec runner) + (/translation/function.spec runner) + (/translation/common.spec runner) )) (def .public (spec platform bundle expander program) diff --git a/stdlib/source/specification/compositor/common.lux b/stdlib/source/specification/compositor/common.lux index f72bb20bc..9b3f398f4 100644 --- a/stdlib/source/specification/compositor/common.lux +++ b/stdlib/source/specification/compositor/common.lux @@ -13,7 +13,7 @@ ["[0]" declaration] ["[0]" phase ["[0]" macro (.only Expander)] - ["[0]" generation (.only Operation)] + ["[0]" translation (.only Operation)] [extension (.only Extender) ["[0]" bundle]]] [default @@ -28,7 +28,7 @@ (type .public (Instancer what) (All (_ anchor expression declaration) (-> (Platform IO anchor expression declaration) - (generation.State anchor expression declaration) + (translation.State anchor expression declaration) what))) (def (runner (open "[0]") state) @@ -36,7 +36,7 @@ (function (_ evaluation_name expressionS) (do try.monad [expressionG (<| (phase.result state) - generation.with_buffer + translation.with_buffer (do phase.monad [_ runtime] (phase expressionS)))] @@ -47,34 +47,34 @@ (function (_ lux_name expressionS) (do try.monad [definitionG (<| (phase.result state) - generation.with_buffer + translation.with_buffer (do phase.monad [_ runtime expressionG (phase expressionS) - [host_name host_value host_declaration] (generation.define! lux_name expressionG) - _ (generation.learn lux_name host_name)] + [host_name host_value host_declaration] (translation.define! lux_name expressionG) + _ (translation.learn lux_name host_name)] (phase (synthesis.constant lux_name))))] (at host evaluate! "definer" definitionG)))) (def .public (executors target expander platform - analysis_bundle generation_bundle declaration_bundle + analysis_bundle translation_bundle declaration_bundle program extender) (All (_ anchor expression declaration) (-> Text Expander (Platform IO anchor expression declaration) analysis.Bundle - (generation.Bundle anchor expression declaration) + (translation.Bundle anchor expression declaration) (declaration.Bundle anchor expression declaration) (-> expression declaration) Extender (IO (Try [(declaration.State anchor expression declaration) Runner Definer])))) (do io.monad - [?state (platform.initialize target expander analysis_bundle platform generation_bundle declaration_bundle program extender)] + [?state (platform.initialize target expander analysis_bundle platform translation_bundle declaration_bundle program extender)] (in (do try.monad [[declaration_bundle declaration_state] ?state - .let [generation_state (the [declaration.#generation - declaration.#state] - declaration_state)]] + .let [translation_state (the [declaration.#translation + declaration.#state] + declaration_state)]] (in [[declaration_bundle declaration_state] - (..runner platform generation_state) - (..definer platform generation_state)]))))) + (..runner platform translation_state) + (..definer platform translation_state)]))))) diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 916f1dbc2..29e2725cf 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -895,7 +895,8 @@ item/1 random.nat item/2 random.nat] (all _.and - (_.coverage [/.Either] + (_.coverage [/.Either + /.#Left /.#Right] (and (exec (is (/.Either Nat Text) {.#Left left}) diff --git a/stdlib/source/test/lux/control/maybe.lux b/stdlib/source/test/lux/control/maybe.lux index d99622737..7ff61a642 100644 --- a/stdlib/source/test/lux/control/maybe.lux +++ b/stdlib/source/test/lux/control/maybe.lux @@ -29,7 +29,8 @@ (def .public test Test (<| (_.covering /._) - (_.for [.Maybe]) + (_.for [.Maybe + .#None .#Some]) (all _.and (_.for [/.equivalence] ($equivalence.spec (/.equivalence n.equivalence) (random.maybe random.nat))) diff --git a/stdlib/source/test/lux/data.lux b/stdlib/source/test/lux/data.lux index b242a4582..74432550a 100644 --- a/stdlib/source/test/lux/data.lux +++ b/stdlib/source/test/lux/data.lux @@ -10,8 +10,7 @@ ["[0]" / ["[1][0]" binary] ["[1][0]" bit] - ["[1][0]" color (.only) - ["[1]/[0]" named]] + ["[1][0]" color] ["[1][0]" identity] ["[1][0]" product] ["[1][0]" sum] @@ -44,7 +43,7 @@ /binary.test /bit.test /color.test - /color/named.test)) + )) (def test/1 Test diff --git a/stdlib/source/test/lux/data/collection/list.lux b/stdlib/source/test/lux/data/collection/list.lux index f32a5c3d5..3b079d53d 100644 --- a/stdlib/source/test/lux/data/collection/list.lux +++ b/stdlib/source/test/lux/data/collection/list.lux @@ -415,7 +415,8 @@ (def .public test Test (<| (_.covering /._) - (_.for [.List]) + (_.for [.List + .#End .#Item]) (let [(open "/#[0]") (/.equivalence n.equivalence) (open "/#[0]") /.functor] (do [! random.monad] diff --git a/stdlib/source/test/lux/data/color.lux b/stdlib/source/test/lux/data/color.lux index e098211cb..c56352d3d 100644 --- a/stdlib/source/test/lux/data/color.lux +++ b/stdlib/source/test/lux/data/color.lux @@ -11,7 +11,7 @@ [collection ["[0]" list]]] [math - ["[0]" random (.only Random)] + ["[0]" random (.only Random) (.use "[1]#[0]" functor)] [number ["n" nat] ["f" frac] @@ -20,12 +20,15 @@ [test ["_" property (.only Test)]]]] [\\library - ["[0]" /]]) + ["[0]" / (.only) + ["[0]" rgb]]] + ["[0]" / + ["[1][0]" rgb] + ["[1][0]" named]]) (def .public random (Random /.Color) - (|> (all random.and random.nat random.nat random.nat) - (at random.monad each /.of_rgb))) + (random#each /.of_rgb /rgb.random)) (def scale (-> Nat Frac) @@ -51,11 +54,12 @@ [tr tg tb] (/.rgb to)] (square_root (all f.+ - (|> (scale tr) (f.- (scale fr)) square) - (|> (scale tg) (f.- (scale fg)) square) - (|> (scale tb) (f.- (scale fb)) square))))) + (|> (scale (rgb.number tr)) (f.- (scale (rgb.number fr))) square) + (|> (scale (rgb.number tg)) (f.- (scale (rgb.number fg))) square) + (|> (scale (rgb.number tb)) (f.- (scale (rgb.number fb))) square))))) -(def rgb_error_margin +1.8) +(def rgb_error_margin + +1.8) (with_template [<field>] [(def (<field> color) @@ -70,7 +74,7 @@ (def (encoding expected) (-> /.Color Test) (all _.and - (_.coverage [/.RGB /.rgb /.of_rgb] + (_.coverage [/.rgb /.of_rgb] (|> expected /.rgb /.of_rgb (at /.equivalence = expected))) (_.coverage [/.HSL /.hsl /.of_hsl] @@ -210,4 +214,7 @@ (_.coverage [/.translucent] (r.= /.transparent (r.+ /.translucent /.translucent))) )) + + /rgb.test + /named.test )))) diff --git a/stdlib/source/test/lux/data/color/rgb.lux b/stdlib/source/test/lux/data/color/rgb.lux new file mode 100644 index 000000000..5781c9efa --- /dev/null +++ b/stdlib/source/test/lux/data/color/rgb.lux @@ -0,0 +1,128 @@ +(.require + [library + [lux (.except) + [abstract + [monad (.only do)] + [\\specification + ["[0]S" equivalence] + ["[0]S" hash] + ["[0]S" monoid]]] + [control + ["[0]" try (.use "[1]#[0]" functor)] + ["[0]" exception]] + [math + ["[0]" random (.only Random) (.use "[1]#[0]" functor)] + [number + ["n" nat]]] + [test + ["_" property (.only Test)]]]] + [\\library + ["[0]" /]]) + +(def .public value + (Random /.Value) + (random.one (|>> (n.% /.limit) + /.value + try.maybe) + random.nat)) + +(def .public random + (Random /.RGB) + (do random.monad + [red ..value + green ..value + blue ..value] + (in [/.#red red + /.#green green + /.#blue blue]))) + +(def .public test + Test + (<| (_.covering /._) + (do [! random.monad] + [expected_value ..value + expected ..random]) + (all _.and + (_.for [/.Value] + (all _.and + (_.coverage [/.number /.value] + (|> expected_value + /.number + /.value + (try#each (|>> /.number + (n.= (/.number expected_value)))) + (try.else false))) + (_.coverage [/.limit] + (and (when (/.value /.limit) + {try.#Failure _} true + {try.#Success _} false) + (when (/.value (-- /.limit)) + {try.#Failure _} false + {try.#Success _} true))) + (_.coverage [/.least] + (when (/.value (++ (/.number /.least))) + {try.#Failure _} false + {try.#Success _} true)) + (_.coverage [/.most] + (when (/.value (-- (/.number /.most))) + {try.#Failure _} false + {try.#Success _} true)) + (_.coverage [/.invalid] + (and (when (/.value (-- (/.number /.least))) + {try.#Failure it} (exception.match? /.invalid it) + {try.#Success _} false) + (when (/.value (++ (/.number /.most))) + {try.#Failure it} (exception.match? /.invalid it) + {try.#Success _} false))) + )) + (_.for [/.RGB] + (all _.and + (_.for [/.equivalence] + (equivalenceS.spec /.equivalence ..random)) + (_.for [/.hash] + (hashS.spec /.hash ..random)) + (_.for [/.addition] + (monoidS.spec /.equivalence /.addition ..random)) + (_.for [/.subtraction] + (monoidS.spec /.equivalence /.subtraction ..random)) + + (_.coverage [/.rgb] + (`` (and (let [red (/.number expected_value) + green (/.number expected_value) + blue (/.number expected_value)] + (when (/.rgb red green blue) + {try.#Failure _} + false + + {try.#Success it} + (and (n.= (/.number expected_value) + (/.number (the /.#red it))) + (n.= (/.number expected_value) + (/.number (the /.#green it))) + (n.= (/.number expected_value) + (/.number (the /.#blue it)))))) + (,, (with_template [<red_offset> <green_offset> <blue_offset>] + [(let [red (n.+ <red_offset> (/.number expected_value)) + green (n.+ <green_offset> (/.number expected_value)) + blue (n.+ <blue_offset> (/.number expected_value))] + (when (/.rgb red green blue) + {try.#Failure it} + (exception.match? /.invalid it) + + {try.#Success _} + false))] + + [/.limit 0 0] + [0 /.limit 0] + [0 0 /.limit] + ))))) + (_.coverage [/.complement] + (let [~expected (/.complement expected) + (open "/#[0]") /.equivalence] + (and (not (/#= expected ~expected)) + (/#= expected (/.complement ~expected))))) + (_.coverage [/.black /.white] + (and (at /.equivalence = /.white (/.complement /.black)) + (at /.equivalence = /.black (/.complement /.white)))) + )) + ))) diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/primitive.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/primitive.lux index a12f284a3..ca7bb0c3b 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/primitive.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/primitive.lux @@ -77,9 +77,9 @@ Test (<| (_.context (%.symbol (symbol ////synthesis.#Primitive))) (`` (all _.and - (,, (with_template [<analysis> <synthesis> <generator>] + (,, (with_template [<analysis> <synthesis> <translator>] [(do r.monad - [expected <generator>] + [expected <translator>] (_.test (%.symbol (symbol <synthesis>)) (|> {////analysis.#Primitive {<analysis> expected}} (//.phase archive.empty) diff --git a/stdlib/source/test/lux/meta/compiler/meta/archive/registry.lux b/stdlib/source/test/lux/meta/compiler/meta/archive/registry.lux index 2097736ad..57ce1b585 100644 --- a/stdlib/source/test/lux/meta/compiler/meta/archive/registry.lux +++ b/stdlib/source/test/lux/meta/compiler/meta/archive/registry.lux @@ -114,8 +114,8 @@ [/.definition (is category.Definition [expected_name {.#None}]) /.definitions category.#Definition /.analyser expected_name] [/.analyser expected_name /.analysers category.#Analyser /.synthesizer expected_name] - [/.synthesizer expected_name /.synthesizers category.#Synthesizer /.generator expected_name] - [/.generator expected_name /.generators category.#Generator /.declaration expected_name] + [/.synthesizer expected_name /.synthesizers category.#Synthesizer /.translator expected_name] + [/.translator expected_name /.translators category.#Translator /.declaration expected_name] [/.declaration expected_name /.declarations category.#Declaration /.custom expected_name] [/.custom expected_name /.customs category.#Custom /.definition (is category.Definition [expected_name {.#None}])] )) @@ -130,7 +130,7 @@ [/.definition (is category.Definition [expected_name {.#None}]) product.left] [/.analyser expected_name |>] [/.synthesizer expected_name |>] - [/.generator expected_name |>] + [/.translator expected_name |>] [/.declaration expected_name |>] [/.custom expected_name |>] )))) @@ -155,7 +155,7 @@ [it {.#None}]))] [/.analyser /.analysers text.equivalence (|>>)] [/.synthesizer /.synthesizers text.equivalence (|>>)] - [/.generator /.generators text.equivalence (|>>)] + [/.translator /.translators text.equivalence (|>>)] [/.declaration /.declarations text.equivalence (|>>)] [/.custom /.customs text.equivalence (|>>)] )))) @@ -174,7 +174,7 @@ [/.definition (is category.Definition [expected_name {.#None}]) product.left] [/.analyser expected_name |>] [/.synthesizer expected_name |>] - [/.generator expected_name |>] + [/.translator expected_name |>] [/.declaration expected_name |>] [/.custom expected_name |>] )))) diff --git a/stdlib/source/test/lux/meta/extension.lux b/stdlib/source/test/lux/meta/extension.lux index e27b0282f..1302a74fc 100644 --- a/stdlib/source/test/lux/meta/extension.lux +++ b/stdlib/source/test/lux/meta/extension.lux @@ -45,7 +45,7 @@ ["[0]" unit]]] [language [lux - ["[0]" generation] + ["[0]" translation] ["[0]" declaration] ["[0]" analysis (.only) ["[0]" type] @@ -53,16 +53,16 @@ ["[0]" synthesis (.only) ["<[1]>" \\parser]] [phase - [generation + [translation (.,, (.for "JVM" (.,, (.these ["[0]" jvm ["[1]/[0]" runtime]])) (.,, (.these))))]]]]]] [test ["_" property (.only Test)]]]] [\\library - ["[0]" / (.only analysis synthesis generation declaration)]]))) + ["[0]" / (.only analysis synthesis translation declaration)]]))) -... Generation +... Translation (for @.old (these) @@ -97,57 +97,57 @@ [location.dummy] (is analysis.Analysis))))))) - ... Generation - (def my_generation|generation - Generation - (generation (_ phase archive [pass_through <synthesis>.any]) - (phase archive pass_through))) + ... Translation + (def my_translation|translation + Translation + (translation (_ phase archive [pass_through <synthesis>.any]) + (phase archive pass_through))) - (def my_generation|synthesis + (def my_translation|synthesis Synthesis (synthesis (_ phase archive [parameters (<>.some <analysis>.any)]) (let [! phase.monad] (|> parameters (monad.each ! (phase archive)) - (at ! each (|>> {synthesis.#Extension (symbol ..my_generation|generation)} + (at ! each (|>> {synthesis.#Extension (symbol ..my_translation|translation)} [location.dummy] (is synthesis.Synthesis))))))) - (def my_generation + (def my_translation Analysis (analysis (_ phase archive [parameters (<>.some <code>.any)]) (let [! phase.monad] (|> parameters (monad.each ! (phase archive)) (at ! each (|>> (is (List analysis.Analysis)) - {analysis.#Extension (symbol ..my_generation|synthesis)} + {analysis.#Extension (symbol ..my_translation|synthesis)} [location.dummy] (is analysis.Analysis))))))) - (def dummy_generation|generation - Generation - (generation (_ phase archive []) - (let [[_ self] (symbol ..dummy_generation)] - (at phase.monad in - (for @.jvm (jvm.string self) - @.js (js.string self) - @.python (python.unicode self) - @.lua (lua.string self) - @.ruby (ruby.string self) - @.php (php.string self) - @.scheme (scheme.string self)))))) - - (def dummy_generation|synthesis + (def dummy_translation|translation + Translation + (translation (_ phase archive []) + (let [[_ self] (symbol ..dummy_translation)] + (at phase.monad in + (for @.jvm (jvm.string self) + @.js (js.string self) + @.python (python.unicode self) + @.lua (lua.string self) + @.ruby (ruby.string self) + @.php (php.string self) + @.scheme (scheme.string self)))))) + + (def dummy_translation|synthesis Synthesis (synthesis (_ phase archive []) (at phase.monad in (is synthesis.Synthesis - [location.dummy {synthesis.#Extension (symbol ..dummy_generation|generation) (list)}])))) + [location.dummy {synthesis.#Extension (symbol ..dummy_translation|translation) (list)}])))) - (def dummy_generation + (def dummy_translation Analysis (analysis (_ phase archive []) (at phase.monad in (is analysis.Analysis - [location.dummy {analysis.#Extension (symbol ..dummy_generation|synthesis) (list)}])))) + [location.dummy {analysis.#Extension (symbol ..dummy_translation|synthesis) (list)}])))) ... Declaration (def my_declaration @@ -166,37 +166,37 @@ expressionS (declaration.lifted_synthesis (synthesis_phase lux archive expressionA)) - generation_phase declaration.generation - expressionG (declaration.lifted_generation - (generation_phase lux archive expressionS)) + translation_phase declaration.translation + expressionG (declaration.lifted_translation + (translation_phase lux archive expressionS)) - _ (declaration.lifted_generation - (generation.with_new_context archive unit.none + _ (declaration.lifted_translation + (translation.with_new_context archive unit.none (do ! - [[module_id artifact_id] (generation.context archive) + [[module_id artifact_id] (translation.context archive) .let [commentary (format "Successfully installed declaration " (%.text self) "!")] - _ (generation.save! artifact_id {.#None} - (for @.jvm (let [$class (jvm/runtime.class_name [module_id artifact_id])] - (<| [$class] - (try.else (binary.empty 0)) - (try#each (binaryF.result class.format)) - (class.class version.v6_0 class.public - (name.internal $class) - {.#None} - (name.internal "java.lang.Object") - (list) - (list) - (list) - (list)))) - @.js (js.comment commentary - (js.statement (js.string commentary))) - @.python (python.comment commentary - (python.statement (python.string commentary))) - @.lua (lua.comment commentary - (lua.statement expressionG)) - @.ruby (ruby.comment commentary - (ruby.statement (ruby.string commentary)))))] - (generation.log! commentary))))] + _ (translation.save! artifact_id {.#None} + (for @.jvm (let [$class (jvm/runtime.class_name [module_id artifact_id])] + (<| [$class] + (try.else (binary.empty 0)) + (try#each (binaryF.result class.format)) + (class.class version.v6_0 class.public + (name.internal $class) + {.#None} + (name.internal "java.lang.Object") + (list) + (list) + (list) + (list)))) + @.js (js.comment commentary + (js.statement (js.string commentary))) + @.python (python.comment commentary + (python.statement (python.string commentary))) + @.lua (lua.comment commentary + (lua.statement expressionG)) + @.ruby (ruby.comment commentary + (ruby.statement (ruby.string commentary)))))] + (translation.log! commentary))))] (in declaration.no_requirements)))) (..my_declaration (n.* 2 3)) @@ -216,13 +216,13 @@ [/.analysis ..my_analysis] [/.synthesis ..my_synthesis])) - (_.coverage [/.generation] + (_.coverage [/.translation] (for @.old false (and (n.= expected - (..my_generation expected)) - (let [[_ expected] (symbol ..dummy_generation)] + (..my_translation expected)) + (let [[_ expected] (symbol ..dummy_translation)] (text#= expected - (..dummy_generation)))))) + (..dummy_translation)))))) (_.coverage [/.declaration] true) ))))) diff --git a/stdlib/source/test/lux/meta/type.lux b/stdlib/source/test/lux/meta/type.lux index 488bdabc0..50cccc419 100644 --- a/stdlib/source/test/lux/meta/type.lux +++ b/stdlib/source/test/lux/meta/type.lux @@ -39,7 +39,7 @@ ["[1][0]" implicit] ["[1][0]" quotient] ["[1][0]" refinement] - ["[1][0]" resource] + ["[1][0]" linear] ["[1][0]" unit] ["[1][0]" variance] ["[1][0]" poly] @@ -569,7 +569,7 @@ /implicit.test /quotient.test /refinement.test - /resource.test + /linear.test /unit.test /variance.test /poly.test diff --git a/stdlib/source/test/lux/meta/type/resource.lux b/stdlib/source/test/lux/meta/type/linear.lux index 4b134ebbe..4b134ebbe 100644 --- a/stdlib/source/test/lux/meta/type/resource.lux +++ b/stdlib/source/test/lux/meta/type/linear.lux |