adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml-lang.org | Public logs at http://tunes.org/~nef/logs/ocaml/
mye has quit [Quit: mye]
eikke has quit [Ping timeout: 245 seconds]
ulfdoz_ has joined #ocaml
emmanuelux has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
ulfdoz_ is now known as ulfdoz
pkrnj has joined #ocaml
rgrinberg has joined #ocaml
<rgrinberg> how can I read a single character in ocaml?
<rgrinberg> without waiting for a return key to be pressed
emmanuelux has quit [Remote host closed the connection]
hcarty has quit [Ping timeout: 256 seconds]
spherox has joined #ocaml
hcarty has joined #ocaml
pkrnj has quit [Quit: Computer has gone to sleep.]
gustav__ has joined #ocaml
pkrnj has joined #ocaml
spherox has quit [Ping timeout: 246 seconds]
walter|rtn has joined #ocaml
thelema_ has joined #ocaml
thelema has quit [Read error: Connection reset by peer]
walter|r has quit [Ping timeout: 246 seconds]
pkrnj has quit [Quit: Computer has gone to sleep.]
pkrnj has joined #ocaml
abeaulieu has quit [Read error: Operation timed out]
madroach has quit [Ping timeout: 244 seconds]
madroach has joined #ocaml
rgrinberg has quit [Ping timeout: 246 seconds]
thelema_ has quit [Remote host closed the connection]
thelema has joined #ocaml
gustav__ has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
everyonemines has joined #ocaml
astertronistic has joined #ocaml
gnuvince has quit [Quit: Remember when men were men and regular expressions recognized regular languages?]
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
Yoric has quit [Ping timeout: 252 seconds]
everyonemines has left #ocaml []
lolcathost has joined #ocaml
thelema has quit [Remote host closed the connection]
thelema_ has joined #ocaml
jamii has joined #ocaml
ftrvxmtrx has quit [Read error: Operation timed out]
ftrvxmtrx has joined #ocaml
mjonsson has quit [Ping timeout: 246 seconds]
gnuvince has joined #ocaml
jamii has quit [Ping timeout: 246 seconds]
thelema has joined #ocaml
thelema_ has quit [Remote host closed the connection]
lolcathost has quit [Read error: Connection reset by peer]
justdit has joined #ocaml
lolcathost has joined #ocaml
lolcathost has quit [Quit: leaving]
lolkatyhosty has joined #ocaml
sepp2k has joined #ocaml
deu5 has quit [Remote host closed the connection]
wormphlegm has quit [Read error: Connection reset by peer]
wormphlegm has joined #ocaml
answer_42 has joined #ocaml
Yoric has joined #ocaml
pango is now known as pangoafk
Neros has joined #ocaml
mfill has joined #ocaml
mfill has quit [Client Quit]
mfill has joined #ocaml
mfill has quit [Client Quit]
mfill has joined #ocaml
justdit has quit [Ping timeout: 255 seconds]
Cyanure has joined #ocaml
hkBst has joined #ocaml
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
chambart has joined #ocaml
djcoin has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
justdit has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
Snark has joined #ocaml
Kakadu has joined #ocaml
Neros has quit [Remote host closed the connection]
Neros has joined #ocaml
testcocoon has joined #ocaml
mfill has quit [Quit: leaving]
thomasga has joined #ocaml
ontologiae has joined #ocaml
everyonemines has joined #ocaml
everyonemines has left #ocaml []
eikke has joined #ocaml
mye has joined #ocaml
Neros has quit [Remote host closed the connection]
astertronistic has quit [Ping timeout: 260 seconds]
notdan has quit [*.net *.split]
sgnb has quit [*.net *.split]
larhat has quit [Quit: Leaving.]
<pippijn> can ocamlsdl (mixer) play music from memory?
<adrien> libao :-)
<pippijn> apparently it can't
<pippijn> but it can play sound from memory
<pippijn> I guess music playing is async by itself
notdan has joined #ocaml
sgnb has joined #ocaml
thelema has quit [Remote host closed the connection]
thelema has joined #ocaml
ocp has joined #ocaml
<adrien> pippijn: if it were sync, you'd have skips
<adrien> and clicks
<pippijn> not necessarily
<adrien> without hard real-time, you would
<flux> adrien, as long as you can keep the buffers non-empty it'd be ok..
<flux> so you could have a non-callback-'fill buffers' function you call between frames
<adrien> if you're buffering, you've started to be asynchronous ;-)
<pippijn> okay
<pippijn> but you can have synchronous file I/O
<pippijn> or asynchronous but in user code
<pippijn> instead of inside libsdl_mixer
<adrien> btw, why libsdl_mixer?
justdit has quit [Read error: Connection reset by peer]
justdit has joined #ocaml
<pippijn> it can do positional sound
<pippijn> I'm making a game
<adrien> hmm, ok
<pippijn> can libao do that?
<adrien> it's not exactly the best library (generally-speaking), that's why I was asking
<adrien> pippijn: I don't remember: I've used libao years ago and was pleased with its simplicity and effectiveness
<adrien> also, btw, 2D or 3D game?
<pippijn> hmm
<pippijn> 2D
<adrien> and SDL for drawing?
<pippijn> no, it's a terminal game
<adrien> ah, ok
* adrien would have told pippijn about Evas otherwise
<pippijn> Evas is the EFL canvas library
<pippijn> this?
<adrien> pippijn: yes
<adrien> and it has some ocaml bindings and I'm interested in expanding that
<adrien> it's portable and ported in many places and it works well
<pippijn> hmm
<pippijn> I would like to have an evas-like library for terminals
<adrien> and it's easier to give feedback to the E people than to the Qt or GTK guys
<adrien> evas handls framebuffers
<pippijn> terminal emulators, rather
<adrien> well, if the output only handles chars and won't let you draw wherever you want, it might be an issue
_andre has joined #ocaml
thelema has quit [Remote host closed the connection]
thelema has joined #ocaml
notdan has quit [*.net *.split]
sgnb has quit [*.net *.split]
notdan has joined #ocaml
sgnb has joined #ocaml
chambart has quit [Ping timeout: 246 seconds]
sgnb` has joined #ocaml
sgnb has quit [Ping timeout: 240 seconds]
notdan_ has joined #ocaml
<adrien> pippijn: but you're using specific characters, right? you can't draw as you want
<pippijn> adrien: unicode
<pippijn> I need a terminal library
notdan has quit [*.net *.split]
<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
<xavierm02> zoie: ping
<zoie> pong
<zoie> xavierm02: i tried putting that (http://caml.inria.fr/resources/doc/guides/debug.en.html) in the main but it didn't work
<zoie> i guess it only works in the toplevel
<xavierm02> well maybe
<xavierm02> your function is a local variable?
hto has quit [Read error: Operation timed out]
hto has joined #ocaml
beckerb has joined #ocaml
answer_42 has quit [Remote host closed the connection]
answer_42 has joined #ocaml
ppseafield has joined #ocaml
mjonsson has joined #ocaml
<zoie> no it was global
<zoie> but it gives a syntax error
<pippijn> zoie: Printexc.record_backtrace true; Sys.catch_break true;
<zoie> thanks
<pippijn> and then send an interrupt to the process
<pippijn> ^C or something
<pippijn> is there a better way to write this: http://paste.xinu.at/HgUv8H/ocaml
<pippijn> ok, there is
<pippijn> wait
mjonsson has quit [Remote host closed the connection]
justdit has quit [Ping timeout: 252 seconds]
<invariant> pippijn, does that compile to assembly using bswapq?
<pippijn> no
<pippijn> it becomes a 670 bytes function
<adrien> that really looks like typical OCaml :D
<pippijn> what does?
<thomasga> pippijn: external swap64 : int64 -> int64 = "%bswap_int64" ?
<pippijn> thomasga: it's represented as string
<thomasga> ha well ...
<pippijn> I get it from the Sha512 module
<pippijn> which writes it in system-endian
<pippijn> which sucks..
<pippijn> I don't even understand why it would do that
<pippijn> it does extra effort to put it in system endian
<pippijn> but who needs that?
deu5 has joined #ocaml
scp has joined #ocaml
<zoie> pippijn: why don't you write a for?
<pippijn> zoie: you're right :)
<zoie> s.[8] is the same as s.[0]?
<pippijn> s.[8] is out of bounds in 64 bit
<vbmithr> Talking about Vincent Hanquez’ ocaml-sha ?
<pippijn> vbmithr: yes
<zoie> for offset = 1 you'll get out of bounds right?
<vbmithr> You’ve got a problem with it ? A while ago it did have an endianness problem but now should be fixed
<pippijn> zoie: I don't understand your question
<pippijn> s.[8] is not out of bounds, but s.[8 + 7 * 8] is
<pippijn> vbmithr: to_bin returns a hash in system-endian
<vbmithr> What version are you using
<pippijn> I don't know how to get the endianness in ocaml (pre 4.0)
<vbmithr> https://github.com/vincenthz/ocaml-sha/blob/master/sha512.c : is not the same as the code you pasted.
<pippijn> hmm
<zoie> oh ok
<pippijn> 1.7
<vbmithr> Use 1.8
<pippijn> oh
<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?
<vbmithr> The 1.8 version works, otherwise I’ve integrated this code into an updated cryptokit if you like: https://github.com/vbmithr/cryptokit-sha512
<pippijn> "Don’t change endianness two times" yep
<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?
<pippijn> marklz: Printexc.record_backtrace true
<marklz> pippijn: i put it
<marklz> but it didn't work
Xizor has quit [Remote host closed the connection]
X1z0r has quit [Remote host closed the connection]
<pippijn> marklz: ocamldebug
<pippijn> marklz: also, did you compile with -g?
<marklz> it's compiled with a makefile that's not mine
<marklz> with ocamldebug: (ocd) runLoading program... done.Time : 453231Program end.Uncaught exception: Stack_overflow
_andre has quit [Quit: leaving]
chambart has joined #ocaml
<pippijn> adrien: which one?
<pippijn> OCAMLFIND_METADIR?
<pippijn> OCAMLFIND_CONF?
jamii has joined #ocaml
<adrien> OCAMLPATH
<adrien> This variable may contain an additional search path for package
<adrien> directories. It is treated as if the directories were prepended
<adrien> to the configuration variable path.
<adrien> ?
Kakadu has joined #ocaml
<pippijn> ah
Kakadu has quit [Client Quit]
<pippijn> my manpage doesn't have that
<adrien> man findlib.conf
<adrien> not man ocamlfind
<pippijn> oh, okay
<pippijn> thanks
chambart has quit [Ping timeout: 246 seconds]
<adrien> there's also "man META"
<pippijn> nice
<adrien> ocamlfind and godi have good documentation; noone knows it's there however
Kakadu has joined #ocaml
Anarchos has joined #ocaml
Kakadu has quit [Client Quit]
Kakadu has joined #ocaml
<pippijn> I like it
Kakadu has quit []
Kakadu has joined #ocaml
jamii has quit [Ping timeout: 260 seconds]
jamii has joined #ocaml
sepp2k1 has quit [Read error: Connection reset by peer]
Kakadu has quit []
Kakadu has joined #ocaml
Kakadu has quit [Client Quit]
Kakadu has joined #ocaml
larsrh has joined #ocaml
<larsrh> Did anybody attempt to implement a heterogeneous list in OCaml?
<larsrh> I was wondering whether something like this is possible; possible use case would be a type-safe compose for multiple functions
larhat has joined #ocaml
<_habnabit> larsrh, you can do it if you have something like type t = A of string | B of int and then had a t list
<tac> ocaml doesn't have existential types, does it?
<invariant> larsrh, I am fairly confident that it can be done by using the module system.
<Kakadu> larsrh: use objects for this purpose
<invariant> Kakadu, I don't think that matches his type-safety constraint.
<larsrh> I was wondering whether it's possible with GADTs
<larsrh> _habnabit: no, that's not what I asked for
<larsrh> HLists contain the precise type information for each element
<Anarchos> Or use Obj.magic
<larsrh> something kind of like this http://pastebin.com/vRQhPBZG
<larsrh> although I can't even get comp_length to compile
<invariant> larsrh, without functors that's never going to work.
<invariant> larsrh, and even then it would probably be worthy of a post to the mailing list.
answer_42 has quit [Ping timeout: 276 seconds]
marklz has quit [Ping timeout: 245 seconds]
<Qrntz> adrien, cool, thanks for letting me know
|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.
<gustav__> Aha.
<pippijn> gustav__: using ocaml libraries does not grow your binary a lot
<pippijn> only the code that is used will be linked in
<gustav__> Apache's processes load all the libraries. With the netcgi2 module.
<pippijn> you link dynamically?
<gustav__> I haven't figured out how to make it binary.
<gustav__> Probably.
<pippijn> oh, you run bytecode?
<gustav__> Yep.
<pippijn> ah
<pippijn> well
<pippijn> 22:41 < pippijn> http://paste.xinu.at/y0AWXM/
<larsrh> I managed to do it: http://pastebin.com/mSmM0mzy
<larsrh> it's not pretty, but it works
<larsrh> invariant: without functors :)
as has joined #ocaml
<pippijn> larsrh: nice
<invariant> larsrh, was that also already possible before Ocaml 4?
<larsrh> now I just have to make that work with monadic composition, but that'll have to wait
<larsrh> invariant: don't think so
<pippijn> larsrh: you are probably aware that your length function is not tail recursive
<invariant> larsrh, I think _ is probably new.
<larsrh> pippijn: yes, I am, it's just a proof of concept :)
<pippijn> I like it
<larsrh> invariant: that didn't exist prior to 4?
<larsrh> don't know, I'm not much of an OCaml hacker
<invariant> larsrh, and the type a, which probably is the same as forall a in Haskell.
<invariant> larsrh, neither am I ;)
<larsrh> got it from there https://sites.google.com/site/ocamlgadt/
<pippijn> yeah
<larsrh> invariant: technically I don't see why it's needed, but probably inference limitations
<pippijn> gadts are new
<larsrh> I overheard some time ago that they've been added
<invariant> larsrh, there are multiple ways in which it can be done the.
<invariant> then. You can even build a list of modules in OCaml now.
chambart has joined #ocaml
<larsrh> oh, nice
<larsrh> looks like I have to play a bit with more new features soon
<invariant> larsrh, in what language do you normally program?
<invariant> larsrh, or are you a polyglot?
<larsrh> invariant: Scala and Haskell
<invariant> larsrh, I like Haskell, but the tools are just so slow......
<invariant> larsrh, from what I heard of Scala, the same problem exists.
<invariant> larsrh, OCaml has been optimized for practical matters like delivering a hypervisor (Xen).
<invariant> Haskell has been optimized for students to write parsers, I think.
<larsrh> yeah, the speed of OCaml's compiler beats many other languages
<larsrh> it's a nifty language, but I miss implicit dictionary passing (aka type classes)
<larsrh> is it possible to define a right-associative operator?
<larsrh> want to get rid of Cons (... Cons (...))
<invariant> It's about how much time it costs to compile divided by the amount of time it takes your program runs.
<invariant> Or some other function, naturally.
<invariant> The Haskell people seem to assume that their CI tool compiles the code once and they never need to do it ;)
<larsrh> since I have a powerful machine, I don't really care about compilation speed anymore :)
<invariant> larsrh, I wrote some software in Haskell and it takes 5 minutes to compile.
<invariant> larsrh, this is not counting the dependencies.
<invariant> larsrh, the same thing would take 3 seconds in OCaml.
<pippijn> I doubt that
<pippijn> maybe 20 seconds
<larsrh> now with more operators! http://pastebin.com/Cbu0L0hi
as has quit [Quit: as]
<invariant> pippijn, how many lines per second does OCaml do?
<larsrh> I do like that.
<larsrh> "lines per second"? I doubt that this metric makes sense
<adrien> invariant: no rule
<pippijn> no rule indeed
<adrien> larsrh: it makes sense for some languages like C
<invariant> larsrh, sure it does. One takes a bunch of common applications and counts the compilation time.
<pippijn> it heavily depends on what language features you use
<pippijn> the measure makes no sense in C++, either
<larsrh> scalac for example is "fast enough" for most cases, except if you (ab)use implicit search
<pippijn> I can write a piece of C++ that compiles in 0.5 seconds and if I add one line, it takes 10 minutes
<larsrh> yes, that's trivial
<pippijn> and takes 5GB of memoy
<pippijn> memory
<larsrh> template metaprogramming is Turing complete
<invariant> I can make it never return too.
<larsrh> as is the preprocessor
<invariant> Exactly.
<larsrh> and the language itself :)
<pippijn> larsrh: it's not trivial
<pippijn> larsrh: and the preprocessor is not turing complete
<larsrh> it isn't?
<pippijn> larsrh: template instantiation depth is limited to maybe 10-100 instantiations
<pippijn> so it's not trivial to create such a corner case
<larsrh> pippijn: you can set that depth in gcc via command line
<pippijn> sure
<pippijn> but that's non-standard
<invariant> The type language of OCaml isn't Turing Complete.
<pippijn> you can get this behaviour in pure standard C++ with an instantiation depth of 7
<invariant> pippijn, it's guaranteed to 17.
<larsrh> pippijn: do you have your example handy? Would like to see it
<pippijn> or 17 :)
<pippijn> larsrh: no, it's far away in some git repo
<larsrh> What's the trick?
<pippijn> boost::bimap
<pippijn> instantiating it many times
<pippijn> it's super heavy
<larsrh> oh, nice
<larsrh> the question is whether boost can be considered "cheating" :)
<pippijn> no
<pippijn> the point was that "lines per second" is a useless figure for C++
<pippijn> I can write things like boost myself, then it's not cheating?
<invariant> pippijn, we were talking about OCaml vs Haskell.
<pippijn> it doesn't make sense in ocaml, either
<pippijn> for the same reason
<pippijn> both ocaml and C++ have language constructs that take a long time to compile
<invariant> pippijn, what is slow in OCaml?
<pippijn> objects, mutually recursive functions
<pippijn> namespace operations
<pippijn> "include"
<pippijn> object coercions
<pippijn> objects themselves are not that slow, but coercions are
<invariant> pippijn, how are coercions slow at compile time?
<pippijn> what is your question?
<pippijn> "how"?
<pippijn> well.. they take much time
<invariant> pippijn, we were discussing compile time speed.
Kakadu has quit []
<invariant> pippijn, does it need to do a lot of work to figure out that something is safe?
<pippijn> do you want to know the compiler-internal reason?
<pippijn> I don't know
<invariant> pippijn, yes
<pippijn> I just know this from experience
<invariant> Before we glorify OCaml completely, there are also some O(n^2) areas still left.\
<larsrh> anyway, I'm off for today
<gustav__> I never got the O notation. What if there are more than one iteration, for instance?
<larsrh> I'm going to try what's possible next week or so
<pippijn> gustav__: then what?
<pippijn> gustav__: determining the length of a list is O(n)
<gustav__> pippijn: How are you going to denote that? Or network access?
<pippijn> network access is irrelevant to algorithmic complexity
<gustav__> Knew you were going to say that.
<gustav__> So how do I denote performance of network reliant code?
<gustav__> A lot of cracks in that facade.
<pippijn> O notation is not about performance
ftrvxmtrx has joined #ocaml
<gustav__> Doesn't have to be. Would be my response to that.
<pippijn> what does that mean?
<gustav__> Network code adds unknown complexity.
<pippijn> no
<pippijn> well yes
<larsrh> gustav__: have you read http://en.wikipedia.org/wiki/Big_O_notation ?
<adrien> s/network/IO/
<gustav__> I'm accessing algorithms far-far way, in a far away galaxy.
<adrien> not algorithmic complexity but code complexity maybe
<larsrh> it's a purely mathematic notion
<gustav__> larsrh: Couple of times. Maybe not all of it.
<pippijn> I/O doesn't do anything to complexity
<adrien> O notation is only about processing power, not latency
<gustav__> Is there like a subset of instructions that can be used in an algorithm which call or jmp is not a part of?
<pippijn> depending on your definitions, writing a character to network can be O(1) or O(n)
<gustav__> Everything in a computer network is built on mathematics. Network cards are logic and so on.
<gustav__> Yep.
<gustav__> Some times of the day O(n^2) and so on.
<pippijn> it depends on what the "n" counts
<gustav__> Well, exactly.
<tane> gustav__, so, what is n then?
<pippijn> for what definition of "n" is writing a character to network O(n^2)?
<gustav__> n = length of input.
<pippijn> what is the length of a character?
<tane> the power of O-notation is exactly to ignore this kind of stuff and is not a bit related to "time"
<gustav__> Hmmm.
<gustav__> So network calls are ignored in O...?
<pippijn> depends on what you mean by "ignored"
<pippijn> and it depends on what exactly you're analysing
<tane> O is not made to analyse what "time" it will take to perform a certain action, but how many of these actions you perform
<pippijn> in O-notation, you atomise certain operations
<pippijn> for example, you can atomise "write string to network"
<pippijn> that becomes 1
<pippijn> now, writing a list of n strings to network becomes O(n)
<pippijn> writing only the first string of that list to network is O(1)
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
<pippijn> but writing a single string of length n to network is O(n) if you say that the atomic operation is writing a character to network
<pippijn> it becomes more interesting when the "atomic operation" depends on n
<pippijn> for example, if your string is actually a character list
<pippijn> and you decide to use indexing instead of iterating
<pippijn> then your code will be: let n = List.length charlist in for i = 0 to n - 1 do write (List.nth charlist n) done
<pippijn> "write" is the atomic operation
tac has quit [Ping timeout: 245 seconds]
<pippijn> List.nth is not atomic, it takes "i" operations
<pippijn> gustav__: let me know when you figure out what the complexity of that algorithm is :)
eikke has quit [Ping timeout: 248 seconds]
eikke has joined #ocaml
<pippijn> does anybody here know omake?
<pippijn> I'm trying this
<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
<pippijn> what rule does this mask?
larhat has joined #ocaml
larhat has quit [Ping timeout: 255 seconds]
chambart has quit [Ping timeout: 246 seconds]