Leonidas changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.13.0 released: https://ocaml.org/releases/4.13.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
Soni has quit [Ping timeout: 250 seconds]
Lycurgus has quit [Quit: Exeunt]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<d_bot> <Ethan__Hunt> Hey, I am stuck at this:
<d_bot> <Ethan__Hunt> I have to create Lookup_class which searches class 'c_name' in class environment 'c_env'. How to do that exactly?
<d_bot> <Ethan__Hunt>
<d_bot> <Ethan__Hunt> let lookup_class : string -> class_env -> class_decl ea_result = fun c_name c_env ->
<d_bot> <NULL> - We have no idea what `class_env` and `class_decl ea_result` are supposed to be
<d_bot> <NULL> - We do not do homework, we help answer questions
<d_bot> <Ethan__Hunt> then what kind of questions are expected here?
Colt has quit [Remote host closed the connection]
Colt has joined #ocaml
<d_bot> <NULL> Simplify your problem until you reach a smallest problem that you can't solve, at this point it should only refer to standard structures or a few specialised ones that you would introduce
<d_bot> <Ethan__Hunt> I just want to know exact how to search?
<d_bot> <NULL> "How to search" ? search what ?
<d_bot> <Ethan__Hunt> class name in class environment
Soni has joined #ocaml
<d_bot> <Ethan__Hunt> I am new to this language
<d_bot> <NULL> "Searching" completely depends on what `class_env` is, and I have no idea what it is
<d_bot> <Ethan__Hunt> type class_env = ((string*class_decl) list)
gzj has joined #ocaml
GZJ0X_ has joined #ocaml
<d_bot> <NULL> So you can simplify the problem down to : I have a string and I want to find it in my `(string * class_decl) list` to return the associated `class_decl`
<d_bot> <Ethan__Hunt> yes
<d_bot> <NULL> Now, how much do you know about programming with lists in a functional language (like OCaml) ?
<d_bot> <Ethan__Hunt> As I said I am new, and just have 3 months of experience with this language
<d_bot> <Ethan__Hunt> But I know List operations
GZJ0X_ has quit [Client Quit]
gzj has quit [Ping timeout: 256 seconds]
<d_bot> <NULL> What do you mean with "List operations" ? Is it about familiarity with the `List` module from `Stdlib` or familiarity with how to construct functions on lists with recursivity
<d_bot> <Ethan__Hunt> Ya I know little of List
<d_bot> <NULL> That doesn't answer my question
<d_bot> <Ethan__Hunt> thank you for your time NULL, I guess I have to do it on my own without seeking help
<d_bot> <Et7f3> No you can ask
<d_bot> <Et7f3> If I give you: `(string * class_decl)` and a name can you say: yes it is the element I want or no give me another one
<d_bot> <Et7f3> (just yes/no)
<d_bot> <NULL> Sorry if I'm being too blunt, surely other people here can help you while being nicer
<d_bot> <Et7f3> @Ethan__Hunt
<d_bot> <Ethan__Hunt> Yes
<d_bot> <Et7f3> Ok do you know how to access each item of a list
<d_bot> <Ethan__Hunt> by Matching?
<d_bot> <Et7f3> for instance
<d_bot> <Et7f3> You see here you want to search a item in a container (list) I first asked if you know how to detect it is the item you want: One sub problem, I then asked if you know how to access item of that container it is again another sub problem
Tuplanolla has quit [Quit: Leaving.]
<Corbin> Is the question just for List.assoc_opt or is there something else going on?
<d_bot> <NULL> A deeper understanding of how the function works and how one would implement it on one's own
Techcable_ has quit [Ping timeout: 268 seconds]
sagax has joined #ocaml
rgrinberg has joined #ocaml
mbuf has joined #ocaml
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #ocaml
waleee has quit [Quit: WeeChat 3.3]
<d_bot> <darrenldl> i think Et7f3's direction is the best bet for starting with this, and usually the approach used when teaching
<d_bot> <darrenldl>
<d_bot> <darrenldl> i'll add that leaving too much room for gues sing often makes it difficult for people to answer your question, or want to answer your question (we're not tutors of your course and have very little context as to what's going on)
Techcable has joined #ocaml
gravicappa has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
Haudegen has joined #ocaml
wwilly_ has quit [Quit: Leaving]
zebrag has quit [Quit: Konversation terminated!]
Haudegen has quit [*.net *.split]
bgs has quit [*.net *.split]
Serpent7776 has quit [*.net *.split]
Guest9898 has quit [*.net *.split]
kurfen_ has quit [*.net *.split]
gdd has quit [*.net *.split]
andreypopp has quit [*.net *.split]
jakzale has quit [*.net *.split]
slothby has quit [*.net *.split]
Enjolras has quit [*.net *.split]
lobo has quit [*.net *.split]
b0o has quit [*.net *.split]
Boarders_ has quit [*.net *.split]
JSharp has quit [*.net *.split]
Fardale has quit [*.net *.split]
cbarrett has quit [*.net *.split]
Techcable has quit [*.net *.split]
jonasbits has quit [*.net *.split]
grobe0ba has quit [*.net *.split]
Corbin has quit [*.net *.split]
rwmjones has quit [*.net *.split]
kakadu has quit [*.net *.split]
ansiwen has quit [*.net *.split]
kandu has quit [*.net *.split]
greyrat_ has quit [*.net *.split]
p4bl0 has quit [*.net *.split]
asm has quit [*.net *.split]
engil1 has quit [*.net *.split]
terrorjack has quit [*.net *.split]
sagax has quit [*.net *.split]
Soni has quit [*.net *.split]
shawn has quit [*.net *.split]
unyu has quit [*.net *.split]
riverdc has quit [*.net *.split]
ralu has quit [*.net *.split]
infinity0 has quit [*.net *.split]
micro has quit [*.net *.split]
jyc has quit [*.net *.split]
bacam has quit [*.net *.split]
omni has quit [*.net *.split]
Drup has quit [*.net *.split]
nyuhu has quit [*.net *.split]
Cypi has quit [*.net *.split]
xand0 has quit [*.net *.split]
Ekho has quit [*.net *.split]
caasih has quit [*.net *.split]
xenu has quit [*.net *.split]
welterde has quit [*.net *.split]
leah2 has quit [*.net *.split]
Putonlalla has quit [*.net *.split]
energizer has quit [*.net *.split]
Chouhartem has quit [*.net *.split]
adrien has quit [*.net *.split]
cross has quit [*.net *.split]
terrorjack has joined #ocaml
bgs has joined #ocaml
unyu has joined #ocaml
Serpent7776 has joined #ocaml
Corbin has joined #ocaml
Guest9898 has joined #ocaml
rwmjones has joined #ocaml
kurfen_ has joined #ocaml
andreypopp has joined #ocaml
gdd has joined #ocaml
slothby has joined #ocaml
jakzale has joined #ocaml
b0o has joined #ocaml
Enjolras has joined #ocaml
lobo has joined #ocaml
kakadu has joined #ocaml
kandu has joined #ocaml
ansiwen has joined #ocaml
ralu has joined #ocaml
riverdc has joined #ocaml
jyc has joined #ocaml
infinity0 has joined #ocaml
greyrat_ has joined #ocaml
micro has joined #ocaml
Fardale has joined #ocaml
cbarrett has joined #ocaml
JSharp has joined #ocaml
omni has joined #ocaml
Boarders_ has joined #ocaml
bacam has joined #ocaml
nyuhu has joined #ocaml
Drup has joined #ocaml
Cypi has joined #ocaml
xand0 has joined #ocaml
Ekho has joined #ocaml
caasih has joined #ocaml
shawn has joined #ocaml
xenu has joined #ocaml
Techcable has joined #ocaml
p4bl0 has joined #ocaml
Soni has joined #ocaml
sagax has joined #ocaml
grobe0ba has joined #ocaml
jonasbits has joined #ocaml
Haudegen has joined #ocaml
leah2 has joined #ocaml
welterde has joined #ocaml
engil1 has joined #ocaml
Putonlalla has joined #ocaml
Chouhartem has joined #ocaml
asm has joined #ocaml
energizer has joined #ocaml
adrien has joined #ocaml
cross has joined #ocaml
d_bot has quit [Excess Flood]
Exa has quit [Max SendQ exceeded]
Exa has joined #ocaml
d_bot has joined #ocaml
Absalom7 has joined #ocaml
Colt has quit [Remote host closed the connection]
Absalom has quit [Ping timeout: 256 seconds]
Absalom7 is now known as Absalom
Colt has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SquidDev has quit [*.net *.split]
drewolson has quit [*.net *.split]
notnotdan has quit [*.net *.split]
daimrod2 has quit [*.net *.split]
theblatte has quit [*.net *.split]
mg has quit [*.net *.split]
theblatte has joined #ocaml
mg has joined #ocaml
drewolson has joined #ocaml
daimrod2 has joined #ocaml
notnotdan has joined #ocaml
mg has quit [Changing host]
mg has joined #ocaml
SquidDev has joined #ocaml
_whitelogger has joined #ocaml
thizanne has joined #ocaml
oisota has joined #ocaml
nore has joined #ocaml
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
salkin has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
Goldstein has joined #ocaml
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
gahr_ is now known as gahr
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
Goldstein has quit [Remote host closed the connection]
Goldstein has joined #ocaml
gahr has quit [Quit: leaving]
gahr has joined #ocaml
mro has joined #ocaml
Goldstein has quit [Ping timeout: 240 seconds]
<Armael>  /w 9
<Armael> ach
mro_ has joined #ocaml
mro has quit [Ping timeout: 240 seconds]
mro_ has quit [Remote host closed the connection]
mro has joined #ocaml
Tuplanolla has joined #ocaml
bartholin has joined #ocaml
<d_bot> <Lupus> so... I have an issue in one environment, ocamlfind can't find threads
<d_bot> <Lupus> exactly the same docker launches yield different results, in the problematic environment it complains about threads, in other environments it works just fine, I'm totally confused on how that's possible, docker was supposed to offer reproducible builds after all 😂
mro has quit [Remote host closed the connection]
Guest9898 has quit [Quit: Konversation terminated!]
spip has joined #ocaml
spip is now known as Guest515
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
vb has quit [Read error: Connection reset by peer]
Haudegen has quit [Quit: Bin weg.]
salkin has quit [Ping timeout: 252 seconds]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
<d_bot> <Tsukishima> hi someone can help me please
<d_bot> <NULL> Help you do what ?
<d_bot> <Tsukishima> Im trying to use Ocam on Vscode but its dont run
<d_bot> <NULL> What are you doing exactly ?
<d_bot> <Tsukishima> I installed the extention ocaml
<d_bot> <Tsukishima> on vscode
<d_bot> <Tsukishima> I also install ubuntu
<d_bot> <NULL> Considering the language of PS and your kinda broken English, do you think it would be easier to go to #débutants ?
<d_bot> <antron> @Tsukishima but in the meantime, the correct extension to use for ocaml right now is usually OCaml Platform, not OCaml and Reason IDE
<d_bot> <Tsukishima> Haha okay sorry
<d_bot> <antron> and it looks like you are working directly on windows, so you'll need to install ocaml on windows (separately from the extension, the extension will just discover your ocaml install)
<d_bot> <NULL> Don't be sorry, I figured you'd have a harder time writing English than me understanding it, and we're both French-speakers
<d_bot> <Tsukishima> i have installed ocaml on my computer as well
<d_bot> <NULL> Looks like you either didn't install opam or it's not in the Path, considering what PS says
<d_bot> <antron> actually looking again, you did say you installed ubuntu (assuming you mean WSL?)
<d_bot> <antron> do you want to use ocaml on windows, inside WSL, or otherwise?
<d_bot> <Tsukishima> I want to use Ocaml haha I tried everything I found on internet so I installed Ocaml and Ubuntu
<d_bot> <antron> ok probably better to stick with windows then
<d_bot> <Tsukishima> How can I do that ?
<d_bot> <antron> what did you do to install ocaml?
<d_bot> <NULL> Regarding installation on Windows, I know pretty much nothing so @antron will help you more
Haudegen has joined #ocaml
<d_bot> <Tsukishima> I installed the extension on Vscode which as you say is not the right one and besides does not work. then i installed Ocaml except I couldn't get to the directory that I needed so I tried on the Vscode terminal and the Ocaml commands didn't work. then I install the Ubuntu virtual machine except that it gives me an error after they ask me to install WSL and finally I directly install the Ubuntu operating system to see if it w
<d_bot> <antron> can you say what you mean, specifically by,
<d_bot> <antron> > then i installed Ocaml
<d_bot> <Tsukishima> I installed Ocaml with the website
<d_bot> <antron> "i went to website XYZ and followed instructions ABC or downloded IJK"
<d_bot> <antron> specifically
<d_bot> <NULL> > except I couldn't get to the directory that I needed
<d_bot> <NULL> I imagine nothing meaningful happened in any case
<d_bot> <Tsukishima> I went to Ocaml.org -> installer Ocaml -> windows -> Graphical Installer
<d_bot> <Tsukishima> Yeah
<d_bot> <antron> i see these options on ocaml.org for installing on windows: <https://ocaml.org/learn/tutorials/up_and_running.html#For-Windows> and <https://ocaml.org/docs/install.html#Windows>. AFAICT there is no graphical installer option. can you link me to it, so i can follow with what you are doing?
<d_bot> <antron> to the page that has the installer
<d_bot> <NULL> fdopen's 64-bit graphical install
<d_bot> <NULL> I imagine
unyu has quit [Quit: brb]
<d_bot> <Tsukishima> Yes
unyu has joined #ocaml
<d_bot> <antron> looking at it now. BTW @Tsukishima we need this kind of information right away
<d_bot> <Tsukishima> wich information ?
<d_bot> <antron> exact steps followed
<d_bot> <NULL> That you installed OCaml by this means
<d_bot> <Tsukishima> yes
xiongxin has joined #ocaml
<d_bot> <Tsukishima> I thing I dont understant what you asked me
<d_bot> <NULL> I think the next question is : what went wrong with the installation
<d_bot> <antron> too early right now 🙂
<d_bot> <antron> im installing it, give me a couple minutes
<d_bot> <Tsukishima> Ocaml works well I think
<d_bot> <NULL> When you're asked "what did you do ?", answer "I went to https://fdopen.github.io/opam-repository-mingw/installation/" rather than "I installed OCaml"
<d_bot> <antron> can you be specific?
<d_bot> <antron> "i am able to go to XYZ directory in ABC shell and run command whatever, it works"
<d_bot> <Tsukishima> I had no problem with the installation and I can run Ocaml on my PC
<d_bot> <NULL> This is not ocaml
<d_bot> <Tsukishima> oh xD
<d_bot> <antron> @NULL it's a cygwin environment with ocaml installed
<d_bot> <NULL> However, if writing ocaml in this window works, then it's good
<d_bot> <antron> it has `opam` and `ocaml`
<d_bot> <antron> it's bash running on windows under cygwin with all the stuff you need to work with ocaml, including mingw C compiler
<d_bot> <NULL> I did in fact do this install a few years back, I thought new ways had arrived since hance why I said I were not qualifie
<d_bot> <antron> @Tsukishima ok so the only issue is getting vscode to work here
<d_bot> <NULL> (And I have since moved to Linux)
<d_bot> <antron> do you have a project? what directory is it located in?
<d_bot> <Tsukishima> yes I have a project to return and I was asked to type the instruction ``ˋopal install dune ˋ`ˋand it worked
<d_bot> <NULL> I imagine it's just a matter of adding cygwin's bin to the Path, isn't it ?
<d_bot> <Tsukishima> I think
<d_bot> <antron> that should be like 80% of it
<d_bot> <Tsukishima> yes I have
<d_bot> <Tsukishima> you asked the file place on my computer ?
<d_bot> <antron> yes
<d_bot> <antron> i need to know if it is inside the cygwin directories or not
<d_bot> <Tsukishima> C:\Users\Fahad\Desktop\parcoursup
<d_bot> <antron> and how are you visiting this inside the OCaml64 (cygwin) environment?
<d_bot> <Tsukishima> can I use the "cd" on Ocaml ?
<d_bot> <antron> that window itself is not ocaml, it's bash running with a library called "cygwin"
<d_bot> <antron> it's basically "linux"
<d_bot> <antron> but really a port of a lot of "linux" (gnu, etc) tools to windows using the cygwin library
<d_bot> <NULL> (Call the window "terminal" or "bash", not "ocaml")
<d_bot> <antron> your project should be at /cygdrive/c/Users/Fahad/Desktop/parcoursup from cygwin's point of view
<d_bot> <Tsukishima> okay
<d_bot> <NULL> Yes, you can `cd` in bash
<d_bot> <antron> so cd to there
<d_bot> <Tsukishima> on the terminal ?
<d_bot> <antron> yes, in the window you sent me a screenshot of
<d_bot> <antron> this
<d_bot> <Tsukishima> its work
<d_bot> <antron> ok you should be able to work with your project here using linux commands basically
<d_bot> <antron> putting it roughly 🙂
<d_bot> <antron> so `cd`, `ls`, `opam`, `ocaml`, etc
<d_bot> <antron> as for vscode let me set up a similar project myself, and see what happens with vscode
<d_bot> <NULL> You can already `opam init` and then `opam install ocaml-lsp-server`, it will come in handy
<d_bot> <NULL> (In bash / the terminal)
<d_bot> <antron> `opam init` should have been run by the installer
<d_bot> <antron> at least thats what it looked like in its logs
<d_bot> <antron> but yes do `opam install ocaml-lsp-server`
<d_bot> <antron> don't do a new `opam init`
<d_bot> <Tsukishima> just the second one ?
<d_bot> <NULL> (it shouldn't hurt, but no need to do it more than once ever)
snatx has joined #ocaml
<d_bot> <antron> get specific
<d_bot> <antron> @Tsukishima does your project already have an `opam` file with dependencies to install?
<d_bot> <Tsukishima> ```opam install ocaml-lsp-server``` I have to do that ?
<d_bot> <NULL> Yes, you only have to write down the second command, `opam install ocaml-lsp-server`
<d_bot> <antron> yes
<snatx> Hi, I'm having a hard time understanding the behavior of this code
<snatx> ```
<snatx>      let x = ref 0;;
<snatx>      let f2 () =
<snatx>        print_endline (string_of_int !x);
<d_bot> <NULL> Not sure they meant more than an empty project
<snatx>        x := !x + 1;
<snatx>        x := !x + 1;
<snatx>        !x;;
<snatx>      let rec l1 () =
<snatx>        if !x > 6 then 0 else begin print_endline ("l1: " ^ (string_of_int !x)); f2 () + l1 () end;;
<snatx>     l1 ();;
<snatx>  ```
<d_bot> <Tsukishima> I have to do ```opam install ocaml-lsp-server```
<d_bot> <NULL> The reverse "don't paste code here"
<d_bot> <antron> does your project have a `something.opam` file already?
<snatx> it loops for ever, f2 is not being called
<d_bot> <antron> snatx: the people in discord basically cant read your code, it's all messed up in formatting. can you send a gist?
<d_bot> <antron> it looks like the project already has at least dune expect tests, based on hte latest screenshot, so there is something in it
<d_bot> <Tsukishima> No I do not think so. I just have to translate some algorithm into Ocaml language and with the "runtest" test if it works or not
<d_bot> <Tsukishima> Can I send you my projet so you can see what its look like ?
<d_bot> <antron> snatx: there is no guarantee that in `f2 () + l1 ()`, `f2 ()` will be evaluated first. the compiler can choose to have the recursive `l1 ()` evaluated first
<d_bot> <NULL> Missed that
<d_bot> <antron> if you want to force the order, use a binding, `let some_variable = f2 () in some_variable + l1 ()`
<snatx> antron: thanks!
<d_bot> <NULL> d_bot stands for "discord bot", the person that answered is antron
<d_bot> <antron> you can make a gist but i dont see a need for it now
<d_bot> <antron> after installing `ocaml-lsp-server` in the terminal, and OCaml Platform extension in vscode, what is happening in vscode?
<d_bot> <Tsukishima> this ?
<d_bot> <Tsukishima> I think I can use it
<d_bot> <NULL> You won't need ReScript, no need to enter all commands as soon as you see them
<d_bot> <NULL> Is your OCaml code coloured differently now ?
<d_bot> <NULL> When you hover your cursor over variables, does the type appear in a pop-up ?
snatx has quit [Quit: Client closed]
<d_bot> <Tsukishima> On Vscode ?
<d_bot> <Tsukishima> no
<d_bot> <zakkor> would a stack overflow crash like this?
<d_bot> <zakkor> ```
<d_bot> <zakkor> $ dune exec ./day6.exe
<d_bot> <zakkor> zsh: segmentation fault dune exec ./day6.exe
<d_bot> <zakkor> ```
<d_bot> <Kakadu> Sometimes it could happen
<d_bot> <Kakadu> You can try to compile to bytecode and run
<d_bot> <Kakadu> Also, you can adjust default stack size
<d_bot> <zakkor> how should I do this using dune?
<d_bot> <Kakadu> There is something about it on the docs
<d_bot> <zakkor> ah, I see
<d_bot> <zakkor> yeah, that helped, it's a stack overflow
<d_bot> <Kakadu> Sometimes it is difficult to distinguish segfault from proper stack overlfow
<d_bot> <Kakadu> It got difficulties with while presenting motivation for CPS for my students
<d_bot> <Kakadu> with it*
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
Guest4 has joined #ocaml
Guest4 has quit [Client Quit]
zebrag has joined #ocaml
rgrinberg has joined #ocaml
xiongxin has quit [Remote host closed the connection]
gahr has quit [Quit: leaving]
gahr has joined #ocaml
mro has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mbuf has quit [Quit: Leaving]
bartholin has quit [Quit: Leaving]
Haudegen has quit [Quit: Bin weg.]
chrisz has joined #ocaml
rgrinberg has joined #ocaml
mro has quit [Remote host closed the connection]
olle has joined #ocaml
mro has joined #ocaml
mro has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mro has joined #ocaml
gravicappa has quit [Ping timeout: 252 seconds]
Anarchos has joined #ocaml
rgrinberg has joined #ocaml
cedric has joined #ocaml
<Anarchos> Hello, i noticed that on my platform (haiku-os), i have two tests of the compiler suite that failed on unix : they are tests on bind on local sockets. Those sockets are created as PF_UNIX/SOCK_DGRAM, but on Haiku, we have only PF_UNIX/SOCK_STREAM for local sockets.
<Anarchos> if i had a test on the platform to select this path, will it have a chance to be accepted in the official testsuite ?
<Anarchos> s/had/add/
<d_bot> <antron> are there any existing PF_UNIX SOCK_STREAM tests?
mro has quit [Remote host closed the connection]
<Anarchos> Anarchos my goals is this test to pass :
<Anarchos> testsuite/tests/lib-unix/unix-socket/recvfrom.ml :
<Anarchos> let s = Unix.socket PF_UNIX SOCK_DGRAM 0 in
<Anarchos> as i have no sock_dgram for pf_unix as i said
mro has joined #ocaml
<d_bot> <antron> i understood what you said about not having SOCK_DGRAM. you separately also said that you want to "add a test on the platform to select this path." does this mean you want to add a new test, or something else?
<Anarchos> Anarchos i think i should transform the bind test on the datagram socket to a connect test on the datagram local socket ?
<Anarchos> on the stream local socket, sorry
<d_bot> <antron> if you unconditionally transform it, i dont think it would be accepted, as recvfrom is typically used for SOCK_DGRAM sockets
<d_bot> <antron> if you can make it conditional on whether the platform supports SOCK_DGRAM or not then perhaps
<d_bot> <antron> that is my guess
<Anarchos> antron i noticed plenty of tests are conditional on the platform, so i will try that. thanks for the advice
<d_bot> <antron> i havent looked into it, but it looks like it should probably interact with the configure script, probably with a check for support for SOCK_DGRAM specifically
* Anarchos just saw that in https://linux.die.net/man/2/recvfrom, recvfrom can be used on both types of sockets
<d_bot> <antron> that is correct, it can be, but it is typically used for SOCK_DGRAM sockets
<d_bot> <antron> because it is (almost fully) redundant for SOCK_STREAM sockets
<d_bot> <antron> or more correctly, it's typically used for sockets other than SOCK_STREAM sockets
<Anarchos> Anarchos i will try to duplicate the test , transform the socket into sock_stream, and look what happens :)
haesbaert has quit [Remote host closed the connection]
waleee has joined #ocaml
sagax has quit [Remote host closed the connection]
chrisz has quit [Quit: leaving]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
olle has quit [Ping timeout: 240 seconds]
<d_bot> <JJam> not sure if this is the right place to ask; is there an easier way to create json strings than what i'm doing right now - I use a string literal {||} with sprintf and then use Yojson.Basic.from_string & to_string. there's gotta be an easier way, right?
<companion_cube> if you already have a string that is valid json… why not use it? :)
<companion_cube> although if you want to create a json with arbitrary values inside
<companion_cube> you could use the yojson type constructors?
<companion_cube> `Assoc ["foo", `Int 1; "bar", `List [`Int 2]]
<companion_cube> for `{foo: 1, bar: [2]}`
<d_bot> <JJam> thank you! that certainly makes things less complicated
<companion_cube> indeed!
bmo has joined #ocaml
sagax has joined #ocaml
<d_bot> <Continuation Calculus> hi
<d_bot> <Continuation Calculus> by any chance, any way to get the stdoutput of a Sys.command call in OCaml that is portable and does not require creating an intermediary file?
<companion_cube> you need to use Unix.open_process_in iirc
<d_bot> <Continuation Calculus> Unix doesn't seem very portable
<d_bot> <Continuation Calculus> it actually is
<d_bot> <Continuation Calculus> what a misnomer
<companion_cube> it works on posix systems, mostly
<companion_cube> won't work on javascript, but well, neither will processes
<d_bot> <jumpnbrownweasel> I was confused about that also, but since I saw Windows code in a Unix .ml file, I figured it was perhaps originally unix and then made more portable over time?
<companion_cube> I don't know about the history
<companion_cube> but parts of Unix are supported on windows
<companion_cube> some functions are not
<companion_cube> I think the open_process functions are.
Techcable has quit [Ping timeout: 256 seconds]
<d_bot> <Continuation Calculus> `The command is interpreted by the shell /bin/sh (or cmd.exe on Windows)`
<d_bot> <Et7f3> It provides API we encounter on unix. This is how I see it. And polyfill as much as possible. I.e. fork doesn't work but the rest is fine.
<d_bot> <Et7f3> Nodejs can create process 👀 so it seems possible to bind it
mro has quit [Quit: Leaving...]
<companion_cube> there's stuff to create processes already
<companion_cube> but also, yes, `luv` exists (bindings to libuv)
<d_bot> <Continuation Calculus> hmmm.. i want to run js in ocaml (to check that the compiler from my lang to js works), but each run takes .120s, which makes running all my tests really slow. currently, i just use `open_process_in`, `input_line` repeatedly and then `close_process_in`. any faster way of doing that? (or should I just start batching all the tests in a single file? ~~but then i loose my neat alcotest colors~~)
<companion_cube> doesn't alcotest parallelize? if not, might be difficult
<d_bot> <Continuation Calculus> ooo, good q, i might gain stuff there
<d_bot> <Continuation Calculus> nothing on readme.md
rgrinberg has quit [Ping timeout: 252 seconds]
<d_bot> <Continuation Calculus> ye it doesn't, np, i'll just batch
<companion_cube> that's a pity
<companion_cube> alcotest came around when ounit already existed, and ounit2 can parallelize
<companion_cube> alcotest became popular because of its colorful UI
<companion_cube> :/
<d_bot> <Continuation Calculus> i was going to ask if ounit2 had colors
<companion_cube> a little bit I think, with the `-ci` mode or whatever
<companion_cube> it's not as pretty
<companion_cube> but I'm a bit sad alcotest wasn't just a nice runner for ounit
<d_bot> <Continuation Calculus> i'll try ounit
<d_bot> <Continuation Calculus> i hope it displays the time taken to run the tests
<companion_cube> I don't recall, honestly
<Anarchos> companion_cube i ought to use ounit2 for my tests, and bisect_ppx for the coverage/nice html results
<companion_cube> sure
<companion_cube> ounit also outputs junit results if you need them, for example
<companion_cube> that was nice in combination with jenkins
<Anarchos> companion_cube i hate java,jenkins and so on, i am fed up with all those j2ee bulllsh*t at work when i tastes the beauty of ocaml since 'classes préparatoires'
<companion_cube> 🤷
<companion_cube> https://github.com/marketplace/actions/junit-report-action it's not just jenkins nowadays :)
<d_bot> <Continuation Calculus> i think i should use alcotest lwt, and lwt to execute commands
<d_bot> <Continuation Calculus> so that i can thread all of this
<d_bot> <Continuation Calculus> but it is good to note that ounit does indeed use more cores
cedric has quit [Quit: Konversation terminated!]
<d_bot> <Et7f3> What you might try to do is open some instance of node repl and keep it open so you avoid the startup time.
<d_bot> <Et7f3> You can try to do a kind of pool: is one instance die just re add process in the pool