News for hackers. Stuff that matters.
Re:WASM_of_OCaml by nequo on Wednesday July 26, 2023 @07:19AM (#36875825)
Interesting. The pipe operator is more idiomatic in OCaml where this would be

  crumb_of_zing x |> glork_of_crumb |> floob_of_glork
versus

  zing_to_crumb x |> crumb_to_glork |> glork_to_floob
Re:WASM_of_OCaml by abecedarius on Wednesday July 26, 2023 @09:14AM (#36877113)
Yeah, fair. Forth especially really commits to that left-to-right order in its general style -- I like it when a language and its culture are conscious about readability in this way.
Re:WASM_of_OCaml by tome on Wednesday July 26, 2023 @09:26AM (#36877294)
It is interesting that the "of" style is common in Ocaml where the left-to-right style is common. They seem to clash!

I 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
Re:WASM_of_OCaml by nequo on Wednesday July 26, 2023 @10:28AM (#36878315)
In addition to Forth, R can do this too:

  x |> zing_to_crumb() |> crumb_to_glork() |> glork_to_floob() -> my_floob
But it is not idiomatic.