Skip to content

Commit

Permalink
Re-named Codec to Format. Slightly more efficient function calls …
Browse files Browse the repository at this point in the history
…for scripting languages.
  • Loading branch information
eduardoejp committed Aug 29, 2023
1 parent b32652a commit b7fb27e
Show file tree
Hide file tree
Showing 151 changed files with 997 additions and 754 deletions.
5 changes: 5 additions & 0 deletions documentation/bookmark/art/film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Reference

0. [What Does CINEMATIC Really Mean?](https://www.youtube.com/watch?v=ZbByKUDJlbI)
0. [How To Analyze Movies – Film Studies 101](https://www.youtube.com/watch?v=ahHIifcFyqk)

20 changes: 10 additions & 10 deletions lux-c++/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
... https://github.com/wlav/cppyy
(.require
[library
[lux (.except)
[lux (.except tuple)
[program (.only program)]
["[0]" ffi (.only import)]
[abstract
Expand Down Expand Up @@ -109,15 +109,15 @@
(the (runtime globals)
(-> Any
Runtime)
(getattr globals /runtime.namespace))
(getattr [globals /runtime.namespace]))

(with_template [<short> <type>]
[(the (<short> @ it)
(-> Runtime Any
<type>)
(let [on (as (-> Any
<type>)
(getattr @ (template.symbol [/runtime._] [<short>])))]
(getattr [@ (template.symbol [/runtime._] [<short>])]))]
(on it)))]

[object_tag Nat]
Expand All @@ -141,14 +141,14 @@
[]
(.python_object_none#)))
(array.has! 2 choice)
..tuple))
[] ..tuple))

(the (tuple::member @ member it)
(-> Runtime Nat Any
Value)
(let [on (as (-> Nat Any
Value)
(getattr @ /runtime.tuple::member))]
(getattr [@ /runtime.tuple::member]))]
(on member it)))

(the (lux_tuple @ lux_value input)
Expand Down Expand Up @@ -176,7 +176,7 @@
... /runtime.f64_tag

/runtime.text_tag
(..str (lux_text @ it))
(..str [(lux_text @ it)])

/runtime.variant_tag
(lux_variant (variant::lefts @ it)
Expand Down Expand Up @@ -211,7 +211,7 @@
[_ (cppyy::cppdef (_.code definition))
.let [globals (io.run! (cppyy::gbl))
it (lux_value (..runtime globals)
(getattr globals global))]
(getattr [globals global]))]
_ (cppyy::cppexec (_.code (_.; (_.:= (_.local global) /runtime.unit))))]
(in it)))))))
execute! (is (-> /runtime.Declaration
Expand All @@ -236,12 +236,12 @@
_ (execute! definition)
.let [globals (io.run! (cppyy::gbl))
value (lux_value (..runtime globals)
(getattr globals global))]]
(getattr [globals global]))]]
(in [global value definition]))))

(the (ingest context content)
(|> content
(of utf8.codec projection)
(of utf8.format projection)
try.trusted
(as /runtime.Declaration)))

Expand Down Expand Up @@ -270,7 +270,7 @@
platform.#runtime /runtime.translation

platform.#phase_wrapper ..phase_wrapper
platform.#write (|>> _.code (of utf8.codec injection))]])))
platform.#write (|>> _.code (of utf8.format injection))]])))

