companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.0 released(!!1!): https://ocaml.org/releases/5.0.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
Tuplanolla has quit [Quit: Leaving.]
wingsorc has quit [Remote host closed the connection]
wingsorc has joined #ocaml
xd1le has joined #ocaml
Soni has quit [Ping timeout: 240 seconds]
azimut has joined #ocaml
Soni has joined #ocaml
gwizon has quit [Quit: leaving]
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #ocaml
chrisz has quit [Ping timeout: 245 seconds]
chrisz has joined #ocaml
<discocaml> <anmonteiro> I think you want to use Configurator: https://dune.readthedocs.io/en/stable/dune-libs.html#configurator
<discocaml> <anmonteiro> You might want to use Configurator: https://dune.readthedocs.io/en/stable/dune-libs.html#configurator
gentauro has joined #ocaml
<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
<greenbagels> so i will read https://ocaml.org/docs/metaprogramming for now
neuroevolutus has joined #ocaml
Serpent7776 has joined #ocaml
bartholin has joined #ocaml
riverdc has quit [Quit: quitting]
riverdc has joined #ocaml
berberman_ has joined #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?
<olle> Eagerly, that is
<discocaml> <._null._> I don't think so ?
<olle> No?
<olle> Asking ChatGPT too
<olle> I have
<olle> | "SplDoublyLinkedList" {List Infer_me: Ast.typ}
<olle> | s=CLASS_NAME {Class_type (s, Infer_allocation_strategy) : Ast.typ}
<olle> But it seems to alway choose S=CLASS_NAME
<olle> Because it's more general...? o0
<discocaml> <._null._> Does it complain about conflicts ?
<olle> Eeeeh
<olle> Warning: 9 states have shift/reduce conflicts.
<olle> Warning: 34 shift/reduce conflicts were arbitrarily resolved.
<discocaml> <._null._> If so, they get solved arbitrarily but you should really fix them
<olle> Stuff like that??
<discocaml> <._null._> Yes, stuff like that
<olle> ><
<discocaml> <._null._> Don't worry too much about the high numbers, it's like compiler errors in compilers which don't stop at the first
<olle> OK but how to now which "state" is faulty?
<olle> know*
<discocaml> <._null._> Add the tag `--explain` and [try to] read the generated file
<olle> null in the dune file?
<discocaml> <._null._> No, this generates a "conflicts" file IIRC. unfortunately it gets placed in `_build`
<olle> Gah
<olle> Lemme just do an ugly hard-code there instead... :d
oriba has joined #ocaml
olle has quit [Ping timeout: 252 seconds]
alexherbo2 has quit [Remote host closed the connection]
olle has joined #ocaml
olle has quit [Ping timeout: 260 seconds]
waleee has joined #ocaml
daftaupe has quit [Remote host closed the connection]
Serpent7776 has quit [Quit: leaving]
daftaupe has joined #ocaml
neuroevolutus has quit [Quit: Client closed]
waleee has quit [Ping timeout: 240 seconds]
dhil has quit [Ping timeout: 240 seconds]
<greenbagels> alright friends youve convinced me with very minimal effort
<greenbagels> ppxes are cool
azimut has quit [Ping timeout: 240 seconds]
elred has quit [Ping timeout: 250 seconds]
elred has joined #ocaml
wingsorc has joined #ocaml
dstein64- has joined #ocaml
dstein64 has quit [Ping timeout: 252 seconds]
dstein64- is now known as dstein64
bartholin has quit [Quit: Leaving]
xd1le has quit [Quit: xd1le]
neuroevolutus has joined #ocaml
waleee has joined #ocaml
neuroevolutus has quit [Quit: Client closed]
Tuplanolla has quit [Quit: Leaving.]