Submarine has quit ["in Soviet Russia, Céline Dion owns you"]
zarvok has quit [Read error: 104 (Connection reset by peer)]
magius_pendragon has joined #ocaml
seafoodX has joined #ocaml
noteventime has quit [Remote closed the connection]
bzzbzz has joined #ocaml
romanoffi has joined #ocaml
david_koontz has quit ["Leaving"]
piggybox_ is now known as piggybox
<flux>
magnus__, I prefer tuareg-mode
<flux>
magnus__, you better have caml-types.el around (from ocaml-mode, I think) so you can look up expression types (assuming you've compiled with -dtypes), it's very convenient
shawn has quit ["This computer has gone to sleep"]
<magnus__>
I see flux, thanks
seafoodX has quit []
piggybox_ has joined #ocaml
sssddd has joined #ocaml
piggybox has quit [Read error: 110 (Connection timed out)]
screwt8 has quit [Remote closed the connection]
screwt8 has joined #ocaml
Smerdyakov has quit ["Leaving"]
shawn has joined #ocaml
seafoodX has joined #ocaml
TFK is now known as ChuckNorris
ChuckNorris is now known as TFK
m3ga has joined #ocaml
m3ga has quit [Client Quit]
Mr_Awesome has quit ["time to impregnate a moth"]
smkl_ has joined #ocaml
smkl has quit [Read error: 110 (Connection timed out)]
seafoodX has quit []
pango has quit [Remote closed the connection]
pango has joined #ocaml
scode has quit [Read error: 110 (Connection timed out)]
<TFK>
bignums are choking my app :-(
<TFK>
Any good substitutes? I'll even take an upper limit on possible integers. (64-bit int? but Int64 is even slower than Num...)
<flux>
try a 64-bit platform :)
<rwmjones>
TFK, there are several alternatives to bignums
* rwmjones
can't find the list now, just a sec ...
<TFK>
flux, maybe when I'm a professor and have the budget for the latest PCs just for play :-)
<flux>
apparently numerix is loads faster than Big_int
<rwmjones>
Big_int actually has a really obvious bug too which someone showed me a while back
<rwmjones>
as in .. it just completely gave the wrong answer
<rwmjones>
http://gmplib.org/ - there are also OCaml bindings for this, although none in a very stable state
<TFK>
Numerix looks promising, AND is available in Synaptic :D
haelix has joined #ocaml
smkl_ is now known as smkl
piggybox has joined #ocaml
pantsd has quit [Read error: 104 (Connection reset by peer)]
pango has quit [Remote closed the connection]
<TFK>
Is Numerx's tref supposed to substitute OCaml's ref?
piggybox_ has quit [Read error: 110 (Connection timed out)]
pango has joined #ocaml
jo_devR has joined #ocaml
shawn has quit ["This computer has gone to sleep"]
<TFK>
I wonder what's better - use Int_type.t and incur the penalty of frequent new value creations, or use Int_type.tref and incur the penalty of having to use "look" lots of times...
pantsd has joined #ocaml
sssddd has quit [Read error: 110 (Connection timed out)]
<TFK>
And how very annoying - Numerix.Infixes overshadows foat infix operations?...
romanoff1 has left #ocaml []
<TFK>
But hey, at least it's fast!
pantsd has quit [Read error: 110 (Connection timed out)]
Smerdyakov has joined #ocaml
slipstream-- has joined #ocaml
<TFK>
What happens when one of the modules of a debugged program are not compiled with the -g flag? Is debugging impossible, or the debugger just won't go into those specific modules?
slipstream has quit [Read error: 113 (No route to host)]
_andre has joined #ocaml
<_andre>
hello
david_koontz has joined #ocaml
<TFK>
howdy
<_andre>
what's the best way to raise a Unix_error exception from a C extension?
<_andre>
i see there's a unix_error() function but it's not available to extensions, it seems
<TFK>
Hmph. When I try "print some_var" in the debugger, it complains it can't find the Numerix module? o_O
<TFK>
Which is curiously listed in "info modules".
<TFK>
Might it be because Numerix wasn't compiled with -g?
linuxtk10 has joined #ocaml
<linuxtk10>
anyone here ever use ocaml for web ?
<linuxtk10>
i wondfer if its possibl ot have your web apps compiled
<haelix>
linuxtk10: why couldn't it be compiled ?
<linuxtk10>
well ........just wondering how what would be done but yea
<haelix>
actually, I don't know what you mean by webapp
pantsd has joined #ocaml
<linuxtk10>
a web app ....... a app that runs in apache or lighttpd
<haelix>
ok
<haelix>
so well
<haelix>
now, I think there are many reason the app could not be compiled, then :)
<linuxtk10>
i think theres a few ways though
<haelix>
I'm not sure how one can feed it with something else than bytecode files :(
<TFK>
CGI scripts can be compiled.
<linuxtk10>
never don it before
<TFK>
But I guess today's webdev is more involved than a few CGI scripts...
kig has joined #ocaml
Mr_Awesome has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
kelaouchi has joined #ocaml
<TFK>
does the compiler do any other optimizations besides -unsafe and -inline?
kelaouchi has quit [Read error: 104 (Connection reset by peer)]
_andre has quit ["leaving"]
G_ has joined #ocaml
G has quit [Connection timed out]
<TFK>
With Numerix, my port of a small C program is 5 times slower :-(
<flux>
well, this is your chance to really try mlton out.. perhaps not a big task to port it.
<flux>
albeit 5 times slower sounds a bit big. the C-version also uses bigints?
<TFK>
nope, uint64.
<TFK>
I think that's my main problem.
<flux>
is 63 bits too little, or is the signedness of the values the problem?
<flux>
of course, it's boxed most of the time in ocaml
<flux>
without a 64-bit platform
<flux>
so that eats a large part of the performance
<TFK>
64 bits is simply not available - Int64 is pretty slow.
<TFK>
Although now I wonder how slow it is compared to Numerix...
* TFK
times
<flux>
I doubt it'd be slower than numeric :-o
<flux>
numerix, even
<flux>
which is also boxed but must do many other things also
harlos has joined #ocaml
<TFK>
Hmmm, Int64 is faster. At least in opeations of addition, it's faster by ~40%.
<TFK>
Still, plain int operations are faster by a few orders of magnitude.
fouad_ has joined #ocaml
<mbishop>
I'm not sure mlton will give you better results, but it couldn't hurt
<TFK>
I'd have to give up the cool OCaml features for mlton!
<flux>
there is that..
<flux>
tfk, why not run the algorithm in C and the rest in ocaml? that's not the real thing you're attempting to do?
<TFK>
The program is mostly just the algo.
<flux>
ok
<TFK>
It should be noted that the C program became super-fast after I passed some optimization flags to the compiler.
<TFK>
before that my port ran only 2 times as slow, and I was optimistic
<TFK>
(Hence my previous question if ocamlopt has optimizations besides -unsafe and -inline)
<Smerdyakov>
ocamlopt is not an optimizing compiler, according to standard expectations of that term.
<Smerdyakov>
As flux said, you should use the Standard ML language and the MLton compiler if you want standard optimizations.
<flux>
if I had a performance critical task I needed to accomplish, I would definitely give it a try..
<TFK>
Well, I'm just playing around.
<TFK>
Trying to see what can be done in OCaml proper.
<Smerdyakov>
And now you know that you generally need to optimize OCaml programs manually.
<TFK>
Indeed. I thought it would be much easier, though :-)
<Smerdyakov>
I always say that if performance is a high priority for you, you shouldn't use OCaml.
<TFK>
And there I was getting lured by the prospect of OCaml being only twice as slow as C.
jo_devR has quit [Read error: 110 (Connection timed out)]
<TFK>
I guess free cheese only comes in a moustrap :-)
<TFK>
I also doubt that bignums are my problem.
<TFK>
Hmmm.
buluca has joined #ocaml
_blackdog has joined #ocaml
buluca is now known as burluca
burluca is now known as buluca
_blackdog has left #ocaml []
harlos has quit [Remote closed the connection]
fouad_ has quit [Remote closed the connection]
G has joined #ocaml
ChristopheT has joined #ocaml
ChristopheT has quit [Remote closed the connection]
<TFK>
Welp, ints vs. int64s wasn't it.
G_ has quit [Connection timed out]
<TFK>
Looking at the code, I wonder how I thought it would have a big impact...
<TFK>
Going back to plain ints, the Ocaml port is 4 times slower. That's better, but still sounds like I'm missing something.
<Smerdyakov>
Every int is tagged in OCaml.
<TFK>
But an int's tag is cheap, no? It's not like a custom object.
ChristopheT has joined #ocaml
<Smerdyakov>
Should be.
<Smerdyakov>
It's just silly to wonder why OCaml code runs slowly.
<Smerdyakov>
The implementation wasn't created to make programs run quickly.
<TFK>
Ah, only it was.
<TFK>
One of OCaml's goals is to be fast. You might say and it can only be so fast, and be quite right.
<Smerdyakov>
I don't think it was created with the expectation of competing with C.
<TFK>
Really? One of its selling points is that it supposedly runs only twice as slow as C++ :-)
<TFK>
Anyway, that's not the point. I would have given up, but I don't think that I have exhausted all my options.
<Smerdyakov>
There are just so many established compilation techniques for runtime efficiency that aren't used.
<TFK>
For example, the profiler shows that 8%+ of execution time are taken by caml_copy_double and caml_c_call. That makes me wonder.
<Smerdyakov>
And you could go on wondering about how a non-optimizing compiler is representing your program, but I say that life is too short for that.
<TFK>
But it's not too short coding in C, eh?
<Smerdyakov>
I don't understand.
shawn has joined #ocaml
<TFK>
A bit ironic mlton and ocaml are nearly evenly matched on the great language shootout :-)
<Smerdyakov>
Hardly, as MLton is most unique in its whole-program optimization, and the shootout implementations are single files using little abstraction.
<TFK>
I'm saying that I was hoping for something fast that wouldn't overtax my poor brains and time the way memory management (for example) does. Even if you don't agree with it, OCaml *is* advertised as being fast *and* cool at the same time.
<TFK>
Maybe I should MLton a try, then.
<Smerdyakov>
Yes, it's certainly "fast" compared to "scripting languages," but not compared to SML.
<Smerdyakov>
It's pretty easy to come up with examples where the OCaml version of an SML program is thousands of times slower.
<TFK>
Thousands of times? Sounds like an algo problem.
<ChristopheT>
TFK: what are you trying to do? OCaml is definitely fast as attested by the post on the main ocaml list (in a variety of fields). Mlton is not necessarily faster (of course you can probably build contrived examples).
<Smerdyakov>
It's lack of inlining across compilation units.
<Smerdyakov>
I'm trying to remember what my test case was. Are you sure that inlining is applied to functors?
<Smerdyakov>
As in, is building a module with a functor the same at runtime as writing it monolithically?
<ChristopheT>
Functors are a bit special. There have been many talks about inlining for them (as early as 1998, http://www.iist.unu.edu/~alumni/software/other/inria/www/caml/caml-list/0606.html) but I think there was no real incentive to allow more inlining so far. There is a defunctorizer though (never used personnally). Of course, this only make sense if your functor is used several time -- otherwise, just use different files and you get
<ChristopheT>
inlining.
<Smerdyakov>
I've heard that there is no longer a usable defunctorizer for OCaml.
<ChristopheT>
Automatic defunctorizingin Mlton is a good thing but may also lead to code bloat.
<Smerdyakov>
It's all configurable. OCaml doesn't even provide the option.
<ChristopheT>
defunctorizer: I heard that some people wanted to revive it but I did not apy too much attention on whether they succeeded.
<Smerdyakov>
I've heard for sure that there is no defunctorizer for OCaml today.
<Smerdyakov>
Obviously all this discussion is about real tools usable right now, since all of the underlying theory is well known for both languages.
<ChristopheT>
Like I said, I agree some more inlining _for_functors_ would be nice. But then, that does not mean OCaml is slow _in_general_ (which is what I thought you were claiming).
<Smerdyakov>
I'm also used to thinking of inlining as doing type specialization, which OCaml doesn't seem to support.
<ChristopheT>
It depends. Local uses of float's, float array's, and float records receive special attention. Also, [compare] and Bigarrays operations will be specialized if used monomorphically. If you want to retain this while writing polymorphic functions on them to be specialized only later, you must use the camlp4 macro system.
<Smerdyakov>
Yup. Needing to use macros for that is quite undesirable.
ForumGoon395 has joined #ocaml
<ForumGoon395>
so i go in a lisp channel and start talking about static typing
<ForumGoon395>
baaad idea
<Smerdyakov>
Your choice of nick indicates you're probably not participating with the best of intentions.
<ForumGoon395>
nah its just a generic name
<ForumGoon395>
from cgiirc
<ForumGoon395>
im too lazy to change the default
<ForumGoon395>
its my last day using cgiirc so i dont care :P
ChristopheT has left #ocaml []
<ForumGoon395>
i need to get around one day and reading the OOP part of Ocaml.. its kind of sad i've always used it like SML
<Smerdyakov>
It's not sad. Most OCaml programmers avoid the OO features most of the time.
<ForumGoon395>
well i dont need to use it, just wanna know how its done ya know.. if its just syntactic sugar for passing around a first argument or whatnot
<TFK>
You get almost everything you do in other OO languages, besides downcasting.
jeremiah has joined #ocaml
jeremiah has quit []
<mbishop>
I avoid oo whenever possible, regardless if it's implemented good or bad :P
gunark has quit [Read error: 104 (Connection reset by peer)]