spew has quit [Quit: Connection closed for inactivity]
_whitelogger has joined #ocaml
pippijn has quit [*.net *.split]
pippijn has joined #ocaml
jao- has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
betux has quit [Ping timeout: 265 seconds]
jao has joined #ocaml
tormen has joined #ocaml
brettgilio has quit [Ping timeout: 245 seconds]
tormen_ has quit [Ping timeout: 248 seconds]
gravicappa has joined #ocaml
jao has quit [Ping timeout: 245 seconds]
ouestbil1ie has joined #ocaml
oni-on-ion has quit [Read error: Connection reset by peer]
narimiran has joined #ocaml
brettgil` has quit [Remote host closed the connection]
brettgilio has joined #ocaml
unyu has quit [Quit: Stupid Emacs.]
dborisog has joined #ocaml
unyu has joined #ocaml
keep_learning has joined #ocaml
gravicappa has quit [Ping timeout: 265 seconds]
sarna has joined #ocaml
sarna has left #ocaml [#ocaml]
brettgilio has quit [Quit: Quit]
Serpent7776 has joined #ocaml
Haudegen has joined #ocaml
vesper11 has quit [Ping timeout: 265 seconds]
vesper11 has joined #ocaml
ouestbil1ie has quit [Remote host closed the connection]
brettgilio has joined #ocaml
Serpent7776 has quit [Remote host closed the connection]
Serpent7776 has joined #ocaml
betux has joined #ocaml
luna_is_here has joined #ocaml
andreas303 has quit [Remote host closed the connection]
andreas303 has joined #ocaml
bartholin has quit [Remote host closed the connection]
gravicappa has joined #ocaml
jaar_ has joined #ocaml
jao has joined #ocaml
gravicappa has quit [Ping timeout: 268 seconds]
ygrek has joined #ocaml
kakadu_ has joined #ocaml
kakadu has quit [Ping timeout: 265 seconds]
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
kakadu has joined #ocaml
kakadu_ has quit [Ping timeout: 265 seconds]
kakadu has quit [Ping timeout: 258 seconds]
kakadu_ has joined #ocaml
kakadu_ has quit [Ping timeout: 248 seconds]
kakadu has joined #ocaml
gravicappa has joined #ocaml
ggole has joined #ocaml
dhil has joined #ocaml
Serpent7776 has quit [Remote host closed the connection]
Serpent7776 has joined #ocaml
gravicappa has quit [Ping timeout: 268 seconds]
betux has quit [Remote host closed the connection]
ofzyh has quit [Ping timeout: 268 seconds]
ofzyh has joined #ocaml
webshinra has joined #ocaml
jaar_ has quit [Ping timeout: 268 seconds]
keep-learning[m] has quit [Ping timeout: 245 seconds]
hdurer[m] has quit [Ping timeout: 246 seconds]
copy` has quit [Ping timeout: 250 seconds]
otini has quit [Ping timeout: 252 seconds]
sepp2k has quit [Ping timeout: 250 seconds]
zwindl[m] has quit [Ping timeout: 245 seconds]
bglm[m] has quit [Ping timeout: 246 seconds]
pc9801[m] has quit [Ping timeout: 245 seconds]
cgenie[m] has quit [Ping timeout: 245 seconds]
aecepoglu[m] has quit [Ping timeout: 246 seconds]
stan[m] has quit [Ping timeout: 252 seconds]
aspiwack[m] has quit [Ping timeout: 252 seconds]
Haudegen[m] has quit [Ping timeout: 252 seconds]
smondet[m] has quit [Ping timeout: 252 seconds]
dl3br[m] has quit [Ping timeout: 250 seconds]
zapashcanon[m] has quit [Ping timeout: 250 seconds]
isaachodes[m] has quit [Ping timeout: 240 seconds]
Virgile[m] has quit [Ping timeout: 240 seconds]
prsafont[m] has quit [Ping timeout: 240 seconds]
jimt[m] has quit [Ping timeout: 250 seconds]
rgr[m] has quit [Ping timeout: 264 seconds]
regnat[m] has quit [Ping timeout: 264 seconds]
flux1 has quit [Ping timeout: 264 seconds]
Haudegen has quit [Quit: Bin weg.]
jao has quit [Ping timeout: 248 seconds]
gravicappa has joined #ocaml
jaar_ has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
jao has joined #ocaml
jaar_ has quit [Client Quit]
andreas303 has quit [Ping timeout: 260 seconds]
andreas303 has joined #ocaml
klntsky has quit [Ping timeout: 260 seconds]
klntsky has joined #ocaml
<cemerick>
Does it make any sense at all that a Hashtbl of int, bool is reliably faster than a Set of Int or even one of the more specialized implementations like ptset?
<cemerick>
Also faster than bitvector impls I've tried 👀
<companion_cube>
faster than bitvectors is a bit weird
<zozozo>
cemerick: in theory, assuming a perfect hash function, hashtables are supposed to have a constant time complexity for lookups, whereas a Set will have a logarithmic time complexity so it doesn't seem too far fetched i'd say
<companion_cube>
faster than trees, not too surprising
<cemerick>
I was obviously over-estimating the overhead of polymorphic hashing. I've seen it as a high-ranking hotspot when profiling other programs.
<companion_cube>
I imagine hashing ints is still not too slow :)
<def`>
(and if you are only hashing ints, all the branching in polymorphic code path is easily predicted)
<companion_cube>
cemerick: how big are your sets?
<cemerick>
companion_cube: In one context, quite small, always < 50 members. In the other, more moderate cardinality, >250
<companion_cube>
hu interesting, on small sets I'd think IntSet was actually faster
<cemerick>
this was my intuition as well
<ggole>
A hashtable being faster than a bitvector is an amusing result
<ggole>
Are they mutable bitvectors?
<cemerick>
ggole: yeah, tried both CCBV and bitv
<cemerick>
A Hashtbl is even faster than an array of bools.....which makes me question my methodology
<ggole>
That's suspicious indeed
<companion_cube>
faster than arrays is … suspicious :D
Haudegen[m] has joined #ocaml
bglm[m] has joined #ocaml
flux1 has joined #ocaml
copy` has joined #ocaml
keep-learning[m] has joined #ocaml
aspiwack[m] has joined #ocaml
peddie has joined #ocaml
zapashcanon[m] has joined #ocaml
jimt[m] has joined #ocaml
zwindl[m] has joined #ocaml
smondet[m] has joined #ocaml
aecepoglu[m] has joined #ocaml
hdurer[m] has joined #ocaml
dl3br[m] has joined #ocaml
otini has joined #ocaml
regnat[m] has joined #ocaml
stan[m] has joined #ocaml
rgr[m] has joined #ocaml
prsafont[m] has joined #ocaml
pc9801[m] has joined #ocaml
isaachodes[m] has joined #ocaml
Virgile[m] has joined #ocaml
sepp2k has joined #ocaml
cgenie[m] has joined #ocaml
spew has joined #ocaml
Haudegen has joined #ocaml
johnelse_ is now known as johnelse
johnelse has quit [Quit: leaving]
johnelse has joined #ocaml
johnelse is now known as Guest88645
Guest88645 is now known as johnelse
jao has quit [Remote host closed the connection]
narimiran has quit [Ping timeout: 245 seconds]
gareppa has joined #ocaml
sepp2k has quit [Read error: Connection reset by peer]
stan[m] has quit [Read error: Connection reset by peer]
flux1 has quit [Read error: Connection reset by peer]
bglm[m] has quit [Read error: Connection reset by peer]
cgenie[m] has quit [Read error: Connection reset by peer]
zwindl[m] has quit [Read error: Connection reset by peer]
isaachodes[m] has quit [Remote host closed the connection]
aecepoglu[m] has quit [Read error: Connection reset by peer]
hdurer[m] has quit [Write error: Connection reset by peer]
jimt[m] has quit [Read error: Connection reset by peer]
aspiwack[m] has quit [Read error: Connection reset by peer]
zapashcanon[m] has quit [Remote host closed the connection]
peddie has quit [Write error: Connection reset by peer]
keep-learning[m] has quit [Write error: Connection reset by peer]
smondet[m] has quit [Remote host closed the connection]
Virgile[m] has quit [Remote host closed the connection]
dl3br[m] has quit [Read error: Connection reset by peer]
copy` has quit [Read error: Connection reset by peer]
regnat[m] has quit [Remote host closed the connection]
pc9801[m] has quit [Remote host closed the connection]
otini has quit [Read error: Connection reset by peer]
prsafont[m] has quit [Remote host closed the connection]
Haudegen[m] has quit [Remote host closed the connection]
rgr[m] has quit [Read error: Connection reset by peer]
gareppa has quit [Quit: Leaving]
prsafont[m] has joined #ocaml
bartholin has joined #ocaml
smazga has joined #ocaml
jao has joined #ocaml
twopoint718 has joined #ocaml
Haudegen[m] has joined #ocaml
bglm[m] has joined #ocaml
keep-learning[m] has joined #ocaml
aspiwack[m] has joined #ocaml
flux1 has joined #ocaml
copy` has joined #ocaml
zapashcanon[m] has joined #ocaml
peddie has joined #ocaml
smondet[m] has joined #ocaml
jimt[m] has joined #ocaml
zwindl[m] has joined #ocaml
stan[m] has joined #ocaml
hdurer[m] has joined #ocaml
aecepoglu[m] has joined #ocaml
rgr[m] has joined #ocaml
otini has joined #ocaml
regnat[m] has joined #ocaml
Virgile[m] has joined #ocaml
isaachodes[m] has joined #ocaml
dl3br[m] has joined #ocaml
sepp2k has joined #ocaml
cgenie[m] has joined #ocaml
pc9801[m] has joined #ocaml
ggole has quit [Quit: Leaving]
dhil has quit [Ping timeout: 248 seconds]
oni-on-ion has joined #ocaml
Serpent7776 has quit [Quit: Leaving]
<gahr>
I was getting through Real World OCaml once again to try to understand sharing constraints
<gahr>
I don't get the fundamental difference between
<gahr>
module Make_interval(Endpoint: Comparable) : Interval with type endpoint := Endpoint.t = struct ... end
<gahr>
and
<gahr>
module Make_interval(Endpoint: Comparable) : Interval = struct type endpoint = Endpoint.t ... end
<oni-on-ion>
hmm
<gahr>
it looks to me like in both cases we're saying what "type endpoint" in the signature should be actualized into when we apply the functor
<companion_cube>
:= is a destructive substitution, it removes the type declaration iirc
<oni-on-ion>
yea im just thinking about scope, otherwise i cant see any other practical difference
<gahr>
I guess the naive question is: why do we need both forms?
<oni-on-ion>
good question. there should be only one way to do things, some say
Haudegen has quit [Quit: Bin weg.]
dborisog has quit [Ping timeout: 245 seconds]
<gahr>
well they appear to do two different things, but the second form doesn't allow you to use endpoint
<gahr>
if you have "val create : endpoint -> endpoint -> t" inside the signature
<gahr>
you can't call it from outside with the second form
<gahr>
it errors with
<oni-on-ion>
ohh. would need Endpoint.endpoint ? (rather than t?)
<gahr>
Error: This expression has type int but an expression was expected of type Endpoint.t
<gahr>
no wait
<gahr>
Error: This expression has type int but an expression was expected of type Int_interval.endpoint
<oni-on-ion>
hm =)
<companion_cube>
ah but you do need `: Interval with type endpoint = Endpoint.t`
<companion_cube>
otherwise it makes `endpoint` opaque
<gahr>
yeah if I use "with type" in the declaration it works
<gahr>
I was just wondering what is the difference between that and instantiating type endpoint = Endpoint.t *inside* the struct
<companion_cube>
ah, you probably need to do both
<gahr>
if I keep the inner one it whines with "unused type endpoint."
<companion_cube>
do you also do something like `include Endpoint`? :)
<gahr>
no I'm within the same module
<gahr>
there is no Endpoint module.. as far as I understand, Endpoint is a placeholder right?
<companion_cube>
I think, without seeing your code it's a bit hard to guess :)
<gahr>
right
<gahr>
module Make_interval(Endpoint: Comparable) : Interval with type endpoint := Endpoint.t = struct ... end
<companion_cube>
you're making the type `endpoint` disappear here :)
<gahr>
this is a functor which you can instantiate on any type with is Comparable
<gahr>
inside the module, the type you instantiate it with, will be called Endpoint
<gahr>
yes, making it disappear is the only way to say that when I instantiate it with "module Int_interval = Make_interval(Int)" endpoint is Int
<gahr>
so I can call functions that take an Endpoint with an Int
ziyourenxiang has quit [Ping timeout: 268 seconds]
<gahr>
I'll try to cook a minimal example that shows my confusion and get back tomorrow with more questions
oni-on-ion has quit [Remote host closed the connection]
Serpent7776 has joined #ocaml
oni-on-ion has joined #ocaml
<gahr>
companion_cube: thanks, that helps
<gahr>
I think I realized one (obvious) point: to instantiate a module on a type via a functor does not make its abstract types concrete for the client
<gahr>
so in MakeBarNoCast, although the abstract type t of the interface is actualized with X.t where X is the type parameter of the functor, the module generated via
<gahr>
MakeBarNoCast(struct type t=int let some_t=42 end)
<gahr>
doesn't have access to the structure of the inner t
<gahr>
unless it "concretizes" the abstract type t of the interface via the "with type t = int" form
<gahr>
does that sound correct, though convoluted?
<companion_cube>
that's the opposite
<companion_cube>
concrete types remain concrete
<companion_cube>
unless you add a module cast like `: FOO` (which abstracts away all types in `FOO` if you don't constrain them)
<companion_cube>
if you don't put any signature, the types are concrete
<gahr>
sure
<gahr>
but in your examples, BAR has an abstract type t
<gahr>
so in "module MakeBar(X : FOO) : BAR", t remains abstract, right?
<companion_cube>
t _becomes_ abstract when you cast into `BAR`
<gahr>
ok I see that
<gahr>
in a way, the module is constrained by the abstractness in the interface
<gahr>
any pointer to authoritative, pedantic, format, documentation of this?
<gahr>
s/format/formal/
<gahr>
tutorial that _use_ the feature without explaining the mechanics don't help me too much
<gahr>
googling for destructive substitution doesn't bring up much
<companion_cube>
(I should have said that long ago… -_-)
<gahr>
thanks, I'll read that
<companion_cube>
"extension" meaning it was added much later in the life of the language
<gahr>
got to run again, thanks a bunch+
kleisli has joined #ocaml
<companion_cube>
++
kleisli has quit [Ping timeout: 248 seconds]
kakadu_ has joined #ocaml
kleisli has joined #ocaml
kakadu_ has quit [Ping timeout: 258 seconds]
kakadu__ has joined #ocaml
Haudegen has quit [Ping timeout: 268 seconds]
Haudegen has joined #ocaml
kakadu_ has joined #ocaml
kakadu__ has quit [Ping timeout: 248 seconds]
bglm[m] has quit [Quit: User has been idle for 30+ days.]
kleisli has quit [Ping timeout: 258 seconds]
kleisli has joined #ocaml
gareppa has joined #ocaml
smondet[m] has quit [Quit: User has been idle for 30+ days.]
<reynir>
Where does 'exit' live?
<reynir>
Oh, it's in Pervasives :o
jnavila has joined #ocaml
klntsky has quit [Remote host closed the connection]
klntsky has joined #ocaml
narimiran has quit [Ping timeout: 250 seconds]
dhil has quit [Ping timeout: 248 seconds]
maskt has joined #ocaml
<maskt>
whenever I execute a function that raises an exception inside dune utop, utop exits with the message "Fatal error: executable program file not found". does anyone know why that could be?
jnavila has quit [Ping timeout: 252 seconds]
jnavila has joined #ocaml
DabsR has joined #ocaml
jnavila has quit [Remote host closed the connection]
DabsR has quit [Client Quit]
Serpent7776 has quit [Quit: leaving]
gareppa has quit [Quit: Leaving]
jao has quit [Remote host closed the connection]
jao has joined #ocaml
kleisli has quit [Ping timeout: 258 seconds]
twopoint718 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
unyu has quit [Ping timeout: 246 seconds]
brettgilio has joined #ocaml
DabsR has joined #ocaml
DabsR has quit [Client Quit]
GreyFaceNoSpace has joined #ocaml
webshinra has quit [Ping timeout: 246 seconds]
Haudegen has quit [Quit: Bin weg.]
luna_is_here has quit [Ping timeout: 268 seconds]
ziyourenxiang has joined #ocaml
webshinra has joined #ocaml
webshinra has quit [Ping timeout: 246 seconds]
smazga has quit [Quit: leaving]
webshinra has joined #ocaml
kakadu_ has quit [Remote host closed the connection]