<gareth_0>
btw for regular ocaml programs i am getting a back trace, so i assume it is the correct environment variable
<gareth_0>
I get: File "test.ml", line 130, characters 30-32:
<gareth_0>
Camlp4: Uncaught exception: Not_found
<mfp>
ah, are you calling camlp4o directly, or using it via -pp?
<mfp>
anyway, you've got the location, which is good enough unless you're debugging an extension of yours
<mfp>
if you were using -pp, OCAMLRUNPARAM=b camlp4o pa_whatever.cmo pr_o.cmo test.ml > out.ml might work
<gareth_0>
that is correct
<gareth_0>
i am debugging an extension of mine ;)
Smerdyakov has joined #ocaml
<mfp>
heh
<mfp>
depending on what it does, you could try to wrap it with a try ... with _ -> print_endline (Printexc.get_backtrace ())
<mfp>
easy if you're using an AST filter, not sure if doable if you're changing the syntax directly
struktured_ has quit [Read error: Connection reset by peer]
struktured_ has joined #ocaml
Drk-Sd is now known as drk-sd
smimou has quit [Ping timeout: 246 seconds]
smimou has joined #ocaml
thrasibule has quit [Ping timeout: 246 seconds]
sepp2k has joined #ocaml
thrasibule has joined #ocaml
pimmhogeling has quit [Ping timeout: 276 seconds]
elehack has joined #ocaml
pikachuyann has joined #ocaml
jakedouglas has joined #ocaml
komar_ has joined #ocaml
thrasibule has quit [Ping timeout: 276 seconds]
drk-sd has quit [Quit: foo]
Proteus__ has joined #ocaml
sgnb has quit [Ping timeout: 276 seconds]
Proteus_ has quit [Ping timeout: 264 seconds]
joewilliams_away is now known as joewilliams
maskd has quit [Quit: leaving]
joewilliams is now known as joewilliams_away
smimou has quit [Ping timeout: 246 seconds]
struktured_ has quit [Ping timeout: 260 seconds]
<rwmjones>
gildor, around?
<Camarade_Tux>
probably not yet ;-)
stdDoubt has joined #ocaml
<stdDoubt>
all recursive functions should be written in a tail recursive way if possible (using an accumulator)? or/when should "pure/inductive" recursive functions be used instead?
<Smerdyakov>
This question is unduly complicated in OCaml, which uses tiny fixed stack size limits.
<Smerdyakov>
With OCaml, you certainly want to use tail recursion whenever your stack depth would otherwise exceed that limit.
<thelema>
if you need to support large input, you need tail recursion.
<thelema>
If you don't, you don't need tail recursion.
<elehack>
pure recursion is frequently used/needed with trees and other data structures that don't lend themselves well to accumluation or reversal.
<Smerdyakov>
elehack, but if you had a high call depth, you might need to manually CPS in OCaml.
<Camarade_Tux>
large meaning 100_000 recursive calls (130k actually)
<elehack>
although you have to be careful - if there's a chance that user input could force such a structure to be too deep and you use non-tail recursion, you have a security hole in native code.
<elehack>
yep, CPS is another good option.
<elehack>
when you can't apply more straightforward tail-recursive techniques.
drk-sd has joined #ocaml
<Smerdyakov>
No, it's not good. It's another reason to prefer a language without an arbitrary recursion bound. :P
<Camarade_Tux>
I saw you this morning then didn't see you anymore
<Camarade_Tux>
was pleased to see ocaml cross-compilation to windows worked well (was on debian)
Smerdyakov has quit [Quit: Leaving]
ikaros_ has joined #ocaml
ikaros_ has quit [Read error: Connection reset by peer]
drk-sd has quit [Ping timeout: 276 seconds]
drk-sd has joined #ocaml
struktured_ has joined #ocaml
sepp2k has quit [Ping timeout: 276 seconds]
<stdDoubt>
what is the main advantage of using objects in ocaml? isn't easier to use the module system? (I am new to the language...but one thing that I am thinking about is that there is no need to use objects)
sepp2k has joined #ocaml
<thelema>
the module system doesn't get you runtime dispatch
<Camarade_Tux>
hmmm, first-class modules :-) (not as much but gives some of that)
<thelema>
also, you don't quite get as nice subtyping relationships when you "inherit" with modules.
<derdon>
thelema: plain objects can't be inherited ;)
pikachuyann has quit [Remote host closed the connection]
pimmhogeling has quit [Ping timeout: 245 seconds]
struktured_ has quit [Ping timeout: 246 seconds]
komar_ has quit [Ping timeout: 258 seconds]
komar_ has joined #ocaml
<elehack>
thelema, I've made the UTF8 private type change and pushed it to 'utf8-string' on my Batteries fork.
<elehack>
along with another patch which adds an 'adopt_string' function as a half-way between 'of_string' and 'of_string_unsafe' (validates but doesn't copy)
<elehack>
any thoughts on the addition of this function?
gareth_0 has quit [Ping timeout: 245 seconds]
brooksbp has joined #ocaml
ttamttam has quit [Quit: Leaving.]
komar_ has quit [Quit: WeeChat 0.2.6]
struktured_ has joined #ocaml
enthymeme has joined #ocaml
cizra has joined #ocaml
<cizra>
Hi
<cizra>
I've understood that the main selling points of OCaml are speed, type system and geekiness points. Anything else I've missed?
<Camarade_Tux>
speed of development
* cizra
is bored and wishes to learn something
<cizra>
Oh? Hm. How is it optimized? By type inference?
<schme>
cizra: I guess it depends on from where you are coming. For me some of the main selling points is that it makes working with gtk/gui and crossplatformy stuff easier than lisp.
<Camarade_Tux>
type inference, strong typing, high-level
<cizra>
How difficult getting started is, compared with, say, Haskell?
<schme>
cizra: It is totally easy. fire up vim, start hacking (:
* schme
might add that he found haskell totally impossible :P
<elehack>
cizra, I think it's easier to get started than Haskell due to greater similarity with widely-known languages (esp. I/O just works), and decent tutorials.
<elehack>
type system is big win for me though. Strong checking, expressive type system (so I can have things statically checked that would be impractical e.g. in Java), and strict interface definition and checking.
<elehack>
Refactoring is a breeze due to the interfaces and strong checking.
elehack is now known as elehack|afk
<cizra>
Heh.
<cizra>
Can't go better than Agda WRT type systems, in my not-very-well-informed opinion
<gildor>
Camarade_Tux: post-treat the audio recording -> is it good ?
<cizra>
Agda allows you to check for list underflows in compile-time, frinstance. Oh, irrelevant