irc.freenode.net changed the topic of #ocaml to: OCaml 3.08 "Bastille Day" Release available ! -- Archive of Caml Weekly News: http://pauillac.inria.fr/~aschmitt/cwn , A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ , A free book: http://cristal.inria.fr/~remy/cours/appsem, Mailing List (best ml ever for any computer language): http://caml.inria.fr/bin/wilma/caml-list
<pango_> dan2: on an unloaded P4 2.8GHz, it takes ~ 2.2s to compute fib 200000
<dan2> hmm
<dan2> that seems faster, tho this machine is a athlon xp 2000
<dan2> pango_: I can't imagine Numerix is adding significant overhead with gmp
<dan2> pango_: Numerix provides an exact replica api to Big_int, I'll try that
<dan2> pango_: my results are similar to yours, tho times differ
<dan2> pango_: best bet is for you to compile mine on your machine and test
<dan2> pango_: do you have numerix installed?
<pango_> I guess not... not to mention the above P4 is file server at work... I have a P3 550 that's already quite loaded ;)
* dan2 retests with nice -n-15
<dan2> 7.19 seconds using Big_int
<dan2> 6.37 with GMP
<pango_> numerix looks slightly faster
<Smerdyakov> Hey, pango_! Want to help me out by testing my SML-based PHP replacement?
<pango_> Smerdyakov: sorry, it's already 2:30am here... I should have gone to sleep a long time ago already
<pango_> Smerdyakov: but I like the idea (more specifically: I don't like PHP :) )
chris is now known as det
mlh has joined #ocaml
mpc has joined #ocaml
<Smerdyakov> mlh, how would you like to help me test an SML-based PHP replacement?
mlh has quit [Read error: 104 (Connection reset by peer)]
mlh has joined #ocaml
mpc has quit []
det_ has joined #ocaml
det has quit ["leaving"]
Smerdyakov is now known as Smerdy
zigong has quit [Remote closed the connection]
cjohnson has quit ["Leaving"]
mpc has joined #ocaml
mpc has quit [Client Quit]
<mlh> Smerdy, i'd like to but i probably don't have the time or knowledge to help you sorry
* Smerdy cries.
<Smerdy> Oh well. I'll get over it.
j_n has quit [Read error: 113 (No route to host)]
j_n has joined #ocaml
j_n_ has joined #ocaml
j_n has quit [Read error: 113 (No route to host)]
bk_ has joined #ocaml
monochrom has quit ["Don't talk to those who talk to themselves."]
kinners has joined #ocaml
gpciceri has joined #ocaml
alexott has quit [Remote closed the connection]
kinners has quit [Read error: 60 (Operation timed out)]
alexott has joined #ocaml
gpciceri has quit ["Ciao, sono un virus dei messaggi di quit. Sostituisci la tua vecchia linea di quit con questa cosi potro continuare a moltipl]
Iter has joined #ocaml
alexott has quit ["ERC Version 4.0 $Revision: 1.701 $ (IRC client for Emacs)"]
pango_ has quit ["Client exiting"]
mrsolo_ has quit [Read error: 104 (Connection reset by peer)]
mrsolo_ has joined #ocaml
pango has joined #ocaml
mlh has quit [Client Quit]
Herrchen has joined #ocaml
mrsolo_ has quit [Read error: 104 (Connection reset by peer)]
mrsolo_ has joined #ocaml
alexott has joined #ocaml
buggs has quit ["upgrade"]
buggs has joined #ocaml
det_ is now known as det
buggs^z has joined #ocaml
buggs has quit [Nick collision from services.]
buggs^z is now known as buggs
cjohnson has joined #ocaml
Herrchen has quit ["bye"]
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
eugos has joined #ocaml
eugos has left #ocaml []
eugos has joined #ocaml
terpstra has joined #ocaml
<terpstra> I've noticed that inside a functor definition, I can do 'open' and then access the methods of another functor without qualification.
<terpstra> However, it doesn't let me use those 'open'ed methods to meet the signature type. why?
<terpstra> (i know this sounds like OO, but I really want to use modules---not classes)
<terpstra> module Make(R : Ring.Sig) = struct type t = Ring.t open Ring ... is valid, but the methods are not automatically proxied
* Smerdy reads.
vezenchio has joined #ocaml
<Smerdy> What is Ring?
<terpstra> ring.ml includes a signature called Sig
<terpstra> Ring contains abstractions for operations like multiplication and so on (ie: it is a mathematical ring)
<Smerdy> But how do functors come into this?
<terpstra> Make is a functor
<Smerdy> You said "access the methods of another functor without qualification."
<Smerdy> That implies that Ring is a functor.
<terpstra> The actual module which implements the Ring signature comes in turn from another functor
<Smerdy> But you do "open Ring," which would mean that _Ring_ itself would have to be a functor.
<Smerdy> Which is not true if it comes from ring.ml.
<terpstra> I won't debate the finer points of ocaml terminology; Ring is a signature then, which in the case I care about is implemented by a Functor
<Smerdy> I believe Ring.Sig is a signature, not Ring, and this is important. I am honestly confused by what you are saying.
<terpstra> Polynomial.Make(Modulo.Make(Fermat)) is the eventual thing
<terpstra> Erm right, Ring is a module, Ring.Sig is a signature
<Smerdy> OK. So when you said "and then access the methods of another functor without qualification," you mean "module" instead of "functor"?
<terpstra> Modulo.Make gives back something which matches the signature Ring.Sig
<terpstra> Polynomial.Make is what is doing the 'open'
<terpstra> Smerdy, I am not sure what a module created by a functor and passed into a matching signature should be called...
<Smerdy> terpstra, did you mean to say "open R" instead of "open Ring"?
<terpstra> oooh - yes
<terpstra> Sorry - cut and paste error :-)
<terpstra> I typed the last line by hand and got it wrong =)
<terpstra> should be module Make(R : Ring.Sig) = struct type t = Ring.t open R
<terpstra> should be module Make(R : Ring.Sig) = struct type t = R.t open R
<Smerdy> OK. And you're saying that the identifiers introduced by 'open' are usable but not counted as contents of the functor output?
<terpstra> sorry -- that is what I mean
<terpstra> yes
<Smerdy> Too bad. They are in SML. I don't know what else to say. :)
<terpstra> SML?
<Smerdy> Standard ML
<terpstra> does standard ml have a compiler?
<Smerdy> SML has around 10 compilers.
<Smerdy> Since it's standardized and all. :)
<terpstra> i mean an optimizing compiler like ocaml :)
<Smerdy> Yup. At least one better optimizing compiler, too.
<terpstra> .... reeeallly! can you pass me a url? :-)
<terpstra> I only know ocaml so far, but I assume they're pretty much the same??
<Smerdy> mlton (for SML) comes in it 3rd best optimizing compiler among those in Debian.
<Smerdy> OCaml comes in 5th.
<Smerdy> www.mlton.org
<terpstra> so why are so many people using ocaml?
<Smerdy> They were much more practical in the first years of ML's existence for the mainstream world.
<Smerdy> So they have a head start.
<Smerdy> But one team of Frenchmen who maintain a non-open source-ish kind of grip on the one compiler can only keep up for so long.
<Smerdy> So I feel that SML is pulling ahead, by virtue of having a standard that anyone can choose to work from.
<mflux> having an actual standard is quite a benefit
<terpstra> i see
<mflux> but then again ocaml has oo and somewhat big support for an assorted set of system libraries
* terpstra is formulating a testcase to check if the compiler supports his needs. =)
<terpstra> I don't need OO
<Smerdy> mflux, system library interfaces are a cinch with any good FFI, which MLton and SML/NJ have enough of,
<terpstra> although I find the Map, Big_Int, and so on modules useful
<mflux> smerdy, it's nicer to have someone else do the work ;).
<Smerdy> BigInt is in the SML Basis specification now.
<mflux> if it was so simple, the libraries would exist already
<Smerdy> The SML/NJ library has standard container functors like OCaml has.
<Smerdy> mflux, it _is_ simple. I maintain one myself.
<mflux> and it isn't just a matter of hooking the function calls.. 'ocamlifying' the interface is part of the deal too
<Smerdy> Yup, and it's not much work.
<mflux> for example sdl for ocaml is a nice conversion
<mflux> so do sdl, gtk and curses have bindings for sml?
<terpstra> can I paste 5 lines of code in here?
<Smerdy> Let's put it this way: It's reasonable for one person to produce a nice interface to a system library in a reasonable amount of time.
<Smerdy> If everyone takes up one missing library, we're set in no time.
<mflux> big 'if' ;)
<Smerdy> terpstra, yes
<terpstra> this works in ocaml:
<terpstra> module type S = sig val foo: int -> int end
<terpstra> module A = struct let foo a = a+1 end
<terpstra> module B = struct open A let bar a = a*a end
<terpstra> module F(C : S) = struct let baz a = C.foo a + 1 end
<terpstra> module M = F(A)
<terpstra> changing M = F(B) does not
<terpstra> you say that will work in SML?
<Smerdy> Yes
* terpstra apt-get installs mltron :-)
<Smerdy> mlton
<Smerdy> You probably want SML/NJ, also. MLton has no repl yet.
<Smerdy> It's only a whole-program compiler.
<terpstra> repl?
<Smerdy> Like what you get when you run 'ocaml'
<terpstra> oh, I never use that
CoolPops has joined #ocaml
<terpstra> files are called .sml? not .ml?
<Smerdy> Yes
<terpstra> eeek
<terpstra> mlton says i need semicolons everywhere
<Smerdy> OCaml and SML are not the same language....
<terpstra> they both end in ML :-)
<terpstra> ack
<terpstra> I suppose I need to read a tutorial to modify my testcase. :P
<CoolPops> I want to pass a file stream from my c app (opened with fopen) for use with ocaml functions such as fprintf. Returning a simple Val_int() does not work (segfault). I looked into using some other functions, but it seems the ones avail to me in alloc.h are not going to cut it. Any suggestions?
* CoolPops meant Val_long
<terpstra> Smerdy, if you can tell me that mlton has unsigned 32 bit integers I will convert immediately =)
<Smerdy> It does.
<terpstra> YES!!!
<terpstra> (native?)
* terpstra has been so pissed off at ocaml that he couldn't fit 3*2^30+1 in a native type
<Smerdy> Yes.
<terpstra> ok, sml definitely sounds like what to use
<Smerdy> SML doesn't standardize on int size. I'm only talking about MLton here.
<Smerdy> SML/NJ has tag bits, like OCaml.
<terpstra> the unsigned part is what really matters to me
<terpstra> unsigned ints have the guarantee that multiplication is mod 2^n, signed don't
<Smerdy> Unsigned ints are standardized, though not their sizes, I believe.
<terpstra> just like C then
<terpstra> Smerdy, do you recommend any SML tutorials?
<vegai> here too, Smerdy? :)
<Smerdy> I'm invincible.
<mflux> terpstra, perhaps you should benchmark the difference of ocaml's int32 and ml's offering ;)
<mflux> although, ocaml will still have only signed integers
<Smerdy> mflux, isn't OCaml's boxed?
<mflux> yes, but it features some automatic unboxing
<terpstra> mflux, I might; I am doing some stuff which is pretty CPU intensive
<terpstra> although the ocaml part was more for prototyping the C...
<Smerdy> Silly decision. Both OCaml and MLton produce C comparable performance.
<terpstra> not for what i'm doing ...
<Smerdy> Have you verified that for yourself?
<terpstra> yes
<Smerdy> With MLton?
<terpstra> the stuff i am working with is very cache sensitive
<terpstra> not with mlton no
<terpstra> i was impressed with ocaml's Set implementation (with 3* of the STL's speed), but for FFTs... there's no comparison
<terpstra> erm within 3* that is
<Smerdy> On the contrary, that sort of thing is quite simplistic.
<Smerdy> It's reasonable to expect no detectable performance difference.
<Smerdy> Could be some obvious optimizations are missed.
<terpstra> Smerdy, i will compare with mlton as soon as I have it ported
<terpstra> Smerdy, unless you can teach ml to do the transform in-place ...
<terpstra> cache reallly matters
<mflux> terpstra, how about using some ready-made fft library and hook that with ml/ocaml
<mflux> some of them are really optimized
<mflux> or is that just a benchmark, not what you need?
<terpstra> there are no ready-made fft libraries that operate over finite fields
<terpstra> except the ntl which really sucks
<mflux> hmh, mlton's profiling seems to be better than ocaml's
<terpstra> does sml have 'lazy_t' ?
<terpstra> i see that sml is 'strict', but sometimes lazy is handy
eugos has left #ocaml []
<terpstra> wow, mlton is a very slow compiler
vezenchio has quit [Read error: 60 (Operation timed out)]
<terpstra> is mlton written in ml? :-)
<Smerdy> Yes
<Smerdy> It's a whole program compiler.
<Smerdy> Do you understand what that means?
<terpstra> i assume it means to combine all source files and optimize them all together in one big pass?
<mflux> it means that compiling code is O(n^2)?-)
<Smerdy> terpstra, yes.
<terpstra> ... not to sound skeptical, but ... just how big is the biggest mlton program?
<Smerdy> terpstra, so it means lots of inlining, and potentially lots of code size blow-up.
<Smerdy> Beats me. It's a pretty young compiler. It's easiest to do this for now.
<terpstra> what is 'boxing'
<terpstra> something to do with gc?
<Smerdy> Store something as a pointer to a value instead of the value itself.
<terpstra> why would ml do that?
_fab has joined #ocaml
<terpstra> wow - sml is a lot different than ocaml
<Smerdy> To use a consistently sized representation for all values
<terpstra> ahh, that makes some sense
_fab has left #ocaml []
kuribas has joined #ocaml
<terpstra> Smerdy, uh oh - in sml i can't make my own infix versions of '+' or '-'?
<Smerdy> No, you can.
<terpstra> how does that jive with operator *type* overloading?
<Smerdy> Neither OCaml nor SML has any overloading.
* terpstra hrms, "I suppose it comes later in the tutorial."
<terpstra> Sure, SML can do 4.4+3.3 and 2+5
docelic has joined #ocaml
kuribas has quit ["Leaving"]
<Smerdy> Except for built-in ad-hoc stuff like that.
<Smerdy> If you shadow the definition of +, then you lose the overloading.
<terpstra> well, I need to be able to make my own version of + like: val (+): Ring.Sig.t -> Ring.Sig.t -> Ring.Sig.t
<Smerdy> You can't.
<Smerdy> And there's no good reason to want to.
<Smerdy> You can use a new name for that function.
<terpstra> there definitely are
<Smerdy> Nope.
<Smerdy> You're thinking in terms of other languages.
<Smerdy> In ML, there's no signficant reason to want to.
<terpstra> dude, the integers are a special case of a ring, rings should have the + operator. =) If integers need an operator, _they_ should use something else. ;)
<Smerdy> Just always use the specific function wherever you would have used the overloaded name.
<terpstra> i don't want to be writing code like (mul (add x y) z c)
<Smerdy> Why? What do you lose?
<terpstra> readability
<Smerdy> So make up ++, **, etc.
<terpstra> transcribability from equations and theorems
<terpstra> those will be infix?
<Smerdy> Or even use local bindings of + in the places where you use your ring.
<Smerdy> You can declare any identifier to be infix in SML.
<terpstra> ie: z ** (x ++ y) ** c ?
<terpstra> how does it determine precedence then?
<Smerdy> You specify it in the infix or infixr declaration.
<terpstra> i see
<terpstra> i'll wait until i've read the section before saying more then
eugos has joined #ocaml
Smerdy is now known as Smerdyakov
Herrchen has joined #ocaml
CoolPops has quit ["Download Gaim: http://gaim.sourceforge.net/"]
pattern has quit ["Terminated with extreme prejudice - dircproxy 1.1.0"]
<Smerdyakov> Wow. Mozilla has a lot of buffer overflow vulnerabilities!
<Excedrin> does SML/NJ support the Posix structure on Windows?
<Excedrin> sorry, wrong channel
eugos has left #ocaml []
eyda|mon has joined #ocaml
_shawn has joined #ocaml
shawn_ has quit [Read error: 104 (Connection reset by peer)]
pango has quit ["Leaving"]
pango has joined #ocaml
terpstra has quit ["Leaving"]
lmbdwr has joined #ocaml
<lmbdwr> yo yo
<lmbdwr> someone can confirm that C structures can be abstracted as intersection types ?
bk_ has joined #ocaml
gpciceri has joined #ocaml
pattern has joined #ocaml
Herrchen has quit ["bye honeys"]
vezenchio has joined #ocaml
intero has joined #ocaml
<intero> howdy
<intero> is it possible to obtain a uml diagram or something given the sources of a program?
eugos has joined #ocaml
<mflux> there are programs that do that kind of reverse-engineering
<mflux> I would imagine they often work too
Maddas has left #ocaml []
cj has joined #ocaml
<intero> mflux: could you name one that works with ocaml?
<mflux> nope ;)
<intero> thanks anyway
<mflux> there exists programs written in ocaml for which one would like to run that kind of software?
cjohnson has quit [Read error: 60 (Operation timed out)]
eugos has left #ocaml []
Riastrad1 has joined #ocaml
Riastradh has quit [Nick collision from services.]
Riastrad1 is now known as Riastradh
Robert has quit ["Suicide (...I hope not)"]
terpstra has joined #ocaml
<intero> mflux: yes, my teacher's ;)
<terpstra> If you have a functor which contains only one method, is there some sort of nicer way to use it?
<terpstra> or, just open the functor, and/or rename it?
<Riastradh> What do you mean by 'contains only one method?'
Anvil_Vapre has joined #ocaml
_fab has joined #ocaml
monochrom has joined #ocaml
mrsolo has joined #ocaml
<terpstra> sorry, i mean it's 'struct val foo x = .... end
<terpstra> Rather, a sec
<terpstra> module GCD(Int : Integer.Sig) = struct let gcd a b = ... end
intero has left #ocaml []
Anvil_Vapre has quit [Client Quit]
gpciceri has quit ["Leaving"]
_fab has quit []
Robert has joined #ocaml
smimou has joined #ocaml
<Smerdyakov> Let's hear it for smimou, who is a supporter of Freenode.
<smimou> hum
<Smerdyakov> You win: A chance to beta test my SML-based PHP replacement!!
<Smerdyakov> Do you accept the prize?
<dan2> eek ocaml class initialization is slow
<Smerdyakov> dan2, only asses use classes.
<Riastradh> OCaml's object system is slow.
<Riastradh> It is not
<Riastradh> Grrph.
<dan2> ironically, I thought ocaml's main intent was OO
<dan2> Objective Caml
<Smerdyakov> How old is Riastradh?
<dan2>
<Smerdyakov> That's what I said.
<monochrom> Riastradh is old and wise.
<Smerdyakov> You mean ?
* dan2 can't read the unicode charachter
<Smerdyakov> Apparently Riastradh's age is a mystery to you.
<dan2> why is ocaml's object system so slow?
monochrom has quit ["Don't talk to those who talk to themselves."]
<Smerdyakov> Who cares? Don't use it for things where speed matters.
mlh has joined #ocaml
Iter has quit [Read error: 238 (Connection timed out)]
smimou has quit [Remote closed the connection]