companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.11 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.11/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
shawnw has joined #ocaml
<salkin-mada> hmm nope. okay "data type Promise". Slowly learning here. Take care out there.
wonko7 has quit [Ping timeout: 265 seconds]
<salkin-mada> Lwt_main.run begin
olle has quit [Ping timeout: 265 seconds]
olle has joined #ocaml
<companion_cube> salkin-mada: hmm, the dev version of RWO mentions lwt syntax?!
<companion_cube> that's surprising, it's been years since that was the right thing
<companion_cube> look for lwt ppx
<salkin-mada> aha!
<salkin-mada> thanks!
<salkin-mada> i had the feeling something was not really up to date.
<salkin-mada> companion_cube i dont know what RWO is :) . but the OSC package refers to lwt.syntax in the example
<companion_cube> sorry, what's OSC?
<salkin-mada> Open Sound Control
<salkin-mada> network messages
<companion_cube> https://github.com/johnelse/ocaml-osc/blob/master/src/lwt/dune this? I don't see lwt.syntax
<salkin-mada> so the latter example in the README of that ocaml-osc package.
<salkin-mada> how can i make it work in straight up no REPL OCaml?
<salkin-mada> i cant get it to compile in my dune project. because i dont understand how to `lwt = client ..`
<companion_cube> well the readme is not up to date
<salkin-mada> i see
<companion_cube> you don't need lwt.syntax anyway
<companion_cube> if you use `utop` it should work well with lwt
<salkin-mada> okay. will try utop. But if i just want it to work with non toplevel. maybe i am completely off here and it shines through that i dont have the faintest idea about the toplevel versus lowlevel. and all the lovely Ocaml stuff :)~
<salkin-mada> but yeah, lets say i want to try that example (the latter in the readme, the one in the paste.rs)
<salkin-mada> but not in a REPL or utop or whatever
<salkin-mada> i just want to make it work in normal OCaml in my dune project
<salkin-mada> like it was a `hello_world` dune program
<companion_cube> ah, then you just need to add `osc` to your dune and opam files
<companion_cube> (and lwt, probably, to manipulate whatever it gives you)
<companion_cube> (and optionally lwt-ppx to have some syntactic sugar on top of lwt)
<salkin-mada> i have osc in my dune file under libraries. and lwt.unix. maybe its just lwt.ppx i a missing? will try. again just installed ocaml today. total new here.
<salkin-mada> so adding lwt.ppx under libraries just throws an error. and "opam install lwt" seems to not have a ppx module contained in it so to speak..?=?= :)
<salkin-mada> but "opam install ppx_tools" did atleast download some KB of data to my computer . hihi
<salkin-mada> yes! okay so now in my dune file "(libraries osc lwt ppx_tools)"
<salkin-mada> or maybe ppx_tools is something completely different thatn lwt-ppx ?
<salkin-mada> aha! so this is the difference between opam and ocamlfind? its ppx_tools and the latter is lwt.ppx
<salkin-mada> hmm highly confusing i must say. But i am probably, at some point, gonna succeed in sending and receiving an OSC message on port 57120 in OCaml :)
<salkin-mada> companion_cube thanks for letting me know about the ppx so i can use `let%lwt` with out build errors. fingers crossed
<salkin-mada> still getting a mixture of <Uninterpreted extension 'lwt'> and <Error: Unbound module Lwt_main>. Somethings not right here.
<salkin-mada> okay all of this is prob. just me stil having no clue about the OCaml syntax.
<salkin-mada> again companion_cube: thanks for your time.
<companion_cube> ah
<companion_cube> Lwt_main requires lwt.unix
<companion_cube> sorry was not looking at IRC
tryte has quit [Remote host closed the connection]
tryte has joined #ocaml
hackinghorn has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
narimiran has joined #ocaml
narimiran has quit [Ping timeout: 265 seconds]
yomimono has joined #ocaml
shawnw has quit [Ping timeout: 240 seconds]
tane_ has joined #ocaml
narimiran has joined #ocaml
richbridger has quit [Ping timeout: 268 seconds]
richbridger has joined #ocaml
Haudegen has joined #ocaml
salkin-mada has quit [Ping timeout: 252 seconds]
mro_name has joined #ocaml
<d_bot> <dj charlie> @olle going alright, trying to make working with some text easier for our guys in the kafka pipeline
<d_bot> <dj charlie> the way our org does things is we have a package called a "kit" that has some environment variable based setup for chatting to the kafka, so jugging either doing the child strat (and feeding in what we want), having a kafka client and writing a new kit (also needs logging, etc) and using our ocaml code as an external
<d_bot> <dj charlie> doing the kit strat atm
<d_bot> <dj charlie> *or using our ocaml code as external
Serpent7776 has quit [Ping timeout: 240 seconds]
Serpent7776 has joined #ocaml
mro_name has quit [Remote host closed the connection]
bartholin has joined #ocaml
mro_name has joined #ocaml
kini has quit [Remote host closed the connection]
kini has joined #ocaml
waleee-cl has joined #ocaml
mro_name_ has joined #ocaml
mro_name has quit [Read error: Connection reset by peer]
mro_name_ has quit [Remote host closed the connection]
<d_bot> <Naupio> does someone run command `dune utop` with this error:
<d_bot> <Naupio> ```
<d_bot> <Naupio> ld: library not found for -lev
<d_bot> <Naupio> clang: error: linker command failed with exit code 1 (use -v to see invocation)
<d_bot> <Naupio> ```
<d_bot> <Naupio> I was running this with MacBook Pro (13-inch, M1, 2020)
mro_name has joined #ocaml
mro_name has quit [Remote host closed the connection]
<d_bot> <dj charlie> not on a mac, but do you need `libev` from homebrew?
Haudegen has quit [Quit: Bin weg.]
salkin-mada has joined #ocaml
mro_name has joined #ocaml
st8less has joined #ocaml
narimiran has quit [Ping timeout: 240 seconds]
mro_name has quit [Ping timeout: 250 seconds]
zebrag has joined #ocaml
aspiwack[m] has quit [Ping timeout: 245 seconds]
dash has quit [Ping timeout: 276 seconds]
Sumera[m] has quit [Ping timeout: 276 seconds]
labor[m] has quit [Ping timeout: 245 seconds]
Coldfusion[m] has quit [Ping timeout: 245 seconds]
aspiwack[m] has joined #ocaml
dash has joined #ocaml
Sumera[m] has joined #ocaml
mro_name has joined #ocaml
Tuplanolla has joined #ocaml
Coldfusion[m] has joined #ocaml
sar has quit [Ping timeout: 258 seconds]
caasih has quit [Ping timeout: 250 seconds]
metadave has quit [Ping timeout: 246 seconds]
higherorder__ has quit [Ping timeout: 260 seconds]
angerman has quit [Ping timeout: 260 seconds]
mro_name has quit [Remote host closed the connection]
mro_name has joined #ocaml
TheLemonMan has joined #ocaml
metadave has joined #ocaml
higherorder__ has joined #ocaml
jeroud has quit [Ping timeout: 245 seconds]
pmonson has quit [Ping timeout: 250 seconds]
noonien6 has joined #ocaml
noonien has quit [Ping timeout: 240 seconds]
noonien6 is now known as noonien
labor[m] has joined #ocaml
higherorder__ has quit [Max SendQ exceeded]
caasih has joined #ocaml
jeroud has joined #ocaml
pmonson has joined #ocaml
mro_name has quit [Remote host closed the connection]
angerman has joined #ocaml
higherorder__ has joined #ocaml
Haudegen has joined #ocaml
mbuf has joined #ocaml
osa1 has joined #ocaml
<osa1> where can I find 4.10 verison of this page https://www.ocaml.org/api/List.html searched in Google, and using the search box on the left, but no luck..
mbuf has quit [Quit: Leaving]
mro_name has joined #ocaml
hackhorn has joined #ocaml
xenu has quit [Read error: Connection reset by peer]
ansiwen has quit [Remote host closed the connection]
shmibs_ has joined #ocaml
salkin-mada_ has joined #ocaml
ansiwen has joined #ocaml
dan64 has quit [Quit: ZNC - http://znc.in]
hackinghorn has quit [Remote host closed the connection]
shmibs has quit [Quit: leaving =o]
salkin-mada has quit [Remote host closed the connection]
seliopou has quit [Ping timeout: 240 seconds]
Jesin has quit [Ping timeout: 240 seconds]
shmibs_ is now known as shmibs
dan64 has joined #ocaml
seliopou has joined #ocaml
xenu has joined #ocaml
hornhack has joined #ocaml
hackhorn has quit [Ping timeout: 260 seconds]
<d_bot> <dj charlie> anyone have any issues with kafka_lwt blocking indefinitely when producing?
<d_bot> <dj charlie> for seemingly no reason?
<d_bot> <dj charlie> ``` Kafka.new_topic handler topic
<d_bot> <dj charlie> [ "auto.commit.enable", "true"
<d_bot> <dj charlie> ; "acks", "all" ]```
<d_bot> <dj charlie> ``` [ bootstrap_servers, host
<d_bot> <dj charlie> ; "client.id", client_id
<d_bot> <dj charlie> ; "sasl.username", username
<d_bot> <dj charlie> ; "sasl.password", password
<d_bot> <dj charlie> ; "sasl.mechanisms", "PLAIN"
<d_bot> <dj charlie> ; "security.protocol", "SASL_PLAINTEXT"
<d_bot> <dj charlie> ; "enable.partition.eof", "false" ] in```
<companion_cube> please use a paste site instead :p
<companion_cube> (I have no clue, I don't use kafka)
<d_bot> <dj charlie> apologies πŸ™‚
dhil has joined #ocaml
<d_bot> <dj charlie> πŸ˜” https://pastebin.com/zbv87i5R PAIN
<companion_cube> and this blocks?
<d_bot> <dj charlie> yeah
<d_bot> <dj charlie> only sends a single message, this is with kafka-console-consumer.sh as the consumer
<d_bot> <dj charlie> might be because of a flag or something, i'm only familiar with the go package behaviour with kafka
salkin-mada_ has quit [Ping timeout: 240 seconds]
narimiran has joined #ocaml
<d_bot> <darrenldl> `partition` should be a labelled argument right? (not that this helps with the blocking)
<d_bot> <dj charlie> nah, doc's out of date
<d_bot> <dj charlie> :^(
<d_bot> <dj charlie> caught me too
<d_bot> <darrenldl> oh
<d_bot> <darrenldl> anyway, back to topic, try tinkering with kafka timeout setting stuff?
<d_bot> <darrenldl>
<d_bot> <darrenldl> incidentally i only have a very vague idea of what is going on
<d_bot> <darrenldl> okay im confused, let me read the source code a bit...
<d_bot> <darrenldl> (of ocaml-kafka)
<d_bot> <dj charlie> i have to sleep but sure let's give it a shot πŸ™‚
sz0 has quit [Quit: Connection closed for inactivity]
<d_bot> <dj charlie> tried message.timeout.ms and request.timeout.ms with ms of 10000 in my other codebase and no dice
<d_bot> <dj charlie> (time to sleep lol)
<d_bot> <darrenldl> i have a possibly odd idea of how it is meant to be used maybe...let me try it
kakadu_ has joined #ocaml
kakadu has quit [Ping timeout: 265 seconds]
osa1 has quit [Remote host closed the connection]
ArthurStrong has quit [Read error: Connection reset by peer]
ArthurStrong has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
Jesin has joined #ocaml
webshinra has quit [Remote host closed the connection]
webshinra has joined #ocaml
mro_name has quit [Remote host closed the connection]
Haudegen has joined #ocaml
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
ghosthell has joined #ocaml
mxns has joined #ocaml
bartholin has quit [Quit: Leaving]
kakadu_ has quit [Read error: Connection reset by peer]
kakadu_ has joined #ocaml
hornhack has quit [Quit: Leaving]
<d_bot> <darrenldl> okay right, @dj charlie try `Kafka_lwt.new_producer` instead of `Kafka.new_producer`
<d_bot> <darrenldl>
<d_bot> <darrenldl> `Kafka_lwt.new_producer` has some internal bookkeeping ceremony
<d_bot> <mimoo> why is Result not a module in 4.07.1 but it is in 4.08?
<d_bot> <mimoo> I'm not sure how I can find docs/available modules per ocaml version
<companion_cube> because it was added in 4.08 I think
<companion_cube> before that you need to depend on the `result` shim
<d_bot> <octachron> And there is a since 4.08 annotation on the module (https://ocaml.org/api/Result.html)
<d_bot> <mimoo> oh nice! that's helpful
<d_bot> <mimoo> I can't seem to find the doc on that for 4.07.1 o_O
<d_bot> <mimoo> I guess there is only doc for the last version of ocaml?
<schlaftier> mimoo: Head to https://ocaml.org/releases/ and follow the links to the given release, then find "User's manual"
<companion_cube> if you see `@since 4.08` it means it can't be in the 4.07 docs :)
<d_bot> <mimoo> I meant the shim you're talking about
<d_bot> <mimoo> ah I see! I guess there's been some visual improvement since then πŸ˜„
<d_bot> <mimoo> thx for the pointer!
<companion_cube> `opam info result` :)
<d_bot> <mimoo> no search function in any of them though >.<
<companion_cube> it's not in the 4.07 distribution since it's newer
<companion_cube> it's a separate compability package that does nothing on >= 4.08
<d_bot> <mimoo> ah I see! It's an external library
<companion_cube> yes, it allows people to get the Result module as far back as 4.02, iirc
<d_bot> <mimoo> "Error: Unbound module Option", looks like there's no `option` package this time πŸ˜„
<companion_cube> ah possibl
<companion_cube> there's stdlib-shims which is a larger effort
<companion_cube> since the stdlib has been growing quicker after `result`
<companion_cube> (or you could use containers :p β€” not 100% though)
<d_bot> <mimoo> interesting, it seems like the consensus was to use jane street's Core, but I guess the stdlib is getting better and better that this might change?
<companion_cube> there's no consensus :D
<companion_cube> some people use base/core, some use only the stdlib, some use containers, some use batteries
<zozozo> and some rewrite/copy the functions they need in every project, :p
<companion_cube> yeah that's included in "use only the stdlib"
<companion_cube> :p
mro_name has joined #ocaml
<d_bot> <mimoo> it'd be good to have consensus πŸ˜„ I've been writing https://o1-labs.github.io/ocamlbyexample/basics-opam.html using Core
<d_bot> <mimoo> but I wouldn't mind changing that to the stdlib
<zozozo> it might be nicer in the begining to use the direct stdlib indeed I think
<zozozo> one problem that often comes with people using Core is some confusion because of stdlib things the Core shadows, leading to people who read the stdlib documentation being confused about why their code does not compile
<d_bot> <mimoo> yeah that's a real issue... Core's doc is also horrendous haha
<d_bot> <mimoo> but I was thinking that if the community ends up using Core in general, better just learn Core...
<d_bot> <mimoo> is the stdlib trying to catch up with Core's functionalities? Or integrate some of Core's code?
mro_name has quit [Remote host closed the connection]
<companion_cube> no, and no
<companion_cube> the stdlib is just adding stuff a lot of people have been reimplementing over and over again
<d_bot> <mimoo> is it to keep stdlib lean?
<companion_cube> (I must disclose that I'm not unbiased: I wrote containers, so Core is a bit of a competitor to me :p)
<companion_cube> the stdlib is indeed relatively lean, and it also must be perfectly backward compatible
<d_bot> <mimoo> ah πŸ˜„
<d_bot> <mimoo> I'm still wondering why it is so lean, I couldn't even find functions to encode/decode hexstrings
<companion_cube> historically it's there to service the compiler
<d_bot> <mimoo> a newcomer shouldn't have to choose between core/batteries/etc.no? What if they start using different libraries that depend on either or and then you need to pass a type of one of the stdlib replacement around?
mro_name has joined #ocaml
mro_name has quit [Client Quit]
<d_bot> <mimoo> then nothing is compatible πŸ˜„
<d_bot> <mimoo> ah I see
<zozozo> well, that's one of the reasons why the stdlib has been extended recently: to give some more common types for compatibility between stdlib extensions/replacements
<zozozo> but ultimately, not everything can be compatible
<companion_cube> @mimoo you seem to think there's a unified community :)
<companion_cube> Janestreet do their thing, with a lot of big packages that move at the same pace (sometimes with breaking changes); very featureful but also their own world
<dh`> some of the things that aren't in the stdlib have long baffled me
<companion_cube> the stdlib is still in the style of ocamlc itself, done by people who care about compatibility for decades and add things slowly
<dh`> e.g. Map doesn't have of_list
<dh`> and they only just added an "either" type, which has always seemed to me about the second most basic standard ADT after "option"
<zozozo> dh`: well, there was a recent PR to add that but you end up on details that are quite controlversial, e.g. for Map.of_list if there are multiple bindings to the same variabl, in which way do they shadow each other ?
<companion_cube> dh`: well there's result
<companion_cube> which is more important than Either imho
<companion_cube> zozozo: the cat is out of the bag because of of_seq, no?
<dh`> it's more _useful_, I'm not sure it's more fundamental
<companion_cube> heh, this ain't haskell
<zozozo> well, with seq at least, you don't anymore need to have of_list,o_farray,o_fwhatever_else, but the order in which the bindings are added can be subject to debate
<dh`> (that haskell tacitly conflated the two irritated me back when I used haskell)
<dh`> zozozo: "unspecified"
<zozozo> dh`: meh.. in this case, in my opinion it's too important to leave unspecified
<dh`> meh in turn :-p normal uses won't have duplicate keys
<zozozo> as in: it will occur too often and for good reasons, and thus users will very likely need a specified version, so an unspecified version will not be usefula t all
<dh`> by far the most common use is of_list [constant list]
<zozozo> I'm not sure users will not have duplicate keys, if you read some input, you cannot guarantee it
<dh`> and I don't think I've ever needed to care
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<companion_cube> zozozo: I think it's ok that it's unspecified
<dh`> if you read some input you want to complain about duplicates, not silently discard tem
<companion_cube> but clearly the simplest and fastest is to keep the last key
<dh`> right, but which is last?
<dh`> it's reasonable to implement it with either fold_left or fold_right
<companion_cube> oh noooooooo no no no no
<companion_cube> fold_left only
<companion_cube> this ain't haskell :p
<zozozo> companion_cube: right, and in the case of Map, I think the straightforward way is a reasonable specification, but for e.g. hastbl (and thei surprising `add` semantics): do you want to add or replace duplicate bindings ? :p
<companion_cube> replace
<companion_cube> I forgot if that's the one I wrote for seq, but tbh, that's still the only reasonable way
<companion_cube> `add` is really a niche use case
<companion_cube> (as in, it should never have been named `add`)
<zozozo> you're probably right
<companion_cube> with `add`, the bindings will be there and take space, but they'll basically never be accessed
<companion_cube> (unless you reach for `find_all` naturally, I know I don't)
<zozozo> probably
<companion_cube> in other words, most of the time you want to pretend that `Hashtbl` is like Map and that `add` doesn't exist :p
olle has quit [Ping timeout: 260 seconds]
<zozozo> indeed
<companion_cube> (confirmed, in the stdlib it's with replace)
zebrag has quit [Remote host closed the connection]
zebrag has joined #ocaml
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Changing host]
neiluj has joined #ocaml
narimiran has quit [Ping timeout: 252 seconds]
neiluj has quit [Quit: leaving]
tane_ has quit [Quit: Leaving]
_habnabit is now known as habnabit_
<d_bot> <psteckler> does anyone know whether Jane Street intends to add the newfangled monadic binders (`let*`, `let+`) to their libraries?
<d_bot> <mseri> Don’t know. They have ppx_let that in addition I think does something to improve backtrackes (like lwt_ppx) so maybe they don’t care too much (yet)
<d_bot> <mseri> mimoo you can see the rationale behind the various stdlibs nicely summarised here: https://ocamlverse.github.io/content/standard_libraries.html
<d_bot> <Anurag> @mseri from what I can tell it doesn't to anything for backtraces, but it does support things that aren't currently part of the ocaml compiler's let-op support. Namely: `match%bind, match%map` , ability to locally qualify which monad the `%bind` is working on, etc
<d_bot> <therewolf> yminsky had a comment on this here: https://discuss.ocaml.org/t/ppx-let-vs-binding-operators/7037/2
Tuplanolla has quit [Quit: Leaving.]
zebrag has quit [Quit: Konversation terminated!]
mxns_ has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
Haudegen has quit [Ping timeout: 265 seconds]
dhil has quit [Ping timeout: 240 seconds]
smondet[m] has quit [Ping timeout: 258 seconds]
Sumera[m] has quit [Ping timeout: 245 seconds]
dash has quit [Ping timeout: 245 seconds]
inkbottle[m] has quit [Ping timeout: 250 seconds]
lnxw37d4 has quit [Ping timeout: 258 seconds]
pqwy[m] has quit [Ping timeout: 258 seconds]
aspiwack[m] has quit [Ping timeout: 245 seconds]
smondet[m] has joined #ocaml
Sumera[m] has joined #ocaml
dash has joined #ocaml
inkbottle[m] has joined #ocaml
pqwy[m] has joined #ocaml
help301 has joined #ocaml
lnxw37d4 has joined #ocaml
aspiwack[m] has joined #ocaml
<help301> Is there a version of Int.of_string that returns `int option`
<help301> Β instead of throwing an exception?