<pippijn>
seems pretty basic - exactly what I need
larhat has joined #ocaml
justdit has quit [Read error: Connection reset by peer]
justdit has joined #ocaml
justdit has quit [Read error: Connection reset by peer]
justdit has joined #ocaml
ftrvxmtrx has joined #ocaml
xavierm02 has joined #ocaml
chambart has joined #ocaml
justdit has quit [Read error: Connection reset by peer]
justdit has joined #ocaml
thelema has quit [Remote host closed the connection]
thelema has joined #ocaml
tane has joined #ocaml
Xizor has joined #ocaml
Xizor has quit [Client Quit]
Xizor has joined #ocaml
fusillia has joined #ocaml
chambart has quit [Ping timeout: 260 seconds]
ocp has quit [Ping timeout: 255 seconds]
zoie has joined #ocaml
<zoie>
hello, i wrote a program which seems stuck somewhere when i execute; can i print the call trace during the executing without having ot put print's everywhere?
<zoie>
(so that i figure out where it's stuck)
<zoie>
execution* to put*
Xizor has quit [Remote host closed the connection]
Xizor has joined #ocaml
<xavierm02>
# trace f
<xavierm02>
i think
<xavierm02>
or something like that
<xavierm02>
and it prints whenever you enter or leave the function
<zoie>
i'm adding files to a project someone else wrote with a Makefile; is there a way to add warnings to the compilation so that it tells me if i have arguments that i don't use in some functions?
<zoie>
i have a function with 14 arguments and i feel sad
<pippijn>
vbmithr: poke debian to update their package
<pippijn>
even unstable doesn't have 1.8
<vbmithr>
they had several debian patches on top
<pippijn>
cryptokit is 1.5
<vbmithr>
I’ll send a message to notify them. You can try opam otherwise :)
<pippijn>
hmm, the patches are: install mli files, compile with -fPIC -DPIC, rename CFLAGS to ccopts, compile for byte-code as well
<pippijn>
so, only build system patches
cago1 has joined #ocaml
<ousado>
I'm looking for something like a structural hash on types. basically something that would be used in a compiler-cache to determine whether recompilation is required. any pointers?
<pippijn>
a hash on types?
<pippijn>
how are your types represented?
<Kakadu>
I think he looks for universal hash
<pippijn>
ousado: Hashtbl.hash is universal, but doesn't know anything about data structure semantics
<ousado>
they're represented as in the macro-engine of the haxe compiler
<pippijn>
so, if you have a set represented as list [1; 2; 3] and you want [3; 1; 2] to have the same hash, you need to write your own
<pippijn>
I don't know the haxe compiler
<ousado>
I'm looking for general ideas how to go about this, rather that implementations
<ousado>
it's basically ADTs and records
<ousado>
*rather than
<pippijn>
ousado: does Hashtbl.hash do what you want?
ocp has joined #ocaml
<pippijn>
it's just an 31 (or 63) bit hash
<pippijn>
you may want to use Digest
<ousado>
no I don't think so, this is more about how to build the key properly
<pippijn>
ok
<ousado>
it's for persistence-stuff, and I want to accumulate the information whethter a type matches the previous version in a way I could easily check
<ousado>
*whether
travisbrady has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
leoncamel has quit [Ping timeout: 276 seconds]
<Qrntz>
are Labl{Tk,GTK} the only mature toolkit bindings for OCaml?
<Qrntz>
I know about LablQt but that didn't get anywhere, sadly
f[x] has quit [Ping timeout: 264 seconds]
larhat has quit [Quit: Leaving.]
leoncamel has joined #ocaml
leoncamel has quit [Remote host closed the connection]
leoncamel has joined #ocaml
leoncamel has quit [Client Quit]
ocp has quit [Ping timeout: 240 seconds]
scp has quit [Quit: Leaving]
deu5 has quit [Quit: Leaving]
fusillia has quit [Ping timeout: 246 seconds]
leoncamel has joined #ocaml
leoncamel has quit [Client Quit]
leoncamel has joined #ocaml
leoncamel has quit [Client Quit]
leoncamel has joined #ocaml
justdit has joined #ocaml
justdit has quit [Read error: Connection reset by peer]
justdit has joined #ocaml
justdit has quit [Read error: Connection reset by peer]
travisbrady has quit [Quit: travisbrady]
lolkatyhosty has quit [Ping timeout: 256 seconds]
ftrvxmtrx has quit [Quit: Leaving]
<adrien>
I hope to get bindings for the EFLs quite soon
<adrien>
the API is C, simple and rather small
travisbrady has joined #ocaml
lolkatyhosty has joined #ocaml
zoie has quit [Ping timeout: 245 seconds]
travisbrady has quit [Quit: travisbrady]
cago1 has left #ocaml []
jamii has joined #ocaml
jamii has quit [Client Quit]
hkBst has quit [Quit: Konversation terminated!]
jamii has joined #ocaml
Cyanure has quit [Ping timeout: 248 seconds]
travisbrady has joined #ocaml
Cyanure has joined #ocaml
tac has joined #ocaml
Cyanure has quit [Remote host closed the connection]
Yoric has quit [Ping timeout: 252 seconds]
mye_ has joined #ocaml
mye has quit [Ping timeout: 252 seconds]
mye_ is now known as mye
Cyanure has joined #ocaml
<ImAlsoGreg>
adrien: that's exciting - I just looked at their docs. Built-in hardware accelerated canvas sounds really useful.
ontologiae has quit [Ping timeout: 248 seconds]
cdidd has quit [Remote host closed the connection]
BiDOrD has joined #ocaml
BiDOrD_ has quit [Ping timeout: 252 seconds]
sepp2k1 has joined #ocaml
sepp2k has quit [Ping timeout: 246 seconds]
chambart has joined #ocaml
gusta715 has joined #ocaml
Yoric has joined #ocaml
milosn has quit [Ping timeout: 246 seconds]
milosn has joined #ocaml
chambart has quit [Ping timeout: 246 seconds]
thelema has quit [Remote host closed the connection]
thelema has joined #ocaml
djcoin has quit [Quit: WeeChat 0.3.9.1]
jamii has quit [Ping timeout: 246 seconds]
X1z0r has joined #ocaml
mye has quit [Quit: mye]
pangoafk is now known as pango
<pippijn>
can ocamlfind be told to look up packages in another directory in addition to the ocamlfind.conf paths?
<adrien>
like other ocamfind installations?
<pippijn>
like a staged install
lolkatyhosty has quit [Quit: leaving]
<pippijn>
while building a package with inter-dependent libraries
<adrien>
ocamlfind environment variables handle that nicely
beckerb has quit [Quit: Konversation terminated!]
marklz has joined #ocaml
<marklz>
hello, how can i know where is a stack overflow coming from?
|jbrown| has quit [Read error: Operation timed out]
answer_42 has joined #ocaml
|jbrown| has joined #ocaml
gusta715 is now known as gustav___
gustav___ is now known as gustav____
gustav____ is now known as gustav__
<gustav__>
Is there some way of making let x = y in let z = e in ... cached? I.e. so that x and z doesn't need to be recalculated on each run. I'm not looking for lazy evaluation, I think.
<gustav__>
A fancy way.
ppseafield has left #ocaml []
<pippijn>
gustav__: it depends
<_habnabit>
gustav__, i don't understand the problem. why don't you just... not calculate them multiple times?
<pippijn>
gustav__: maybe you can store them in global variables
answer_42 has quit [Ping timeout: 276 seconds]
<gustav__>
Sure.
<pippijn>
gustav__: if y and e depend on a function argument, you can use an explicit cache (some kind of map)
<gustav__>
Hmm.
thomasga has quit [Quit: Leaving.]
<pippijn>
gustav__: can you show the real code?
<gustav__>
I think I might be thinking of something from LISP but I can't squeeze it from my head.
<gustav__>
pippijn: Hold on.
Snark has quit [Quit: Quitte]
<gustav__>
Hmm.
<gustav__>
Thing about global vars is that might be what happens, I have no idea, but it's not as pretty. Better to have something like let a = (persistent b x.)
Yoric has quit [Ping timeout: 252 seconds]
<pippijn>
not as pretty?
<gustav__>
Well, it should't be languagbly accessible.
<gustav__>
That's a new word...
<pippijn>
languagbly?
<gustav__>
Yeah.
<pippijn>
I don't know that new word
<pippijn>
can you show the code?
milosn has quit [Read error: Connection reset by peer]
<gustav__>
http://pastebin.com/35Y0DEAx See on line 9, I don't want that to happen every time. But this example isn't that great.
<gustav__>
What I mean by pretty is the correct syntax/syntax style for OCaml, not something I brought with me from C.
milosn has joined #ocaml
<gustav__>
The most efficient language expression.
<pippijn>
what about moving the definition of c out of the loop?
<pippijn>
before "while true"
ontologiae has joined #ocaml
<gustav__>
Yeah, I know. I think there's some other expression I can use, though.
<pippijn>
well
<pippijn>
not that I know of
<pippijn>
you're looking for C++ "static"
<gustav__>
And this doesn't really work... the connection object isn't reliable. I don't know what I'm doing wrong, yet. And creating it and finishing it isn't great either, it's not closed. Maybe it has to be GC'd.
<pippijn>
if you need deterministic cleanup, you need to do it yourself
<gustav__>
Mkey.
<gustav__>
How can I do that?
<pippijn>
BatStd.with_dispose
<gustav__>
Grr. Batteries.
<pippijn>
why?
<pippijn>
why are you afraid of using libraries?
<gustav__>
Isn't the GC standard? In OCaml?
<pippijn>
yes
<pippijn>
and it's nondeterministic
<gustav__>
Inefficiet, not necessary. Use a lot of RAM, too. Apache demons just grow and grow.
<pippijn>
and I get this output: deliantra depends on ../../_install/lib/ncurses/META
<pippijn>
but the dependency is not actually added, because it tries to build deliantra before ncurses
<pippijn>
if I manually build _install/lib/ncurses/META, it works
<pippijn>
if I add a dependency to a non-existent file, it doesn't fail to build, either
thomasga has joined #ocaml
thomasga has quit [Client Quit]
<gustav__>
I think n is length of input because it's talked about in relation to scaling.
<gustav__>
O(n^2) is bad. O(1) is good.
<gustav__>
I don't think the WP article is very good. But I'll go check it out again.
<gustav__>
It's not the number of operations.
<gustav__>
It's more abstract than that, sadly.
<tane>
yes :)
<tane>
on networking again:
<tane>
you could consider your n the number of bytes,strings or whatever, and m the number of network participants.. then you could have for example O(n*m), taking that into account
<gustav__>
number of instructions = O(n) or O(n^2) etc.
<pippijn>
abstract instructions
<pippijn>
not machine instructions
<gustav__>
Any kind of instruction. Something you can measure. They should be equal, I think. I don't really get how O() isn't about time, though.
<gustav__>
Most of the time what you care about when you're optimizing is time, so.
<gustav__>
"This single algorithm is taking to much time, I'll be a 102 when it finishes."
<pippijn>
well
<gustav__>
tane: Yeah.
tac has joined #ocaml
<pippijn>
you can have an O(n) algorithm that takes more time than an O(n^2) algorithm
<tane>
gustav__, consider an algorithm, going through an array with n elements, for each element performing 1000 instructions. if one looks at the number of elements, its O(n), another algorithm performing the same task with one instruction per element is also O(n)
<tane>
yes, exactly
<gustav__>
pippijn: Yep. Depends on the machine.
<pippijn>
no
<pippijn>
depends on the algorithm
<gustav__>
What? No.
<pippijn>
and on the input set
<gustav__>
OH yeah, of course.
<pippijn>
O(n^2) is asymptotically faster than O(n)
<gustav__>
Hmm. Of course. Depends on n.
<pippijn>
but that may only happen when n is very very large
<xavierm02>
a(x) = O( b(x) ) <=> ∃ M and ∃ x0 such as ∀ x > x0, | a( x ) | < M | b( x ) |
<xavierm02>
the basic idea
<xavierm02>
is that if you have O( n )
<xavierm02>
and you double the size of the input, you double the time needed
<xavierm02>
if you have O( n ^ 2 ) and double the size of the input, you multiply the time by 4
<gustav__>
Yeah, I get it now. Better to draw these, I think.
<gustav__>
At least for me.
<xavierm02>
when you change machine, you more or less multiply by a constant
<xavierm02>
but as the size of the input grows that constant get less and less important
<xavierm02>
if you have O( 2^n )
<xavierm02>
and have a computer twice as fast
<xavierm02>
you can only solve for an input of length one more
<xavierm02>
which is why O( 2^n ) sucks
xavierm02 has quit [Quit: Leaving]
<gustav__>
Calculus talks about how "fast" functions are, I think that makes sense in the O(x) context.
<gustav__>
x^2 faster than 2x. 2^x faster than x^2.
<tane>
isnt it the other way around? :)
<pippijn>
2^x takes more operations than x^2 for asymptotically large x
<pippijn>
eh
<pippijn>
more time*
<gustav__>
I think the relevant point is when each of these functions reach inf. I think 2^x hits that before x^2.
<gustav__>
Yeah, big time.
<gustav__>
Damn. Gotta poop.
<pippijn>
gustav__: no, every function that depends on n reaches inf at the same time
<pippijn>
gustav__: n/2 reaches inf at the same time as 2^n
<pippijn>
well, n/2 is the same as n
<pippijn>
n reaches inf at the same time as 2^n
<pippijn>
namely when n = inf
<gustav__>
Nah.
<pippijn>
but inf is not interesting
<pippijn>
gustav__: when is 2^n inf?
<pippijn>
for what n is 2^n inf?
<gustav__>
About 954.
<pippijn>
no
<gustav__>
gnuplot really sucks.
<pippijn>
2^954 = approx. 1.5227053E287
<pippijn>
2^2000 = approx. 1.1481307E602
<pippijn>
2^200000 = approx. 9.9800518E60205
<pippijn>
when does it reach inf?
<gustav__>
Uhm.
gnuvince has quit [Ping timeout: 252 seconds]
<pippijn>
it reaches inf when n=inf
<pippijn>
2^infinity = infinity
travisbrady has quit [Quit: travisbrady]
gnuvince has joined #ocaml
<gustav__>
No wonder I always fail in math.
thelema has quit [Read error: Connection reset by peer]
thelema has joined #ocaml
larhat has quit [Quit: Leaving.]
<gustav__>
No, but... I don't think you're supposed to think about these things as symbols when assessing inf.
<gustav__>
Because then you can't say when 1/n is inf. For instance.
<gustav__>
Eh...
<gustav__>
Just n.
<pippijn>
1/n never becomes inf for integers n
<pippijn>
gustav__: inf is not interesting when talking about O-notation
<pippijn>
"very large" is more interesting
<gustav__>
I think so... inf is a long time to wait.
<gustav__>
inf is very, very large.
<pippijn>
you can talk about how fast something is going to inf
<pippijn>
but they reach inf at the same time
<pippijn>
just one of them is going there faster
<pippijn>
a bit weird :)
<gustav__>
You're never defining inf.
<gustav__>
Then all functions are equal.
<gustav__>
There is a list of how fast functions are. I just don't know where. It was part of a course. So probably not online. But it's general knowledge.
<_habnabit>
just take the derivative!
<pippijn>
infinity is a number that is greater than any other number
<dsheets>
omega?
<gustav__>
inf is generally when things stop to happen in a graph. When the difference in x is so very small for a given x. Like derivative.
ontologiae has quit [Ping timeout: 256 seconds]
Cyanure has quit [Remote host closed the connection]
spherox has joined #ocaml
mjonsson has joined #ocaml
thelema has quit [Remote host closed the connection]
thelema has joined #ocaml
fraggle_ has quit [Ping timeout: 245 seconds]
tac has quit [Ping timeout: 245 seconds]
gustav__ has quit [Read error: Connection reset by peer]
<pippijn>
<W> Grammar extension: in [expr] some rule has been masked
<pippijn>
this is my rule: "unpack"; template = STRING -> Expander.unpack _loc template