<greenbagels>
so yojson seems to be an extremely popular json library but it is (by its own admission) pretty low-level; to use it natively to deserialize JSON objects into ocaml data types is a pretty verbose process
<greenbagels>
am i wrong in thinking people use some kind of code generation / metaprogramming to deserialize json data in practice?
<discocaml>
<bluddy5> Easiest way is to use ppx_deriving_yojson
<greenbagels>
would you say that is the most common way people use it? hmm
<discocaml>
<bluddy5> I don't know. I know that I have no patience to describe how to serialize or deserialize objects. I serialize my entire game state like this.
<greenbagels>
i feel ya
<companion_cube>
json for a game, tho… 😅
<discocaml>
<bluddy5> it's fine. makes it easier to debug
<discocaml>
<bluddy5> I can switch to a binary format later
<greenbagels>
i guess my question boils down to more than just asking about json itself; i guess im getting to the point where i have to understand the extent to which preprocessing is idiomatic in ocaml
<discocaml>
<bluddy5> Some people will tell you it's not essential. I beg to differ. Once you start scaling up, you cannot afford to spend time on basics like serialization for every data structure.
berberman has quit [Ping timeout: 264 seconds]
berberman has joined #ocaml
berberman_ has quit [Ping timeout: 264 seconds]
bartholin has quit [Quit: Leaving]
neuroevolutus has quit [Quit: Client closed]
kakadu has joined #ocaml
kakadu has quit [Client Quit]
alexherbo2 has joined #ocaml
hrberg has joined #ocaml
kakadu has joined #ocaml
kakadu has quit [Client Quit]
dhil has joined #ocaml
dh` has quit [Read error: Connection reset by peer]
Tuplanolla has joined #ocaml
sagax has quit [Ping timeout: 245 seconds]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
luke96 has joined #ocaml
luke96 has quit [Client Quit]
luke93 has joined #ocaml
wingsorc has quit [Ping timeout: 246 seconds]
<companion_cube>
Yeah at this point it's fairly important imho
<companion_cube>
But I have colleagues who use elm-style encoders, so, combinators, and it works well enough
luke93 has quit [Ping timeout: 246 seconds]
elred has joined #ocaml
Anarchos has joined #ocaml
<discocaml>
<tym972> Hello, I have a problem with my OCaml environment. I'm on Windows, and I work with VS Code on Ubuntu. I am trying to install unionFind module, for that I did opam install unionFind in console. By doing #require in utop, I access the functions, but the problem is that I can't do "open UnionFind" in my source files, the module is not recognized. Could someone guide me?
mechap has joined #ocaml
<discocaml>
<octachron> You need to communicate to your build system which library you are using.
<discocaml>
<octachron> With dune this means adding the library to your `libraries` stanza.
mechap has quit [Ping timeout: 240 seconds]
<discocaml>
<tym972> I'm novice, how do we do it? I think I use dune but there is no dune file in my Workspace root.
Anarchos has quit [Quit: Vision[]: i've been blurred!]
dhil has quit [Ping timeout: 260 seconds]
mechap has joined #ocaml
<discocaml>
<octachron> If you don't have a `dune` file nor a `dune-project` file, you have not yet set up dune for your project. The `dune-project` file can be as short as `(lang dune 3.0)` whereas the `dune` file should contain something like `(executable (name my_project_name) (libraries unionFind))`.
<discocaml>
<contificate> Nice to see that I can't be the only one that sometimes uses `3.0` to permit being able to just do projects as a single folder endeavour.
<companion_cube>
why wouldn't that work with 2? :)
<discocaml>
<contificate> Gotta be as modern as possible whilst also sticking to your principles, unless you're telling me `dune` major versions work decrementally, and we're about to converge on the perfect build system with version 0.
alexherbo2 has quit [Ping timeout: 246 seconds]
<companion_cube>
hmm no, I just try to not force my users to use the most recent version of things
<companion_cube>
(in this case, in particular, upgrading dune is a PITA because you have to recompile your whole switch)
dhil has joined #ocaml
dh` has joined #ocaml
alexherbo2 has joined #ocaml
TrillionEuroNote has quit [Ping timeout: 245 seconds]
TrillionEuroNote has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
bartholin has joined #ocaml
mechap has quit [Ping timeout: 246 seconds]
neuroevolutus has joined #ocaml
olle has joined #ocaml
<olle>
Hm isn't Menhir parsing in order in the parser file?