mengu has quit [Remote host closed the connection]
larhat has joined #ocaml
ollehar has joined #ocaml
ghostpl_ has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 265 seconds]
dsheets has joined #ocaml
ghostpl_ has joined #ocaml
AltGr has left #ocaml [#ocaml]
Haudegen has joined #ocaml
elfring has joined #ocaml
reem has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
reem has quit [Ping timeout: 256 seconds]
reem has joined #ocaml
struktured has quit [Ping timeout: 256 seconds]
reem has quit [Remote host closed the connection]
<MercurialAlchemi>
flux: hmm
<MercurialAlchemi>
isn't that the very OO web framework thingie?
<MercurialAlchemi>
also, it's really quick to write 'fast' and 'concurrent', but it's more work to back up such claims with comprehensive benchmarks :)
<whitequark>
"match Unix.fork () with" lol
<whitequark>
it's garbage
<whitequark>
like, pretty much every single decision
<mrvn>
What's wrong with matching fork?
<whitequark>
nothing wrong with matching
<whitequark>
many things wrong with forking
<MercurialAlchemi>
well, yes and no
<MercurialAlchemi>
it depends when you fork
<whitequark>
every request, of course
<MercurialAlchemi>
yeah
<MercurialAlchemi>
"lightweight and fast"
<MercurialAlchemi>
:)
<mrvn>
I can probably handle the whole request before fork() comes back.
<MercurialAlchemi>
it doesn't seem to be using any async library either
<MercurialAlchemi>
ah well
<MercurialAlchemi>
let's say it's a proof of concept
<flux>
how about if it used ocaml threads?-o
<mrvn>
MercurialAlchemi: what async library do you want to use? libc/librt so you get 16 threads for IO?
<MercurialAlchemi>
lwt?
<mrvn>
MercurialAlchemi: that's non-blocking, not async
<whitequark>
lwt is an async library, of course
<MercurialAlchemi>
are you saying that lwt doesn't do asynchronous IO?
<mrvn>
I'm saying it uses non-blocking stuff underneath
<MercurialAlchemi>
I'm not talking about parallelism
<mrvn>
and that's realy all you need for sockets.
rgrinberg has joined #ocaml
<flux>
ocaml doesn't really have a great varietry of threading-related primitivies (ie. semaphores, queueing non-blocking queues, broadcast busses)
<flux>
all that business happens on the monadic libraries
<whitequark>
semaphores should probably just die
<flux>
what, semaphores are great!
_andre has joined #ocaml
<whitequark>
anyway there's ocaml-semaphore
<mrvn>
since ocaml doesn't interrupt you everything is pretty much atomic.
badon has quit [Disconnected by services]
badon_ has joined #ocaml
<whitequark>
wat?
<MercurialAlchemi>
flux: ocaml doesn't have great IO anything out of the box, either
<whitequark>
ocaml interrupts you every once in a while if you use threads
<whitequark>
second, you allocate a lot in ocaml anyway
<mrvn>
whitequark: It's how the GC works. can't be changed.
<flux>
that provides sysv semaphores, not semaphores you would typically use for inter-thread synchronization
<flux>
well, or that's atleast what the interface looks like :)
moei has quit [Quit: Leaving...]
<whitequark>
mrvn: bullshit. an implementation without GIL would not suffer from that, for example
<mrvn>
whitequark: Point is that you can do "incr foo" and that's going to be atomic.
<flux>
mrvn, have you tried that incr foo works also on the oc4mc branch?
rgrinberg has quit [Ping timeout: 255 seconds]
<mrvn>
whitequark: you have to replace the GC for that. Teach it about register contents.
<flux>
it is sort of annoying that it is almost safe, and then you have overhead of using mutexes to make it truly safe
<whitequark>
mrvn: i'm well aware.
<whitequark>
point is, this "atomicity" is not a guarantee that is provided by the language
<flux>
isn't ocaml specified by its implementation?-)
<whitequark>
by its manual, in my opinion
<whitequark>
everything that's not in the manual is subject to change without notice anyway
etehtsea has joined #ocaml
etehtsea has quit [Max SendQ exceeded]
etehtsea has joined #ocaml
etehtsea has quit [Max SendQ exceeded]
<mrvn>
It's like C. It has nothing to say about threads. That there actually is a thread module is more of an aftherthought thats completly undocumented behaviour.
<whitequark>
that's complete bullshit
<mrvn>
whitequark: then show me the place in the manual that declares a granteed behavour with threads.
<whitequark>
search for "happens-before", for example
<whitequark>
it gives you some very specific guarantees, such as "Thread.create funct arg creates a new thread of control, in which the function application funct arg is executed concurrently with the other threads of the program."
<whitequark>
and it does not give you other guarantees, such as atomicity.
<mrvn>
which describe the thread module but not how or if that changes the semantic of anything else.
<mrvn>
whitequark: that's what I said.
<whitequark>
"That there actually is a thread module is more of an aftherthought thats completly undocumented behaviour.
<whitequark>
"
<whitequark>
no, it's not undocumented.
<mrvn>
whitequark: you are misreading me. Yes, the Thread module is documented. The language though does not document it's semantic under the aspect of threads.
yomimono has quit [Ping timeout: 245 seconds]
<mrvn>
i.e. weather "incr foo" will always be atomic or not.
<whitequark>
um, yes
<mrvn>
so we all agree. lets get lunch.
<adrien_znc>
f00d!
antkong has joined #ocaml
mengu has joined #ocaml
seangrove has quit [Ping timeout: 240 seconds]
bjorkintosh has quit [Quit: Leaving]
rossberg has quit [Remote host closed the connection]
rossberg has joined #ocaml
avsm has joined #ocaml
pyon has left #ocaml ["work"]
Bhavya has quit [Quit: Leaving]
ontologiae_ has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
Haudegen has quit [Ping timeout: 264 seconds]
matason has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
Haudegen has joined #ocaml
jao has quit [Ping timeout: 256 seconds]
matason has quit [Ping timeout: 246 seconds]
octachron has joined #ocaml
yomimono has joined #ocaml
rgrinberg has joined #ocaml
Haudegen has quit [Ping timeout: 265 seconds]
yomimono has quit [Ping timeout: 264 seconds]
rgrinberg has quit [Ping timeout: 246 seconds]
Haudegen has joined #ocaml
johnelse is now known as johnel_away
johnel_away is now known as johnelse
mcclurmc_ has quit [Ping timeout: 246 seconds]
johnelse is now known as johnel_away
johnel_away has quit [Remote host closed the connection]
TheLemonMan has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
hilquias has quit [Ping timeout: 272 seconds]
matason has joined #ocaml
`eeks has joined #ocaml
Haudegen has joined #ocaml
monod has joined #ocaml
bjorkintosh has joined #ocaml
Haudegen has quit [Ping timeout: 244 seconds]
slash^ has joined #ocaml
fedjo has joined #ocaml
mengu has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
Kakadu has quit [Ping timeout: 246 seconds]
Kakadu has joined #ocaml
oscar_toro has joined #ocaml
mengu has joined #ocaml
Haudegen has quit [Ping timeout: 255 seconds]
rgrinberg has joined #ocaml
Haudegen has joined #ocaml
BitPuffin has joined #ocaml
monod has quit [Quit: Sto andando via]
rgrinberg has quit [Ping timeout: 244 seconds]
travisbrady has joined #ocaml
shinnya has joined #ocaml
antkong has quit [Quit: antkong]
steffo has joined #ocaml
AlexRussia has quit [Ping timeout: 256 seconds]
travisbrady has quit [Quit: travisbrady]
AlexRussia has joined #ocaml
pyon has joined #ocaml
Fullma has quit [Ping timeout: 244 seconds]
dsheets has quit [Ping timeout: 256 seconds]
voglerr3 has joined #ocaml
voglerr2 has quit [Ping timeout: 245 seconds]
robink has quit [Ping timeout: 245 seconds]
wting has quit [Ping timeout: 245 seconds]
wting has joined #ocaml
robink has joined #ocaml
ggole has joined #ocaml
jprakash has joined #ocaml
moei has joined #ocaml
Haudegen has quit [Remote host closed the connection]
Haudegen has joined #ocaml
tane has joined #ocaml
badkins has joined #ocaml
travisbrady has joined #ocaml
rgrinberg has joined #ocaml
jprakash has quit [Ping timeout: 265 seconds]
rgrinberg has quit [Ping timeout: 256 seconds]
oscar_toro has quit [Quit: Lost terminal]
jbalint has joined #ocaml
jbalint has joined #ocaml
mcc has joined #ocaml
Haudegen has quit [Ping timeout: 252 seconds]
mengu has quit [Remote host closed the connection]
mort___ has left #ocaml [#ocaml]
igstan has joined #ocaml
Guest31356 has joined #ocaml
gasche has quit [Remote host closed the connection]
Haudegen has joined #ocaml
gasche has joined #ocaml
TheLemonMan has quit [Quit: leaving]
moei has quit [Ping timeout: 250 seconds]
moei has joined #ocaml
igstan has quit [Quit: igstan]
Haudegen has quit [Ping timeout: 246 seconds]
johnelse has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
mengu has joined #ocaml
lordkryss has joined #ocaml
<haesbaert>
regarding ocaml, say I have two descriptors that I want to continually read from.
testcocoon has joined #ocaml
<flux>
haesbaert, sounds like you want to use Unix.select or Lwt
<haesbaert>
if I got this right I should do something like join (bind t1; bind t2)
<haesbaert>
flux: sorry sorry, I meant " regarding lwt "
dsheets has joined #ocaml
<haesbaert>
and then Lwt_main.run on the joined thread
Haudegen has joined #ocaml
<haesbaert>
now, suppose t2 gets some input and runs, does the scheduler continue to wait on events on t2 ?
<haesbaert>
from the docs, I'm guessing not, t2 terminates.
<haesbaert>
depends if SA_RESTART is set for the fd
<mfp>
you can get the signal used to mark OCaml threads for preemption during SSL_read
* mfp
checks
<haesbaert>
then the syscall gets restarted and you never see the signal
rgrinberg has joined #ocaml
<mfp>
haesbaert: AFAICS SA_RESTART is used nowhere in OCaml's runtime, lwt or ocaml-ssl
<mfp>
shouldn't ocaml-ssl handle it anyway, by retrying instead of raising Unix_error? Or maybe it should be done higher, in e.g. Lwt_ssl and other callers?
mengu has quit [Remote host closed the connection]
arj has quit [Quit: Leaving.]
rgrinberg has quit [Ping timeout: 252 seconds]
<mfp>
oh right, it's not even Unix_error _, it's Ssl.Read_error Error_syscall so you cannot handle it in the caller, it's got to be done by ocaml-ssl
<haesbaert>
I'm not sure it should retry, libraries that retry on EINTR are evil since you can never get back from them with a signal
<haesbaert>
can you reproduce the case ?
<mfp>
then the error reporting would be in need of some changes so that you can address EINTR higher
<haesbaert>
i.e send a signal while the applicatoin is blocked on a SSL_read
<mfp>
Lwt_ssl uses non-blocking sockets so it's a bit hard :/
<haesbaert>
AFAIC you can't get EINTR with nonblocking sockets
mcc has quit [Quit: This computer has gone to sleep]
<haesbaert>
but that is some behaviour that might not be uniform across unixes
<mfp>
actually, what I'm seeing is seemingly spurious Ssl.Read_error Ssl.Error_syscall and trying to figure out what could be doing that --- seems I'll have to patch ssl to get a look at errno
<tane>
mfp, use "strace"
<haesbaert>
you could try to look with fstat/strace
<mfp>
yes, good idea
<Drup>
hi mfp, still investigating the web stack I see :)
<mfp>
Drup: not in ocsigen-server actually, but if I do find something it would also benefit from it :)
<Drup>
in web stack, I meant the whole thing, ssl included :p
mcclurmc has quit [Remote host closed the connection]
<tane>
SomeDamnBody, >>= is usually the infix name for the "bind" function of the corresponding monad
<SomeDamnBody>
ergh
<SomeDamnBody>
I'm not experienced with monads...
<SomeDamnBody>
but what I was inferring was that
<SomeDamnBody>
the Cmdline.parse () function's returned result was being fed into bound start
<tane>
yes
<SomeDamnBody>
thought so... it's kind of hard
<tane>
look at the functions On_error.bind and On_error.(>>=)
<tane>
they're identical
<SomeDamnBody>
but I just am trying to figure out, from readbin.ml how to transform some bytes or a string into BIL
<tane>
if you look at the type you may infer what they do
<SomeDamnBody>
where is On_error?
<SomeDamnBody>
oh! >>= is an infix operator for bind
<tane>
line 2
MrScout has joined #ocaml
<SomeDamnBody>
tane, it's Or_error
<tane>
right :)
<SomeDamnBody>
I read On_error
travisbrady has quit [Quit: travisbrady]
<tane>
i wrote on_error, my mistake
<SomeDamnBody>
all is well
<SomeDamnBody>
Found it
<SomeDamnBody>
Insn.bil
<SomeDamnBody>
now I just need to figure out how to construct an Insn instance
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
ggole has quit []
avsm has quit [Quit: Leaving.]
monod has quit [Quit: Sto andando via]
Submarine has joined #ocaml
travisbrady has joined #ocaml
jleroux has joined #ocaml
Kakadu has quit [Quit: Page closed]
bjorkintosh has quit [Quit: Leaving]
nullcat has joined #ocaml
claudiuc has joined #ocaml
jleroux has quit [Ping timeout: 246 seconds]
mhi^ has joined #ocaml
dsheets_ has quit [Ping timeout: 245 seconds]
_whitelogger has joined #ocaml
travisbrady has quit [Quit: travisbrady]
ghostpl_ has joined #ocaml
travisbrady has joined #ocaml
oscar_toro has joined #ocaml
TheLemonMan has quit [Quit: leaving]
struktured has quit [Ping timeout: 255 seconds]
seangrove has joined #ocaml
<seangrove>
I'm writing a function to recursively remove all files/directories (the equivalent of rm -r), but wondering if there's a built-in function in the Unix namespace, or something similar
<seangrove>
Googling shows a bunch of custom functions
<kakadu>
maybe 'fileutils' library?
<kakadu>
I remmeber the one
<kakadu>
It is remrkable because many functions from there are buggy
<seangrove>
kakadu: Checking it out, thanks
<seangrove>
And you're saying that fileutils has a lot of buggy functions?
<tane>
haha
<kakadu>
the one mentioned in this channel was
ontologiae_ has quit [Ping timeout: 252 seconds]
rgrinberg has quit [Ping timeout: 245 seconds]
struktured has joined #ocaml
jprakash has quit [Ping timeout: 256 seconds]
laughing-octo-sh has joined #ocaml
dsheets has joined #ocaml
axiles has joined #ocaml
johnelse is now known as johnel_away
johnel_away is now known as johnelse
mort___ has quit [Quit: Leaving.]
_andre has quit [Quit: leaving]
yomimono has joined #ocaml
MrScout has quit [Remote host closed the connection]
MrScout has joined #ocaml
nullcat has quit [Read error: Connection reset by peer]
jprakash has joined #ocaml
rgrinberg has joined #ocaml
MooseAndCaml has joined #ocaml
<MooseAndCaml>
hi
rgrinberg has quit [Ping timeout: 256 seconds]
<MooseAndCaml>
does anyone here work with functions that extend lists to include previous elemets?
<seangrove>
Is there a preference for Sys.readdir vs Unix.readdir ?
<MooseAndCaml>
Sorry, rather - Something like List.map , with (fun last_elt x -> ) ,,,
nullcat has joined #ocaml
<Drup>
MooseAndCaml: you could write your own easily :)
<MooseAndCaml>
for sure. I was wondering if there was an abstraction people used for combinations of N prev, N next, Nacc and index folds
netABCs has joined #ocaml
<Drup>
for index fold, well, foldi
<Drup>
not sure what you mean for the rest
<haesbaert>
let opts = if not env.ipv4only then
<haesbaert>
AI_FAMILY PF_INET6 :: opts else opts
<haesbaert>
in
<haesbaert>
is there a better idiom for this ?
<haesbaert>
I'll have some others, it will look silly to do "else opts" for every line
<def`>
make a function cons_if?
<haesbaert>
ack, I was wondering if there wasn't something without making a func
<def`>
cons_if b1 v1 @ cons_if b2 v2 @ opts
<haesbaert>
@ = :: ?
<def`>
(or @@ I don't remember which one is for applicatiln)
<def`>
let (@@) f x = f x
<def`>
there is a def like that in stdlib, I am not sure of the exact name
<haesbaert>
lemese
<haesbaert>
Catenate two lists. Same function as the infix operator @. Not tail-recursive (length of the first argument). The @ operator is not tail-recursive either.
<Leonidas>
my code is basically just @@ and |> with some other things thrown in occasionally
<Leonidas>
(although I think @@ is a super-ugly name)
<mrvn>
@^@
travisbrady has quit [Quit: travisbrady]
<mrvn>
you can't set the stack pointer in C. You need at least some asm for that.
<mrvn>
ups
myyst has quit [Ping timeout: 256 seconds]
myyst has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 252 seconds]
majoh has quit [Quit: bam bam bam bam]
badkins has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
antkong has quit [Ping timeout: 264 seconds]
Guest42551 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
badkins has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
myyst has quit [Ping timeout: 265 seconds]
myyst has joined #ocaml
travisbrady has joined #ocaml
steffo has quit [Quit: steffo]
WraithM has quit [Quit: leaving]
ptc has joined #ocaml
ptc is now known as Guest29441
jprakash has quit [Ping timeout: 272 seconds]
Submarine has quit [Quit: Leaving]
kakadu has quit [Remote host closed the connection]
nullcat has quit [Read error: Connection reset by peer]
myyst has quit [Ping timeout: 265 seconds]
myyst has joined #ocaml
lnich has quit [Ping timeout: 246 seconds]
lnich has joined #ocaml
tane has quit [Quit: Verlassend]
matason has joined #ocaml
bytbox has quit [Remote host closed the connection]
AlexRussia has joined #ocaml
elfring has quit [Quit: Konversation terminated!]
nullcat has joined #ocaml
antkong has joined #ocaml
<SomeDamnBody>
How do I unsalt an instances so that I can get the type I want
<SomeDamnBody>
Error: This expression has type ('a, 'b) Insn.t
<SomeDamnBody>
but an expression was expected of type ins
<SomeDamnBody>
basically, Insn.t is of type insn
<SomeDamnBody>
... "expected of type insn**
<SomeDamnBody>
how do I get that to match?
<S11001001>
SomeDamnBody: is Insn.t abstract at the point of use?
<SomeDamnBody>
abstract?
<SomeDamnBody>
I don't think so
<SomeDamnBody>
it gets passed as an argument
<SomeDamnBody>
I'm trying to augment a particular function that was converting Insn into a string summary
<SomeDamnBody>
into a different string encoding using sexp to be printed
<SomeDamnBody>
so, I'm thinking... if it compiles the old way, with calls and all that to decode and use it or whatever... why does it fail on my use?
<SomeDamnBody>
Is there some matching abstract invocation of the function that I'm using?
<SomeDamnBody>
(is what I'm thinking, I know you probably wouldn't know)
<SomeDamnBody>
because right now, I'm going over this library that I'm pretty unfamiliar with and it's really hard to make sense of everything because several functions are repeated numerous times
<SomeDamnBody>
I opened up the library in toplevel and it shows it's type being appropriate
<SomeDamnBody>
so idk why it is wrong here...
<S11001001>
SomeDamnBody: in the Insn.mli file, is type t defined, or just listed as 'type t'?
<S11001001>
SomeDamnBody: (the mli, rather than the ml)
<SomeDamnBody>
it's actually declared as type t with bin_io, compare, sexp
nullcat has quit [Read error: Connection reset by peer]
<SomeDamnBody>
S11001001,
<S11001001>
SomeDamnBody: so I can't say for sure, but it is probably abstract then, and you aren't permitted to use that Insn.t ~ insn at this location.
<SomeDamnBody>
the documentation generated is really misleading then
<SomeDamnBody>
it says that the type of the function that i'm trying to use is:
averell has quit [Remote host closed the connection]
<whitequark>
`opam repository` ?
<nullcat>
oh my bad
<nullcat>
i added mirage-dev...
<S11001001>
SomeDamnBody: I mean, what command are you issuing to the toplevel to load this module where you are able to see the type t's concrete definition?
<nullcat>
thanks quark
<SomeDamnBody>
S11001001, the toplevel I'm using is a custom version that has the libraries preloaded
<SomeDamnBody>
Bap.Std.Insn.bil
<SomeDamnBody>
which is exactly the function I tried to resolve when I placed that exact value in to transform the value
netABCs has quit [Ping timeout: 255 seconds]
mcclurmc_ has quit [Ping timeout: 272 seconds]
mcclurmc has joined #ocaml
<S11001001>
SomeDamnBody: maybe your custom toplevel ignores signatures.
<SomeDamnBody>
how could it do that?
<SomeDamnBody>
ignores signatures?
<S11001001>
SomeDamnBody: every time it sees a .mli or 'sig', just sort of whistle and look nonchalant
<SomeDamnBody>
oh lol
<SomeDamnBody>
so a mli restricts the amount of info it sees
Simn has quit [Read error: Connection reset by peer]
<SomeDamnBody>
likely because the purpose in doing that was to increase modular
<SomeDamnBody>
modularity, but then you have to know how to compose interfaces and instances so that you can make such as strategy useful
<SomeDamnBody>
right?
<S11001001>
SomeDamnBody: that's what happens when you #use "file.ml" for example
<S11001001>
file.mli gets ignored
<SomeDamnBody>
oh ok
<S11001001>
SomeDamnBody: and yes, right.
reem has joined #ocaml
mjw56 has joined #ocaml
ghostpl_ has quit [Remote host closed the connection]
travisbrady has quit [Quit: travisbrady]
travisbrady has joined #ocaml
jwatzman|work has joined #ocaml
reem has quit [Remote host closed the connection]
<SomeDamnBody>
does opening a specific other module before using a particular exposed edition of the function that I want alter the behavior?