Post 9rELeXIlJPIcXPv8Nc by orbifx@mstdn.io
(DIR) More posts by orbifx@mstdn.io
(DIR) Post #9rELeQ3yE0JA5Vwiqu by 22@octodon.social
2020-01-18T19:40:20Z
0 likes, 0 repeats
I am doing 2019 Advent of Code https://adventofcode.com in #ReasonML (#OCaml)—looking for a types experience that's more intenso than #TypeScript.It's a bit awkward toggling between #BuckleScript and OCaml documentation but this feeling of being in good hands, this confidence in the solidness of the language, is something I haven't felt in a while. TypeScript is fairly internally-consistent but nothing like Reason/OCaml.
(DIR) Post #9rELeQmHZFkmIwg6vA by 22@octodon.social
2020-01-19T03:13:03Z
0 likes, 0 repeats
Totally over-using the |> pipe-last notation.Ooh, Reason/BuckleScript dirty laundry: https://stackoverflow.com/a/55476957/500207
(DIR) Post #9rELeRFhnrHzmCRbma by 22@octodon.social
2020-01-19T03:19:14Z
0 likes, 0 repeats
I should pause before day 5 and write the first four days in1- Scala2- Elixir/Erlang
(DIR) Post #9rELeRrdWpd9fqBtuC by 22@octodon.social
2020-01-20T00:52:57Z
0 likes, 0 repeats
Why does #Scala's `sbt run` take thirty seconds to run unchanged code?ReasonML/BuckleScript likes to tell me how it finished in twenty-four MILLIseconds.What's the real way people write and run Scala code?
(DIR) Post #9rELeSTvEUFtaa6Ta4 by 22@octodon.social
2020-01-20T01:30:43Z
0 likes, 0 repeats
Ok, you run `sbt` which starts an interactive mode shell?, and `~ run` watches for source code changes, compiles & re-runs. This takes <2 seconds, so I'm good now."The magic of myth and legend has come true in our time. One types the correct incantation on a keyboard, and a display screen comes to life, showing things that never were nor could be. … If one character, one pause, of the incantation is not strictly in proper form, the magic doesn’t work." —#FredBrooks https://cs.calvin.edu/courses/cs/262/kvlinden/references/brooksJoysAndWoes.html
(DIR) Post #9rELeSvDb05cxEsH7w by 22@octodon.social
2020-01-20T01:35:36Z
0 likes, 0 repeats
(I invoke Fred Brooks tongue-in-cheek because on one hand one could think "Why the hell is Scala sbt so weird" but then I remember how at ease I am in JavaScript, where four major things like sbt contend for mastery… #FredBrooks again: "designing grand concepts is fun; finding nitty little bugs is just work. With any creative activity come dreary hours of tedious, painstaking labor, and programming is no exception.")
(DIR) Post #9rELeTTbX9ayfsxjiy by 22@octodon.social
2020-01-20T03:02:50Z
0 likes, 0 repeats
Funny factoid, #Scala and #FSharp are very close to each other in how much they're loved and dreaded, per 2019 Stack Overflow survey https://insights.stackoverflow.com/survey/2019#technology-_-most-loved-dreaded-and-wanted-languagesBut I'm not so sure about this list—OCaml isn't on it. Erlang is loved about as much as Ruby & PHP (47%, not very much), and it's dreaded about the same as those two. But Elixir is loved much more (68%), so …?When I saw that Scala was much less loved than I thought, I became bearish on it, but I think I should do my own investigation.
(DIR) Post #9rELeTuttfQi2XjXGq by 22@octodon.social
2020-01-20T03:12:28Z
0 likes, 0 repeats
The Stack Overflow survey respondent is maybe more likely to be junior & prone to loving whatever's on Hacker News, or maybe whatever's easy to setup and has a gentle learning curve.And since meeting all these fresh college grads at work in love with whatever garbage they learned in school (Java? Python? Really, you love these boring languages? What are you, fifty-five and have a mortgage to pay and kids to put through college?), I can see this crowd more meh on things than experienced devs.
(DIR) Post #9rELeUNy9agLUhKka0 by 22@octodon.social
2020-01-20T04:17:28Z
0 likes, 0 repeats
Jordan Walke (React inventor) on two types of friction:- static, the friction of getting a stone rolling- kinetic, the friction to keep it rolling,and how you might think if you overcome static friction, people will see how great this stone, this new technology, is.But.You'd be competing with other technologies which offer zero static friction—"you can start pushing them right now, so people have to trust that the technology's going to deliver once they invest".https://youtu.be/5fG_lyNuEAw?t=967
(DIR) Post #9rELeV21keizUw4k1A by 22@octodon.social
2020-01-21T02:00:52Z
0 likes, 0 repeats
I've done the first four days of Advent of Code 2019, in #ReasonML–#OCaml and now #Scala.I am a huge fan of standard libraries that provide a slew of specialized utilities for slicing sequences (arrays, lists, etc.), like `sliding` window and `segmentLength` (https://www.scala-lang.org/api/current/scala/collection/AbstractIndexedSeqView.html). #Rust has that too and it makes me feel loved.I'm going to do more AoC in Scala because I rather like it—unexpectedly since I was listening to a lot of naysayers, instead of evaluating it for myself.
(DIR) Post #9rELeVf1PfutRsJsnY by 22@octodon.social
2020-01-21T02:01:01Z
0 likes, 0 repeats
Meanwhile in #OCaml–#ReasonML, it seems I have to rigorously keep arrays & lists separate. Furthermore, simple utilities like `zip` or `cross` (cross product) aren't even in the stdlib, let alone fancy things like `sliding` or `splitAt`.OCaml gurus, is there no concept in OCaml of a supertype to Array and List that defines `map` and `fold` etc., so I don't have to specify which type's `map` I want to invoke?And, what's the recommended library to get all the nice tasty utilities? @wim_v12e?
(DIR) Post #9rELeXIlJPIcXPv8Nc by orbifx@mstdn.io
2020-01-21T15:42:18Z
0 likes, 0 repeats
@22 check out for more exotic containers:http://c-cube.github.io/ocaml-containers/2.8.1/containers/index.htmlThe standard library provides only basic containers and I think that is intentional and sensible.You shouldn't have to specify which map or fold you want to use so long you `open` the correct module in the scope.@wim_v12e
(DIR) Post #9rEVYvz1dGhotIekka by 22@octodon.social
2020-01-21T17:33:24Z
0 likes, 0 repeats
@orbifx thanks for the note. Is the idea that I’d use CCArray and CCList et al. instead of normal Array and List?Also, my code has lists and arrays, so I keep explicitly having to say Array.map or List.fold and I want to make sure that’s just what everyone does?
(DIR) Post #9rEXo0Xt9TdPIDHL7o by orbifx@mstdn.io
2020-01-21T17:58:29Z
0 likes, 0 repeats
@22 use the CC ones only if you want something they provide you know Stblib's doesn't provide.Do you use Array and List even in the same function scope? Across multiple functions?I'd like to code. Do you have XMPP to discuss? Or email?
(DIR) Post #9rF74MdqGQDAqqb916 by 22@octodon.social
2020-01-22T00:33:40Z
0 likes, 0 repeats
@orbifx Hmmm!https://github.com/fasiha/advent-of-code-2019-reasonml/blob/master/src/Demo.re#L270 (I was both learning ReasonML/OCaml & simultaneously trying to solve Advent of Code 2019 puzzles, so it's super-messy—the next version in Scala is much neater because I was just learning Scala then!)(ReasonML is isomorphic to OCaml: https://reasonml.github.io/docs/en/comparison-to-ocaml)Yes, it looks like a function uses either arrays or lists, not both. That helps!I'll continue to write Reason! Keeping array/list separate, like keeping int/float separate, is weird but ok?
(DIR) Post #9rFyjKg3lbCMCe3WCm by orbifx@mstdn.io
2020-01-22T10:34:58Z
0 likes, 0 repeats
@22 I think so.Consider joining our #ocaml #XMPP room for easier chat:ocaml@conferences.orbitalfox.eu?joinThere is also the #mailinglist:https://sympa.inria.fr/sympa/info/caml-list