<fds>
Well, the OCaml runtime has no type information; it gets thrown away by the compiler. I imagine some people are unhappy with that, because they want to play nasty dynamic tricks.
<pierpa>
hmmm
<pierpa>
looks like the opposite od caml...
<pierpa>
*of
<fds>
I also don't like the sound of it, but they might have good reasons.
<pierpa>
or ir may be something different :)
<pierpa>
*it uff
<fds>
Indeed.
jrslepak has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dmbaturin>
fds: Well, people who want dynamic tricks can use polymorphic variants, for many things it's enough.
abeaumont_ has quit [Ping timeout: 276 seconds]
* fds
shrugs.
<def`>
well its more to observe type definition at runtime
<def`>
while staying type safe
<def`>
nothing like poly variant
Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lobo has quit [Quit: leaving]
<pierpa>
maybe a kind of database of types for debugging
<Drup>
or just a generic printer.
<pierpa>
this one would be great
<dmbaturin>
This sounds cool.
<def`>
the main problem is that this deals bad with abstraction
struk|desk is now known as struk|desk|away
<def`>
unlikely to grt integrated to the language
struk|desk|away is now known as struk|desk
Stalkr_ has joined #ocaml
nullcatxxx_ has joined #ocaml
fluter has quit [Ping timeout: 250 seconds]
govg has joined #ocaml
fluter has joined #ocaml
struk|desk is now known as struk|desk|away
Stalkr_ has quit [Quit: Leaving...]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
arquebus has joined #ocaml
arquebus has quit [Client Quit]
struk|desk|away is now known as struk|desk
nullcatxxx_ has joined #ocaml
badon has quit [Ping timeout: 276 seconds]
mcc has quit [Quit: Connection closed for inactivity]
darkf has joined #ocaml
eeks_ has joined #ocaml
eeks_ has quit [Client Quit]
eeks_ has joined #ocaml
eeks_ has quit [Client Quit]
struk|desk is now known as struk|desk|away
kdas_ has quit [Quit: Leaving]
cody` has quit [Quit: Connection closed for inactivity]
eeks_ has joined #ocaml
struk|desk|away is now known as struk|desk
pierpa has quit [Ping timeout: 250 seconds]
mac10688 has quit [Ping timeout: 255 seconds]
yegods has joined #ocaml
eeks_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yegods has quit [Client Quit]
struk|desk has quit [Remote host closed the connection]
tmtwd has joined #ocaml
ryanartecona has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
tmtwd has quit [Ping timeout: 246 seconds]
badon has joined #ocaml
ryanartecona has joined #ocaml
damason has quit [Remote host closed the connection]
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
tmtwd has joined #ocaml
ggole has joined #ocaml
jrslepak has quit [Quit: This computer has gone to sleep]
Simn has joined #ocaml
kakadu has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
JacobEdelman has quit [Quit: Connection closed for inactivity]
mort___ has joined #ocaml
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
abeaumont_ has joined #ocaml
MercurialAlchemi has joined #ocaml
abeaumont_ has quit [Remote host closed the connection]
abeaumont_ has joined #ocaml
tmtwd has quit [Ping timeout: 256 seconds]
foocraft has joined #ocaml
foocraft has joined #ocaml
<mrvn>
Anyone here that can help me add a preprocessor to oasis/myocamlbuild that generate ml and c files?
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lostman has quit [Quit: Connection closed for inactivity]
foocraft has quit [Ping timeout: 272 seconds]
hannes has quit [Remote host closed the connection]
hannes has joined #ocaml
badon_ has joined #ocaml
badon has quit [Disconnected by services]
badon_ is now known as badon
zpe has joined #ocaml
clockish has quit [Ping timeout: 250 seconds]
clockish has joined #ocaml
foocraft has joined #ocaml
foocraft has joined #ocaml
abeaumont_ has quit [Ping timeout: 240 seconds]
mort___ has quit [Quit: Leaving.]
tmtwd has joined #ocaml
tane has joined #ocaml
foocraft has quit [Ping timeout: 245 seconds]
govg has quit [Ping timeout: 256 seconds]
govg has joined #ocaml
mort___ has joined #ocaml
agumonkey has quit [Ping timeout: 240 seconds]
agumonkey has joined #ocaml
foocraft has joined #ocaml
psy_ has quit [Read error: No route to host]
zpe has quit [Remote host closed the connection]
tmtwd has quit [Ping timeout: 260 seconds]
Haudegen has quit [Ping timeout: 260 seconds]
fluter has quit [Ping timeout: 250 seconds]
Sorella has joined #ocaml
fluter has joined #ocaml
Haudegen has joined #ocaml
lobo has joined #ocaml
pierpa has joined #ocaml
mac10688 has joined #ocaml
Haudegen has quit [Ping timeout: 245 seconds]
foocraft has quit [Ping timeout: 245 seconds]
dsheets has joined #ocaml
noplamodo has quit [Ping timeout: 264 seconds]
noplamodo has joined #ocaml
Haudegen has joined #ocaml
noplamodo_ has joined #ocaml
noplamodo has quit [Ping timeout: 255 seconds]
Haudegen has quit [Remote host closed the connection]
jgjl has joined #ocaml
dsheets has quit [Ping timeout: 260 seconds]
mcmillhj has joined #ocaml
jrslepak has joined #ocaml
jrslepak has quit [Read error: Connection reset by peer]
jrslepak has joined #ocaml
JacobEdelman has joined #ocaml
Gvidon has joined #ocaml
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kakadu has quit [Remote host closed the connection]
kakadu has joined #ocaml
ncthom91 has joined #ocaml
ncthom91 has quit [Read error: Connection reset by peer]
ncthom91 has joined #ocaml
Haudegen has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
govg has quit [Ping timeout: 250 seconds]
govg has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
jrslepak has quit [Quit: This computer has gone to sleep]
<mrvn>
I'm wondering how to implement QT signals and slots. Specifically how to shortcut native c++ signals to c++ slots where possible.
<Gvidon>
Isn't it just a function call?
FreeBirdLjj has joined #ocaml
<mrvn>
yeah. but for custom stuff that needs to call back to ocaml and I don't want to have a callback to ocaml just to invoke a c++ function again.
Haudegen has joined #ocaml
philtor has quit [Ping timeout: 255 seconds]
<mrvn>
I'm also tempted to make those signal/slots as mixin classes. So when you have a button and want the clicked signal you do: class myButton = object inherit QButton.qButton inherit QButton.onClicked method onClicked = ... end. Does that make sense?
<kakadu>
why not to implement your own `connect` method?
<Gvidon>
Shouldn't it be compiler's problem? If a function does nothing but calling another function, then it should be optimized out by the compiler, no?
NingaLeaf has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<mrvn>
Gvidon: how would the non-optimizing compiler be able to optimize out external C stubs?
<kakadu>
Gvidon: not really, Qt has its own rttish thing which is used to dispatch slot calls
<Gvidon>
mrvn: If you use a "non-optimizing compiler" then you shouldn't care about performance at all
<kakadu>
mrvn: Do you have C++ QObject* value behind `inherit QButton.qButton` ?
<mrvn>
Gvidon: QT calls a C stub, the C stub aquires the ocaml runtime lock and calls a ocaml callback, the ocaml callback calls an external function, the external function drops the ocaml runtime lock and calls a QT object. When it returns it goes the other way.
<mrvn>
kakadu: QButton.qButton is a class that has a custom block containing a pointer to the c++ QT object.
<Gvidon>
Well, I dunno. Have you tried link-time optimization?
<kakadu>
So, why not to reinvent QObject::connect on ocaml side?
<mrvn>
kakadu: because that would go through the ocaml side while often you want to connect one QT object directly to another.
Haudegen has quit [Ping timeout: 256 seconds]
<kakadu>
mrvn: `that` is a slot call or connection function
<mrvn>
I think it makes sense to have some connect_ocaml and connect_direct.
BitPuffin|osx has quit [Ping timeout: 256 seconds]
BitPuffin|osx has joined #ocaml
<mrvn>
kakadu: that is interesting but unrelated to the question.
<mrvn>
kakadu: The question is how to detect when a signal and slot are unaltered QT signals and slots and can be connected directly without injecting the ocaml runtime inbetween them
<Gvidon>
You need compiler support to do that
<mrvn>
kakadu: out of interest how do you invoke slot#call with a variable number of arguments?
Haudegen has joined #ocaml
lobo has quit [Quit: leaving]
<mrvn>
kakadu: correct me if I'm wrong but the slot#call is just there to get included in the type and never gets used at all, right?
Anarchos has joined #ocaml
darkf has quit [Quit: Leaving]
<mrvn>
kakadu: FYI: the "Qt's moc-like tool" link on wiki/Creating-user's-slots is dead
ncthom91 has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
agumonkey has quit [Ping timeout: 246 seconds]
mcc has joined #ocaml
agumonkey has joined #ocaml
jrslepak has joined #ocaml
struk|desk has joined #ocaml
<kakadu>
Well, the page is really outdated
<kakadu>
it from the ancient time when I tryed to create bindings to Qt4 widgets
<kakadu>
The only thing I wanted to show is that we can put slot's arguments to the type of object to be able to typesafely connect signal clicked(string,int,string) with the slot onclicked(string,int)
<kakadu>
(using object's subtyping rule)
mort___ has quit [Quit: Leaving.]
<mrvn>
kakadu: I want to work without a precompiler like moc or other generated code in the app. That makes that kind of hard to do for me since I would have to call the slot dynamically
<mrvn>
kakadu: do you remember if QT has any signal/slots with multiple arguments?
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<kakadu>
do you mean variadic arguments or function overload?
<mrvn>
just multiple argument, like clicked(string,int,string)
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
FreeBirdLjj has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 246 seconds]
Stalkr_ has joined #ocaml
<gasche>
def`: hnrgrgr actually did good work on the combination of runtime types and type abstraction, while visiting Jacques
<gasche>
you may want to have a chat with Jacques about that
<gasche>
but I think there is too much overlap between dyntypes and implicits to have both as separate mechanisms in the language
<gasche>
you can build one from the other, and if you had a solid implementation of implicits, that could indeed supersede the dyntypes work
Anarchos has joined #ocaml
<gasche>
(the encoding is not completely faithful though, using implicits to implement runtime types throws out most abstraction facilities)
tmtwd has joined #ocaml
Haudegen has joined #ocaml
zpe has joined #ocaml
sgronblo has joined #ocaml
<sgronblo>
Hello, I'm trying to finish up the Universite Paris Didero FUN Ocaml intro course but I'm a little bit stumped with using functors.
<sgronblo>
Cold someone try to help me sort out the problem. I feel like I'm just randomly trying to juggle keywords in hopes that the types will match up.
<sgronblo>
The instructions say the following: "The solver also expects a data structure to represent sets of boards. Use the standard library's functor Set.Make to implement this data structure as a module BoardSet of signature Set.S with type elt = board"
<kakadu>
you need to create a module where type t = board at least. Do yo have this thing?
NingaLeaf has joined #ocaml
<sgronblo>
yep i have it
<sgronblo>
and the compare for it too
<kakadu>
so, module BoardSet = Set.Make(Board)
NingaLeaf has quit [Ping timeout: 246 seconds]
<sgronblo>
well the Board is basically an inlince struct
<kakadu>
you can write Set.Make(struct ... end) if it fits
<sgronblo>
I think there is some other related type that doesnt fit
nullcatxxx_ has joined #ocaml
teknozulu has joined #ocaml
<sgronblo>
Theres like a polymorphic ('configuration, 'move) puzzle where the 'configuration definitely should be board
<sgronblo>
But then the solve_puzzle function has the following type solve_puzzle : ('c, 'm) puzzle -> ('c list, 's) set_operations -> 'c -> 'c list
<sgronblo>
So now I need to define a type ('a, 'set) set_operations presumably using the BoardSet module
<sgronblo>
But the BoardSet stores boards not lists of boards...
<kakadu>
maybe you need polymorphic map
<kakadu>
this one doesn't use functors
<kakadu>
you just pass comparator
<sgronblo>
hmm, well I thought there was a reason the instrutions told me to set up the BoardSet module
<kakadu>
si function Map.Poly.of_alist_exn available?
<kakadu>
is*
<sgronblo>
can I somehow use a Set.S with type elt = board to create another Set.S with type elt = board list?
<sgronblo>
kakadu: not sure, but it hasnt been mentioned in the course so far so i kinda doubt i need to use it to solve the problem.
<kakadu>
if set_operations is really a set where 'c list is a key it seems that it is a polymorphic functorless set
zpe has quit [Remote host closed the connection]
<pierpa>
I did the exercise. What is the question?
<sgronblo>
set_operations is just a record with the following functions: empty, add and mem
<sgronblo>
pierpa: I'm at the final part of Project 1
<sgronblo>
Can't figure out how to define solve_klotski
<pierpa>
the final setop?
MercurialAlchemi has quit [Remote host closed the connection]
<pierpa>
it's been published even in the discusison board of the course, but here's how I did it:
<sgronblo>
so the klotski type was already shown how to define it
<pierpa>
let klotski_setop =
<pierpa>
{ empty = BoardSet.empty;
<pierpa>
mem = (fun l s -> BoardSet.mem (List.hd l) s);
<pierpa>
add = (fun l s -> BoardSet.add (List.hd l) s) }
<pierpa>
<sgronblo>
ah yeah... you are supposed to only cache the latest state in the path, not the path itself...
MercurialAlchemi has joined #ocaml
<pierpa>
you only want to cache to position, don't care about the path
<pierpa>
*the
Anarchos has quit [Read error: Connection reset by peer]
Anarchos has joined #ocaml
Stalkr_ has joined #ocaml
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 246 seconds]
<sgronblo>
oh darn, stack overflow...
nullcatxxx_ has quit [Quit: gone...]
vpm has quit [Ping timeout: 246 seconds]
Gvidon has quit [Quit: Leaving]
jfntn has joined #ocaml
pyon has quit [Quit: Loops are hard, let's GOTO shopping!]
pyon has joined #ocaml
<sgronblo>
man, i wish i could at least see where i am overflowing the stack...
<please_help>
Are your function recursive and not tail-recursive?
cody` has joined #ocaml
<sgronblo>
please_help: havent really had time to figure out how ocaml deals with tail recursiveness yet
<sgronblo>
I do have some let recs in a few places
<please_help>
tail calls are optimized, non-tail calls cannot be optimized - same as in most languages.
<please_help>
(no stack frame is pushed when it's optimized so you're O(1) in size outside of any side-effects, otherwise you're O(n) in the number of call for one invocation)
Haudegen has quit [Ping timeout: 240 seconds]
teknozulu has quit [Ping timeout: 245 seconds]
Stalkr^ has joined #ocaml
Stalkr_ has quit [Ping timeout: 276 seconds]
mort___ has quit [Quit: Leaving.]
teknozulu has joined #ocaml
Haudegen has joined #ocaml
<sgronblo>
please_help: can you explain more about the side effects?