adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Current MOOC: https://huit.re/ocamlmooc | OCaml 4.04.0 release notes: http://ocaml.org/releases/4.04.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
snhmib has joined #ocaml
NJBS has quit [Read error: Connection reset by peer]
inr has quit [Read error: Connection reset by peer]
riveter has quit [Ping timeout: 240 seconds]
rcabaco has quit [Read error: Connection reset by peer]
rcabaco has joined #ocaml
flx has joined #ocaml
jcloud has quit [Ping timeout: 240 seconds]
ansiwen has quit [Quit: No Ping reply in 180 seconds.]
ggherdov has quit [Ping timeout: 240 seconds]
caw has quit [Ping timeout: 240 seconds]
menasw has quit [Read error: Connection reset by peer]
inr has joined #ocaml
menasw has joined #ocaml
nicoo has quit [Ping timeout: 240 seconds]
iZsh has quit [Ping timeout: 240 seconds]
ahf has quit [Ping timeout: 245 seconds]
andreypopp has quit [Ping timeout: 240 seconds]
lobo has quit [Ping timeout: 240 seconds]
ansiwen has joined #ocaml
DanielRichman has quit [Ping timeout: 240 seconds]
mattg has quit [Ping timeout: 240 seconds]
Khady has quit [Remote host closed the connection]
apache3 has joined #ocaml
apache3_ has quit [Ping timeout: 240 seconds]
ggherdov has joined #ocaml
Khady has joined #ocaml
Khady has joined #ocaml
Khady has quit [Changing host]
DanielRichman has joined #ocaml
flux has quit [Ping timeout: 240 seconds]
flx is now known as flux
caw has joined #ocaml
govg has quit [Ping timeout: 256 seconds]
riveter has joined #ocaml
ahf has joined #ocaml
iZsh has joined #ocaml
nicoo has joined #ocaml
mattg has joined #ocaml
lobo has joined #ocaml
hcarty has quit [Ping timeout: 252 seconds]
apache3 has quit [Remote host closed the connection]
apache3_ has joined #ocaml
nicoo has quit [Excess Flood]
nicoo has joined #ocaml
tmtwd has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
silver has quit [Quit: rakede]
snhmib has quit [Ping timeout: 258 seconds]
P4Titan has joined #ocaml
nomicflux has quit [Quit: nomicflux]
P4Titan` has joined #ocaml
<P4Titan`> Hi all
<Algebr``> hi
<P4Titan`> I am writing a simple server/client pair of programs using LWT
<P4Titan`> Now, LWT makes sense for the server in order to enable it to be multi-client
<P4Titan`> but for the client, having coroutines don't make sense
<P4Titan`> and even complicate things a little more since I may need to have a lock in a section
P4Titan has quit [Ping timeout: 240 seconds]
<P4Titan`> That said, LWT has a very nice `with_connection` function clearly meant to be used for client side code
<P4Titan`> What should I do about this? Any thoughts/recommendations?
wtetzner has quit [Remote host closed the connection]
nomicflux has joined #ocaml
bigs_ has joined #ocaml
nomicflux has quit [Ping timeout: 245 seconds]
<cheater> hey guys
<cheater> i need to be able to write to a data structure from two Lwt callbacks, without data races, how can i do that?
<cheater> i need something like a hash table of lists
<cheater> of maybe strings
<cheater> i guess i could use an mvar
al-damiri has quit [Quit: Connection closed for inactivity]
<aantron> cheater: if your writing code does not call back into lwt, you don't need to worry about data races, as that code will run to completion before lwt calls any other "callback"
<cheater> i'm not even sure if i should be using an mvar?
<aantron> but if that's not the case, there are options like lwt_mutex
<cheater> so what i have here is...
<cheater> let me type up the structure of this code
<aantron> ok
<aantron> what i am saying is if your data structure modifying code does not call back into lwt, there is no chance for anything else scheduled by lwt to interfere
<cheater> i basically have let rec loop () = Lwt.choose [ ... stuff ... ] >>= function (handle packet) worker_loop ()
<cheater> and i'd like the function handling the packets to be able to share data between the handlers for two packets coming in
<cheater> oh sorry that should have been..
<cheater> let rec loop () = Lwt.choose [ ... stuff ... ] >>= function (handle packet) loop ()
<cheater> right
<cheater> so anyways, why wouldn't i just create a simple list or something just before i define and launch loop, and just append and remove from that list inside the packet handler?
<cheater> should i use mutex and other stuff like that?
<aantron> i don't know, why not?
<aantron> cheater
<aantron> i just told you what the rule is
<aantron> please respond to that
<cheater> you have but i didn't understand what you said because i don't really know how lwt relates to the terms you used
<aantron> then ask for clarification
<aantron> because i dont know what you are missing or that you are missing
<cheater> so for example... is the packet handler code that calls back into lwt or not?
<aantron> it
<aantron> i don't know, it depends on how you wrote it
<aantron> basically if your data structure update does not use any functions from Lwt
wu_ng has joined #ocaml
<aantron> e.g.
<aantron> you are doing a List.iter over some mutable record list, and just updating the fields
<cheater> ok let me tell you what the packet handler does
<aantron> without calling any functions from lwt in the function you passed to .iter
wu_ng has quit [Read error: Connection reset by peer]
<aantron> then that whole List.iter cannot be "descheduled" by lwt
wu_ng has joined #ocaml
<aantron> that is by design
<aantron> so you don't have to protect it
<cheater> right because it's not cooperative
<aantron> so as long as you are interacting with your shared data structure in this way, you don't need to take any special measures
<cheater> aha
<cheater> that makes sense, thanks!
tmtwd has quit [Ping timeout: 256 seconds]
<cheater> ok, i guess i might need to call into lwt after all
<aantron> this is also easy to guarantee statically, if you wrap all the ways to mess with your data structure in a module, and that module has no Lwt.t in the interface (and does not abuse Lwt.async internally)
<cheater> because sometimes i'll need to send out network io
<aantron> (or starting lwt threads and ignoring them, etc.)
<cheater> aha
<cheater> that's pretty good then
<cheater> thank you
jcloud has joined #ocaml
<aantron> cheater: it might not be a problem as long as you are doing the io in between well-defined, independent interactions with that shared data. if that's not possible, then you might need lwt_mutex, lwt_condition, and/or other approaches
andreypopp has joined #ocaml
<aantron> ok :)
<cheater> lwt_condition?
<cheater> haven't seen that
<aantron> argh i used lwt "threads" :p
<aantron> just look in the manual :)
<aantron> though some problems that can be solved with Lwt_condition + Lwt_mutex are better solved with Lwt_stream
<cheater> yeah i've been reading it
<cheater> looks cool
<cheater> thanks
<cheater> yeah i think we're using streams here for some stuff
<cheater> but i think a mutex is better suited here
<cheater> because i can't really express my problem in terms of streams
Sorella has quit [Quit: Connection closed for inactivity]
Denommus has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
copy` has quit [Quit: Connection closed for inactivity]
mfp has quit [Ping timeout: 240 seconds]
apache3 has joined #ocaml
apache3_ has quit [Remote host closed the connection]
pierpa has quit [Ping timeout: 248 seconds]
ryanartecona has joined #ocaml
Guest26 has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
ryanartecona has quit [Quit: ryanartecona]
ryanartecona has joined #ocaml
maicki has joined #ocaml
hunteriam has joined #ocaml
Guest26 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
maicki has quit [Quit: Textual IRC Client: www.textualapp.com]
Guest26 has joined #ocaml
P4Titan` has quit [Remote host closed the connection]
hcarty has joined #ocaml
zv has quit [Quit: WeeChat 1.6]
Guest26 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Guest26 has joined #ocaml
MercurialAlchemi has joined #ocaml
Guest26 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
MercurialAlchemi has quit [Ping timeout: 240 seconds]
Guest26 has joined #ocaml
nonenone has joined #ocaml
demonimin has joined #ocaml
nonenone has quit [Client Quit]
Guest26 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
<Algebr``> I really dislike how let in an object class definition only goes off once
govg has joined #ocaml
ygrek has joined #ocaml
<flux> class foo () = let .. in object
MercurialAlchemi has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
ryanartecona has joined #ocaml
hcarty has quit [Ping timeout: 240 seconds]
nomicflux has joined #ocaml
<Algebr``> heh, but default arguments are evaluated each time
soultadu has joined #ocaml
hunteriam has quit [Quit: Connection closed for inactivity]
ocaml252 has joined #ocaml
nomicflux has quit [Quit: nomicflux]
<ocaml252> I have ported part of some Haskell code to OCaml http://pastebin.com/VFSw6SFL
<ocaml252> But I've a question there. Any advice ?
soultadu has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
alfredo has joined #ocaml
<flux> ocaml252, go ahead
jnavila has joined #ocaml
<ocaml252> Question in that link
<ocaml252> Question about code actually
<flux> what link?
ryanartecona has quit [Quit: ryanartecona]
<flux> it seems there's more to the haskell code
<flux> I have limited Haskell knowledge, but it looks like the gridzipper should be a parametrized type
<flux> as in the Haskell code there is GridZipper a <- a is a type variable
<flux> and I don't see 'left' defined in the haskell code
<flux> I understand 'case left' would be like 'match left' in OCaml
<ocaml252> Previous code before the Haskell function has those record types
<flux> the last line would be like | hd::tl -> Some ( focus = hd; left = tl; right = focus :: right }
<flux> except the first ( should have been {
<flux> hmm, ok so if 'left' is a record field, then in haskell 'left' should take the record as an argument to 'left', right?
<flux> but there is no argument in that code
<ocaml252> | hd::tl -> Some ( let newgridzipper = { g with focus = hd, left = tl, right = focus :: right })
<flux> should read case left g perhaps?
<ocaml252> Thought they were updating part of a record type.
<ocaml252> to move left
<flux> your "let newgridzipper = " does nothing as is invalid
<flux> statements of form let a = b are only legal in the top level
<flux> and the expression form "let a = b in c" only sets a = b in the expression c, not outside it
<ocaml252> | hd::tl -> let newgridzipper = { g with focus = hd, left = tl, right = focus :: right } in Some(newgridzipper)
<flux> ah now I notice the haskell code has this 'g { ..'. I don't quite know what that does. is that the haskell way to return a new record while sharing some old values? in that case your { g with .. } is correct
<flux> yes, that wold be proper
<flux> except for , need to be ;
<ocaml252> I guess so. It is the zipper pattern.
<flux> I think your code with that most recent change is on the right track
govg has quit [Quit: leaving]
<flux> I need to be moving, good luck with your zipper!
<flux> could have maybe started with a simpler zipper to get a hang of it?-)
<ocaml252> As I understand it is a list of lists. Thought can't be simpler.
<ocaml252> let newgridzipper = { g with focus = hd; left = tl; right = g.right @ [g.focus] } in Some(newgridzipper)
<ocaml252> Does g.focus at the end reflect the new value of focus or old ?
<ocaml252> focus = hd
myst|fon has joined #ocaml
AltGr has joined #ocaml
lambda_foo has quit [Quit: Connection closed for inactivity]
nkhodyunya has joined #ocaml
freusque has quit [Ping timeout: 240 seconds]
malc_ has joined #ocaml
mfp has joined #ocaml
AlexRussia has quit [Ping timeout: 248 seconds]
trepta has quit [Ping timeout: 240 seconds]
larhat has joined #ocaml
kakadu has joined #ocaml
mpenet has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
<Leonidas> ocaml252: in the haskell code? looks like it's the new head
<Leonidas> also the let in the ocaml code is ???
<Leonidas> also, containers has zippers, just sayin' ;-)
snhmib has joined #ocaml
mpenet has left #ocaml ["ERC (IRC client for Emacs 26.0.50.2)"]
<Leonidas> turns out .. is a GHC extension
silver has joined #ocaml
Guest26 has joined #ocaml
<ocaml252> Leonidas: Was away.
<ocaml252> What did you mean about hd ?
<ocaml252> let newgridzipper = { g with focus = hd; left = tl; right = g.right @ [g.focus] } in Some(newgridzipper)
<ocaml252> Does g.focus at the end the updated "g with focus = hd; "
ygrek has quit [Ping timeout: 240 seconds]
freusque has joined #ocaml
<ocaml252> http://pastebin.com/FMb2vYtR That is the code.
rcabaco has quit [Ping timeout: 248 seconds]
<lyxia> That's a lot of indentation
<ocaml252> Haven't really understood OCaml indentation.
<ocaml252> x and x' are just used to differentiate ?
<lyxia> It's two different variable names, like x and x1.
ltadeu has joined #ocaml
<bernardofpc> I'm getting .opam/4.03.0/lib/ocaml/libasmrun.a(custom.o): relocation R_X86_64_32 against symbol `caml_custom_table' can not be used when making a shared object; recompile with -fPIC
<bernardofpc> does anyone know how to recompile a switch with -fPIC ?
nkhodyunya has quit [Quit: Leaving.]
<bernardofpc> (google did not help me)
<flux> bernardofpc, I had the same issue, I switched to an opam switch with fPIC
<companion_cube> I think there is a special switch for fpic
<flux> bernardofpc, opam switch -a | grep PIC and choose one you want
<flux> I wonder what has changed in debian as my old switches (without fPIC) also broke
<bernardofpc> thanks
<flux> the number of opam switches does make me think that maybe parametrized switches would be cool.. :)
<bernardofpc> (that's rather horrible since no PIC switch appears on the main choices, and this seems to be required by ocmlfind/camlp4 ... not strange packages)
nkhodyunya has joined #ocaml
<flux> I wonder if fPIC will become the default at some point. I understand it costs some % of performance, though.
<flux> but I think the default should be working. there could be separate switches for -no-fPIC
<companion_cube> so this problem appeared recently for you? I never had that
<flux> after last debian upgrade, maybe, I noticed my ocaml environment doesn't produce executables anymore
<flux> switching to fPIC fixed it
<companion_cube> maybe just recompiling the switch would do? :?
<companion_cube> :/
<companion_cube> that's weird though
<flux> I'm not sure if I tried it, but the errors before the final linker error complained about missing fPIC
<flux> oh and the problem was with native binaries, not with ocamlc ones
<flux> here's the output btw: https://www.modeemi.fi/~flux/random/fPIC.txt
<companion_cube> eeek
<companion_cube> (have you submitted a bug report?)
<flux> no.. fixed.. works on my machine :)
<companion_cube> if "fixed" requires to use fpic, it's not really a fix, is it?
<flux> how is it not a fix?
<flux> seems like some other people have had the same issue as well, judging from the google of the first error
<companion_cube> well, ocamlopt should work without fpic too, should it not?
<flux> not sure, perhaps there's something in recent debian that requires fPIC
_andre has joined #ocaml
Guest26 has quit [Read error: Connection reset by peer]
infinity0 has quit [Ping timeout: 240 seconds]
infinity0 has joined #ocaml
dhil has quit [Quit: Quit]
<bernardofpc> opam: "tcgetattr" failed: Inappropriate ioctl for device -> :(
<bernardofpc> hum, xargs problem
<bernardofpc> opam -y to the rescue
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
rcabaco has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
dhil has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
sepp2k has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
freusque has quit [Quit: WeeChat 1.6]
silver has quit [Read error: Connection reset by peer]
silver has joined #ocaml
dhil has joined #ocaml
AlexRussia has joined #ocaml
freusque has joined #ocaml
hcarty has joined #ocaml
hcarty has quit [Ping timeout: 258 seconds]
nkhodyunya has quit [Quit: Leaving.]
<ocaml252> type grid = {gamegrid : cell list} How do I pattern match grid into hd :: tl ?
<ocaml252> I am able to match only like this. | {gamegrid = g}
<Drup> {gamegrid = h :: t}
<ocaml252> Oh!
<Drup> (or you just get rid of the record, because it's not very useful here
<ocaml252> Yes. But I learnt something new :-)
<Drup> indeed. It's nice to be able to nest patterns
freusque has quit [Ping timeout: 258 seconds]
<ocaml252> Didn't know such nested patterns existed.
sz0 has joined #ocaml
al-damiri has joined #ocaml
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
AlexRussia has quit [Read error: Connection reset by peer]
wtetzner has joined #ocaml
wu_ng has quit [Remote host closed the connection]
larhat has quit [Quit: Leaving.]
nkhodyunya has joined #ocaml
dhil has quit [Ping timeout: 258 seconds]
shinnya has joined #ocaml
rpip has quit [Ping timeout: 255 seconds]
govg has joined #ocaml
nkhodyunya has quit [Quit: Leaving.]
<ocaml252> let focuscell celllist n = let rec loop acc n l = match l,n with | hd :: tl,n when n > 0 -> loop (hd :: acc) (n - 1) tl | [],_ -> None | hd :: tl,0 -> Some (acc, hd, tl) in loop [] 0 celllist ;;
<ocaml252> _::_,1 is unmatched according to the error. Why ?
larhat has joined #ocaml
freusque has joined #ocaml
sh0t has quit [Ping timeout: 256 seconds]
wtetzner has quit [Remote host closed the connection]
ocaml252 has quit [Ping timeout: 260 seconds]
shinnya has quit [Ping timeout: 255 seconds]
theblatt1 is now known as theblatte
dhil has joined #ocaml
yurug has joined #ocaml
yurug has quit [Client Quit]
moei has quit [Quit: Leaving...]
nomicflux has joined #ocaml
govg has quit [Quit: leaving]
rgrinberg has joined #ocaml
snhmib has quit [Read error: Connection reset by peer]
copy` has joined #ocaml
chindy has joined #ocaml
sh0t has joined #ocaml
th5 has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
moei has joined #ocaml
nkhodyunya has joined #ocaml
snhmib has joined #ocaml
jimt has joined #ocaml
ryanartecona has joined #ocaml
orbifx-m has joined #ocaml
<orbifx-m> vbmithr: here?
hcarty has joined #ocaml
<reynir> exciting
larhat has quit [Quit: Leaving.]
<Drup> itshappening.gif
hcarty has quit [Ping timeout: 240 seconds]
<ltadeu> nice!
<theblatte> \ô/
<companion_cube> now for 2 years of fight on the PR
<companion_cube> :D
alfredo has quit [Quit: Textual IRC Client: www.textualapp.com]
<vbmithr> orbifx-m: yep
<vbmithr> (now yes)
<reynir> companion_cube: haha :(
<companion_cube> ahah
<Leonidas> aren't JST PRs autoapproved directly by the bot? :p
<companion_cube> ah, it's from JST itself? thought it was ocamllabs
<companion_cube> but yeah, maybe
<Leonidas> oh, true
smondet has joined #ocaml
octachron has joined #ocaml
_andre has quit [Quit: leaving]
MercurialAlchemi has joined #ocaml
mfp has quit [Ping timeout: 245 seconds]
<orbifx-m> vbmithr: what's the maturity of your implementation?
<vbmithr> I've used it successfully in prod
<vbmithr> Decoding real live trades / orderbook info on poloniex (large cryptocurrency exchange)
<vbmithr> I think it's fairly fast too (at least much more than the coq-extracted msgpack-ocaml)
<vbmithr> I haven't written benchmarks though.
<companion_cube> vbmithr: you work on cryptocurrencies?!
<vbmithr> a big word
<vbmithr> I played a bit with exchanges
<vbmithr> Well, actually, I do :)
<orbifx-m> vbmithr: and the advantage over the other one? the test example looks a bit convoluted
<companion_cube> all of them, just btc, just eth, ... ?
<vbmithr> companion_cube: I work on Tezos :)
<vbmithr> vbmithr: bytes support
<vbmithr> orbifx-m: ^
<vbmithr> and strings not implemented as list of chars
<companion_cube> ahah, tezos, ok
<companion_cube> you filthy OCaml programmer :p
<vbmithr> lol
<vbmithr> orbifx-m: also mine is ~300 lines, VS ~4000 coq extracted lines
<companion_cube> I suppose poloniex doesn't handle tezos yet? :)
<vbmithr> it's not out yet so
<companion_cube> I wonder, are there plan for formal verif yet?
yomimono has joined #ocaml
<orbifx-m> vbmithr: ok. are you planning to simplify or explain the interface a bit more?
jnavila has quit [Ping timeout: 240 seconds]
<reynir> o/ vbmithr
<reynir> (I hope to take a look at ocaml-websocket again soon heh)
nomicflux has quit [Quit: nomicflux]
mattg has quit [Ping timeout: 258 seconds]
andreypopp has quit [Ping timeout: 240 seconds]
larhat has joined #ocaml
nomicflux has joined #ocaml
slash^ has joined #ocaml
smondet has quit [Ping timeout: 255 seconds]
madroach has quit [Ping timeout: 256 seconds]
madroach has joined #ocaml
nomicflux has quit [Quit: nomicflux]
mattg has joined #ocaml
larhat has quit [Quit: Leaving.]
orbifx-m has quit [Remote host closed the connection]
<vbmithr> reynir: :)
<vbmithr> companion_cube: some apparently
<vbmithr> companion_cube: but there is not much activity around for now
kakadu has quit [Quit: Konversation terminated!]
mfp has joined #ocaml
hcarty has joined #ocaml
orbifx-m has joined #ocaml
lenticularmother has joined #ocaml
myst|fon has quit [Quit: Connection closed for inactivity]
<Algebr``> Anyone know if using an Abstract_tag protects a C pointer from being moved, or you have to use Custom tag?
jnavila has joined #ocaml
trepta has joined #ocaml
pierpa has joined #ocaml
dhil has quit [Ping timeout: 245 seconds]
yomimono has quit [Ping timeout: 240 seconds]
yomimono has joined #ocaml
<hcarty> Algebr``: The pointer itself or the thing it's pointing to? Warning: I'm not 100% sure in either case :-)
AltGr has left #ocaml [#ocaml]
Flerex has joined #ocaml
lenticularmother has quit [Read error: Connection reset by peer]
octachron has quit [Quit: Page closed]
orbifx-m has quit [Ping timeout: 248 seconds]
ygrek has joined #ocaml
kakadu has joined #ocaml
orbifx-m has joined #ocaml
orbifx-m has quit [Client Quit]
rgrinberg has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
nomicflux has joined #ocaml
nomicflux has quit [Client Quit]
voglerr has joined #ocaml
boojinks has joined #ocaml
andreypopp has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
sepp2k has quit [Quit: Leaving.]
boojinks has quit [Quit: Lost terminal]
Muzer has quit [Ping timeout: 240 seconds]
<def`> Algebr``: an ocaml block can always be moved. I don't know what you mean by C pointer.
ryanartecona has joined #ocaml
boojinks has joined #ocaml
chindy has quit [Quit: Leaving]
govg has joined #ocaml
AlexRussia has joined #ocaml
hyperboreean has joined #ocaml
hyperboreean has quit [Client Quit]
whirm has joined #ocaml
nomicflux has joined #ocaml
ltadeu has quit [Remote host closed the connection]
nomicflux has quit [Client Quit]
trepta has quit [Ping timeout: 252 seconds]
whirm has quit [Remote host closed the connection]
Muzer has joined #ocaml
Xadnem_ has joined #ocaml
Xadnem_ has quit [Client Quit]
<Algebr``> When do you want to use Abstract_tag over a Custom value?
nomicflux has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
nomicflux has quit [Client Quit]
iZsh has quit [Quit: ZNC - http://znc.in]
iZsh has joined #ocaml
rgrinberg has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
<orbitz> Ugh, bytes + ocamldebug do not mix
sz0 has quit [Quit: Connection closed for inactivity]
myst|fon has joined #ocaml
<def`> Algebr``: if you have no custom equality/comparison/hashing/marshalling functions
<Algebr``> Hmm, I was more interested in the GC aspect
<Algebr``> anything more besides one gives you a hook on collection ?
<Algebr``> def`:
<def`> no
<def`> If you want a value that is not moved, that doesn't exist in OCaml (I suggested the feature a few time informally, as it would help complex bindings, but it has not been considered yet :))
<flux> you can register a gc root, can't you?
<Algebr``> right
<def`> yes, so that it is moved.
<def`> but non moving values are not possible :o
octachron has joined #ocaml
<def`> the problem with gc root is that it keeps the value alive. You might want to manage liveness on OCaml side and yet be able to refer to the heap from C-side
<def`> (a simple recursion in a value used by a C-binding, e.g a closure in labgtk, is likely to cause a memory leak; it is possible to work around that, but it would be much easier with some support from GC)
octarin has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
Flerex has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<flux> it is too darn easy to make buggy C-bindings for OCaml
<flux> my program uses fftw3 and pulseaudio and there are some problems with it :)
soultadu has joined #ocaml
<def`> I don't know :).
<def`> The GC FFI is quite simple, but not well specified I feel.
cojy has joined #ocaml
soultadu has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
hcarty1 has joined #ocaml
hcarty has quit [Ping timeout: 240 seconds]
nkhodyunya has quit [Quit: Leaving.]
jnavila has quit [Remote host closed the connection]
ia0 has quit [Quit: reboot]
ia0 has joined #ocaml
<octachron> I didn't notice that the optional argument syntax is partially white space sensitive: "let f ?x= …" ≡ "let f ? x = … " but "let f ? x:y = …" ≠ "let f ?x:y = …"
<octachron> I wonder if there is a reason for this difference
<companion_cube> oh, I always write `let f ?(x=y)`
<octachron> companion_cube, which is also fine with a white space f ? (x=y)
<companion_cube> :D
<companion_cube> terrible
<octachron> given that it is only the less used form of optional argument that is whitespace sensitive, I would tend to infer an oversight
yomimono has quit [Ping timeout: 260 seconds]
octarin has quit [Quit: leaving]
boojinks has quit [Quit: byeeee]
larhat has joined #ocaml
larhat has quit [Ping timeout: 240 seconds]
th5 has quit [Remote host closed the connection]
<def`> what differs in the second case?
<cheater> is there a good set impl in ocaml with fast lookup?
<cheater> i was told i should be using a set based on a balanced tree.
<hcarty1> cheater: Is the stdlib's Set fast enough for you?
al-damiri has quit [Quit: Connection closed for inactivity]
<hcarty1> Rather, have you tested with the OCaml stdlib's sets?
<octachron> def`, the first is seen as "(f ? label):type_expr", eg "let f ? x:int = 0", the second as "f ?label:pattern", e.g " let f ?x:y = y "
<def`> ah. But it is the same with labelled arguments, no?
<cheater> hcarty1: i don't know. i haven't. i didn't know stdlib had sets.
<octachron> def`, ah you are right
hcarty1 is now known as hcarty
<cheater> yeah
<cheater> reading that right now haha
<hcarty> :-)
<cheater> The implementation uses balanced binary trees, and is therefore reasonably efficient: insertion and membership take time logarithmic in the size of the set
<cheater> should be fine
<cheater> :)
<cheater> thanks hcarty :)
<hcarty> Have fun!
jrslepak has quit [Remote host closed the connection]
jrslepak has joined #ocaml
rgrinberg has quit [Ping timeout: 256 seconds]
kakadu has quit [Remote host closed the connection]
octachron has quit [Quit: Leaving]
orbifx has joined #ocaml
<orbifx> I get a warning when building: findlib: [WARNING] Interface topdirs.cmi occurs in several directories: ...
<orbifx> and it says the two directories
<orbifx> compiler-libs and the directory above
<orbifx> In the past I was told to delete one, but which?
nomicflux has joined #ocaml
nomicflux has quit [Client Quit]
<orbifx> seems #ocaml is asleep
shinnya has joined #ocaml
sillyotter has joined #ocaml
sillyotter has quit [Client Quit]