Leonidas changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.1.1 released: https://ocaml.org/releases/5.1.1 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
waleee has quit [Ping timeout: 246 seconds]
waleee has joined #ocaml
jabuxas has quit [Ping timeout: 268 seconds]
waleee has quit [Ping timeout: 256 seconds]
mbuf has joined #ocaml
ansiwen has quit [Quit: ZNC 1.7.1 - https://znc.in]
ansiwen has joined #ocaml
mro has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
olle has joined #ocaml
Serpent7776 has joined #ocaml
bartholin has joined #ocaml
mro has quit [Ping timeout: 268 seconds]
wingsorc has quit [Ping timeout: 272 seconds]
reynir has joined #ocaml
mro has joined #ocaml
YuGiOhJCJ has joined #ocaml
<YuGiOhJCJ> hello, I am new to ocaml, I am following this guide: https://ocaml.org/docs/installing-ocaml and have been able to use the "ocaml" (not "utop") interpreter to interpret my "main.ml" file, I used the "print_endline" function, then the "printf" function of the "Printf" module, all is good when I work on a single file/module (main.ml) however when I have a second file/module (mymod.ml) then I run "ocaml main.ml", the "mymod" module is not
<YuGiOhJCJ> found, is "dune" required for doing modular programming? I would prefer to only use the "ocaml" interpreter instead of several tools for simplicity
<olle> Dune is not required, but it can make things easier and automatic for you, so you don't need a Makefile etc
<olle> Especially if the project grows.
<YuGiOhJCJ> ok but if I just want to interpret a modular project using only the "ocaml" tool is it possible? (with or without Makefile)
<YuGiOhJCJ> let's say that this modular project only has 2 files in the same directory: main.ml and mymod.ml
<YuGiOhJCJ> main.ml is using mymod.ml
<olle> Sure, but someone else will have to fill in the details (or check gemini/chatgpt/your favorite llm)
<YuGiOhJCJ> isn't it enough to name my second file "mymod.ml" so "main.ml" is able to use "mymod.v"?
<olle> .v?
<discocaml> <._null._> Interpreting files is not the recommended way to run them, ocaml is a compiled language.
<discocaml> <._null._> If you really want to go that way, you can use `#use "mymod.ml"` to run a file and access its definitions (you lose the namespacing though)
<YuGiOhJCJ> <._null._>, ok yes I thought it was an interpreted language as I started by using "ocaml" which is an interpreter for ocaml, I will try with "use" to see if it works but I will probably move to a compiler instead of interpreter
<discocaml> <._null._> Compiled vs interpreted is really about the tool you use to run code, but OCaml projects (as in > 1 file) are basically always compiled, never interpreted
<olle> ocamlc is the compiler
<olle> IIRC
<YuGiOhJCJ> ok got it
<discocaml> <._null._> There are two depending on whether you compile to a portable bytecode or native code. Usually you just let dune do its thing
<YuGiOhJCJ> tried with "use mymod" and got "Error: Unbound value use" (I am on OCaml version 4.14.2)
<discocaml> <._null._> The # is required
<discocaml> <._null._> The # is required; this is not part of OCaml code but a "preprocessor instruction"
<YuGiOhJCJ> wow I thought it the # was the one of the interpret like $ for the terminal! it was a trap
<discocaml> <._null._> Ah, I didn't think about that confusion, sorry
<YuGiOhJCJ> no problem, and I confirm it works! but I will probably switch to a compiler
<YuGiOhJCJ> are preprocessor instructions (like #use) documented somewhere here? https://ocaml.org/docs I don't find the corresponding section
<bartholin> YuGiOhJCJ: https://ocaml.org/manual/5.2/toplevel.html#s%3Atoplevel-directives
<YuGiOhJCJ> nice thanks :)
pi3ce_ has quit [Ping timeout: 260 seconds]
pi3ce has joined #ocaml
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
myrkraverk_ has quit [Remote host closed the connection]
myrkraverk_ has joined #ocaml
<discocaml> <commutativeconjecture> When using https://ocaml.org/p/js_of_ocaml-ppx_deriving_json/latest, I get `(warning 39 [unused-rec-flag]): unused rec flag.` on simple records
<discocaml> <commutativeconjecture> I am also wondering if it's possible to get a nice JSON-like representation, rather than nested tuples. Is there a ppx or something that converts ocaml types to nice-looking json-of-ocaml-compatible values?
torretto has quit [Quit: WeeChat 4.1.1]
torretto has joined #ocaml
jabuxas has joined #ocaml
reynir has quit [Ping timeout: 252 seconds]
reynir has joined #ocaml
jabuxas has quit [Ping timeout: 255 seconds]
olle has quit [Ping timeout: 240 seconds]
jabuxas has joined #ocaml
jabuxas has quit [Ping timeout: 260 seconds]
waleee has joined #ocaml
trillion_exabyte has quit [Ping timeout: 256 seconds]
trillion_exabyte has joined #ocaml
olle has joined #ocaml
olle has quit [Ping timeout: 255 seconds]
waleee has quit [Ping timeout: 256 seconds]
mro has quit [Ping timeout: 252 seconds]
myrkraverk_ has quit [Read error: Connection reset by peer]
myrkraverk has joined #ocaml
myrkraverk has quit [Read error: Connection reset by peer]
myrkraverk has joined #ocaml
troydm has quit [Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset]
Tuplanolla has joined #ocaml
mbuf has quit [Quit: Leaving]
wingsorc has joined #ocaml
bartholin has quit [Quit: Leaving]
jabuxas has joined #ocaml
ocra8 has quit [Quit: WeeChat 4.2.2]
waleee has joined #ocaml
companion_cube has quit [Quit: WeeChat 4.2.1]
ocabot has quit [Remote host closed the connection]
discocaml has quit [Remote host closed the connection]
ocabot has joined #ocaml
discocaml has joined #ocaml
companion_cube has joined #ocaml
jabuxas has quit [Ping timeout: 268 seconds]
<discocaml> <kakadu18> If your types are non-recursive, you can try to add 'nonrec' keyword. @commutativeconjecture
jabuxas has joined #ocaml
troydm has joined #ocaml
jabuxas has quit [Ping timeout: 255 seconds]
bartholin has joined #ocaml
sixfourtwelve has joined #ocaml
Serpent7776 has quit [Ping timeout: 264 seconds]
torretto has quit [Remote host closed the connection]
torretto has joined #ocaml
bartholin has quit [Quit: Leaving]
sixfourtwelve has left #ocaml [#ocaml]
waleee has quit [Quit: WeeChat 4.1.2]
jabuxas has joined #ocaml
jabuxas has quit [Ping timeout: 268 seconds]
Tuplanolla has quit [Quit: Leaving.]
<discocaml> <riquy> Hi to everyone, this is my first functional language and it looked very interesting, feels nice to have a community to join.:ricard283MikuTaBien:
<discocaml> <riquy> And that messages are from a IRC bridge? Looks good.
<discocaml> <riquy> And that messages are from a IRC bridge? Looks nice.
<discocaml> <riquy> Are that messages from a IRC bridge? Looks nice.