cjeris changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/
<tsuyoshi>
hey I have a question about this type variables in methods syntax
<tsuyoshi>
for example:
<tsuyoshi>
method set_property : 'a. string -> 'a Gobject.data_set -> unit
<tsuyoshi>
why is the "'a." necessary?
<Nutssh>
tsuyoshi, it means 'for all A, ......' Its used to make the type closed.
<tsuyoshi>
so without the 'a., what happens? is it the same 'a for all the methods in a class?
jeberle has joined #ocaml
<Nutssh>
It depends on the scoping. Without it, the type is ill-formed.
<Nutssh>
You might get what you need easier through the module system. In my programming, I've rarely used ocaml's classes.
jeberle has left #ocaml []
<tsuyoshi>
I've never written any classes, but I saw that in lablgtk, and it took me a while to figure out what it meant
<tsuyoshi>
and then when I figured it out I was wondering.. "you can do it in regular procedures without that, so...?"
<Nutssh>
Classes have a type system thats rather more complicated and messy. For that alone, I like to use them only when I need their features.
Foxyloxy has quit [Connection timed out]
jlouis__ has joined #ocaml
wren has joined #ocaml
<wren>
Any lablgtk users about? I'm observing a rather strange error.
jlouis_ has quit [Read error: 110 (Connection timed out)]
G has joined #ocaml
<G>
hmmm, .a .cma and .cmxa are all static ocaml libraries right?
wren has quit ["Leaving"]
<G>
(or have I been misinformed?
<Smerdyakov>
Those are the two library extensions, yes.
<Smerdyakov>
Native code OCaml doesn't support dynamic loading.
<Smerdyakov>
I expect that bytecode uses the same files for dynamic loading as static loading.
<G>
so it has to be built using static libraries?
jacobian has quit [Read error: 110 (Connection timed out)]
Z4rd0Z has joined #ocaml
mbishop has joined #ocaml
pants1 has quit [Read error: 110 (Connection timed out)]
Mr_Awesome has quit ["...and the Awesome level drops"]
love-pingoo has joined #ocaml
<tsuyoshi>
wren: yeah I use lablgtk
<tsuyoshi>
oh, he left
<Smerdyakov>
G, _what_ has to be built using static libraries?
<tsuyoshi>
g: yeah, ocaml is ordinarily all static
<tsuyoshi>
a few people have gotten it to compile shared libraries.. their efforts haven't really seen any widespread use yet
Smerdyakov has quit ["Leaving"]
<G>
tsuyoshi: okay I was looking for shared (Fedora is against building against static), thats all
<tsuyoshi>
the ocaml runtime is a shared library iirc, but everything else is static
<tsuyoshi>
I remember xavier leroy explaining the reasoning one time on the mailing list.. but I don't remember what he said exactly
<tsuyoshi>
(he's the lead developer)
<G>
Okay, well I've posted a message on fedora-packaging group, it may be possible to give ocaml based packages an exemption, I have no idea
<tsuyoshi>
I'm surprised you don't have ocaml packages already
<G>
There are
<G>
(And i'm surprised that those people didn't spot it)
<tsuyoshi>
oh.. but people are trying to get rid of them?
<G>
well, I was packaging camlimages and ocamlsdl, and noticed it was producing static libraries, and when I packaged another program written in ocaml I thought it weird that ld etc came up clean
<flux>
there's always scaml. it's a shame it isn't in the main distribution - albeit this way it hasn't received much testing
G has quit [Read error: 110 (Connection timed out)]
G_ is now known as G
benny_ has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
benny has quit [Read error: 110 (Connection timed out)]
Z4rd0Z has quit [Read error: 110 (Connection timed out)]
G_ has joined #ocaml
G has quit [Read error: 110 (Connection timed out)]
<flux>
hmm.. is comparing 'a Weak.t with 'compare' a stable function?
<flux>
hm, s/stable/pure/
<flux>
I'm thinking: what happens if I use that as a key to a map
<flux>
actually, that might not make sense anyway.. how would one search such map..
G has joined #ocaml
fezsentido has quit [Read error: 54 (Connection reset by peer)]
G_ has quit [Read error: 110 (Connection timed out)]
love-pingoo has joined #ocaml
smimou has joined #ocaml
<G>
pango, flux: thanks for the comments, I'll look into them
jer has quit [Read error: 131 (Connection reset by peer)]
<flux>
looking the continuation io framework it really makes me thing syntax candy would be nice
<flux>
infact I think it could look just like the one for monads
<flux>
perform a <- register_read_fd fd; b <- register_write_fd; pause [a; b]; let v = random () ..
<flux>
maybe I could lift the code from pa_monad..
<flux>
(that would be like: register_read_fd fd (fun a -> register_write_fd (fun b -> pause [a; b] (fun () -> let v = random () .. )
jer has joined #ocaml
Demitar has joined #ocaml
smimou has quit ["bli"]
jer has quit [Read error: 145 (Connection timed out)]
malc_ has joined #ocaml
<mrvn>
flux: I always made my FD structure know if it was registered or not and the write function to register when needed.
jer has joined #ocaml
Smerdyakov has joined #ocaml
jacobian has joined #ocaml
Ai_Itai has joined #ocaml
pango has quit [Remote closed the connection]
nuncanada has joined #ocaml
pango has joined #ocaml
love-pingoo has quit ["Leaving"]
screwt8 has joined #ocaml
Go4005 has joined #ocaml
<Go4005>
i might be using ocaml for a commerical project ......is ocaml the only compiler ?
<flux>
yes
<flux>
mrvn, does that give you performance or nicer structure or what?-)
<Go4005>
also is ocaml still being developed on .........if everything goes through i am sure my boss wouldnt be wanting closer connections with the language he likes it alot so far
<flux>
ocaml is still being developed, by a french research group (inria.fr)
<flux>
if you want vendor-independence, sml might be interesting
<Go4005>
any plans for more optimization or a gcc frontendd ......etc ?
<flux>
it doesn't provide all the things ocaml does, but then again, perhaps you don't miss them
<flux>
I haven't heard of such plans
<flux>
(but I don't subscribe to the caml mailing list - however those things don't sound very likely)
smimou has joined #ocaml
<flux>
hm, is there a cpu performance counter library for ocaml? or for linux, even
<mrvn>
flux: easier functionality. I (the app) don't have to care about whether the write would block or about buffering. I just call IO.write fd buf and it writes as much as possible directly, buffers the rest (if any) and adds the fd to the wait queue until the buffer got written. Then it removes the fd automatically.
<mrvn>
If you use selcet you have the probblem that there is no edge trigger.
<mrvn>
flux: Mostly people use inline asm. The library call could skew the counter.
<mrvn>
s/could/would/
<flux>
yes, but not surprisingly
malc__ has joined #ocaml
malc_ has quit [Read error: 110 (Connection timed out)]
postalchris has joined #ocaml
cjeris has joined #ocaml
postalchris has quit [Remote closed the connection]
postalchris has joined #ocaml
postalchris has quit [Remote closed the connection]
postalchris has joined #ocaml
postalchris has quit [Client Quit]
malc__ has quit ["leaving"]
postalchris has joined #ocaml
postalchris has quit [Remote closed the connection]
postalchris has joined #ocaml
postalchris has quit [Remote closed the connection]
postalchris has joined #ocaml
Demitar has quit [Read error: 113 (No route to host)]
descender is now known as code-janitor
slipstream-- has joined #ocaml
slipstream has quit [Success]
postalchris has quit [Remote closed the connection]
postalchris has joined #ocaml
<Go4005>
anyone here familiar with nix ?
<flux>
are there any wrappers for libevent for ocaml are actually used?
<Go4005>
yea i used libevent once
<flux>
I've found three somewhat critical bugs from ocaml-events - fortunately the author is still around
<Go4005>
although i ended up jus using poll casue it was only 1 connection
<flux>
(actually two critical, one medium bug)
<Go4005>
worked for me but i jus did something very simple
<flux>
the simplest test cases work
<Go4005>
flux: do you know how i can see all connection ......in nix ?
<Go4005>
i havent worked with iptables at all really
<flux>
netstat -t
<flux>
iptables also has its state table under /proc.. /proc/net, or /proc/sys/net
flux- has joined #ocaml
flux has quit [Read error: 104 (Connection reset by peer)]
nuncanada has quit ["Leaving"]
Demitar has joined #ocaml
<Go4005>
will thier even be a gcc front end for ocaml ?
<postalchris>
You mean a parser from OCaml to GCC IR or a parser from C to an OCaml IR?
<Go4005>
i mean
<postalchris>
(for C read: C/C++/Java/Fortran, any GCC input lang)
<Go4005>
a way so ocaml would be better optimized
<Go4005>
and run faster
<postalchris>
You're begging the question there.
<postalchris>
That's a good question, though. I don't know if GCC's back-end is particularly well suited to optimizing OCaml
<Go4005>
would be cool
<Go4005>
ocaml is about half the optimization as gcc atm i think
<flux->
llvm-backend for ocaml would be interesting
nuncanada has joined #ocaml
<Go4005>
ocaml is becoming my favorte language
<Go4005>
that and lua
<mrvn>
juhey, another one converted.
<mrvn>
postalchris: ocaml is pretty easy to transform to single assignment notation or cps or whatever you want.
<flux->
apparently some students are doing an ocaml-frontend for llvm
<Go4005>
llvm ?
<flux->
perhaps within a year we'll see some results.. or not
<flux->
a virtual machine framework
<Go4005>
i think a nice gcc fornt end would be good
<Go4005>
nothing beats ocaml or lua
jer has quit [Read error: 145 (Connection timed out)]
<mrvn>
Lets write a ocaml to C compiler. That ought to be simple.
<mrvn>
or rather c++ for the objects.
<pango>
C is a bad backend, that's why they started C-- ;)
<pango>
the printer function for type t must be of type Format.formatter -> t -> unit
RLa has quit ["Leaving"]
smimou has quit ["bli"]
postalchris has quit ["Leaving."]
<dbueno>
Pango: thank you.
<pango>
np
<dbueno>
Turns out I wasn't linking properly with the bignum library; ocamldebug was complaining about not being able to find "Big_int"
<pango>
yes, and you must load nums.cma with load_printer, too... The information is out there, but not readily available, I had to use several information sources
<dbueno>
Ah, I didn't even notice that. Thank you for your research.
<dbueno>
(I'm using ocamlfind, and was able to find some options to pass to that to get my .cma to link properly with the modules necessary.)
screwt8 has joined #ocaml
pango is now known as pangon8
dbueno has quit ["This computer has gone to sleep"]