chrisdotcode has quit [Remote host closed the connection]
ChristopheT has joined #ocaml
hkBst has joined #ocaml
<yezariaely>
has ocaml a mechanism that allows me to define a variable that never conflicts with others? e.g. a prefix/postifx that is unique?
<yezariaely>
I want to include a module and want to define a var that cannot conflict.
<yezariaely>
at the moment I use: _logger2348dnsfhk234234hj = ...
<yezariaely>
something like let _logger$ = ... would be nice
<yezariaely>
hmm, maybe hidding this value is a better approach. Never mind...
speredenn has joined #ocaml
Snark has joined #ocaml
zRecursive has left #ocaml []
<rixed>
yezariaely: lookup gensym+ocaml maybe?
introom has joined #ocaml
<yezariaely>
rixed: thanks for the hint: but I think the normal approach to deal with my problem is hidding of names via mli, anything else seems to be much more complicated now. ;-)
Neros has joined #ocaml
introom has quit [Remote host closed the connection]
ben_zen has quit [Quit: leaving]
introom has joined #ocaml
avsm has joined #ocaml
zpe has joined #ocaml
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
Kakadu has joined #ocaml
yacks has quit [Ping timeout: 276 seconds]
thomasga has joined #ocaml
weie_ has joined #ocaml
weie has quit [Ping timeout: 240 seconds]
weie has joined #ocaml
olasd has quit [Quit: brb]
weie_ has quit [Ping timeout: 260 seconds]
olasd has joined #ocaml
wwilly has joined #ocaml
<wwilly>
Bonjour
<companion_cube>
hi
weie_ has joined #ocaml
weie has quit [Ping timeout: 264 seconds]
osa1 has joined #ocaml
weie has joined #ocaml
mfp has joined #ocaml
weie_ has quit [Ping timeout: 240 seconds]
<Kakadu>
Guys
<Kakadu>
If I get a Stack_overflow is it possible to print stack to see what function/functions have issues?
<kerneis>
Kakadu: have you tried OCAMLRUNPARAM=b ./yourprogram ?
<kerneis>
I'm not sure it works with stack overflow, though; maybe in bytecode but not native
<Kakadu>
I have native code and I can't catch this exception
<flux>
did you try that nevertheles?
weie_ has joined #ocaml
<kerneis>
Kakadu: otherwise, compile with ocamlopt -g, set ulimit -c 10000, and look and the trace in gdb
<kerneis>
s/trace/coredump
<kerneis>
your function will have funny names
<kerneis>
but it gives you a hint
weie has quit [Ping timeout: 264 seconds]
<Kakadu>
It seems I was trying to catch it in a wrong place
osa1 has quit [Read error: No route to host]
osa1 has joined #ocaml
<Kakadu>
heh
<Kakadu>
gdb says that pervasives.ml:211 is my problem
<Kakadu>
and it is .... (@)
<kerneis>
Kakadu: if it's a stack overflow, what you are interested in is one of the first functions
<kerneis>
hmm, last I mean
<kerneis>
hmm, I don't know
<kerneis>
depends on how you look at your stack ;-)
<Kakadu>
My problem is a little bit complex
<Kakadu>
I'm experimenting with parser-combinatorrs
<Kakadu>
and I'm parsing matematical expressions
<Kakadu>
using two parsers: left-factorized (expr: factor (op factor)? ) and not: expr: factor op factor| factor
<Kakadu>
and also I use memoization
<Kakadu>
Some times memoizations gives a big speeed up
<Kakadu>
but for a long tests it gives stackoverflow
<Kakadu>
for two parsers which are not left factorized
q66 has joined #ocaml
<kerneis>
well, you need to make everything tail recursive then
<kerneis>
using continuations where necessary
<kerneis>
but I'm not familiar enough with parser-combinators to know if it's practical
osa1 has quit [Ping timeout: 264 seconds]
<Kakadu>
hm, I'm at depth 50k in gdb's thrace. Interesting, how big OCaml stack is?
<Kakadu>
200k. nathing cahnged
watermind has joined #ocaml
<Kakadu>
probably it is not a backtrace
<watermind>
quick question, is there some sort of "lazy let"? that binds a variable to an expression but is only evaluated when/if needed?
<watermind>
I know I can simulate it by lifting the desired value (to unit -> t )
<watermind>
but was wondering if that's how it is usually done, or if there is some native construct
<companion_cube>
there is a "lazy" construct in the language
<companion_cube>
plus a Lazy module to handle lazy values
dsheets has quit [Read error: Connection reset by peer]
francis has joined #ocaml
<francis>
I believe that there's no official documentation for Camlp4 version 4, but are there any documents that you can recommend for me to start working with it?
osa1 has quit [Remote host closed the connection]
osa1 has joined #ocaml
osa1 has quit [Ping timeout: 260 seconds]
osa1 has joined #ocaml
osa1 has quit [Remote host closed the connection]
osa1 has joined #ocaml
mort___ has joined #ocaml
hyperboreean has quit [Read error: Connection reset by peer]
osa1_ has joined #ocaml
osa1 has quit [Ping timeout: 276 seconds]
osa1_ is now known as osa1
ollehar has quit [Ping timeout: 264 seconds]
Sim_n has joined #ocaml
csakatoku has joined #ocaml
csakatok_ has quit [Ping timeout: 246 seconds]
Simn has quit [Ping timeout: 270 seconds]
Sim_n is now known as Simn
osa1 has quit [Quit: Konversation terminated!]
osa1 has joined #ocaml
osa1 has quit [Client Quit]
bondar has joined #ocaml
osa1 has joined #ocaml
hyperboreean has joined #ocaml
yacks has joined #ocaml
clog has quit [Ping timeout: 240 seconds]
clog has joined #ocaml
Drup has joined #ocaml
milosn_ has quit [Read error: Operation timed out]
speredenn has joined #ocaml
milosn has joined #ocaml
_andre has joined #ocaml
amirmc has joined #ocaml
amirmc has quit [Read error: Connection reset by peer]
amirmc has joined #ocaml
structuralist has quit []
walter has joined #ocaml
speredenn_ has joined #ocaml
speredenn has quit [Quit: Leaving]
speredenn_ has quit [Client Quit]
introom has quit [Remote host closed the connection]
csakatoku has quit [Remote host closed the connection]
introom has joined #ocaml
yacks has quit [Ping timeout: 264 seconds]
yacks has joined #ocaml
bondar has quit [Ping timeout: 240 seconds]
amirmc has quit [Quit: Leaving.]
amirmc has joined #ocaml
osa1 has quit [Read error: Operation timed out]
osa1 has joined #ocaml
yacks has quit [Ping timeout: 240 seconds]
yacks has joined #ocaml
hkBst has quit [Quit: Konversation terminated!]
mort___ has quit [Quit: Leaving.]
chambart has joined #ocaml
<kerneis>
francis: what do you mean version 4? the current one?
metasyntax has joined #ocaml
beckerb has joined #ocaml
smondet has joined #ocaml
<watermind>
when trying to use corebuild (not ocamlbuild) I'm getting "ocamlbuild: unknown option `-syntax'."
<watermind>
tried to search around for ocamlbuild errors but no luck
<watermind>
any idea what may be happening here?
* Kakadu
have never heard about corebuild
<watermind>
it's part of Jane Street's core
<watermind>
"corebuild script is installed along with Core, and its purpose is to pass in the flags required for building a program with Core"
<watermind>
but apparently one of the flags (-syntax) is not recognized by ocamlbuild
tobiasBora has joined #ocaml
<watermind>
my version anyway
<watermind>
4.00.1
<Kakadu>
Guys
<Kakadu>
If my program spents half time in memory allocation than I should enlarge minor_heap_size and major_heap_increment?
<companion_cube>
not necessarily
<companion_cube>
first, try to reduce the number of allocations :p
<watermind>
I thought they meant use the other kind of equality
<watermind>
right, they just don't want people to accidently mistake == for =
<smondet`>
putting tricky semantics into infix operators makes code unreadable
<watermind>
or the other way around
<technomancy>
is that because genuine need for physical equality is very rare, and they want it to be called out as special in a "pay attention; this is weird" kind of way?
<watermind>
it makes sense, I can understand that
<smondet`>
so when you read code using `phys_equal` you know you have to pay attention
<companion_cube>
could use (=====)
<mrvn>
they could have made it ('a -> 'a) -> ('a -> 'a) -> bool
<watermind>
:)
<companion_cube>
or maybe ==/!\==
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
ygrek has joined #ocaml
zpe has quit [Ping timeout: 256 seconds]
chambart has quit [Ping timeout: 246 seconds]
mort___ has quit [Ping timeout: 276 seconds]
osa1 has joined #ocaml
Drup has joined #ocaml
whitequark has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
amirmc has joined #ocaml
tane has quit [Quit: Verlassend]
ggole has quit []
chambart has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
zpe has joined #ocaml
gautamc has quit [Read error: Connection reset by peer]
gautamc has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
<jpdeplaix>
kerneis: the trick with the _build works a little but it doesn't work if I clean first. How to add tags after that the files were copied in the _build dir ?
_andre has quit [Quit: leaving]
ollehar has joined #ocaml
morolin has quit [Ping timeout: 264 seconds]
<orbitz>
Any suggested reading for lookingat FRP? I see Froc and React but looking also for theoratical reads
<companion_cube>
there are probably seminal papers
<watermind>
howcome is the need for the "rec" annotation for type checking a consequence of non-purity?
<watermind>
I'm not seeing how both are connected
<orbitz>
watermind: in function defintions?
<watermind>
orbitz: yes
<orbitz>
what's your question?
amirmc has joined #ocaml
amirmc has quit [Ping timeout: 262 seconds]
speredenn has quit [Quit: Leaving]
dsheets has joined #ocaml
weie_ has quit [Ping timeout: 264 seconds]
<watermind>
orbitz: I read the keyword "rec" is needed in ocaml for the typechecking algorithm to work, because ocaml is non-pure
<watermind>
but I don't see the connection between both
<watermind>
why would the typechecking algorithm not work without rec?
<watermind>
in particular what do side effects have to do with it
smondet` has quit [Quit: music!]
<levi>
rec is not about purity, it's about recursiveness.
<levi>
The 'let' form introduces a lexical binding, i.e. a name is bound to a value. The question is, does the binding take effect *inside* the expression that's being bound to the name?
Simn has joined #ocaml
<watermind>
levi: I know it is about recursion, but some languages (e.g. haskell) do not need the rec lable
<levi>
That is because in haskell, the recursive let is the only kind.
<companion_cube>
also because haskell is lazy
<companion_cube>
a recursive definition does not need to trigger immediately an infinite loop
<companion_cube>
(only during evaluation)
<watermind>
this is what I read in real world ocaml: "the type-inference algorithm needs to know when a set of function definitions are mutually recursive, and for reasons that don't apply to a pure language like Haskell, these have to be marked explicitly by the programmer"
<levi>
Laziness doesn't have anything to do with definitions. Expressions aren't evaluated when they're bound in a definition.
<companion_cube>
levi: let () = printf "hello" ?
<levi>
Oops, you're right.
<companion_cube>
in OCaml, non-recursive definitions are evaluated in order
<companion_cube>
in Haskell, they are evaluated on demand
<companion_cube>
that's also what makes the "where" block usable
<watermind>
right
<levi>
Hmmm.
<watermind>
hmm... so, even though it is not idiomatic, could I be using let rec to define lazy bidings?
<levi>
Let rec doesn't make things lazy, though.
<levi>
I think the recursive case is just doesn't take the extra work in a lazy language that it does in a strict one. But I have not thought that through fully yet either.
<companion_cube>
no, but you cannot write any kind of expression in a let rec
<watermind>
let rec x = x ;; ?
<watermind>
yeap that seems ruled out
<companion_cube>
if you define recursive functions that's ok, because the recursion only occurs at call time
<companion_cube>
let rec x = y and y = x+1;;
<companion_cube>
↑ not accepted
<watermind>
right
<watermind>
but why not accept it and have it result in infinite recursion when evaluated?
<companion_cube>
I'm not sure there is a proper evaluation model for this
<companion_cube>
recursive functions are ok, but recursive primitive values...
<companion_cube>
non-functional values*
<watermind>
right... fair point, Y in call by value has type ((a->b)->(a->b))->a->b
mort___ has joined #ocaml
<watermind>
but in any case, that could be ruled out in (all) let's
<watermind>
rather than just the rec's
amirmc has joined #ocaml
<watermind>
the only extra you seem to get is to refer to a previous definition of x when defining a new x
<companion_cube>
the usual let allows shadowing, for instance
<companion_cube>
exactly
<companion_cube>
and evaluation is sequential
ollehar has quit [Ping timeout: 264 seconds]
tianon has joined #ocaml
<watermind>
you could still have arguments shadowing previous other definitions
<watermind>
not all kinds of shadowing would be gone
<watermind>
just not the kind where you use a previous definition, in a newer one with the same name... but that looks awfully confusing to be honest
<watermind>
as in a nice source for subtle bugs
amirmc has quit [Ping timeout: 256 seconds]
ChristopheT has left #ocaml []
Sim_n has joined #ocaml
Simn has quit [Ping timeout: 276 seconds]
amirmc has joined #ocaml
amirmc has quit [Ping timeout: 248 seconds]
osa1 has quit [Quit: Konversation terminated!]
pkrnj has quit [Quit: Computer has gone to sleep.]
Sim_n has quit [Quit: Leaving]
tobiasBora has joined #ocaml
<tobiasBora>
Hello,
amirmc has joined #ocaml
<tobiasBora>
I'm using the Arg module and I'd like to remove the "-help" option added by default. I tried to override it with empty Unit function and doc, but it still appear in the usage message...
Neros has quit [Remote host closed the connection]