adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.07.1 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.07/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml | Due to ongoing spam, you must register your nickname to talk on the channel
coventry has joined #ocaml
barcabuona has joined #ocaml
nicooo has joined #ocaml
nicoo has quit [Remote host closed the connection]
TC01 has quit [Read error: Connection reset by peer]
efm has quit [Quit: Konversation terminated!]
TC01 has joined #ocaml
orbifx1 has quit [Ping timeout: 240 seconds]
env__ has quit [Ping timeout: 264 seconds]
ziyourenxiang has joined #ocaml
env__ has joined #ocaml
silver has quit [Read error: Connection reset by peer]
JimmyRcom has joined #ocaml
coventry_ has joined #ocaml
coventry has quit [Ping timeout: 240 seconds]
mfp has quit [Ping timeout: 252 seconds]
zolk3ri has quit [Quit: Lost terminal]
tormen has joined #ocaml
tormen_ has quit [Ping timeout: 268 seconds]
Jeanne-Kamikaze has joined #ocaml
jao has quit [Ping timeout: 264 seconds]
MadcapJake has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
<xvilka> why OCaml doesn't have something like rust-bindgen? Writing Ctypes bindings is always such a waste of time...
rdivyanshu has joined #ocaml
rdivyanshu has quit [Client Quit]
pierpa has quit [Quit: Page closed]
<engil> xvilka: I think yallop had a prototype to generate ctypes bindings from include files, and it worked on Z3, but I can't find it
<engil> there's cppffigen also, but it's more for C++ as the name suggests
MadcapJake has quit [Quit: MadcapJake]
philtor has joined #ocaml
jack5638 has quit [Ping timeout: 264 seconds]
jack5638 has joined #ocaml
coventry_ has quit [Ping timeout: 246 seconds]
steenuil has quit [Remote host closed the connection]
pierpal has joined #ocaml
pierpal has quit [Client Quit]
Jeanne-Kamikaze has quit [Quit: Leaving]
pierpal has joined #ocaml
Albanaaaa has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
Albanaaaa has quit [Quit: TurboIRC for iOS. Available at the App Store.]
pierpal has joined #ocaml
<mildtaste> Hi all, I am struggling for days to get a simple GET request done from ocaml, I understand cohttp would be the right library to use but I cannot find any good example working in toplevel or in a simple program (I am using async and it seems the problem is the async scheduler not running)
JimmyRcom has quit [Ping timeout: 252 seconds]
JimmyRcom has joined #ocaml
env__ has quit [Ping timeout: 245 seconds]
kakadu_ has joined #ocaml
sagotch has joined #ocaml
jack5638 has quit [Ping timeout: 246 seconds]
marble_visions has joined #ocaml
marble_visions has quit [Remote host closed the connection]
freyr69 has joined #ocaml
orbifx1 has joined #ocaml
jack5638 has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
marble_visions has joined #ocaml
<mildtaste> All examples I could find were with lwt rather than async, it makes me wonder if the first is the preferred way
<freyr69> Lwt is the preferred way
orbifx1 has quit [Ping timeout: 252 seconds]
env__ has joined #ocaml
<xvilka> uh, some programmers write so awful imperative code, coming to the extremes - where all variables are mutable and their state changes multiple times in multiple places, how even people can think like this?
<xvilka> even when I write C I tend to reduce this kind of thing
env__ has quit [Ping timeout: 252 seconds]
<xvilka> they are probably not aware how much uncovered combinations they introduce /o\
bartholin has joined #ocaml
<freyr69> The compiler is written in such an imperative way
<freyr69> Dunno why is it so
<Armael> because technical debt ?
Haudegen has joined #ocaml
<freyr69> Passing context explicitly is expensive?
<Armael> I'm not sure what you're thinking about precisely. I would say in some parts the code is ugly because it is both very tricky and was originally written that way
<Armael> so that it's now not so obvious to refactor
<Armael> and I mean sure, you can always just carry around all of your state in a monolithic fashion
<Armael> but it won't make the code clearer
kakadu_ has quit [Remote host closed the connection]
Jesin has quit [Ping timeout: 264 seconds]
Jesin has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
<Armael> (to be clear, nowadays people agree that this is bad style! so PRs that refactor ugly parts of the compiler into something that is clearly better are very welcome)
rdivyanshu has joined #ocaml
sagotch has quit [Ping timeout: 252 seconds]
sagotch has joined #ocaml
rdivyanshu has quit [Remote host closed the connection]
rdivyanshu has joined #ocaml
RalfJ has joined #ocaml
<xvilka> why I can't write "type mytype = Ctypes.uint16_t" ?
<xvilka> It complains with "Unbound type constructor Ctypes.uint16_t"
rdivyanshu has quit [Read error: Connection timed out]
rdivyanshu has joined #ocaml
<freyr69> uint16_t is not a type
<freyr69> uint16 is
JimmyRcom has quit [Ping timeout: 264 seconds]
<xvilka> still same problem
<Leonidas> mildtaste: in utop you don't need to run the async scheduler
<Leonidas> mildtaste: never had issues with cohttp and async, it works just fine
<Leonidas> hmm, odd, it blocks :|
* Leonidas never really uses utop
<xvilka> err, I was right, it is uint16_t ofc
<RalfJ> I noticed that a 2.0.1 tag has been cretaed in the opam repo, and it has binaries attached to it, but there was no announcement of the website yet. can I already use these binaries or might they still change before the final release?
<xvilka> works as isolated case
<mildtaste> Leonidas: I thought there was some difference between utop and ocaml (the interactive mode) In the way async is started, but what I can tell, the examples in https://v1.realworldocaml.org/v1/en/html/concurrent-programming-with-async.html do not work, I can peek or just display the value but it is always None
<xvilka> mildtaste: btw use dev.realworldocaml.org
<Leonidas> mildtaste: you should use the newer version of the book, http://dev.realworldocaml.org/concurrent-programming.html
carlosdagos has quit [Quit: Connection closed for inactivity]
<Leonidas> mildtaste: I don't have time to build an example right now but you can see async + cohttp being used in this library I wrote some months ago: https://github.com/issuu/sure-deploy/blob/master/src/lib/requests.ml
<mildtaste> Leonidas: thanks a lot
<xvilka> using Unsigned.uint16 did the trick
<xvilka> interesting that "let sgsfdg = uint16_t" works in utop but not in the ocaml
<Leonidas> potentially because you have an identifier called uint16_t
<Leonidas> utop does not tend to accept invalid code
<xvilka> Leonidas: you mean tend to accept?
<xvilka> because it was working in utop
<Leonidas> xvilka: what happens if you type `uint16_t;;` in utop
<Leonidas> my point is that it is probably some value and not a type, which is why the let binding works.
<xvilka> - : Unsigned.uint16 typ = uint16_t
<Leonidas> xvilka: yeah, thats not a type, thats a value.
<xvilka> yes, just realized my mistake
<xvilka> I wrote let binding in utop by habit
<xvilka> while used "type ssfsdf = uint16_t" in program
<xvilka> so utop complains too
<Leonidas> exactly
rdivyanshu has quit [Ping timeout: 240 seconds]
rdivyanshu has joined #ocaml
barcabuona has quit [Quit: WeeChat 2.2]
mfp has joined #ocaml
RalfJ has quit [Ping timeout: 252 seconds]
RalfJ has joined #ocaml
zolk3ri has joined #ocaml
ggole has joined #ocaml
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 252 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 276 seconds]
<xvilka> why OCaml has literals for int32, int64, etc but not for uint32, uint64, etc?
<xvilka> ah, I see
<xvilka> there is PR for this: https://github.com/ocaml/ocaml/pull/1201
sagotch has quit [Quit: Leaving.]
rdivyanshu has quit []
Haudegen has quit [Remote host closed the connection]
<xvilka> I'm surprised it is not merged yet, sigh
<Leonidas> xvilka: ocaml is a functional language, not much a systems language (for the most part), this is why they don't exist
<Leonidas> you also can't match on Int32 or Int64 as far as I'm aware :-(
<Drup> Sure you can
<Drup> # let f = function 1L -> "bli" | _n -> "bla" ;;
<Drup> val f : int64 -> string
chindy has joined #ocaml
chindy has quit [Client Quit]
chindy has joined #ocaml
chindy has quit [Client Quit]
chindy has joined #ocaml
sagotch has joined #ocaml
hnfmr has joined #ocaml
<hnfmr> i am trying to build a binary using dune, with some signal handling stuff, e.g. set_signal sigint (Signal_handle f);
<hnfmr> but it doesn't seem to invoke the signal handler when i press Ctrl+C
<hnfmr> but if i compile using ocamlopt manually it works, i must have missed something?
spew has joined #ocaml
<theblatte> hnfmr: maybe you can look at the difference between your ocamlopt invocation and dune's by looking at dune's logs from a clean build?
<theblatte> perhaps look out for when Unix gets linked and if it gets linked more than once
<hnfmr> theblatte: thanks, let me check
jaar has joined #ocaml
kakadu has left #ocaml ["Konversation terminated!"]
kakadu has joined #ocaml
quipa has joined #ocaml
quipa has quit [Read error: Connection reset by peer]
jao has joined #ocaml
<hnfmr> theblatte: turns out to be a regression in Dune 1.4.0, it's been fixed in master......thanks :D
<theblatte> ouch ^^
Guest57763 has joined #ocaml
Guest57763 has quit [Read error: Connection reset by peer]
jack5638 has quit [Ping timeout: 252 seconds]
jack5638 has joined #ocaml
Haudegen has joined #ocaml
hnfmr has quit [Quit: Page closed]
coventry has joined #ocaml
_andre has joined #ocaml
JimmyRcom has joined #ocaml
ziyourenxiang has quit [Quit: Leaving]
ziyourenxiang has joined #ocaml
zolk3ri has quit [Quit: Lost terminal]
FreeBirdLjj has joined #ocaml
al-damiri has joined #ocaml
terry_ has joined #ocaml
terry_ has quit [Client Quit]
tgphelps has joined #ocaml
tgphelps has quit [Client Quit]
tgphelps has joined #ocaml
<tgphelps> Just installed ocaml 4.07.1 and opam 2.0.0. Did opam init, and "opam install ocamlbuild". It failed with: gcc: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found.
<tgphelps> Am I missing something? I'll post more info, if you ask.
<freyr69> tgphelps: something is wrong with your gcc toolchain
<freyr69> opam unrelated
<freyr69> which distro do you use?
<tgphelps> I just freshly installed Scientific Linux 7.5 (RHEL clone), did a "yum install gcc".
<freyr69> find /usr/lib64 -name "liblto_plugin*"
<tgphelps> freyr69: Not there.
<tgphelps> freyr69: Is liblto_plugin a requirement that I missed?
<freyr69> In /usr/lib?
<tgphelps> freyr69: Ah, it's in /usr/libexec/gcc/x86_64-redhat-linux/4.8.2
aydio has joined #ocaml
<freyr69> Could you compile a dummy C program?
<tgphelps> freyr69: I compiled ocaml from source, so gcc worked many times during that.
<freyr69> So you've compiled ocaml with opam, but fail to compile ocamlbuild? Could you compile lwt?
<tgphelps> Do you mean "opam install lwt"?
<freyr69> Yes, with lwt_unix
<tgphelps> I'm not sure what "with lwt_unix" means.
<freyr69> opam install lwt
<freyr69> it seems
<freyr69> yes
<tgphelps> lwt wanted jbuilder and dune first. Install of dune got that same "liblto_plugin.so not found" error.
ehirdoy has quit [Ping timeout: 252 seconds]
chindy has quit [Ping timeout: 240 seconds]
<freyr69> could you create a new switch?
nicooo has quit [Ping timeout: 256 seconds]
<freyr69> opam switch create test ocaml-variants.4.07.1+fp
<freyr69> for example
<freyr69> and try it with that switch
ehirdoy has joined #ocaml
<freyr69> maybe you also have a different gcc inslalled, maybe some cross compiler or 32bit gcc?
<tgphelps> No, I have a freshly installed RHEL 7.5 "minimal" system. The only other thing I've installed is "bubblewrap", which opam said I must have.
<tgphelps> Gee, the "opam switch" failed with "gcc: error trying to exec 'cc1': execvp: No such file or directory # Compiler family and version: . # [ERROR!] Unable to compile the test program. # Make sure the C compiler gcc is properly installed.
<tgphelps> You're right. Something is horribly wrong with the gcc toolchain.
chindy has joined #ocaml
<tgphelps> I should go try to debug that before I bother you any more.
<tgphelps> freyr69: I built ocaml from source just fine. And now something is terribly hosed.
<freyr69> is gcc available at this shell (aka `gcc --version`)?
<freyr69> also what `opam config list` shows?
<tgphelps> $ gcc --version gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)
<tgphelps> $ opam config list <><> Global opam variables ><><><><><><><><><><><><><><><><><><><><><><><><><><> arch x86_64 # Inferred from system jobs 1 # The number of parallel jobs set up in opam configuration make make # The 'make' command to use opam-version 2.0.0 # The currently running opam
<tgphelps> os linux # Inferred from system os-distribution rhel # Inferred from system os-family scientific # Inferred from system os-version 7.5 # Inferred from system root /home/tgphelps/.opam # The current opam root directory switch default # The identifier of the current switch sys-ocaml-version 4.07.1
<tgphelps> prefix /home/tgphelps/.opam/default lib /home/tgphelps/.opam/default/lib bin /home/tgphelps/.opam/default/bin sbin /home/tgphelps/.opam/default/sbin share /home/tgphelps/.opam/default/share doc /home/tgphelps/.opam/default/doc etc /home/tgphelps/.opam/default/etc
<tgphelps> man /home/tgphelps/.opam/default/man toplevel /home/tgphelps/.opam/default/lib/toplevel stublibs /home/tgphelps/.opam/default/lib/stublibs user tgphelps group tgphelps
<freyr69> Wow, you'd better to use something like pastebin for such things
<tgphelps> Never heard of "pastebin". I'll google that.
<freyr69> Do you have a cc command?
<freyr69> it should be an alias to gcc
<freyr69> I don't remember if opam calls cc or gcc
<tgphelps> Yes, cc is gcc.
<freyr69> opam switch -vv create test ocaml-variants.4.07.1+fp?
<tgphelps> Same failure: https://pastebin.com/6Dd0hL6Q
<freyr69> yum install gcc-c++ ?
<tgphelps> Done. Same error: gcc: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found
Haudegen has quit [Remote host closed the connection]
<freyr69> opam switch -vv create test ocaml-variants.4.07.1+fp?
<tgphelps> Like before: # gcc: error trying to exec 'cc1': execvp: No such file or directory
<freyr69> it seems you need cpp
zmt00 has joined #ocaml
<tgphelps> cpp was already there, so I did "yum reinstall cpp". The opam switch you asked for fails same as before.
<Kitambi> can you build anything at all?
<Kitambi> like even a hello world?
<Kitambi> (in C, not ocaml) :)
<tgphelps> Yes, that worked fine.
<tgphelps> And I built ocaml from source 2 hours ago.
jao has quit [Remote host closed the connection]
jao has joined #ocaml
<tgphelps> If you're pretty sure this has nothing to do with ocaml and opam, I'm ready to give up, and do this all again on a fresh Centos install.
<tgphelps> Maybe Scientific Linux 7.5 is "bad" in some strange way.
<Kitambi> virtual machines are your friends...try to reproduce it in centos and scientific and that'll narrow it down a bit
<freyr69> Unrelated to ocaml (and you don't need to build it, opam will build it for you), but something with opam
<freyr69> the problem is, opam sees gcc, calls it, and gcc fails
<tgphelps> Alrighty. I'll get off here, and start over with Centos 7.5. Thanks for the help.
<freyr69> so it basically gcc command
tgphelps has quit []
<freyr69> could you run `echo "int main () {} " > test.c && gcc test.c`?
GreyFaceNoSpace_ has joined #ocaml
err0ne has quit [Disconnected by services]
err0ne has joined #ocaml
erkin has joined #ocaml
freyr69 has quit [Remote host closed the connection]
sagotch has quit [Quit: Leaving.]
ggole has quit [Quit: ggole]
coventry has quit [Ping timeout: 240 seconds]
GreyFaceNoSpace_ has quit [Quit: Ex-Chat]
silver has joined #ocaml
Haudegen has joined #ocaml
jaar has quit [Ping timeout: 252 seconds]
coventry has joined #ocaml
steenuil has joined #ocaml
Nicd- has joined #ocaml
coventry has quit [Ping timeout: 240 seconds]
clownpriest has joined #ocaml
<Nicd-> anyone spot anything wrong here? https://www.irccloud.com/pastebin/AJHIAjNy/ when I call `set_timer_value`, it doesn't set a string value returned from `get_timer_value`, instead it sets the text of the tag to be stringified code. so it appears to me `render_timer_value` is receiving a function instead of a string
<Nicd-> I know it's BuckleScript but I wondered if there's something wrong with the OCaml side
<Nicd-> BS compiles `set_timer_value` as `return render_timer_value(Curry._1(get_timer_value(), /* () */0));` and there's the strange currying there that probably is the culprit
FreeBirdLjj has quit [Remote host closed the connection]
clownpriest has quit [Ping timeout: 264 seconds]
clownpriest has joined #ocaml
zmt01 has joined #ocaml
zmt00 has quit [Ping timeout: 260 seconds]
aydio has quit [Quit: WeeChat 2.2]
aydio has joined #ocaml
aydio has quit [Client Quit]
aydio has joined #ocaml
jnavila has joined #ocaml
clownpriest has quit [Ping timeout: 252 seconds]
clownpriest has joined #ocaml
coventry has joined #ocaml
maarhart has joined #ocaml
maarhart has quit [Client Quit]
env__ has joined #ocaml
steenuil has quit [Remote host closed the connection]
coventry has quit [Ping timeout: 268 seconds]
TheLemonMan has joined #ocaml
orbifx1 has joined #ocaml
coventry has joined #ocaml
rotsix has joined #ocaml
spew has quit [Quit: going to the dentist]
env__ has quit [Ping timeout: 264 seconds]
zmt00 has joined #ocaml
zmt01 has quit [Ping timeout: 240 seconds]
coventry has quit [Ping timeout: 244 seconds]
thizanne has quit [Remote host closed the connection]
env__ has joined #ocaml
kakadu_ has joined #ocaml
coventry has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Nicd-> I changed the code to this (takes the cookie name as argument instead of no argument) and it works for some reason 🤷 https://www.irccloud.com/pastebin/HrGsqdlQ/
clownpriest has quit [Ping timeout: 250 seconds]
ewanas has joined #ocaml
coventry has quit [Ping timeout: 240 seconds]
Jesin has quit [Quit: Leaving]
Jesin has joined #ocaml
Haudegen has quit [Read error: Connection reset by peer]
clownpriest has joined #ocaml
nicooo has joined #ocaml
bartholin has quit [Remote host closed the connection]
ewanas has quit [Remote host closed the connection]
aydio has quit [Quit: WeeChat 2.2]
kvda has joined #ocaml
rotsix has quit [Remote host closed the connection]
coventry has joined #ocaml
JimmyRcom has quit [Ping timeout: 264 seconds]
Haudegen has joined #ocaml
efm has joined #ocaml
jnavila has quit [Remote host closed the connection]
_andre has quit [Quit: leaving]
coventry has quit [Ping timeout: 240 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
coventry has joined #ocaml
kakadu_ has quit [Remote host closed the connection]
Haudegen has quit [Remote host closed the connection]
orbifx1 has quit [Ping timeout: 268 seconds]
env__ has quit [Ping timeout: 272 seconds]
pierpa has joined #ocaml
emily has quit [Ping timeout: 264 seconds]
env__ has joined #ocaml
efm has quit [Ping timeout: 268 seconds]
carlosdagos has joined #ocaml
coventry has quit [Ping timeout: 246 seconds]
keep_learning has quit [Ping timeout: 268 seconds]
al-damiri has quit [Quit: Connection closed for inactivity]
Guest30145 has left #ocaml [#ocaml]
env__ has quit [Ping timeout: 240 seconds]