mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
jlouis has quit [Remote closed the connection]
postalchris has quit [Read error: 110 (Connection timed out)]
szell has quit [Connection timed out]
tty56 has quit []
rby_ has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
smimou has quit [Read error: 110 (Connection timed out)]
rby has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
smimou has joined #ocaml
AxleLonghorn has joined #ocaml
AxleLonghorn has left #ocaml []
seafood_ has joined #ocaml
seafood_ has quit []
Ramzi has joined #ocaml
<Ramzi> thelema: are you there?
Ramzi has quit ["http://irc.netsplit.de/"]
seafood_ has joined #ocaml
seafood_ has quit []
seafood_ has joined #ocaml
seafood_ has quit [Client Quit]
seafood_ has joined #ocaml
seafood_ has left #ocaml []
jeremiah has joined #ocaml
|jeremiah has joined #ocaml
|jeremiah has quit [Remote closed the connection]
pattern has quit [Remote closed the connection]
jeremiah has quit [Read error: 110 (Connection timed out)]
szell has joined #ocaml
Kopophex has quit [Read error: 110 (Connection timed out)]
jeremiah has joined #ocaml
jeremiah has quit [Read error: 110 (Connection timed out)]
jeremiah has joined #ocaml
jdrake has quit [Read error: 113 (No route to host)]
seafood_ has joined #ocaml
<seafood_> Has anyone here had experience writing C to OCaml bindings?
<seafood_> I'm looking for a good reference on how to create OCaml data structures from C.
jeremiah has quit [Read error: 104 (Connection reset by peer)]
<thelema> seafood: once you understand the representation of ocaml types, creating them (even from C) isn't difficult.
<seafood_> thelema: Excellent. Where can I learn about this? I was trawling through the OcamlSDL binding and saw that you need to know tag numbers.
<seafood_> I'm assuming these correspond to constructors in Ocaml. But how do you calculate them?
<thelema> look in obj.ml
<seafood_> Okay.
<thelema> err, for variant types?
<seafood_> thelema: Yeah.
<thelema> polymorphic variants tags are calculated based on the name...
* thelema tries to think of where that code sits...
<seafood_> thelema: Oh don't worry about polymorphic variants.
<seafood_> How do you do it for just ordinary algebraic data types?
<thelema> for variants, it's easy - variants w/o arguments have the same representation as ocaml ints 1, 2, 3, ...
<thelema> variants with arguments become a block with tag 1, 2, 3, ... in order of definition.
<thelema> (maybe there's a 0 in there...)
<seafood_> Right, so this is in order of declaration? So for "type a = A | B | C" the tags are A = 1, B = 2, C =3?
<thelema> no arguments - 0, 1, 2...
<thelema> # type foo = A | B | C
<thelema> # Obj.dump [A; B; C]
<thelema> ;;
<thelema> - : string = "[0; 1; 2]"
<seafood_> No one's written a tool to automatically generate C bindings?
<thelema> # type foo1 = D of int | E of int | F of int;;
<thelema> type foo1 = D of int | E of int | F of int
<thelema> # Obj.dump [D 50; E 50; F 50];;
<thelema> - : string = "[(50); Tag1 (50); Tag2 (50)]"
<thelema> I'm sure there is - I've not used it, and can't recall its name.
<seafood_> I guess I can write my own.
<thelema> I wish you good luck and good night.
Kopophex has joined #ocaml
Mr_Awesome has joined #ocaml
bluestorm has joined #ocaml
bluestorm has quit [Client Quit]
Mimmie has joined #ocaml
Mimmie has quit ["( www.nnscript.com :: NoNameScript 4.21 :: www.esnation.com )"]
Demitar has quit [Read error: 110 (Connection timed out)]
al-maisan has joined #ocaml
al-maisan has left #ocaml []
l_a_m has joined #ocaml
hkBst has joined #ocaml
Kopophex has quit ["Leaving"]
kig has joined #ocaml
TychoBrahe has quit ["KVIrc 3.4.0 Virgo http://www.kvirc.net/"]
mfp_ has joined #ocaml
TychoBrahe has joined #ocaml
mfp has quit [Read error: 110 (Connection timed out)]
seafood_ has quit []
TychoBrahe has quit [Read error: 110 (Connection timed out)]
TychoBrahe has joined #ocaml
OChameau has joined #ocaml
johnnowak has joined #ocaml
fremo has joined #ocaml
johnnowak has quit []
OChameau has quit ["Leaving"]
Tetsuo has joined #ocaml
hkBst has quit [Read error: 104 (Connection reset by peer)]
hkBst_ has joined #ocaml
hkBst_ is now known as hkBst
<fremo> I would like to use class methods in the module or function way...
LordMetroid has joined #ocaml
Snark has joined #ocaml
sporkmonger has quit []
Yoric[DT] has joined #ocaml
sporkmonger has joined #ocaml
sporkmonger has quit [Read error: 104 (Connection reset by peer)]
sporkmonger has joined #ocaml
m3ga has joined #ocaml
gim has quit [Remote closed the connection]
gim has joined #ocaml
filp has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
Yoric[DT] has quit ["Ex-Chat"]
postalchris has joined #ocaml
<struk_atwork> fremo, best of luck
RobertFischer has joined #ocaml
RobertFischer has left #ocaml []
LordMetroid has quit ["Leaving"]
postalchris has quit [Read error: 110 (Connection timed out)]
tty56 has joined #ocaml
structured has quit [Connection timed out]
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
optikal has quit [Read error: 110 (Connection timed out)]
bluestorm has joined #ocaml
filp has quit ["Bye"]
middayc has joined #ocaml
<middayc> hi
<orbitz> hi
mfp_ is now known as mfp
<flux> an extendable type system would be fun. basically, a set of hooks to the compiler that would allow the current type checker to be implemented externally; and potentially extended or swapped
<bluestorm> try lisp or scheme :-'
<flux> perhaps someone could have their thesis done on the subject ;)
<bluestorm> hm
<flux> do the statically typed flawors have as nice macros etc?
<flux> with feedback from the type system?
<bluestorm> don't the numerous crazy ghc extensions provide this ?
<flux> I don't know, I thought everything was in ghc
<bluestorm> maybe
Linktim has joined #ocaml
LordMetroid has joined #ocaml
<mfp> flux: do you know Qi?
<flux> I've heard of it
postalchris has joined #ocaml
<flux> can the macros there interface with the type system?
<mfp> IIRC it pretty much made it possible to create your own type system
<mfp> w/ something called the "sequent calculus" sys
<mfp> http://www.lambdassociates.org/qiml.htm -> "The real innovation in Qi is the use of sequent notation to define types. This is an enormously powerful means of defining types which gives Qi capacities beyond ML or even more recent languages such as Haskell. The use of sequent notation derives from Gerhard Gentzen who developed the sequent calculus treatment of first-order logic. In Gerhard's system a sequent is a pair composed of two lists o
<mfp> f logical formulae called the antecedent and the succeedent respectively. The sequent is valid if the conjunction of the elements of the antecedent logically implies the disjunction of the elements of the consequent. The concept of logical implication is defined by laying down a series of sequent rules that say how sequents may be proved."
<mfp> oops, it didn't seem that long in the browser
Yoric[DT] has joined #ocaml
<palomer> sequent notation is funky
<palomer> let's you define your own typing rules
<Smerdyakov> mfp, you can get all the benefits of "defining your own type system" with dependent types in the style Coq supports.
<Smerdyakov> mfp, and that's a much simpler foundational mechanism than what Qi provides, I think.
<palomer> (not to mention dependent types in haskell)
<palomer> (and LF)
<Smerdyakov> Haskell doesn't yet support dependent types, and LF doesn't support realistic programming.
<palomer> GHC has dependent types
<palomer> had'em for a while now
rby_ has quit [Read error: 104 (Connection reset by peer)]
<Smerdyakov> Nope.
<palomer> woops
<palomer> I'm mistaken
<palomer> was thinking generalized algebraic datatypes
<palomer> sorry!
* palomer is off
<Yoric[DT]> What's Qi ?
<Smerdyakov> http://www.lambdassociates.org/qiml.htm <-- given by mfp above
AxleLonghorn has joined #ocaml
AxleLonghorn has left #ocaml []
<Yoric[DT]> ok
<Yoric[DT]> thanks
flux has quit [Remote closed the connection]
flux has joined #ocaml
flux has quit [Connection reset by peer]
flux has joined #ocaml
flux has quit [Remote closed the connection]
flux has joined #ocaml
mfp has quit [Read error: 104 (Connection reset by peer)]
ChristopheT has joined #ocaml
LordMetroid has quit ["Leaving"]
mfp has joined #ocaml
jeremiah has joined #ocaml
middayc_ has joined #ocaml
psnively has joined #ocaml
middayc has quit [Read error: 110 (Connection timed out)]
postalchris has quit [Connection timed out]
psnively has quit []
ChristopheT has left #ocaml []
tty56_ has joined #ocaml
tty56 has quit [Read error: 104 (Connection reset by peer)]
petchema has quit [Read error: 110 (Connection timed out)]
love-pingoo has joined #ocaml
postalchris has joined #ocaml
Snark has quit ["Ex-Chat"]
l_a_m has quit [Remote closed the connection]
kelaouchi has joined #ocaml
Axioplase has quit [Read error: 104 (Connection reset by peer)]
Axioplase has joined #ocaml
TychoBrahe has quit [Read error: 104 (Connection reset by peer)]
Linktim_ has joined #ocaml
Linktim- has joined #ocaml
bzzbzz has quit ["leaving"]
Linktim has quit [Read error: 110 (Connection timed out)]
Linktim has joined #ocaml
Linktim_ has quit [Read error: 110 (Connection timed out)]
Anarchos has joined #ocaml
sporkmonger has quit [Read error: 110 (Connection timed out)]
Linktim- has quit [Read error: 110 (Connection timed out)]
Linktim has quit [Read error: 110 (Connection timed out)]
sporkmonger has joined #ocaml
Anarchos has quit ["Vision[0.8.5-0418]: i've been blurred!"]
Demitar has joined #ocaml
johnnowak has joined #ocaml
johnnowak has quit [Client Quit]
Yoric[DT] has quit ["Ex-Chat"]
rwmjones_ has joined #ocaml
kAworu has joined #ocaml
kelaouchi has quit ["leaving"]
qwr has quit [Remote closed the connection]
qwr has joined #ocaml
doy has left #ocaml []
Tetsuo has quit ["Leaving"]
qwr has quit [Remote closed the connection]
tty56_ has quit []
RobertFischer has joined #ocaml
qwr has joined #ocaml
<jonafan> struk_atwork,
Axioplase has quit ["leaving"]
hkBst has quit ["Konversation terminated!"]
rwmjones_ has quit ["Closed connection"]
bluestorm has quit ["Konversation terminated!"]
middayc_ has quit []
marque has quit [Remote closed the connection]