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/
olle has quit [Ping timeout: 256 seconds]
chiastre has quit [Ping timeout: 245 seconds]
chiastre has joined #ocaml
spip has joined #ocaml
bobo_ has quit [Ping timeout: 268 seconds]
<d_bot> <darrenldl> a map seems suitable(?
kaph has quit [Remote host closed the connection]
kaph has joined #ocaml
towel_ has quit [Quit: ZNC - https://znc.in]
towel has joined #ocaml
zebrag has quit [Remote host closed the connection]
micro_ has quit [Ping timeout: 240 seconds]
zebrag has joined #ocaml
Armael has quit [Ping timeout: 268 seconds]
micro has joined #ocaml
hannes has quit [Read error: Connection reset by peer]
hannes has joined #ocaml
chiastre has quit [Ping timeout: 268 seconds]
epony has joined #ocaml
szkl has quit [Quit: Connection closed for inactivity]
chiastre has joined #ocaml
perrierjouet has joined #ocaml
xgqt has joined #ocaml
xgqt has quit [Quit: WeeChat 3.3]
xgqt has joined #ocaml
Corbin has quit [Ping timeout: 240 seconds]
ouestbillie has quit [Read error: Connection reset by peer]
perrierjouet has quit [Quit: WeeChat 3.4]
Corbin has joined #ocaml
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #ocaml
mbuf has joined #ocaml
perrierjouet has joined #ocaml
Haudegen has joined #ocaml
waleee has quit [Ping timeout: 268 seconds]
spip has quit [Ping timeout: 256 seconds]
bobo_ has joined #ocaml
gravicappa has joined #ocaml
ansiwen_ has quit [Quit: ZNC 1.7.1 - https://znc.in]
ansiwen has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ekho has quit [Quit: CORE ERROR, SYSTEM HALTED.]
infinity0 has quit [Ping timeout: 256 seconds]
infinity0 has joined #ocaml
Ekho has joined #ocaml
rgrinberg has joined #ocaml
kaph has quit [Ping timeout: 268 seconds]
mro has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kaph has joined #ocaml
kaph has quit [Read error: Connection reset by peer]
kaph has joined #ocaml
kaph_ has joined #ocaml
kaph has quit [Read error: Connection reset by peer]
kaph_ has quit [Remote host closed the connection]
kaph has joined #ocaml
kaph has quit [Remote host closed the connection]
kaph has joined #ocaml
Tuplanolla has joined #ocaml
kaph has quit [Ping timeout: 256 seconds]
Armael has joined #ocaml
spip has joined #ocaml
bobo_ has quit [Ping timeout: 268 seconds]
bobo_ has joined #ocaml
spip has quit [Ping timeout: 268 seconds]
humasect has joined #ocaml
mro has quit [Remote host closed the connection]
olle has joined #ocaml
mro has joined #ocaml
_whitelogger has joined #ocaml
greaser|q has joined #ocaml
sparogy has joined #ocaml
remexre has joined #ocaml
chiastre has joined #ocaml
noddy has joined #ocaml
ansiwen has quit [Ping timeout: 256 seconds]
ansiwen has joined #ocaml
Tuplanolla has quit [Ping timeout: 256 seconds]
Armael has quit [Ping timeout: 256 seconds]
Tuplanolla has joined #ocaml
mro has joined #ocaml
Armael has joined #ocaml
mro has quit [Ping timeout: 240 seconds]
pgiarrusso has quit [Ping timeout: 250 seconds]
pgiarrusso has joined #ocaml
d_bot_ has joined #ocaml
Soni has quit [Ping timeout: 250 seconds]
d_bot has quit [Ping timeout: 250 seconds]
SoniEx2 has joined #ocaml
humasect has quit [Read error: Connection reset by peer]
humasect has joined #ocaml
mro has joined #ocaml
landonf has joined #ocaml
mro has quit [Ping timeout: 250 seconds]
spip has joined #ocaml
bobo_ has quit [Ping timeout: 240 seconds]
bartholin has joined #ocaml
cedric has joined #ocaml
mro has joined #ocaml
bobo_ has joined #ocaml
spip has quit [Ping timeout: 256 seconds]
ouestbillie has joined #ocaml
mclovin has joined #ocaml
mro has quit [Ping timeout: 250 seconds]
mclovin has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mclovin has joined #ocaml
mclovin has quit [Remote host closed the connection]
mclovin has joined #ocaml
smondet[m] has joined #ocaml
saltrocklamp[m] has joined #ocaml
OCamlPro[m] has joined #ocaml
JosEduardo[m] has joined #ocaml
CodeBitCookie[m] has joined #ocaml
Sofi has joined #ocaml
mclovin has quit [Quit: Client limit exceeded: 20000]
saltrocklamp[m] has quit [Quit: Client limit exceeded: 20000]
smondet[m] has quit [Quit: Client limit exceeded: 20000]
OCamlPro[m] has quit [Quit: Client limit exceeded: 20000]
CodeBitCookie[m] has quit [Quit: Client limit exceeded: 20000]
kaph has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
kaph_ has joined #ocaml
kaph has quit [Read error: Connection reset by peer]
gravicappa has quit [Ping timeout: 256 seconds]
kaph_ has quit [Remote host closed the connection]
kaph has joined #ocaml
kaph has quit [Read error: Connection reset by peer]
humasect has quit [Remote host closed the connection]
Haudegen has joined #ocaml
mro has joined #ocaml
<d_bot_> <myrkraverk> I did not find any map-like data structure in the standard library.
mclovin has joined #ocaml
smondet[m] has joined #ocaml
OCamlPro[m] has joined #ocaml
saltrocklamp[m] has joined #ocaml
CodeBitCookie[m] has joined #ocaml
<d_bot_> <myrkraverk> But I can roll my own, or use <https://hg.sr.ht/~cannam/sml-trie> maybe.
<d_bot_> <orbitz> @myrkraverk https://ocaml.org/releases/4.13/api/Map.html ?
<d_bot_> <myrkraverk> I'm using _standard ML_, for this project.
<d_bot_> <orbitz> ohh sorry
<d_bot_> <myrkraverk> No worries. The mods have not yet deigned to create an #sml channel.
<d_bot_> <KW78> there is a ml-general channel in the functional programming discord
<d_bot_> <Butanium (@me on answer)> You have to give an invitation to this channel
<d_bot_> <Butanium (@me on answer)> A link is not enough
<d_bot_> <KW78> ok tks done (but I have a weird error Internal Server Error although the invite does appear)
chrisz has quit [Remote host closed the connection]
mro has quit [Remote host closed the connection]
<d_bot_> <colin> SMLNJ lib supports RedBlackMapFn
<d_bot_> <colin> ships with MLton, with patches, just need to include in mlbasis file and it will just work
<Armael> mmh, would it be possible to rename back d_bot_ to d_bot on IRC?
gravicappa has joined #ocaml
<Armael> not sure who to ask
<companion_cube> bluddy I think
<olle> Or "dbot"
gwizon has joined #ocaml
tankf33der has left #ocaml [the lounge - https://webirc.envs.net]
<adrien> Armael: why?
<Armael> because I configured weechat to display "d_bot"'s messages like normal messages
<Armael> (the config was from zozozo I believe)
mro has joined #ocaml
<Armael> but if the bot changes name well it doesn't work anymore
rak has quit [Quit: Segmentation fault (core recycled)]
rak has joined #ocaml
<zozozo> Armael: note that you can have multiple configurations for my script, e.g. on my instance of weechat I have it configured to work for both d_bot and d_bot_
Absalom has quit [Quit: the lounge - https://webirc.envs.net]
Absalom has joined #ocaml
jlrnick has joined #ocaml
<adrien> Armael: then handle trailing underscores! :D
<adrien> it merely means the bot is not currently identifier to IRC services, it's probably something fairly common
humasect has joined #ocaml
humasect has quit [Client Quit]
mro has quit [Remote host closed the connection]
jlrnick has quit [Ping timeout: 250 seconds]
<Armael> :'(
Haudegen has quit [Quit: Bin weg.]
chrisz has joined #ocaml
wyrd has quit [Ping timeout: 276 seconds]
wyrd has joined #ocaml
mbuf has quit [Quit: Leaving]
<d_bot_> <Président daren le pétrolier> Hi! I'm looking for the implementation of the stdlib `Stream` module in the compiler repo but I can't find it in the `stdlib/` directory, does anyone know its source?
<companion_cube> it's just been removed, if you're looking at trunk
<companion_cube> not in stdlib anymore 💃
<companion_cube> it's just so… strange :D
<d_bot_> <undu> is there anywhere I can read about the reasoning behind the removal? the PR is quite empty
<d_bot_> <Président daren le pétrolier> oh curious, thank you!
rgrinberg has joined #ocaml
<companion_cube> the usage has been discouraged for years, although I don't remember official stuff right now
<companion_cube> but basically, Stream is a weird, kind of slow, quirky form of iterators
<d_bot_> <Président daren le pétrolier> I'm looking for a data structure to read line by line a file without loading it entirely in memory, I thought that the streams could be adapted
<d_bot_> <Président daren le pétrolier> do you know of a more suitable structure for this usage?
<companion_cube> well, the simpler is a recursive function with `input_line`
<companion_cube> that said, Seq.t is standard now, and I have a collection of iterators that do that kind of stuff
<companion_cube> but there's no iterator that's perfectly adapted to IOs I think, alas
bartholin has quit [Quit: Leaving]
<d_bot_> <Président daren le pétrolier> oh ok, good to know
<d_bot_> <Président daren le pétrolier> what are the differences between a stream and a `Seq.t`?
gwizon has quit [Quit: Lost terminal]
Haudegen has joined #ocaml
<companion_cube> well, check out the implementations
<d_bot_> <Président daren le pétrolier> I will do that, thank you 🙂
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mro has joined #ocaml
rgrinberg has joined #ocaml
mro has quit [Quit: Leaving...]
waleee has joined #ocaml
hackinghorn has quit [Remote host closed the connection]
hackinghorn has joined #ocaml
zebrag has joined #ocaml
rgrinberg has quit [Read error: Connection reset by peer]
rgrinberg has joined #ocaml
vicfred has joined #ocaml
<d_bot_> <EduardoRFS> If anyone wants bikeshedding, good PR https://github.com/ocaml/ocaml/pull/10979
<d_bot_> <octachron> You even gave room for bikeshedding with `(let.)`, `let!` and `let+x = Some 0 in x`!
greaser|q has joined #ocaml
greaser|q has quit [Changing host]
greaser|q is now known as GreaseMonkey
<d_bot_> <EduardoRFS> I just made it exactly the same as Reason but we can remove those, I didn't understand the `let+x = Some 0 in x` case
<d_bot_> <VPhantom> Oh that is a nice one!
<d_bot_> <VPhantom> For now what I do is dedicate one character per monad (`let|` for `Option.bind`, `let*` for `Result.bind` or `Lwt_result.bind` depending on context, etc.)
<companion_cube> let.1 x = … in let.2 y = … in x,y
<companion_cube> can't wait :p
<d_bot_> <EduardoRFS> I guess it's better than >>=?=
<d_bot_> <VPhantom> The notion of having a short keyword instead would definitely make things more explicit for the reader.
<d_bot_> <octachron> `let+x = Some 0 in x` is currently valid since `x` is the start of a new token. With the extension of the `letopsymbolchar` in your PR, the expression is now tokenized as `let+x` `=` ... and triggers a syntax error.
<d_bot_> <EduardoRFS> and as a core maintainer you cannot unsee that right?
<d_bot_> <VPhantom> What does `let+x` currently mean in that example?
<d_bot_> <EduardoRFS> let+ x
<d_bot_> <VPhantom> Oh!
<d_bot_> <davesnx> I 100% believe that landing a syntactic feature in OCaml is just opening the PR straight away
<d_bot_> <davesnx> I love you @EduardoRFS
<d_bot_> <EduardoRFS> I always forget that OCaml accepts a lot of code without spaces
<d_bot_> <EduardoRFS> it's not even whitespace insensitive just not insensitive
<d_bot_> <EduardoRFS> just insensitive
<d_bot_> <octachron> @EduardoRFS , I cannot unsee that this is a breaking change, but it would not be the first time that we break code with missing conceptually required white spaces.
<d_bot_> <octachron> There was a similar issue with `< 'a.?x:int -> ... >` and the custom indexing operators.
<d_bot_> <VPhantom> Since `let.` and `let!` weren't allowed as let bindings, then the `.` or `!` make sense as the keyword "introducers" here, to me.
<d_bot_> <EduardoRFS> ! will not cut, as gasche mentioned in the PR, so we can use `.` and multiple `.`
<companion_cube> let<await>
<d_bot_> <VPhantom> Yeah, `.` is more intuitive to me anyway. 😛 That PR is actually what I expected when I heard let bindings were coming, before I saw the single-symbol implementation.
<d_bot_> <VPhantom> @companion_cube That seems unnecessarily "noisy" to me. The period is discrete, and it's half the characters also.
<companion_cube> I was kidding :p
<companion_cube> I do think the dot is good.
<d_bot_> <VPhantom> Whew! 😛
<d_bot_> <octachron> only with unicode angled brackets `let❬await❭` , `<` is a binary operator not a bracket.
<d_bot_> <VPhantom> oh boy…
<companion_cube> :D
<companion_cube> the classic go solution
<d_bot_> <EduardoRFS> I'm pretty sure golang people were using this for generics at some point
<d_bot_> <EduardoRFS> yes
<d_bot_> <VPhantom> All those wrapping brackets and what not is why I feel uncomfortable with the likes of Rust and Java. They're a sea of symbols compared to how clean OCaml can be.
<d_bot_> <d4hines> I'm working on an application that uses Lwt to process incoming messages asynchronously, but I'm trying to offload expensive (pure) computations to another domain using `Lwt_domain` . However, my application also calls other programs using `Lwt_process.pmap`, which calls `Unix.fork` under the hood. This raises the error:
<d_bot_> <d4hines> ```
<d_bot_> <d4hines> Unix.fork may not be called while other domains were created
<d_bot_> <d4hines> ```
<d_bot_> <d4hines> What is the prescribed way to call other programs when using multicore?
<d_bot_> <EduardoRFS> actually that's a good question, why does multicore banned fork? Also how can I execute a CLI without it?
<companion_cube> EduardoRFS: can we also get `;.foo` ?
<companion_cube> I hate `let.blabla () = …` so much
<companion_cube> or `let+ () = …`
<d_bot_> <EduardoRFS> no
<d_bot_> <EduardoRFS> Didn't knew that I had veto power, but it's nice to use it
<companion_cube> :(
<companion_cube> sa
<companion_cube> d
<d_bot_> <octachron> with `create_process` and friends?
<sadiq> You can fork but only if you've only ever had a single Domain
<sadiq> oh I see that's already been said earlier =)
<companion_cube> ofc the problem is if create_process and the likes are too limitd
<companion_cube> which, they sometime are :/
<sadiq> how might they be too limited?
<sadiq> (am not saying they aren't, I just don't know what the other use cases are)
<companion_cube> well, if you want to be able to pkill the process, and redirect/read stdin/stderr/stdout, and possibly enforce a timeout, and get the exit code
<companion_cube> I think there's not one API that does all of them
<companion_cube> I certainly havea couple of "popen" like functions that redo create_process, but with more options, because I often need a timeout on my subprocesses
vicfred has quit [Quit: Leaving]
<sadiq> I see
<companion_cube> also, tbh, the closing mechanism is ugly
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<companion_cube> if it was to be done from scratch, I'd definitely go with a `Subprocess.t` type, and accessorss for pid, channels, exit status (blocking and non blocking), etc.
<companion_cube> instead of tuples :)
<sadiq> I think it's possible to add support for Unix.fork from multi-Domain, it's just a lot of (potentially invasive) work.
<energizer> i'm not an ocamler but i'm trying to read a bit of ocaml code. `| Indexed of 'e * 'e index list` is that `| Indexed of (('e) * ('e index list))`?
<sadiq> It's also going to introduce some codepaths that are rarely if ever going to get exercised.
<energizer> in terms of how the syntactic grouping works
<companion_cube> yes
<companion_cube> it's a pair, the second element is a list of 'e index list
<d_bot_> <NULL> energizer: `Indexed of ('e) * (('e) index) list`
<companion_cube> sadiq: a real problem, of course, is that fork is indeed bad
<d_bot_> <NULL> Not exactly a pair, it's a constructor with two arguments
<companion_cube> what's good is fork+exec or the better APIs (?)
<energizer> d_bot_: can you add another set of () to that so i can see where `list` goes
gravicappa has quit [Ping timeout: 256 seconds]
<d_bot_> <NULL> Oh yeah I forgot some `Indexed of ('e) * ((('e) index) list)`
<d_bot_> <NULL> The main thing I wanted to highlight is that having parentheses around the whole product changes stuff slightly
<d_bot_> <NULL> Also, d_bot_ is the bridging bot
<energizer> oh you are NULL
<d_bot_> <NULL> Yes
<companion_cube> the obsolete version of nullptr?
<energizer> `(Indexed of ('e)) * ((('e) index) list)` or `Indexed of (('e) * ((('e) index) list))` ?
<d_bot_> <NULL> companion_cube: A representation of my inspiration on creating a username
<companion_cube> apparently you could have used some pointers for inspiration
<companion_cube> energizer: the first 'e is not in the list.
<d_bot_> <NULL> Think of `Indexed of ('e) * ((('e) index) list)` as `{constructor_id=INDEXED; field_1: 'e; field_2: ('e index) list}`
<d_bot_> <NULL> If you are more familiar with C, that's pretty much what it translates to
<energizer> ok i think i get it. thanks.
Serpent7776 has quit [Quit: leaving]
rgrinberg has joined #ocaml
sagax has quit [Ping timeout: 260 seconds]
kaph has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
zebrag has quit [Client Quit]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
spip has joined #ocaml
bobo_ has quit [Ping timeout: 256 seconds]
cedric has quit [Quit: Konversation terminated!]
Haudegen has quit [Ping timeout: 250 seconds]