(the (extender _)
Extender
Expand Down
6 changes: 3 additions & 3 deletions lux-js/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@

(the (ingest context content)
(|> content
(of utf8.codec projection)
(of utf8.format projection)
try.trusted
(as _.Statement)))

Expand Down Expand Up @@ -621,7 +621,7 @@

(the (ingest context content)
(|> content
(of utf8.codec projection)
(of utf8.format projection)
try.trusted
(as _.Statement)))

Expand Down Expand Up @@ -660,7 +660,7 @@
platform.#phase js.expression
platform.#runtime runtime.translate
platform.#phase_wrapper ..phase_wrapper
platform.#write (|>> _.code (of utf8.codec injection))])))
platform.#write (|>> _.code (of utf8.format injection))])))

(the (lux_program context program)
(Program _.Expression _.Statement)
Expand Down
8 changes: 4 additions & 4 deletions lux-lua/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@

(the (ingest context content)
(|> content
(of utf8.codec projection)
(of utf8.format projection)
try.trusted
(as _.Statement)))

Expand Down Expand Up @@ -775,7 +775,7 @@

(the (ingest context content)
(|> content
(of utf8.codec projection)
(of utf8.format projection)
try.trusted
(as _.Statement)))

Expand Down Expand Up @@ -857,7 +857,7 @@
platform.#phase lua.expression
platform.#runtime runtime.translate
platform.#phase_wrapper (..phase_wrapper ..to_host)
platform.#write (|>> _.code (of utf8.codec injection))]])))]
platform.#write (|>> _.code (of utf8.format injection))]])))]
(for .old <jvm>
.jvm <jvm>
.lua (the platform
Expand All @@ -869,7 +869,7 @@
platform.#phase lua.expression
platform.#runtime runtime.translate
platform.#phase_wrapper (..phase_wrapper ..to_host)
platform.#write (|>> _.code (of utf8.codec injection))])))))
platform.#write (|>> _.code (of utf8.format injection))])))))

(the (lux_program context program)
(Program _.Expression _.Statement)
Expand Down
2 changes: 1 addition & 1 deletion lux-mode/lux-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ Called by `imenu--generic-function'."
"for"
"io"
"infix"
"format"
"message"
"regex")
"\\>"))))
(separator "\\.")
Expand Down
4 changes: 2 additions & 2 deletions lux-php/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@

(the (ingest context content)
(|> content
(of utf8.codec projection)
(of utf8.format projection)
try.trusted
(as _.Statement)))

Expand All @@ -519,7 +519,7 @@
platform.#host host
platform.#phase php.translate
platform.#runtime runtime.translate
platform.#write (|>> _.code (of utf8.codec injection))])))
platform.#write (|>> _.code (of utf8.format injection))])))

(the (program context program)
(Program _.Expression _.Statement)
Expand Down
6 changes: 3 additions & 3 deletions lux-python/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@

(the (ingest context content)
(|> content
(of utf8.codec projection)
(of utf8.format projection)
try.trusted
(as (_.Statement Any))))

Expand Down Expand Up @@ -487,7 +487,7 @@

(the (ingest context content)
(|> content
(of utf8.codec projection)
(of utf8.format projection)
try.trusted
(as (_.Statement Any))))

Expand Down Expand Up @@ -544,7 +544,7 @@
platform.#phase python.expression
platform.#runtime runtime.translate
platform.#phase_wrapper ..phase_wrapper
platform.#write (|>> _.code (of utf8.codec injection))])))
platform.#write (|>> _.code (of utf8.format injection))])))

(the (lux_program context program)
(Program (_.Expression Any) (_.Statement Any))
Expand Down
4 changes: 2 additions & 2 deletions lux-r/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@

(the (ingest context content)
(|> content
(of utf8.codec projection)
(of utf8.format projection)
try.trusted
(as _.Expression)))

Expand All @@ -561,7 +561,7 @@
platform.#host host
platform.#phase r.translate
platform.#runtime runtime.translate
platform.#write (|>> _.code (of utf8.codec injection))]])))
platform.#write (|>> _.code (of utf8.format injection))]])))

(the (program context program)
(Program _.Expression _.Expression)
Expand Down
4 changes: 2 additions & 2 deletions lux-ruby/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@

(the (ingest context content)
(|> content
(of utf8.codec projection)
(of utf8.format projection)
try.trusted
(as _.Statement)))

Expand Down Expand Up @@ -974,7 +974,7 @@
platform.#phase ruby.expression
platform.#runtime runtime.translate
platform.#phase_wrapper ..phase_wrapper
platform.#write (|>> _.code (of utf8.codec injection))])))
platform.#write (|>> _.code (of utf8.format injection))])))

(the (lux_program context program)
(Program _.Expression _.Statement)
Expand Down
12 changes: 6 additions & 6 deletions stdlib/source/documentation/lux.lux
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@
"Existential quantification."

($.example (' (for_some (_ a)
[(Codec Text a) a])))
[(Format Text a) a])))

($.comment "A name can be provided, to specify a recursive type.")
($.example (' (for_some (Self a)
[(Codec Text a)
[(Format Text a)
a
(List (Self a))]))))
))
Expand Down Expand Up @@ -594,18 +594,18 @@
["M" monad (.except)]]
[data
maybe
["[0]" name (.use "[1]#[0]" codec)]]
["[0]" name (.use "[1]#[0]" format)]]
[macro
code]]
[//
[type (.use "[0]" equivalence)]]))))

($.definition /.of
"Allows accessing the value of a implementation's member."
($.example (' (of codec injection)))
($.example (' (of format injection)))

($.comment "Also allows using that value as a function.")
($.example (' (of codec injection +123))))
($.example (' (of format injection +123))))

($.definition /.has
"Sets the value of a record at a given tag."
Expand Down Expand Up @@ -705,7 +705,7 @@
[<tests> (with_template [<function> <parameter> <expected>]
[(cover [<function>]
(compare <text>
(of codec injection <function> <parameter>)))]
(of format injection <function> <parameter>)))]

[bit #1 "#1"]
[int +123 "+123"]
Expand Down
4 changes: 2 additions & 2 deletions stdlib/source/documentation/lux/abstract.lux
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
["[0]" list]]]]]
["[0]" /
["[1][0]" apply]
["[1][0]" codec]
["[1][0]" format]
["[1][0]" comonad]
["[1][0]" enum]
["[1][0]" equivalence]
Expand All @@ -25,7 +25,7 @@
(.List $.Documentation)
(list.together
(list /apply.documentation
/codec.documentation
/format.documentation
/comonad.documentation
/enum.documentation
/equivalence.documentation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
(list ($.module /._
"")

($.definition (/.Codec medium value)
($.definition (/.Format medium value)
"A way to move back-and-forth between a type and an alternative representation for it.")

($.definition /.composite
"Codec composition."
($.example (' (is (Codec c a)
(composite (is (Codec c b)
cb_codec)
(is (Codec b a)
ba_codec))))))))
"Format composition."
($.example (' (is (Format c a)
(composite (is (Format c b)
cb_format)
(is (Format b a)
ba_format))))))))
6 changes: 3 additions & 3 deletions stdlib/source/documentation/lux/control/projection.lux
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
\n "That way, the same input can be consumed again by another projection.")
($.example (' (speculative projection))))

($.definition /.codec
"Decode the output of a projection using a codec."
($.example (' (codec codec projection))))
($.definition /.format
"Decode the output of a projection using a format."
($.example (' (format format projection))))
))
2 changes: 1 addition & 1 deletion stdlib/source/documentation/lux/data/bit.lux
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
($.definition /.hash)
($.definition /.disjunction)
($.definition /.conjunction)
($.definition /.codec)
($.definition /.format)

($.definition /.complement
(%.message "Generates the complement of a predicate."
Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/documentation/lux/data/format/json.lux
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
($.definition /.object)
($.definition /.equivalence)
($.definition /.injection)
($.definition /.codec)
($.definition /.format)

($.definition /.json
"A simple way to produce JSON literals."
Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/documentation/lux/data/format/xml.lux
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
($.definition /.Attribute)
($.definition /.Attrs)
($.definition /.XML)
($.definition /.codec)
($.definition /.format)
($.definition /.equivalence)

($.definition /.attributes
Expand Down
4 changes: 2 additions & 2 deletions stdlib/source/documentation/lux/data/text/encoding/utf8.lux
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
(list ($.module /._
"")

($.definition /.codec
"A codec for binary encoding of text as UTF-8.")
($.definition /.format
"A format for binary encoding of text as UTF-8.")
))
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
($.definition /.modulus)
($.definition /.value)
($.definition /.incorrect_modulus)
($.definition /.codec)
($.definition /.format)

($.definition /.=)
($.definition /.<)
Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/documentation/lux/math/number/frac.lux
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
($.definition /./)
($.definition /.%)
($.definition /.reciprocal)
($.definition /.codec)
($.definition /.format)
($.definition /.addition)
($.definition /.multiplication)

Expand Down
Loading

0 comments on commit b7fb27e

Please sign in to comment.