Here's a thread of reddit about it: https://www.reddit.com/r/ocaml/comments/6es88t/what_does_the...
type 'a option = None | Some of 'a
So calling this project "WASM of OCaml" is one way of saying that it "wraps" OCaml code in WASM.It has been used as a translation of the French de since the 11th century and I think it gets some senses (eg derivation) from that. With a verb meaning create, this ocaml construction is fine in modern English (eg ‘make a string of an int’) and dates back a long way (OED offers a source from 893; this is sense I. [VII.] 20. a. in the second edition). So I think partly the question is whether omitting make in make_string_of_int (or String.make_of_int) is an acceptable abbreviation in programming.
`js_from_ocaml`, `string_from_int`, etc would have been clearer in english.
If i didn't speak Spanish it would bother me a lot more.
i = int_of_string s
where the "i" is next to the "int" and the "s" is next to the "string". i = string_to_int s
just looks backwards to me.From the other comments sounds like its local style for OCaml maybe because of some French lineage, but that "int_of_string" is a function that converts a string into an int was definitely not something that I would have assumed (as opposed to 'int_from_string' or something).
It's just "[create an] int [out] of [a] string"
"from" would have made more sense.
And as a consequence, Rust has it standardized as "i = from s".
(i :: Int) = fromString s
Although once in a while it's useful to make a short synonym for disambiguating the type, x_of_y is certainly not a short synonym, so it's not commonly used.
f = glork_to_floob (crumb_to_glork c)
versus f = floob_of_glork (glork_of_crumb c)
and picture the first style inside a more complex function with more constructors/conversions. f = floob_of_glork . glork_of_crumb . crumb_of_zing
which is much better than f = glork_to_floob . crumb_to_glork . zing_to_crumb crumb_of_zing x |> glork_of_crumb |> floob_of_glork
versus zing_to_crumb x |> crumb_to_glork |> glork_to_floobI would like to know what it's like to work in a fully left-to-right language, for example, to define `my_floob`:
let my_crumb |> zing_to_crumb |> crumb_to_glork |> glork_to_floob = my_floob x |> zing_to_crumb() |> crumb_to_glork() |> glork_to_floob() -> my_floob
But it is not idiomatic.> The notation g ∘ f is read as "g of f "...
* "used as a function word to indicate origin or derivation, eg. a man of noble birth" (js code comes from ocaml code)
* "used as a function word to indicate the component material, parts, or elements or the contents, eg. throne of gold / cup of water" (js application made of ocaml code)
"of" usually implies a state of being while "from" implies a transformation.
"JS of Ocaml" implies that the JS is Ocaml, but that's not true as it is transformed. "JS from Ocaml" would be more accurate.
Rope (advanced string): corde
Thread: fil
So string from object would like ficelle d'objet which is yeah, string from object. But the "of" thing in Ocaml is well documented. I vaguely remember them when I had an Ocaml project in my coursework.
But "standard library" never was a strong point of OCaml anyway so I guess meh shrugs