sgnb` has quit [Read error: 104 (Connection reset by peer)]
<jbapple>
Well, since the ocaml debugger can travel *backwards* in time, I'll just ask it to take me *forward* to a time when chameleon2 is feature-complete. :-)
jeddhaberstro has quit []
BiD0rD has joined #ocaml
BiDOrD has quit [Read error: 110 (Connection timed out)]
verte has joined #ocaml
rwmjones has joined #ocaml
verte_ has joined #ocaml
verte has quit [Nick collision from services.]
verte_ is now known as verte
verte has quit [Read error: 60 (Operation timed out)]
kaustuv has quit [Read error: 113 (No route to host)]
Snark has joined #ocaml
Snark has quit [Client Quit]
totom has quit [Read error: 101 (Network is unreachable)]
jeremiah has quit [Read error: 104 (Connection reset by peer)]
Yoric[DT] has joined #ocaml
itewsh has quit [Success]
jeremiah has joined #ocaml
itouch has quit ["There are only 10 kinds of people: those who understand binary and those who don't"]
xerxes has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
Jedai has joined #ocaml
BiD0rD has quit [Remote closed the connection]
mperillo has joined #ocaml
BiDOrD has joined #ocaml
Camarade_Tux has quit ["Quitte"]
Camarade_Tux has joined #ocaml
mpwd has joined #ocaml
Camarade_Tux has quit ["Quitte"]
verte has joined #ocaml
verte_ has joined #ocaml
Camarade_Tux has joined #ocaml
verte has quit [Nick collision from services.]
verte_ is now known as verte
maskd- has joined #ocaml
maskd- is now known as maskd
verte_ has joined #ocaml
verte has quit [Read error: 60 (Operation timed out)]
verte_ is now known as verte
_zack has joined #ocaml
Smerdyakov has joined #ocaml
jeanb-- has joined #ocaml
jeanbon has quit [Nick collision from services.]
jeanb-- is now known as jeanbon
mpwd has quit [Read error: 104 (Connection reset by peer)]
angerman has joined #ocaml
monadic_kid has quit ["Leaving"]
verte_ has joined #ocaml
verte has quit [Nick collision from services.]
verte_ is now known as verte
mpwd has joined #ocaml
verte_ has joined #ocaml
verte has quit [Nick collision from services.]
verte_ is now known as verte
seafood has quit [Connection timed out]
verte has quit [Read error: 110 (Connection timed out)]
ztfw has quit [Remote closed the connection]
ztfw has joined #ocaml
monadic_kid has joined #ocaml
dejj has joined #ocaml
<flux>
finally I have a use case for bitstring, get to try it out
mpwd_ has joined #ocaml
mpwd has quit [Read error: 110 (Connection timed out)]
dejj_ has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
dejj has quit [Read error: 110 (Connection timed out)]
ztfw has quit [Remote closed the connection]
ztfw has joined #ocaml
jeremiah has joined #ocaml
<flux>
hmm, is it my bug, or is having a tail recursing parser non-trivial with bitstring?
<flux>
I'm recursing from within the bitmatch expression and my stack blows
<Smerdyakov>
Switch to a compiler without a stack limit. ;)
<flux>
smerdyakov, well, it would use memory without bounds, which isn't good either
<flux>
smerdyakov, besides SML doesn't have a bit matching syntax extension, so that would not help me at all :)
<thelema>
flux: is there a reason you need to recurse so deep?
<flux>
thelema, I have a packet capture with variable size packets. I recurse after parsing each packet. of course, I could do the loop outside that parsing function, but I would have expected that to work..
<flux>
(I simply changed that from bitmatch bits with | .. -> do_something .. to (bitmatch bits with | .. -> fun () -> do_something..) (), it now works)
<thelema>
bitmatch does some crazy rewriting, I'm not surprised it stops being tail recursive
jeremiah has quit [Read error: 104 (Connection reset by peer)]
<palomer>
hrmph
<palomer>
can someone give me an example of using printf?
<thelema>
palomer: [Printf.printf "%d: %d" 12 81]
itewsh has joined #ocaml
<palomer>
hrmph...
<palomer>
printf looks like magic
<flux>
it is
<flux>
delicious magic!
<palomer>
printf x always returns unit
<palomer>
printf x y also
<palomer>
printf x y z also
<palomer>
what gives?
<flux>
format string parsing in the compiler gives
<palomer>
how is printf well typed?
<flux>
val printf : ('a, Pervasives.out_channel, unit) Pervasives.format -> 'a
<flux>
the magic is in the type
<flux>
read functional unparsing white paper for better insight
<monadic_kid>
the format type is treated specially, the string literal is analyzed at compile-time
<monadic_kid>
and generates function types for you from that string
<palomer>
so the type of printf x depends on x
<monadic_kid>
yes
<flux>
depends what you mean
<monadic_kid>
x being a string format
<palomer>
at compile time...
<flux>
that's like saying let identity a = a 's type depends on a
<palomer>
what about let x = printf in x y z
<flux>
which it sort of does, but on the other hand doesn't
<thelema>
palomer: the compiler analyzes your format string and generates a non-string type for it which drives the rest of the system.
<palomer>
how does the compiler know if a computation will reduce to printf?
<flux>
palomer, entering let x = Printf.printf in the toplevel will give you the answer
<flux>
palomer, "printf" itself is not magical. it is the string type when used in the place of Persavisev.format is.
<monadic_kid>
if you look at the docs for the format type, one of the type varibles is what get substituted with a function type which is computed from the format string at compile-time
jeremiah has joined #ocaml
<palomer>
ahh, that's really magical
<flux>
batteries has printf with different flavour of magic
mpwd has joined #ocaml
<monadic_kid>
really? it looked like it was doing the samething to me
<flux>
but it requires annotating the format strings with a prefix
<flux>
monadic_kid, I mean the new shiny extensible ones
<monadic_kid>
but on the same ideas of using a format string and extracting function types from it at compile-time?
<flux>
monadic_kid, I thought it simply creates a tuple of certain type, like ("hello % bar %", [(fun () -> ..); (fun () -> ); etc])
<flux>
yes
<monadic_kid>
could do, haven't used put my batteries in :P
<flux>
so haven't I :)
* monadic_kid
deactivates into the abyss with the lack of power supplied from batteries
<palomer>
err
<thelema>
the batteries printf uses camlp4 to convert the string into a printer structure
<palomer>
is there a function for unparsing? (ie string substitutions)
<monadic_kid>
so you could write most of those functions in terms of ksprintf
<palomer>
how is that any better than failwith (Printf.sprintf "aargh,error:%s" "foo") ?
<flux>
less parenthesis!
<monadic_kid>
your giving it a function to pass on the results so you can do what ever you want
<monadic_kid>
*you're
<flux>
and it works also even if you happen to have a monadic or cps-based IO system
<flux>
which btw I hope so does the batteries equivalent of formatting strings
<palomer>
why isn't printf in pervasives?
<flux>
btw, there's the Format module too
<flux>
it might actually be a good idea to use it instead, but I don't remember why :)
<flux>
it may be related to using the %t specifier in the format string
<monadic_kid>
in F# sharp the format type has a property called Value for which you can pattern match on if you're was gonna write your own functino that takes format strings
<monadic_kid>
you can write your own functions that take the format type and have functin types generated from string formats and i'm assuming that is the case with ocaml too
ztfw` has joined #ocaml
mpwd_ has quit [Connection timed out]
<monadic_kid>
how do you guys handle very stateful problems like game states, is FRP the only decent way to go?