snhmib has quit [Read error: Connection reset by peer]
larhat has joined #ocaml
<Algebr>
something is raising a Failure with the string Multiprocessor and I'm not sure from where...
<aantron>
cheater: it waits for all the promises to become resolved. if none of them do I/O, then they will (already have) run one after the other. otherwise, the ones that do I/O run in parallel with the others
<aantron>
well its possible not to do I/O but still call into lwt in such a way that one of the promises is not yet resolved. anyway that's not the point
manizzle has joined #ocaml
<octachron>
ok, Arg bug caught; sometimes I wish that the compiler would remember that OCaml is a functional language…
yomimono has quit [Ping timeout: 240 seconds]
larhat has quit [Quit: Leaving.]
chindy has quit [Ping timeout: 258 seconds]
wtetzner has quit [Remote host closed the connection]
wtetzner has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
LACampbell has quit [Ping timeout: 248 seconds]
snhmib has joined #ocaml
octachron has quit [Quit: Leaving]
wolfcore has quit [Ping timeout: 258 seconds]
xorpse has quit [Ping timeout: 258 seconds]
sammy__ has quit [Ping timeout: 260 seconds]
danieli has quit [*.net *.split]
vinoski has quit [*.net *.split]
spion has quit [*.net *.split]
tg has quit [*.net *.split]
flux has quit [*.net *.split]
milodavis has quit [*.net *.split]
xaimus has quit [*.net *.split]
aantron has quit [*.net *.split]
gargawel has quit [*.net *.split]
Madars has quit [*.net *.split]
rbocquet has quit [*.net *.split]
apache3 has quit [*.net *.split]
gustav__1 has quit [*.net *.split]
ewanas has quit [*.net *.split]
jyc has quit [*.net *.split]
gustav___ has joined #ocaml
xaimus has joined #ocaml
apache3 has joined #ocaml
flux has joined #ocaml
gargawel has joined #ocaml
danieli_ has joined #ocaml
jyc has joined #ocaml
spion_ has joined #ocaml
aantron has joined #ocaml
milodavis has joined #ocaml
rbocquet has joined #ocaml
Madars has joined #ocaml
ewanas has joined #ocaml
vinoski has joined #ocaml
wolfcore has joined #ocaml
Drup has quit [*.net *.split]
fedruantine has quit [*.net *.split]
cheater has quit [*.net *.split]
ansiwen has quit [*.net *.split]
jmasseo has quit [*.net *.split]
_y has quit [*.net *.split]
wagle has quit [*.net *.split]
chenglou has quit [*.net *.split]
yunxing has quit [*.net *.split]
jmasseo has joined #ocaml
_y has joined #ocaml
cheater has joined #ocaml
wagle has joined #ocaml
Drup has joined #ocaml
fedruantine has joined #ocaml
ansiwen has joined #ocaml
bbc has quit [Ping timeout: 240 seconds]
jbrown has quit [Ping timeout: 245 seconds]
silver has quit [Read error: Connection reset by peer]
jbrown has joined #ocaml
infinity0 has quit [Remote host closed the connection]
bbc has joined #ocaml
chenglou has joined #ocaml
infinity0 has joined #ocaml
rbocquet has quit [Ping timeout: 240 seconds]
yunxing has joined #ocaml
wolfcore has quit [Ping timeout: 248 seconds]
rbocquet has joined #ocaml
manizzle has quit [Ping timeout: 240 seconds]
wolfcore has joined #ocaml
snhmib has quit [Read error: Connection reset by peer]
lujara has quit [Ping timeout: 245 seconds]
mfp has quit [Ping timeout: 240 seconds]
lujara has joined #ocaml
lujara has joined #ocaml
lujara has quit [Changing host]
tmtwd has quit [Ping timeout: 240 seconds]
manizzle has joined #ocaml
jbrown has quit [Ping timeout: 245 seconds]
snhmib has joined #ocaml
jbrown has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
jbrown has quit [Ping timeout: 245 seconds]
govg has quit [Quit: leaving]
rcabaco has joined #ocaml
jbrown has joined #ocaml
rcabaco has quit [Ping timeout: 240 seconds]
frug72_ has quit [Ping timeout: 240 seconds]
frug72 has joined #ocaml
stux|RC has joined #ocaml
tennix has joined #ocaml
mrallen1 has quit [Read error: Connection reset by peer]
JSharp has quit [Ping timeout: 258 seconds]
NhanH has quit [Read error: Connection reset by peer]
MorTal1ty has quit [Read error: Connection reset by peer]
JSharp has joined #ocaml
bigs_ has quit [Ping timeout: 258 seconds]
wtetzner has quit [Remote host closed the connection]
chelfi has quit [Ping timeout: 258 seconds]
regnat_ has quit [Ping timeout: 258 seconds]
edwin has quit [Ping timeout: 258 seconds]
MorTal1ty has joined #ocaml
regnt[m] has quit [Ping timeout: 258 seconds]
regnat[m] has quit [Ping timeout: 258 seconds]
matth[m] has quit [Ping timeout: 258 seconds]
M-pesterhazy has quit [Ping timeout: 258 seconds]
na9da[m] has quit [Ping timeout: 258 seconds]
dfeldman[m] has quit [Ping timeout: 258 seconds]
srenatus[m] has quit [Ping timeout: 258 seconds]
dlat_ has quit [Ping timeout: 258 seconds]
wtetzner has joined #ocaml
chelfi has joined #ocaml
dfeldman[m] has joined #ocaml
regnt[m] has joined #ocaml
M-pesterhazy has joined #ocaml
edwin has joined #ocaml
na9da[m] has joined #ocaml
srenatus[m] has joined #ocaml
stux|RC-only has quit [Quit: Aloha!]
mrallen1 has joined #ocaml
wtetzner has quit [Ping timeout: 240 seconds]
matth[m] has joined #ocaml
regnat[m] has joined #ocaml
NhanH has joined #ocaml
dlat has joined #ocaml
jbrown has quit [Ping timeout: 245 seconds]
jbrown has joined #ocaml
breitenj has quit [Ping timeout: 240 seconds]
breitenj has joined #ocaml
M-Illandan has quit [Ping timeout: 240 seconds]
M-Illandan has joined #ocaml
snhmib has quit [Read error: Connection reset by peer]
trepta has joined #ocaml
snhmib has joined #ocaml
pierpa has quit [Ping timeout: 240 seconds]
snhmib has quit [Ping timeout: 245 seconds]
infinity0 has quit [Ping timeout: 258 seconds]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
snhmib has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
bigs_ has joined #ocaml
rcabaco has joined #ocaml
rcabaco has quit [Ping timeout: 240 seconds]
MercurialAlchemi has joined #ocaml
snhmib has quit [Ping timeout: 240 seconds]
malc_ has joined #ocaml
\h has quit [Quit: WeeChat 1.6]
\h has joined #ocaml
sz0 has joined #ocaml
snhmib has joined #ocaml
infinity0 has quit [Ping timeout: 240 seconds]
infinity0 has joined #ocaml
AlexDenisov has joined #ocaml
Mercuria1Alchemi has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
snhmib has quit [Read error: Connection reset by peer]
snhmib has joined #ocaml
snhmib has quit [Read error: Connection reset by peer]
snhmib has joined #ocaml
jnavila has joined #ocaml
lucybun has quit [Quit: lucybun]
lucybun has joined #ocaml
lenticularmother has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
snhmib has quit [Ping timeout: 240 seconds]
snhmib has joined #ocaml
freusque has joined #ocaml
AlexDenisov has joined #ocaml
snhmib has quit [Read error: Connection reset by peer]
Guest26 has joined #ocaml
snhmib has joined #ocaml
tg has joined #ocaml
Guest26 has quit [Read error: Connection reset by peer]
AltGr has joined #ocaml
lujara has quit [Ping timeout: 260 seconds]
aggelos_ has quit [Ping timeout: 246 seconds]
lujara has joined #ocaml
lujara has joined #ocaml
lujara has quit [Changing host]
trepta has quit [Ping timeout: 248 seconds]
kolko has quit [Ping timeout: 245 seconds]
tennix has quit [Quit: WeeChat 1.6]
ski_ is now known as ski
silver has joined #ocaml
ocp has joined #ocaml
snhmib has quit [Ping timeout: 258 seconds]
sepp2k has joined #ocaml
<Leonidas>
jerith: do you want to reword/squash some commits before I merge them? Otherwise I'll hit that merge button hard :)
snhmib has joined #ocaml
demonimin has joined #ocaml
<jerith>
Leonidas: Nope, I almost never do that kind of thing after pushing to github unless someone asks me to. :-)
<jerith>
Are you going to release any time soon?
<Leonidas>
jerith: I'd like to, though I fear users_list is broken and with it a number of other things.
demonimin has quit [Ping timeout: 258 seconds]
<Leonidas>
I'd need to carve out some time to test the functions whether they bitrotted and release
<Leonidas>
What I ACTUALLY need is a small integration test :|
<jerith>
Leonidas: I can maybe work on that sometime.
<jerith>
I need to do it for my own bot anyway.
<Leonidas>
jerith: that'd be awesome.
<Leonidas>
Last time I thought about it I was hesistant because I needed to embed my slack token, but turns out you can have secret variables in Travis so it can run the integration test and not leak credentials :)
<Leonidas>
(pretty sure once my next job uses slack there will be far more activity)
<Leonidas>
the upside is that it's probably an easy fix
<flux>
leonidas, another thing I've been thinking of.. maybe replace 'token' with 'session' and then have the session cache all kinds of stuff?-) (with explicit cache invalidation support)
<Leonidas>
"it currently implements 100% of the Slack API" is also a blatant lie by now
<flux>
(for backwards compatibility type token = session and leaving the token_of_stirng would be nice)
<flux>
leonidas, not lie.. marketing :)
<Leonidas>
flux: hmm, that's a good idea.
<Leonidas>
i'd love to consume the session after each call, but since this is not rust, that's not really possible
<Leonidas>
OTOH, I'd need to return the session née token after each call.
<jerith>
Leonidas: You could always change the API and bump the version appropriately. :-)
<flux>
I think faking some kind of stateful type system when none exists is just more annoyance than value ;)
demonimin has quit [Ping timeout: 240 seconds]
<flux>
making the messaging primitives themselves first class might be a more valuable approach. ie. sync (user_list) >>= fun users -> .. and async (user_list) (fun users -> .. ) would be possible two ways to use such an interface.
<companion_cube>
I'm surprised by the bug in Arg, how does it happen?
<companion_cube>
I never had any problem with Arg so far…
octachron has joined #ocaml
<octachron>
companion_cube: you mean how to trigger it?
larhat has joined #ocaml
ocaml943 has joined #ocaml
<companion_cube>
yeah, what's causing it, etc.
_andre has joined #ocaml
<flux>
I cannot reproduce that with 4.02.0
kakadu has joined #ocaml
<octachron>
the problem happens with internal error when parsing arguments
<octachron>
for instance having a string argument and not giving it argument
<companion_cube>
ah, if several arguments are wrong?
<octachron>
one wrong argument is enough
<flux>
I guess Arg is pretty nice for very small cases, but Cmdliner is superior - except for the difficult in learning how to use it :-)
<companion_cube>
hmm, never had issues with wrong arguments either…
<companion_cube>
Arg works very well for my use cases
<companion_cube>
I just keep all the dirty state in the main
<flux>
but it's so diiirtyy!
<flux>
I guess I've gotten over that dirtiness over time, though ;)
<companion_cube>
dirty but simple
<octachron>
companion_cube, it could be a 4.04 only bug
<Leonidas>
jerith: yes, though returning a tuple of (session', actual_return_value) in every method is rather… ugly.
<Leonidas>
companion_cube: you might have the same bug when you use Arg.String/Int or whatever, you just don't know it
<Leonidas>
after all, it's just a printing bug, not a functional issue
rossberg has joined #ocaml
ocaml943 has quit [Quit: Page closed]
<jerith>
Leonidas: You could make parts of the session mutable so it doesn't need to be returned every time.
<jerith>
The credentials would be immutable, but cached identifier mappings would be mutable.
<companion_cube>
Leonidas: I mean, sometimes I use my Arg-powered program wrongly, never had a duplicate message
ocp has quit [Ping timeout: 240 seconds]
<Leonidas>
let me build 4.02.3 and check
<Leonidas>
yeah, works in 4.02.3
ltadeu has joined #ocaml
<companion_cube>
you mean the bug is 4.04 only? or >= 4.03?
<Leonidas>
Building 4.03 for bisecting
<octachron>
companion_cube: after checking, the bug is only triggerred with missing argument
<Drup>
You can learn it for fun, but it's not useful for 99% of OCaml programming
<Drup>
("that theory" is a bit imprecise ;) )
<ocaml094>
Why ?
<Drup>
Because the link between category theory and OCaml is actually quite distant
<companion_cube>
^
<Drup>
(it's also actually not that close to Haskell either and you can do everything by just knowing a little bit of algebra, but they really really like their categories, so don't tell them :p)
<ocaml094>
What kind of algebra do you mean ? That is a beginning for learners like me.
<companion_cube>
if you're a beginner, don't bother with category theory in any case, whatever the language
<flux>
is Lwt.t even really a monad, given the dynamic enforcement of single-use for Lwt values?
<Drup>
flux: what dynamic enforcement ?
<companion_cube>
well, let x = Lwt_io.readline() in sequence [x;x;x]
<Drup>
ocaml094: just learn the language, you can learn everything on the fly when you'll actually need it
<companion_cube>
is not the same as [Lwt_io.readline(); Lwt_io.readline(); Lwt_io.readline()]
<companion_cube>
which makes it not really a monad, I have to agree :]
<companion_cube>
Drup: I don't know, Lwt_io is part of the core for me :/
<Drup>
(now, the real "problem" with the lwt monad is that the behavior of "bind" is not the same depending on whether the left side is already evaluated or not)
<Drup>
companion_cube: it's not part of the monad operators *shrug*
<companion_cube>
for me, the issue with lwt as a monad is that creating a future has side effects
<flux>
actually reusing ie. the value Lwt_mvar.take x is pretty interesting :)
<Drup>
I feel you are making a false distinction, and your problem is just with defered computations+side effects
<flux>
it seems to return the previously returned value
<Drup>
even 'a lazy has the issue
xorpse has quit [Ping timeout: 258 seconds]
<companion_cube>
Drup: maybe so
xorpse has joined #ocaml
<flux>
well, putting side-effectful things into lazy in a way that depends on the side-effects happening at certain point is a bit dubious
<flux>
whereas with Lwt values you surely expect things to happen at the bind?
<Drup>
flux: in that case, most of the usages of Lazy are dubious :D
<companion_cube>
in theory you can write a proper IO monad in OCaml
<companion_cube>
something in which the `let` I pasted above would work properly
<flux>
drup, the whole point of Lazy is that the side effect happens exactly once, I also hope multicore won't break this :)
<flux>
but with Lwt the side effects are like a combination of creating the monadic value and then binding it
<flux>
or not binding but applying Lwt_unix.run to it directly :)
<companion_cube>
well, lazy + side effects is super dangerous
<companion_cube>
(I do it, I have to say, but it's magic)
<flux>
that of course matches exactly what lazy does, except 'binding' lazy values doesn't need a special value being chained on. but I've never heard Lwt being described as the lazy IO framework ;-)
<companion_cube>
(and typically it's idempotent side effects only in my code)
<flux>
well, lazy+side effects is super useful :-)
<Drup>
(the typechecker is so full of lazy+side effects)
lukky513 has quit [Ping timeout: 265 seconds]
mengu has joined #ocaml
<flux>
I wonder how the typed effects thing works with lazy
<freehck>
Hello pals! Happy new year to everyone! :)
<ocaml094>
Thanks for that video
<ocaml094>
Hope I understand that.
<companion_cube>
it's the future OCaml, not the present one
<ocaml094>
Oh!
<flux>
and it might not even be that :)
Sorella has joined #ocaml
lenticularmother has quit [Read error: Connection reset by peer]
<Leonidas>
octachron: but there is a warning when using ; on non-unit values. The only difference is the type error that might occur otherwise.
Guest82 has joined #ocaml
ocp has quit [Ping timeout: 240 seconds]
<Leonidas>
ocaml094: I don't think it is necessary to watch bartosz's videos
<cheater>
side effects in lazy code work perfectly well if the codomain of your function is commutative
<cheater>
or rather if the range of effects is commutative
<Leonidas>
cheater: shoo, off to #haskell with you
<cheater>
Non!
<cheater>
I shall remain.
<cheater>
go fix Arg Leonidas
<Leonidas>
no cheatexit
<cheater>
nope
<Leonidas>
cheater: octachron already did
<cheater>
go fix it better
<companion_cube>
is it a weird Go dialect with currying?
<companion_cube>
can't tell
<ocaml094>
Leonidas : It is not necessary for application programming. But he mentions that some advanced Haskell libraries are based on that. Why ?
<cheater>
companion_cube: what?
<companion_cube>
`go` is a keyword :p
<cheater>
ocaml094: based on what?
<cheater>
laziness?
<ocaml094>
in the first video.
<cheater>
what is it that you refer to as "it"?
lenticularmother has joined #ocaml
<ocaml094>
Category theory as explained by him
<cheater>
who are we talking about
<octachron>
Leonidas: I was more speaking of reading order with "let () = …" I already know that "…' is used for a side effect when I start reading the content "…"
<ocaml094>
bartosz's videos
regnat_ has joined #ocaml
<Leonidas>
ocaml094: okay, I see. I was just wondering, thanks for explaining :)
<octachron>
ocaml094: category theory is in some sense a way of structuring mathematical knowledge; it is quite natural when one know category theory to try to apply it to other domains
<Leonidas>
ocaml094: well, yeah, lenses. You can of course also use lenses in OCaml if you want to.
<Drup>
you really don't need category theory to understand lenses
<Leonidas>
but that applies to many things, once you know X you might want to apply that to Y.
<octachron>
I wonder, should I design a library based on the concepts of quantum field theory to try to ensnare programmers in learning QFT?
<Drup>
Note from a quantum theorist on the reddit thread "This is awesome, but it has nothing to do with quanthum physics"
<Leonidas>
hahaha, reading the Arg bug report, looks like OCaml in Fedora was broken for a longer time :D
ocp has joined #ocaml
<octachron>
Drup: yeah, not even some complex probabilities for interference
larhat has joined #ocaml
Guest82 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<mengu>
hi all
Guest82 has joined #ocaml
<mengu>
i thought this was a shortcut for pattern matching -> let fun arg = function | case1 -> val1 | case2 -> val2
<mengu>
instead of let fun arg = match arg with | case1 -> val1 | case2 -> val2
<dmbaturin>
Suppose I have a module Foo with type 'a t and a module Bar with types bar and bar Foo.t How do I go about adding ppx_deriving (yojson one specifically, if that matters) for bar Foo.t ?
<mengu>
turns out the former is returning a function that takes an argument and then does the pattern matching on that
<edwin>
mengu: remove the 'arg' in your first declaration
<dmbaturin>
mengu: Yeah, "function" is an implicit one argument function.
<mengu>
yeah, noticed that
<thizanne>
mengu: `function | case 1 -> ... | case2 -> ...` is the shortcut for `function x -> match x with | case 1 -> ... | case2 -> ...`
<mengu>
thanks ewanas, dmbaturin, thizanne
<Drup>
dmbaturin: [@derive] or Foo.t ?
<thizanne>
and `fun` is a bit like `function`, except you can put several parameters (fun x y z -> ... is the shortcut for function x -> function y -> function z -> ...)
<thizanne>
(it's a keyword, so you can't have a function named `fun` as you did)
<mengu>
thank you thizanne
<mengu>
by the way, real world ocaml, is one of the best books that is ever written in the history of programming
<mengu>
i don't recall enjoying just reading a book this much
<cheater>
Leonidas octachron will that fix to Arg be in some future version of ocaml? or will i benefit from it if i'm on 4.03?
<octachron>
cheater: only in future versions I fear; at earliest 4.04.1, if there is a 4.04.1 version and the fix is backported, otherwise not before 4.05
<octachron>
(resource are too scarce to backport fixes to older version)
<companion_cube>
my, this talk about effects is really nice
<companion_cube>
lots of smarts in it
<companion_cube>
but small chances it will be merged imho
ollehar1 has joined #ocaml
<cheater>
octachron: that's fine
<cheater>
companion_cube: is this about Eff and the other stuff?
<companion_cube>
not about Eff, about typing the effects in OCaml
<companion_cube>
the effort eventually leading to multicore
<companion_cube>
(maybe)
<Leonidas>
mengu: yep, was also my opinion. I really like that it goes quite in depth as well without being boundlessly long like Programming Python.
<mengu>
Leonidas: i've been reading it for months and i'm only at chapter 18
<mengu>
but, i have enjoyed every bit of it
<mengu>
in fact, i made my team start reading it as well
<companion_cube>
a bit sad it teaches Core :p
<dmbaturin>
Drup: Got it. I needed to add [@@deriving yojson] to the bar Foo.t declaration (and export the ('a -> Yojson.Safe.json) -> 'a -> Yojson.Safe.json function of Foo.t in the module signature of course).
<Drup>
You can also just add the deriving annotation in the .mli
<Drup>
it will add the export
<dmbaturin>
Let me try.
<dmbaturin>
Yeah, that works. Cool.
<dmbaturin>
companion_cube: If you don't talk with your kids about Core, they will learn it on Jane Street. ;)
<companion_cube>
bah :]
<dmbaturin>
Anyway, that was the first ML book I read, and I filtered out the "coreness" just fine. Though I had to have someone tell me what Core is.
haesbaert has quit [Ping timeout: 256 seconds]
yomimono has joined #ocaml
haesbaert has joined #ocaml
<Leonidas>
companion_cube: I used to be annoyed by it as well, but Core presents a rather nice and coherent environment
freusque has quit [Ping timeout: 240 seconds]
<Leonidas>
Core is Base now
<companion_cube>
the sad thing is that then people arrive here and believe that everyone uses Core
<Leonidas>
I rather have that than people ragequit because the Stdlib is so incomplete.
<companion_cube>
:/
<companion_cube>
I'm not that far from ragequitting my stdlib PRs, tbh
freusque has joined #ocaml
<dmbaturin>
I'm still to see anyone ragequit C because stdlib is incomplete by the way. ;)
<companion_cube>
dmbaturin: heard of this small language called C++? ^^
RonnieHolm has joined #ocaml
<companion_cube>
gah, I'm going to be angry again
<Drup>
companion_cube: maybe you should redirect your effort towards having good iterators in "base" ?
<companion_cube>
yay
<companion_cube>
they already do though
<companion_cube>
or maybe I could merge containers into Base
<companion_cube>
but they probably have labels everywhere in there
<Drup>
the jst people claim to be more open towards external contribution in base than core
<companion_cube>
ah, really?
<Drup>
well, that's what they said
<Drup>
huum, it seems the git log is still composed of code dumps, though
<companion_cube>
-_-
<companion_cube>
yeah, it looks like it uses a lot of code generation, too
<cheater>
hey guys, does Lwt have a function like print that accepts %a? i'm kinda lost here.
<Drup>
yminsky: wasn't base supposed to switch its developement to be on github ?
<companion_cube>
cheater: I don't think it will work nicely, most printers will want Format anyway, which is blocking
<flux>
cheater, I don't know, but you can probably use Printf.ksprintf <insert lwt printing function here> "%a" ?
<Balod>
cheater: Lwt_io.printf ?
<cheater>
does Lwt_io.printf accept %a and pp_whatever functions?
<Drup>
gaaah, I need to rewrite that
kakadu has quit [Quit: Konversation terminated!]
Mercuria1Alchemi has quit [Remote host closed the connection]
<Drup>
aantron: please add that to the list of stuff where we need to break compat
kakadu has joined #ocaml
<Drup>
Lwt_io's format functions are broken
<cheater>
it's just that i have this project that does %a everywhere for the debugging info logging
<cheater>
but ...
<Drup>
cheater: Lwt_io's functions relies on Printf, not Format
<cheater>
there's no way to actually enable printing of debugging logging.
<cheater>
so,
<cheater>
i need to replace them with something that actually prints.
<companion_cube>
Drup: but it will not work with Format, anyway, will it? unless the IO functions perform a asprintf under the hood?
<Drup>
companion_cube: I have some ideas ...
<Drup>
would have to try
<companion_cube>
I'm tired of all this
<Drup>
cheater: in the meantime, `Format.kasprintf Lwt_io.print`
<cheater>
i'll try that, thanks :)
<cheater>
ok... i'm probably using it wrong? why am i getting a type error here? Format.kasprintf Lwt_io.printf "%s" "bar" >>= fun () ->
pierpa has joined #ocaml
<Drup>
print, not printf
<Drup>
companion_cube: I don't see iterators in base
MercurialAlchemi has joined #ocaml
<companion_cube>
really? facepalm
<Drup>
oh, there is sequence
<Drup>
nevermind
<companion_cube>
ah
ocp has quit [Quit: Leaving.]
<aantron>
Drup: could you be more specific and/or open an issue or write it on the wish list?
<Drup>
yes
<aantron>
chaeter: iirc %a works with Lwt_io.printf, but it is "weird" because Lwt_io.printf is like sprintf, not like printf or anything else
<aantron>
cheater*
<cheater>
Drup: ah! that was it
Guest82 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<cheater>
Drup: all those functions that are basically "print" with line noise before or after them... that makes me dizzy :))
<Drup>
companion_cube: you should still try to get your slightly-modified iterator in
<mfp>
flux: you're maybe actually allocating that fast, but if you're using something that creates custom blocks, it could be compacting a lot with very little allocation
<flux>
mfp, well I don't really have problems most of the time.. but sometime during say 12 hours the memory usage somewhat rapidly rises from 12 megabytes to 800 megabytes
<flux>
sometimes it drops back to 400 megabytes
<flux>
but sometimes it seems to OOM and get restarted
<flux>
and yes, I'm using custom blocks by using pulseaudio audio recording
<Drup>
flux: try spacetime ? :D
<flux>
(I assume as much at least)
<flux>
drup, I'm trying, but it takes a long time for RPi to switch ;)
<mfp>
if you see actual mem usage (and not only lots of time doing GC) it's actually allocating but the custom block issue could also be biting you at the same time
<flux>
of course I should try reproducing this on PC as well
<mfp>
1st thing would be to determine whether it's the OCaml or C's heap
<flux>
by dumping GC information in my main loop?
<mfp>
if it's on the C side you can have fragmentation + lots of custom blocks with associated C heap mem not being collected aggressively enough (the exact opposite of the problem I alluded to before)
<mfp>
yes, you definitely want the Gc stats
<mfp>
also the malloc stats, let me check how you could get them
<mfp>
yeah the 1st slope could be, but the sudden increase doesn't look so
<flux>
I guess I want to log used cpu time as well
<flux>
maybe it is stuck somewhere and a lot, lot of backlog comes
<mfp>
IIRC you could get the malloc stats somewhere in ExtUnix
<flux>
but I'm only reading data at 80 kilobytes per second
<flux>
4.03.0+statistical-memprof doesn't compile on RPi and 4.04.0+spacetime doesn't compile all my dependencies so I guess I'm back to dark ages ;)
<flux>
(I guess I still have the option to try 4.03.0+statistical-memprof on my desktop)
<flux>
I would need 4.03.0+statistical-memprof+fPIC actually, so I'll just postbone this later 8)
ryanartecona has joined #ocaml
<flux>
I think I'll just stab the most likely place and modify the pulseaudio bindings to keep track of the number of non-collected blocks
<mfp>
heh memleak hunting existed before spacetime :) I remember spending like 1 week to find a closure leak caused by a Lwt.choose [ x >> return bla; some_other_promise () ]
<flux>
actually the bindings return directly to a float array and don't deal with custom blocks at all
<mfp>
also fond memories (not!) of a memleak involving Lwt keys and async threads(promises)
<flux>
so that was fruitless :)
<yminsky>
companion_cube: I'm hopeful that Base will appeal to wider audience. It should solve the major technical objections that people have raised in the past: it builds fast, has no dependencies, produces smaller executables, and is fully portable.
yomimono has joined #ocaml
<yminsky>
And people can collaborate and contribute on github. Plus, it's better engineered and richer than any of the alternatives.
<yminsky>
The real release will land in February. I think it makes sense to reasses then. But I'm hopeful that it can become the stdlib that the community rallies around.
<companion_cube>
well, as long as it's not hosted on github, I certainly won't contribute :p
<Drup>
companion_cube: it's on github, but only via code dumps
<companion_cube>
if you want it to be the community's library, it really cannot be Janestreet's
<companion_cube>
Drup: which is not being on github
<Drup>
yminsky: you seriously underestimate the effect of not having a real open developements, I think
<companion_cube>
^
Guest82 has joined #ocaml
<companion_cube>
(also, the "better engineered" is somewhat subjective, I'd say)
<yminsky>
companion_cube: surely subjective. But I still think pretty clear.
<companion_cube>
I don't know, how is it better than containers?
<companion_cube>
;-)
<yminsky>
Drup: We'll see. Frankly, you two have been more concerned with this than anyone else I've interacted with. The majority care more about the technical issues than the details of how JS's contributions to Base arrive on Github.
<companion_cube>
but we're talking about how OTHER PEOPLE's contributions would arrive in base
<Drup>
yminsky: I'm not the only one
<companion_cube>
if only JST contributes to base, it's not the community's library
<Drup>
(numerous people expressed similar concerns, they just kinda gave up of ever having anything else from jst, which is a bit jarring by itself, honestly)
<yminsky>
Drup: No. But there are many who have quite the opposite view.
<zozozo>
yminsky: I agree with companion_cube and Drup about open developement, ^^
<yminsky>
I guess we'll see over time what happens with uptake and contributions. We're going to try to make the process welcoming to external contributors, and make the quality of the result very high.
<companion_cube>
gah, "external contributors"
<yminsky>
As I said, the code is open source, and GPRs are accepted. The only issue we're talking about is that Jane Street has its own separate process for making changes that's more integrated with our internal flow.
<companion_cube>
it's fine open sourcing your libraries, but don't hope to call them "the community's library" if you're still the only ones in charge
<companion_cube>
I'd rather contribute to batteries again
<yminsky>
INRIA is in charge of OCaml, and yet it is used and accepted by a broader community.
<companion_cube>
well they're the official OCaml maintainers, what do you expect
<yminsky>
They even have a private mailing list that very few people have access to.
<yminsky>
Some language communities have significantly more open processes than OCaml did (and does, even though it's gotten more open.)
<yminsky>
and yet I'm happy to use OCaml.
<companion_cube>
except the stdlib
<companion_cube>
see how this goes ;-)
<Drup>
yminsky: and yet, the number of external contribution has increased significantly since the move to github and a (slightly) more open developement model
<yminsky>
Look, I think you're pretty dug in, so perhaps there's not much point in arguing.
<companion_cube>
yes, indeed
<companion_cube>
can you at least look at my PR so that we have some interoperability?
<companion_cube>
because I don't believe there will be any One True Stdlib any time soon
<companion_cube>
so it would be nice if the various choices could at least communicate better
regnat[m] has quit [Remote host closed the connection]
diamaths[m] has quit [Remote host closed the connection]
M-jimt has quit [Remote host closed the connection]
matth[m] has quit [Write error: Connection reset by peer]
dfeldman[m] has quit [Write error: Connection reset by peer]
M-pesterhazy has quit [Write error: Connection reset by peer]
M-Illandan has quit [Write error: Connection reset by peer]
M-martinklepsch has quit [Remote host closed the connection]
XC[m] has quit [Remote host closed the connection]
srenatus[m] has quit [Read error: Connection reset by peer]
timclassic has quit [Write error: Connection reset by peer]
ktosiek[m] has quit [Write error: Connection reset by peer]
regnt[m] has quit [Write error: Connection reset by peer]
na9da[m] has quit [Write error: Broken pipe]
Guest23668[m] has quit [Write error: Connection reset by peer]
barkmadley[m] has quit [Write error: Connection reset by peer]
lpw25[m] has quit [Write error: Broken pipe]
M-ErkkiSeppl has quit [Write error: Broken pipe]
aspiwack[m] has quit [Write error: Broken pipe]
Bluddy[m] has quit [Write error: Connection reset by peer]
<flux>
reading the iterator pr I'm amazed how it indeed in the end seems to go into a good direction ;-) (I like functional iterators, much fewer surprises.)
<yminsky>
I'm not sure how to help. I don't really have an opinion on the technical merits of this or that representation of sequence types.
<yminsky>
My sense is that this question is just not ready to be settled. Too much flux with Flambda and algebraic effects.
RonnieHolm has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"]
copy` has joined #ocaml
<companion_cube>
just a comment saying "this would be nice" or "this sucks", I don't know
<companion_cube>
Gah, why should we wait for something that might only happen in 10 years, if at all?
manizzle has quit [Ping timeout: 248 seconds]
<yminsky>
You've gotten 137 responses, involving diml (who is the primary maintainer of Base). I'm not sure what my voice adds here. Surely it would be nice to have an agreed upon standard. But people need to actually agree for that, and I'm not sure I can help make that happen.
<companion_cube>
and algebraic effects, despite what Daniel says, have not much to do with the matter imho
<companion_cube>
well, everyone but Daniel seems to be ok
xorpse has quit [Ping timeout: 240 seconds]
<yminsky>
It's not obvious to me either way. I really don't know the details that well.
<companion_cube>
:/
<companion_cube>
(I won't ask your opinion on my other PR, which is only relevant to stdlib users)
<companion_cube>
thanks anyway
<larhat>
companion_cube: what pr you're talking about, btw?
<yminsky>
I can introduce you to the people who work on Sequence at Jane Street, though Jake appears to be already deeply involved in the conversation.
<flux>
I think the current suggestion also lends itself nicely to cases when one would need to provide bidirectional iterators, or random access ones
<flux>
or am I wrong in liking how C++ has all those.. ;)
<dmbaturin>
yminsky: Will the new RWO use Base, by the way?
<flux>
(they would of course be separate, but with almost the same interface)
<flux>
in fact, if step were an open type, would it work out of the box?-o (but more slowly?)
<flux>
((oh, and more dynamically breakable way))
<companion_cube>
yminsky: no need, we've been discussing iterators for a while, I think
<companion_cube>
it's a politics issue, not a technical one
<companion_cube>
whatever Daniel says
<yminsky>
dmbaturin: Yes, we're working on getting RWO refreshed, and the refresh will use Base, primarily.
<dmbaturin>
Yeah, I've heard you are working on a new edition, that's why I ask. Definitely looking forward to it.
slash^ has joined #ocaml
dfeldman[m] has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
<flux>
it would be pretty nice if the iterator also would work with monads. and wouldn't it deal with blocking IO nicely as well out of the box? and errors could be embedded in the enumerated type via type result or via throwing exceptions while stepping?
<companion_cube>
I think 'a m Iter.t could do the trick
<companion_cube>
hmmm
<companion_cube>
anyway, it's far too complicated to have one type parametrized by a monad
<companion_cube>
not to speak of the horrible performance impact
<flux>
those are very hand-wavy arguments ;-)
<companion_cube>
:p
<companion_cube>
(and again, as said in the PR: IO iterators are totally different, they require error AND resource handling)
<companion_cube>
of course, effects make it possible to remove the monad part
lucybun has quit [Quit: lucybun]
hcarty has joined #ocaml
<hcarty>
aantron: Is the deprecation of Lwt_result based on the discussion around the Lwt_opt(ion) PR?
MercurialAlchemi has quit [Ping timeout: 260 seconds]
<companion_cube>
o/ hcarty
<hcarty>
aantron: The module is marked as deprecated but not mentioned in the 3.0.0 tracking issue
<hcarty>
companion_cube: \o
<aantron>
hcarty: yeah, but i released initially as deprecated due to reconsideration since 2.6.0, and never linked it from the manual index. should probably add a link to the PR at least. this deprecation message is before the 2.7.0 style
<hcarty>
Sounds good
octachron has quit [Quit: Page closed]
ryanartecona has quit [Quit: ryanartecona]
trepta has joined #ocaml
AltGr has left #ocaml [#ocaml]
migraine has joined #ocaml
<migraine>
Someone use opam?
<aantron>
everyone i think :)
<migraine>
I novice on it, so, how to compile installed package?
<aantron>
except maybe a few people here using npm as well :)
<aantron>
migraine: if it's installed, it has already been compiled. what do you mean more precisely?
Guest82 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
snhmib has quit [Ping timeout: 258 seconds]
<aantron>
looking at its opam file, you should have a liquidsoap binary you can run if you installed the package (opam install liquidsoap)
<aantron>
is it missing?
<migraine>
Yes, i installed itю
<migraine>
Oh wait
<migraine>
aantron: [ERROR] No package named luquidsoap found.
<migraine>
but i have all packages in .ocaml/packages
<aantron>
well it's liquidsoap not luquidsoap :)
<migraine>
aantron: tell me what to do, coz i totaly not understand wtf
<aantron>
well either you typed the error in wrong to me
<aantron>
or you typed the package name in wrong
<aantron>
aantron: [ERROR] No package named >>luquidsoap<< found.
<aantron>
so clarify and we proceed..
<migraine>
aww
<migraine>
lol
<migraine>
sry
<aantron>
:p
<migraine>
[NOTE] Package liquidsoap is already installed (current version is 1.2.1).
<aantron>
ok now you should have a binary called liquidsoap that you can run from the terminal. do you?
<aantron>
what happens when you execute "liquidsoap"?
<migraine>
liquidsoap
<migraine>
bash: liquidsoap: command not found
<migraine>
Thats why ask.
<aantron>
what if you execute `opam config var bin`/liquidsoap?
<aantron>
you might have to do "eval `opam config env`", then try just "liquidsoap"
<migraine>
`opam config var bin`/liquidsoap
<migraine>
No output defined, nothing to do.
<aantron>
looks like it's working
<aantron>
whats happening here is that opam has its own bin/ directory for binaries, and that needs to be added to your PATH, using that eval command
snhmib has joined #ocaml
<aantron>
if you said yes to opam modifying your dotfiles when running opam init, opam also inserted a script to do this on shell login
<migraine>
yeah
<aantron>
but you would have had to restart your shell since installing opam in order to get that effect and avoid having to use opam config env
<migraine>
How i must update env?
<migraine>
I reloged twice
<aantron>
did you try the command i sent? eval `opam config env`
<aantron>
after that you should be able to run liquidsoap without the prefix
<migraine>
yes, i try this command
<migraine>
and reloged
<migraine>
nothing
migraine has quit [Quit: migraine]
migraine has joined #ocaml
<migraine>
woops
<migraine>
Oh, ok.
<migraine>
aantron: now i see what i do wrong, ty so much.
<aantron>
ok. care to tell us for our education? :)
infinity0 has quit [Ping timeout: 258 seconds]
<justin_smith>
I'm looking for recommendations for well written OCaml codebases that I can read
<justin_smith>
I'm relearning OCaml after using another language at work for many years now, and I think it would help to see how "good code" in OCaml usually looks
<migraine>
wait
<migraine>
aantron: if i add eval `opam config env` to .bashrc it will be ok?
<Drup>
justin_smith: which topic are you interested it ?
<aantron>
migraine: just try it. and tell us. i have something slightly different in my .zshrc, it was added by OPAM automatically
<migraine>
aantron: yes, if i use "eval `opam config env`" i can run liquidsoap
<aantron>
ok :)
<migraine>
directly from shell
<migraine>
$ liquidsoap
<migraine>
No output defined, nothing to do.
gustav___ has quit [Ping timeout: 240 seconds]
<justin_smith>
Drup: I want to see how nontrivial problems are solved in OCaml codebases - I can write in any language as if it were C or Lisp, but that gets clumsy and I get into a "don't know what I don't know" situation - I want to read code that's using what OCaml has to offer so I get a hint of what good code should look like
infinity0 has joined #ocaml
<Drup>
justin_smith: the thing is that "good code" depends a lot of the kind of things you are doing. Sometimes it's good to be clever, sometimes it's not. Also, it's always better to read code in a topic you are interested in, hence the question
<justin_smith>
Drup: DSP, client/server, process management, number crunching
migraine has quit [Quit: migraine]
<Drup>
Huh, that's difficult, there aren't even many ocaml libs in that area
ryanartecona has joined #ocaml
<Drup>
I personally like companion_cube and bunzli's programming style, ctype might be of interest too
<Drup>
(ctype's internals are not exactly idiomatic, though)
infinity0 has quit [Remote host closed the connection]
<Drup>
companion_cube: we should start an "awesome ocaml to read" list
jao has joined #ocaml
<justin_smith>
that would be really cool
jnavila has joined #ocaml
<justin_smith>
possible side effect: people trying to write high quality code in order to show up on the list
infinity0 has joined #ocaml
<Drup>
Yeah, I doubt that
infinity0 has quit [Remote host closed the connection]
<Drup>
:D
infinity0 has joined #ocaml
<dmbaturin>
The opinion regarding what constitutes good OCaml apparently changed quite a lot over time by the way. 90's CAML code is often "pascal with ADTs".
NJBS has joined #ocaml
<Drup>
dmbaturin: the programming style of the stdlib is a good example of this :D
<dmbaturin>
Not that a pascal with ADTs is an inherently bad thing.
<Drup>
well, OCaml is a very good imperative programming
<Drup>
language
sh0t has quit [Read error: Connection reset by peer]
<dmbaturin>
Drup: I wonder if we should come togehther and produce a modernized version of OCaml UNIX programming book.
<Drup>
lol, no, I don't have time
sh0t has joined #ocaml
<justin_smith>
dmbaturin: that's a good description of what I've been writing - basically C plus type inference plus gc, tuples, and destructuring
<dmbaturin>
Well, "we" as in generic "we". If everyone rewrites one example it should be doable. :)
<justin_smith>
Drup: cool - I've been using Clojure where things get very elegant, and maybe I'm doing it wrong and maybe I just have to get used to things being a bit more repetitive and redundant
<justin_smith>
dmbaturin: that looks awesome, thanks
<justin_smith>
basically this is the stuff that Clojure is poorly suited for, so I'm relearning my old friend OCaml
<dmbaturin>
Clojure has best support for immutable data among all languages with too much parens. :)
<Drup>
number crunching is not well represented in OCaml, unfortunatly
<justin_smith>
oh, that's sad to hear
<justin_smith>
is there another ML that's well suited, without having to reach for rust or haskell or something?
<Algebr>
well we have oml for number stuff
infinity0 has quit [Remote host closed the connection]
<Leonidas>
justin_smith: I kinda like my style though I think most people would just roll their eyes in how I abuse ocaml operators :p
MercurialAlchemi has joined #ocaml
<justin_smith>
haha
<Leonidas>
then again my day job is clojure so evertyhing is ->>-fied
<Leonidas>
justin_smith: I'd also recomment pqwy's code
<Leonidas>
like notty, which has a damn cool demo application
<dmbaturin>
I hate my style, but then again, I hate myself in general. ;)
<Leonidas>
the latter is a prerequisite for cameling ;)
<aantron>
very true
<justin_smith>
Leonidas: if the code is at least 1/10th as good as this demo gif, I'm sold
octachron has joined #ocaml
<hcarty>
justin_smith: Number crunching definitely happens in OCaml. I think most of it is behind closed doors though.
<justin_smith>
hcarty: kind of makes sense, I'd assume it's neccessary for the big money applications, but that won't be open source for obvious reasons
<Algebr>
dmbaturin: Leonidas aantron c'mon now.
<Leonidas>
I s'pose Ahrefs might do some number crunching in OCaml, but they do seem to use C++ and maybe Rust.
<dmbaturin>
justin_smith: Speaking of number crunching, there's FFTW that uses ocaml for its intended purpose and generates C implementations of Fourier transforms with it. :)
<Drup>
yeah, they use rust, at least according to what Enjolras is saying
<hcarty>
justin_smith: I did a lot of weather and GIS data wrangling in school and at a previous job using OCaml. It's nice for that kind of thing - not nearly the library support that Python has, but sooo much better to maintain over time
<jerith>
I write OCaml because I don't hate myself.
<jerith>
If I hated myself I'd go back to writing Java and Ruby for a living.
<companion_cube>
slap looks very nice
ygrek has joined #ocaml
<jerith>
(The code I write at work is usually Python, but I spend far more of my time fighting with docker and figuring out how to get persistence in my containers.)
<dmbaturin>
What's the issue with persistence in docker? Don't you just mount a dir into the LXC container in the end?
<jerith>
dmbaturin: Sure, if everything's running on one machine.
<dmbaturin>
If not, what's wrong with using NFS, or another remote filesystem of choice?
<jerith>
If you have a cluster with dozens of worker machines, the story is more complicated.
<jerith>
It's more complicated still when some of the data is subject to privacy laws in various jurisdictions, etc.
<jerith>
So we end up running our services on unreliable hardware in countries with poor network and electricity infrastructure.
<Leonidas>
So, the US?
<dmbaturin>
Well, I guess I don't know nearly enough about your domain and setup to not look like an idiot. :)
<jerith>
See "privacy laws" above. :-P
<Leonidas>
(scnr)
<dmbaturin>
Leonidas: The US got privacy laws? ;)
<Leonidas>
touche
<jerith>
Nigeria, Uganda, places like that.
<Leonidas>
but yeah, it sounds like the main issue is the administration :)
<Leonidas>
(of machines, not countries)
<jerith>
Not all of them have privacy laws, but we care about the people using these sytems so we prefer to comply with the strictest requirements of the various places we operate in.
<Drup>
that's very admirable
<Leonidas>
we tried using EU-only cloud services once
<Leonidas>
turns out: there are not many and they sometimes move over into the US
<Drup>
(I mean it, a lot of multinational's reaction to the issue is "lol fuck off"
<dmbaturin>
I guess services like to move to the US precisely due to lax privacy laws...
<jerith>
The main issue (for me, at least) is building an environment that's resilient to failure for our applications to run in.
<Leonidas>
dmbaturin: partly this and the other part is sweet, sweet VC money
<jerith>
My employer is a kind-of-nonprofit building tech solutions for, among other things, national-scale heath services.
<reynir>
sounds interesting
<dmbaturin>
To be fair, if I were to make a service, I would think twice where to host it too. Quite often it's not just what will happen to you if the data leaks, it's that you are required to comply with completely arbitrary requirements that will limit your choice of software, languages etc.
<Leonidas>
was it the obamacare website that failed specatularly on launch?
_andre has quit [Quit: leaving]
<jerith>
Leonidas: Nope. We do stuff mostly in Africa and places south and east of there.
<jerith>
Our stuff doesn't fail spectacularly on launch. ;-)
<companion_cube>
it fails silently on launch? ^^
<jerith>
(It tends to fail several weeks later when the hosting provider screws up a system update or something.)
<jerith>
One of the best things about this job is that I can legitimately tell people that I save babies for a living.
<reynir>
heheh
<jerith>
(Through several layers of abstraction, but still.)
<Drup>
:D
<jerith>
And sometime soon I'll hopefully have some OCaml code "in production".
<reynir>
I steal money from people (tax authorities is a customer of ... a customer)
<reynir>
:(
<jerith>
Working for governments is the worst.
<dmbaturin>
reynir: You can give part of your stolen money to the poor, it's the canonical method to increase popularity and even romanticize your image.
yomimono has quit [Quit: Leaving]
cyraxjoe has quit [Remote host closed the connection]
<Leonidas>
jerith: your work sounds impactful, that's cool
smondet has joined #ocaml
def`_ has joined #ocaml
def`_ has quit [Client Quit]
def`_ has joined #ocaml
def` has quit [Quit: rosebud]
def`_ has quit [Client Quit]
def` has joined #ocaml
<smondet>
Drup: I'm trying the Eliom 6 eliom-distillery thing, trying to build the mobile app, but `npm` is driving me nuts, do you know if there is a docker container with all the stuff needed for ocsigen-start?
jnavila has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
<companion_cube>
the joy of webdev
<Algebr>
pffff
<companion_cube>
compared to the utter bliss of contributing to the stdlib
jlongster has joined #ocaml
jlongster has quit [Client Quit]
<jerith>
npm is just horrible.
<jerith>
Or rather, it was just horrible when I last used it about a year ago.
ryanartecona has quit [Quit: ryanartecona]
<jerith>
These days all package manager things make me sad because I keep comparing them to opam.
<Algebr>
opam sucks to npm in one way
<Algebr>
STILL no local opam_modules equivalent
<companion_cube>
smondet: maybe yarn can help?
<jerith>
I just make an aliased switch for each project.
<jerith>
(Kind of like what I do for virtualenvs in python.)
<smondet>
Algebr: what's the missing feature?
<Algebr>
jerith: I end up sometimes doing this as well
<smondet>
companion_cube: ha :D
<companion_cube>
:p
<Algebr>
npm installs locally by default, opam installs globally
<reynir>
Algebr: I think I heard opam 2 will have that
<Algebr>
supposedly
<smondet>
Algebr: by locally you in the project directory like Maven? (basically export OPAMROOT=$PWD/localopam)
<smondet>
*you mean
<Algebr>
haven't used maven but I want opam to be like npm in this respect
<companion_cube>
or like cargo
<companion_cube>
please make it like cargo
<companion_cube>
(i.e. with a lockfile)
<jerith>
Doing what npm does makes it tricky to have switches for multiple ocaml versions.
<jerith>
For when I want to check that my code compiles properly with 4.02 and 4.03, for example.
cyraxjoe has joined #ocaml
<Algebr>
given an AST of a program, is it possible to dead code eliminate things at that stage?
<Algebr>
say of a JS AST
<Drup>
smondet: I can't help you with anything related to ocsigen-start
<Drup>
make a bug report
<companion_cube>
I wonder, is there an atomic-write function somewhere (to write a file atomically by tmpfile;write;mv)?
<Drup>
I never implemented anything in it, I haven't looked at the API nor the implementation and I only compiled it once (and it was to debug eliom itself)
<companion_cube>
Algebr: use jsoo? :p
<companion_cube>
(otherwise, I think it's pretty hard in JS to know if some piece of code is never going to be needed)
<octachron>
Algebr, at the generic level, I would say no: take the ast of some spaghetti fortran code with a lot of goto
<Algebr>
right
<Drup>
Algebr: doesn't google closure compiled does all that ?
<Algebr>
yea, closure does it but looking for other options as well
<Drup>
it's the industry standard, why do you need more options ? I'm pretty sure it's packaged in all distributions
<jerith>
We're in #ocaml. Since when is "it's industry standard" convince us of anything? :-P
<jerith>
s/is/does/
apache3_ has joined #ocaml
apache3 has quit [Remote host closed the connection]
<Drup>
jerith: please don't make me depressed :(
<jerith>
If I wanted to make you depressed I'd explain all the ways docker's API is fundamentally broken. :-(
<jerith>
Hrm. Actually, maybe someone here knows a tool that could help me.
<Drup>
jerith: you can complain to the docker people in this channel :D
twold has left #ocaml [#ocaml]
<jerith>
Nah, the docker people who build broken APIs are the golang ones. :-P
<jerith>
Anyway, I have a "purely hypothetical" volume driver API that I need to interact with.
<jerith>
It calls me with "mount" and "unmount" commands, but the same volume may be mounted more than once.
<jerith>
I need to only unmount when the last thing using a volume is finished with it.
ltadeu has quit [Remote host closed the connection]
<jerith>
Refcounts won't work for various reasons, so I need to ask docker about all the things that might be using the volume before I unmount.
<jerith>
Doing this while docker is wating for me deadlocks.
<orbitz>
companion_cube: have you seen String.create errors in qcheck in 0.5.1?
<jerith>
I've come up with a mechanism that hopefully avoids races and deadlocks, but my mortal human brain is not capable of correctly reasoning about such things.
<companion_cube>
orbitz: I don't think so?!
<jerith>
So I want a tool that I can describe the problem to and have it tell me whether my solution is correct.
<orbitz>
companion_cube: I'm having trouble tracking it down
<orbitz>
companion_cube: in 0.5.1 I get Invalid_argument("String.create")
<orbitz>
I don't get it in 0.5
<orbitz>
Looking at the diff I don't see anything obvious...
<companion_cube>
might be in myocamlbuild
<orbitz>
companion_cube: what do you mean?
<companion_cube>
might be in the myocamlbuild file
<orbitz>
companion_cube: i don't see any diffs between myocamlbuild.ml betwee 0.5.1 and 0.5
<orbitz>
companion_cube: is it kosher to call String.length on bytes?
<orbitz>
Invalid_argument("String.create")
<orbitz>
Raised by primitive operation at file "src/QCheck.ml", line 213, characters 4-107
<companion_cube>
funny, one of my last repos not to have safe-string
<companion_cube>
thanks orbitz
<companion_cube>
can you wait a bit for the release?
<companion_cube>
the dev branch should fix the issue in the mean time
<orbitz>
companion_cube: yep, I can just pin to 0.5. Is the problem safestring?
<companion_cube>
well I suppose so
<companion_cube>
ah wait
<companion_cube>
maybe it's line 212, or sth
<orbitz>
I'm not quite getting why
<companion_cube>
what argument to you give to string_size?
ryanartecona has joined #ocaml
<companion_cube>
oh, I see
<companion_cube>
ahaha
<orbitz>
I'm not callign string_size in my test
<companion_cube>
amazing, I shot myself in the feet
<orbitz>
I amI do have a sized generator, though
<orbitz>
What's up?
<companion_cube>
I changed the behavior of small_int
<companion_cube>
:DDDD
<companion_cube>
stupid me
<orbitz>
hahah
<companion_cube>
it does make sense though
<orbitz>
it's making huge It's trying to make huge strings?
<orbitz>
Who quickchecks the quickcheckers?! :)
<companion_cube>
no, it's trying to make negative-length strings
<orbitz>
ah of course
<companion_cube>
actually I think I'm going to revert this change.
<companion_cube>
it's just too error-prone.
<orbitz>
sounds good to me
<orbitz>
thank you for holding on for the wild ride
infinity0 has quit [Ping timeout: 260 seconds]
<companion_cube>
well you did the work
<companion_cube>
thanks a lot
<orbitz>
cwhen will you release?
<orbitz>
I think this one repo I'm working on finds all the bugs for me. I have it always running tests against opam-repo HEAD
infinity0 has joined #ocaml
<orbitz>
companion_cube: night!
<companion_cube>
night!
<companion_cube>
thanks again
snhmib has joined #ocaml
tristero has joined #ocaml
infinity0 has quit [Remote host closed the connection]
octachron has quit [Quit: Leaving]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
tane has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
<shon>
I'm got an OCaml conundrum: I've switched to ocaml 4.03.0 using opam, and I even deleted the one other compiler I had isntalled (4.02.3), but when I try to run `ocaml setup.ml -configure` on a setup file made with oasis, it keeps looking for the older version, but erroring out because it cannot find these files: e.g., "~/.opam/4.02.3/bin/ocamlc.opt: No such file or directory"
<shon>
Has does this ring any bells for anyone?
<shon>
I've been trying to hunt down solutions or diagnosis for quit awhile, but haven't made any progress....
<shon>
s/Has does/Does
<smondet>
shon: I think oasis-based build systems have `make distclean` target (or ocaml setup.ml -distclean ?)
<smondet>
if not oasis keeps full paths in `setup.data` (AFAIR)
<shon>
Ah! Great lead. I'll check those things. (I'm pretty fresh to ocaml, and not well versed in build processes in general, so I may be missing obvious stuff)
jnavila has quit [Remote host closed the connection]
<shon>
Awesome, like a hot dog! Thanks smondet. That set me straight (well, that + uninstalling and reinstalling oasis). Finally I can stop this two day head banging session. Thanks!
<cheater>
you gotta clean, yeah
larhat has quit [Quit: Leaving.]
<reynir>
oh man, me and a coworker were trying to get something to build on an 'exotic' system. I copied my coworkers build dir to continue his efforts and ran make distclean and I learned that the build system used absolute paths :|
<shon>
So basically, I should clean out oasis anytime anything changs with a build?
<Drup>
no, mostly when you switch
<companion_cube>
when you switch, remove _build and setup.data
<companion_cube>
it should be enough
MercurialAlchemi has quit [Ping timeout: 240 seconds]
ryanartecona has joined #ocaml
wolfcore has quit [Ping timeout: 248 seconds]
sepp2k has quit [Read error: Connection reset by peer]
sepp2k has joined #ocaml
<nicoo>
reynir: Sounds not-nice
wolfcore has joined #ocaml
<shon>
Ah. Got it. That makes sense.
<shon>
Thank you!
<reynir>
It was very frustrating
<cheater>
Drup: thanks a lot for your help with the print stuff, that was really nice of you :)
<dmbaturin>
shon: My shortcut to purging all such data is git reset --hard and git clean -dfx (provided you have no uncommited or unstashed changes). :)
<shon>
dmbaturin: Makes sense! I had assumed it was a problem with my ocaml environment, and didn't realize I had just polluted the repo while fumbling around with setup stuff. I'll probably reach for this in similar cases in the future though.
<dmbaturin>
Well, that one issues took me some time to figure out first time I ran into it too.
<shon>
So it goes. There's one other hangup that I haven't been able to work out yet, which is utop not recognizing the lwt syntax extension.
<shon>
I have an .ocamlinit file that requires `lwt.ppx`, but it still complains about "Uninterpreted extension 'lwt'." because of the "let%lwt" syntax.
<shon>
Have you run into this at all dmbaturin? Or do you test out and develop your code in a way that doesn't require loading stuff into utop?
<dmbaturin>
shon: Did you #requite "lwt.ppx"?
<dmbaturin>
* require
<dmbaturin>
Wait, I missed that part. If you require it by hand in utop, does it change anything?
<shon>
Oh! Indeed it does. Perhaps I am missing some nuance of the .ocamlinit approach though it is working to require the other module dependencies, so this is quite strange to me. Now I only need to figure out how to make utop aware of the other modules in the directory, and I'll be on my way! :)
<dmbaturin>
Hhm, I've just added it to .ocamlinit (I don't normally have it there), and it worked for me. Did you add it before or after the topdirs line that opam adds?
moei has quit [Quit: Leaving...]
<shon>
Did you put it in you user .ocamlinit? I made a .ocamlinit for VyConf particularly, but maybe I should just keep adding to the one made by opam at ~/.ocamlinit? That I way I wouldn't have to specify the init file when I invoke, which would be handy. But don't you end up with your .ocamlinit full of long lists of packages from all kinds of different projects?
<dmbaturin>
shon: To be fair, most often in my stuff I just cd to _build/$subdir and load directly. The really good way to do things is to make it into an opam package and install it as a local pin.
<shon>
Nice. I'll try your approach. I have far too much to learn to be opinionated, and I've been spinning my wheels on slippery tooling for weeks, and am very eager to get coding! :D
<shon>
(to be fair, it could just be grasp/know-how that is slipery, not the tooling ;) )
<dmbaturin>
You may want to document your experience perhaps.
<dmbaturin>
It's been a while since I setup my ocaml environment for the first time, and I'm afraid there is no way to do it for the first time again, unless someone developed a selective memory erasing technology.
<dmbaturin>
(Though sometimes doing it on a completely clean OS can get very close)
Sorella has quit [Quit: Connection closed for inactivity]
freehck has quit [Ping timeout: 260 seconds]
jave has quit [Ping timeout: 240 seconds]
tane has quit [Quit: Leaving]
tmtwd has joined #ocaml
<lobo>
companion_cube: ist there an equivalent to List.nth in CCList? can't find it. List.nth from stdlib doesn't play nice with |>
<companion_cube>
CCList.Idx, iirc
<companion_cube>
aww, does not work well with |> either
<companion_cube>
sorry :/
<companion_cube>
time to use flip, I guess
<lobo>
companion_cube: np. thx :D i'm using a helper function for now. it just looks a bit akward. let list_nth i l = List.nth l i
<companion_cube>
yeah :/
jave has joined #ocaml
nomicflux has joined #ocaml
nomicflux has quit [Client Quit]
hunteriam has quit [Quit: Connection closed for inactivity]
nomicflux has joined #ocaml
sepp2k has quit [Quit: Leaving.]
<justin_smith>
replying to some scrollback convo about opam vs. maven vs. npm - one thing I like about maven is that a set of deps belongs to a project but a set of artifacts belongs to a cache, and by changing config in a project I can calculate new deps use different artifacts from the same shared cache. The cache is viable because version numbers are meaningful and the artifacts are immutable, and are not hard coded to one another.
<cheater>
hey guys, there's this thing i see in this code, it's like let () = printf "foo" in ...
<Drup>
well, it's seliopou_'s idea, really, this is just the barebone version
<cheater>
does this actually work? it was a bit screwy before i replaced it with normal stuff like >>= fun () ->
<Drup>
cheater: they can't both typecheck, anyway
Algebr has joined #ocaml
<cheater>
they can't?
<cheater>
they worked
<justin_smith>
cheater: yes, it's an idiom (maybe out of date?) for building a block structure at the top level - it should indicate to you that a bunch of things are going to happen for side effects and won't be creating a usable value
<justin_smith>
it's different from let _ = ... in that it will throw a type error if you try to return a value other than ()
<cheater>
i replaced let () = printf "foo" in (some lwt stuff) with Format.kasprintf Lwt_io.print "foo" >>= fun () -> (same lwt stuff)
<cheater>
both type checked
ryanartecona has quit [Quit: ryanartecona]
<cheater>
and it started printing at the right moment... or printing at all
<cheater>
but maybe that's due to, say, buffering?
<cheater>
just guessing
<Drup>
ah, yes, you added the other stuff
<Drup>
yes, probably buffering/flushing. You should add the flusing marker anyway ("@." for format)
al-damiri has quit [Quit: Connection closed for inactivity]
Algebr has quit [Ping timeout: 255 seconds]
infinity0 has quit [Ping timeout: 240 seconds]
<cheater>
f....flushing marker?
<cheater>
never heard of that
<cheater>
let me look it up
<Drup>
read the Format documentation
<Drup>
(near the end)
<cheater>
i tried
<cheater>
i failed
<Drup>
fair enough
kakadu has quit [Remote host closed the connection]
infinity0 has joined #ocaml
<cheater>
it's overwhelming :)
<cheater>
ok: @.: flush the pretty printer and split the line, as with print_newline ().