<sdschulze>
Anarchos: Run the float-add.ml with some bigger number (as command-line argument) and watch.
<sdschulze>
It generates garbage on each tail-recursive call.
<sdschulze>
I wonder if there's a fundamental problem that stops it from unboxing.
chee has joined #ocaml
<sdschulze>
Or does it see "oh, a funcall, so box" before seeing it's tail-recursive?
<qwr>
Anarchos: ocaml don't have what i meant with mutable binding...
<qwr>
Anarchos: but any non-const C variable would be that
<sdschulze>
qwr: You mean implicit references?
<Anarchos>
qwr let a = ref 0 or let a = {mutable a=0} ??
<sdschulze>
SML doesn't even have mutable record fields...
<qwr>
Anarchos: well, here you have to dereference it
<Anarchos>
let mutable a = 0;;
<Anarchos>
no dereference :)
<verte>
sdschulze: you'd probably have to go sourcecode diving to find out, but that shouldn't be difficult to implement
<qwr>
Anarchos: Syntax error, tells my ocaml :)
<Anarchos>
and your evil add pushes on the stack the n which is a float. I wonder if it will push on the stack if it were an int
seafood has joined #ocaml
<sdschulze>
verte: It is? In the article, Xavier explicitly discourages the use of tail-recursion for tight number-crunching.
<sdschulze>
verte: If it was easy to implement, he probably would've done so by now insted of giving such an advice.
<qwr>
Anarchos: but val mutable in object is practically what i meant
<sdschulze>
(or at least would have written: FIXME)
<sdschulze>
Anarchos: int's never generate garbage. They're always unboxed.
<qwr>
Anarchos: as it is a binding inside of the object scope
<verte>
sdschulze: who knows his motives. maybe he considers it an unnecessary optimisation.
<sdschulze>
Anarchos: And it doesn't push on the stack but on the heap -- thanks to tail recursion.
<Anarchos>
i am not so used to ocaml internals :)
<sdschulze>
verte: Or there's a subtle obstacle he didn't care to elaborate on there.
<qwr>
(the discussion actually started few days ago from dark's question, and i remembered that smerdyakov had few years ago stated something on similar topic...)
Associat0r has joined #ocaml
<verte>
sdschulze: at a platform level, you usually generate an entry point to the function that supports the most general calling convention, and one that implements the most specific, and have the former call the latter. I guess when bytecode is the target that isn't an optimisation, though.
<sdschulze>
Right, read about that.
<sdschulze>
But then I'd almost consider it to be easier to return to the innermost entry point when doing tail recursion.
<verte>
that's the idea
<verte>
there was a paper on ltu recently about calling conventions as types you might like
<sdschulze>
"Types are Calling Conventions"?
<verte>
sounds good
<Smerdyakov>
"Types are calling conventions" was already implicit in Typed Assembly Language. Does this paper add anything new worth reading?
<verte>
haven't read about TAL, so can't say
<verte>
it's not a real revelation, so possibly not
<verte>
but it would have dealt with the aforementioned issue
<sdschulze>
It's quite Haskell-centric.
<Anarchos>
who have already debugged the gc ?
Modius has quit [Quit: I'm big in Japan]
qwr has quit [Remote host closed the connection]
seafood has quit [Quit: seafood]
verte has quit [Quit: ~~~ Crash in JIT!]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
Yoric has quit [Quit: Yoric]
Yoric has joined #ocaml
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
Anarchos has joined #ocaml
Vassia has joined #ocaml
Vassia has quit [Ping timeout: 260 seconds]
aym has joined #ocaml
<sdschulze>
quick question: Does ocamlopt directly compile to native code or via bytecode?
<mfp>
sdschulze: directly
<mfp>
(via asm)
<sdschulze>
Is there any paper on how the compiler works internally?
<Anarchos>
sdschulze now, a beginning of information at google 'ocaml+internals'
<mfp>
AFAIK there's nothing about the OCaml compiler itself in the literature. There are papers about its GC and about the compilation strategy in CAML IIRC.
Yoric has quit [Ping timeout: 240 seconds]
Yoric has joined #ocaml
Yoric has quit [Client Quit]
<sdschulze>
OK, I know the stuff described in "interfacing with C".
<Anarchos>
sdschulze i too, i try to get ocaml gc working with C++ multithread api ...
ztfw has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
philtor has joined #ocaml
philtor has quit [Ping timeout: 260 seconds]
Vassia has joined #ocaml
philtor has joined #ocaml
chee has quit [Quit: <3 =^.^= Ɛ>]
Vassia has quit [Ping timeout: 276 seconds]
philtor has quit [Ping timeout: 260 seconds]
ztfw has joined #ocaml
philtor has joined #ocaml
dskippy has joined #ocaml
<dskippy>
I am having trouble installing OCaml libsndfile. I downloaded it from this site http://www.mega-nerd.com/tmp/ and I'm trying to use ocamlfind install to install it. I figure that's the right way to do things. I ran make and it built the binaries. Now I'm trying "ocamlfind install <directory>" and it says "The META file is missing.
<flux>
dskippy, if the package doesn't come with a META file, you either need to construct one yourself (or pick one from a distribution if they have one) or not use ocamlfind with the package..
<dskippy>
What do I use for the package name? Just make one up, probably libsndfile or libsndfile-ocaml and then that's what I use to reference it from now on?
<flux>
libsndfile or sndfile both sound fine
<dskippy>
flux: Thanks.
<flux>
libsndfile-ocaml sounds a bit redundant for ocamls package system needs :)
<dskippy>
flux: Yeah, I just wish this set of bindings were packaged so that my installation won't be different from someone else's.
<dskippy>
flux: My build scripts won't be portable and other problems like that exist. Wishing there was one right way.
<flux>
yes, that's not so great. but it doesn't appear to be packaged in ubuntu atleast.
<dskippy>
flux: Yeah it's not.
ulfdoz has quit [Ping timeout: 265 seconds]
<ygrek>
lib.. is also redundant cause all packages are libs :)
<flux>
are syntax extensions libs also?-)
<flux>
but I'd say it depends more on if the library refers to itself as libfoo or foo
<ygrek>
they are whatever-syntax anyway :)
ch_ee has joined #ocaml
<dskippy>
Hey. flux, after I do the install, I try to build with "ocamlfind ocamlc -linkpkg -package sndfile mysource.ml" and I get "gcc: sndfile_stub.o: No such file or directory" but that file is in the directory I install my library to.
<flux>
dskippy, possibly it depends on how you produce the .cmo/.cma-files.. I do this so rarely that I often forget the details, sorry.
<dskippy>
That's alright. I'll keep at it. Thanks for the help.
Vassia has joined #ocaml
Vassia has quit [Ping timeout: 276 seconds]
ygrek has quit [Ping timeout: 245 seconds]
barismetin has joined #ocaml
valross has joined #ocaml
barismetin has quit [Remote host closed the connection]
sepp2k has quit [Quit: Leaving.]
seafood has joined #ocaml
jakedouglas has quit [Quit: Leaving.]
ch_ee has left #ocaml []
chee has joined #ocaml
chee is now known as Guest19334
xmarteo has quit [Quit: Debian GNU/Hurd is Good.]
Guest19334 has quit [Changing host]
Guest19334 has joined #ocaml
Guest19334 is now known as cchee
seafood has quit [Quit: seafood]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
coucou747 has quit [Remote host closed the connection]