<vincenz>
seems to work better under linux than cygwin
<vincenz>
how can you tell when your bot has connected before you can do a join channel
oasisbot has joined #ocaml
<vincenz>
hi
oasisbot has quit [Remote closed the connection]
<schlick>
More or less random question... I can see how types stop most kinds of problems, but if you want to assure that something is a particular set of values, at a particular point (e.g. to make sure a operation only results in sane values), how do you use types to do that?
<schlick>
Sorta like a type checked "assert" statement.
<vincenz>
make sure your type is strict enough
oasisbot has joined #ocaml
<schlick>
How do you make the check occur at a particular point though?
oasisbot has quit [Remote closed the connection]
<vincenz>
you make sure your func only takes that type
<schlick>
Like if a variable is set to one of 3 values at point A, and then later on at point B it should have one of two different values (none of the three original are valid)?
<vincenz>
that can't be done wiith types
<vincenz>
that's implicitly runtime
<vincenz>
well that's not fully accurate
<vincenz>
look at polymorphic variants
oasisbot has joined #ocaml
oasisbot has quit [Remote closed the connection]
<schlick>
So it can be type checked then?
<schlick>
With the polymorphic variants thing?
<vincenz>
it's not typechecked
<vincenz>
it's runtime checked
<vincenz>
obviously
<vincenz>
and nm
<vincenz>
I don't think polymorphics do that either
<vincenz>
that's implicitly a runtimie thing
oasisbot has joined #ocaml
oasisbot has quit [Remote closed the connection]
<schlick>
Not necessarily obviously. Supposedly dependent types can do everything a model checker can do. A model checker /can/ check for this sort of thing.
<schlick>
I'm just not real sure how to do it.
<vincenz>
how does a modelchecker work
oasisbot has joined #ocaml
<kmag>
Are any of you aware of French language IRC channels for discussing Ocaml?
<vincenz>
kmag: celle-ci?
oasisbot has quit [Remote closed the connection]
_fab has quit [Remote closed the connection]
<schlick>
You, basically, specify what range of states are allowed at any given point, it checks to make sure that only those states can occur, apparently by tracing along the execution path and keeping track of what set of values each data unit can hold at a given time.
<vincenz>
schlick: checks how
<vincenz>
well maybe if you make a compelx typing system you cold do that
<schlick>
does set A contain exactly the same set as B, I suspect.
<schlick>
No more, no less.
<schlick>
I haven't written one so I don't know.
<vincenz>
schlick: read tapl please
<kmag>
vincenz: there is not another channel preferred for French discussions of Ocaml?
<schlick>
The three bug killing options appear to be type checking, model checking, and theorem proving. They're supposedly roughly equivalent but model checking takes a lot more time and ram (when the sets get big).
<schlick>
vincenz: I don't have my copy yet.
<vincenz>
kmag: no
<vincenz>
kmag: this is the most 'official one'
<vincenz>
schlick: a type is just an abstract annotation
<vincenz>
schlick: it can be anythiin you want it to be, provided you make the typesystem work with it
<schlick>
I suppose. My current understanding of it is it's a label for a data unit that says what operations can be performed on it. Somehow some languages (e.g. ML) can also determine the set of values it can have, and make sure nothing can set it to anything but that. The latter is a bit mysterious. I'm not too sure how you'd go about, basically, converting a type at a given point.
<schlick>
you'd go about, basically, converting a type at a given point, to check it against a different set.
<schlick>
Since doing so would definatly not normally be safe.
vodka-goo has quit ["Connection reset by by pear"]
<vincenz>
I think that modelchecking checks every possible value, which isi basically runtime testing durinig compilation
<schlick>
It's not tied to the compiler. But that's more or less the idea. There are, apparently, techniques to cut down the set to test to something managable.
<vincenz>
probably a smart system that checks boundary conditions
<vincenz>
tho I bet it's limite
<schlick>
There are limits, yes, you can't check infinite states.
<vincenz>
\o/
<schlick>
For instance if something generates a stream with no definite end, you can't verify the stream handler is working correctly by modelling all possible streams.
<vincenz>
I think I made my basic ircbot to log http links
<schlick>
What you can do is test it for all possible "chunks" since no program handles infinite data as one infinite chunk.
<schlick>
Sorry if there's a more precise term than "chunk", I don't know it if there is. Hopefully the meaning is clear. The units of data read from the stream.
* vincenz
Thread.create (fun () -> while true do sleep (); done) ()
shirogane has joined #ocaml
pango_ has joined #ocaml
pango has quit [Read error: 145 (Connection timed out)]
joshcryer has joined #ocaml
quamaretto has quit ["Leaving"]
Smerdyakov has quit ["Leaving"]
inkedmn has quit []
shirogane has quit [Read error: 104 (Connection reset by peer)]
bluestorm has quit [Remote closed the connection]
Mozillion has joined #ocaml
Mozillion has quit [Read error: 110 (Connection timed out)]
pango_ has quit [Read error: 54 (Connection reset by peer)]
noj has quit ["leaving"]
Mozillion has joined #ocaml
Submarine has joined #ocaml
noj has joined #ocaml
pango has joined #ocaml
Skal has joined #ocaml
Submarine has quit ["Leaving"]
Revision17 has joined #ocaml
Raziel has quit [Remote closed the connection]
Raziel has joined #ocaml
revision17_ has quit [Success]
<Mozillion>
ski: it's working a lot better now
<Mozillion>
there is a problem though with 2 rules starting with the same non-terminal
Snark has joined #ocaml
takuan has joined #ocaml
Schmurtz is now known as Schmurtzz
Schmurtzz is now known as Schmurtz
vodka-goo has joined #ocaml
Oejet has joined #ocaml
Mozillion has quit ["Client exiting"]
malc_ has joined #ocaml
_fab has joined #ocaml
gim has joined #ocaml
jave` has joined #ocaml
ski__ has joined #ocaml
ski has quit [Nick collision from services.]
ski__ is now known as ski
__DL__ has joined #ocaml
descender has quit [Read error: 110 (Connection timed out)]
ppsmimou has joined #ocaml
Maledict has joined #ocaml
Oejet has left #ocaml []
Raziel has quit ["Yo soy goma. Tú eres cola."]
_DL_ has joined #ocaml
__DL__ has quit [Read error: 104 (Connection reset by peer)]
Maledict has quit [Read error: 110 (Connection timed out)]
Mozillion has joined #ocaml
Smerdyakov has joined #ocaml
_DL_ has quit [Read error: 104 (Connection reset by peer)]
__DL__ has joined #ocaml
__DL__ has quit [Read error: 104 (Connection reset by peer)]
__DL__ has joined #ocaml
bluestorm has joined #ocaml
bluestorm has quit [Client Quit]
exa has quit [Remote closed the connection]
Mozillion has quit ["Client exiting"]
gim has quit ["うつへいきましょ"]
WFrag has joined #ocaml
<WFrag>
Hello
<WFrag>
Could anybody point me how to append a character to a string?
<mellum>
You can't.
takuan has left #ocaml []
Schmurtz has quit [Read error: 104 (Connection reset by peer)]
Mozillion has joined #ocaml
<malc_>
let append_char s c = let t = " " in t.[0] <- c; s ^ t
Schmurtz has joined #ocaml
<malc_>
let append_char s c = let l = String.length s in let t = String.create (succ l) in String.blit s 0 t 0 l; t.[l] <- c; t
Schmurtz has quit [Remote closed the connection]
<malc_>
let append_char s c = let b = Buffer.create 10 in Buffer.add_string b s; Buffer.add_char b c; Buffer.contents b
<WFrag>
fantastic :)
malc_ has quit [Remote closed the connection]
smimou has joined #ocaml
Schmurtz has joined #ocaml
malc_ has joined #ocaml
shirogane has joined #ocaml
Schmurtz has quit [Read error: 104 (Connection reset by peer)]
pango has quit ["Leaving"]
pango has joined #ocaml
shirogane has quit [Remote closed the connection]
WFrag has quit [Read error: 110 (Connection timed out)]
<vincenz>
malc_: that first one ain't efficient
Skal has quit [Remote closed the connection]
Skal has joined #ocaml
Skal has quit [Remote closed the connection]
shirogane has joined #ocaml
Skal has joined #ocaml
KrispyKringle has joined #ocaml
shirogane has quit [Remote closed the connection]
Raziel has joined #ocaml
Snark has quit [Read error: 110 (Connection timed out)]
<malc_>
vincenz: so?
descender has joined #ocaml
<flux__>
consequentially using such a function isn't efficient in any case
<malc_>
bah, what a load of bullcrap
<flux__>
(so it's better to use Buffers for that case)
<malc_>
it's better to code it all in assembly
<flux__>
well, even in if you did it in assembly converting a O(n) algorithm to O(n^2) algorithm is a bad idea
<flux__>
(if you, say, loop an input string and append each character to some other string)
<flux__>
eventually the better algorithm prevails ;)
<malc_>
eventually nothing of this matters
<malc_>
thing either fits or it does not
<flux__>
true, eventually the cosmos will collapse
<malc_>
context wasn't given
<malc_>
either of my solutions could have been perfect
<malc_>
or not
<malc_>
so there
<flux__>
I thought they were all perfect solutions
<flux__>
but that the problem might have been wrong ;)
<malc_>
we would never know, the damn russkie who asked the question left
<malc_>
to hell with him
<flux__>
:-)
lightstep has joined #ocaml
lightstep has quit ["good night"]
descender has quit ["XML is like violence, if it doesn't solve the problem, just use more."]
__DL__ has quit ["Bye Bye"]
Schmurtz has joined #ocaml
vodka-goo has quit ["Connection reset by by pear"]