Amorphous has quit [Read error: 145 (Connection timed out)]
<Kerris7>
I want "Intro to Comp Sci with OCaml" :P
Kerris7 has quit ["Who is Candlejack? Is he going to c"]
Amorphous has joined #ocaml
Camarade_Tux has quit ["Leaving"]
Amorphous has quit [Read error: 145 (Connection timed out)]
Amorphous has joined #ocaml
alexyk has quit []
Palace_Chan has joined #ocaml
struktured has quit [Read error: 60 (Operation timed out)]
struktured has joined #ocaml
Palace_Chan has quit ["Palace goes to sleep"]
purple__ has quit [Remote closed the connection]
seafood has joined #ocaml
det has quit [Remote closed the connection]
det has joined #ocaml
jeddhaberstro has quit []
jeddhaberstro has joined #ocaml
jeddhaberstro has quit [Client Quit]
seafood has quit []
struktured has quit [Read error: 110 (Connection timed out)]
purple has joined #ocaml
purple is now known as Guest22332
Guest22332 is now known as purple_
struktured has joined #ocaml
alexyk has joined #ocaml
mwhitney has quit [Read error: 60 (Operation timed out)]
mwhitney has joined #ocaml
mwhitney has quit [Read error: 110 (Connection timed out)]
xevz has quit [Remote closed the connection]
xevz has joined #ocaml
<alexyk>
I'm narrowing down debugging of a parallel system deadlock; it uses C clients returning string results; the results are returned with: CAMLreturn (caml_copy_string(str.c_str()));
<alexyk>
is there an issue with garbage-collecting this somehow? accessing this result stops a process sometimes
<tsuyoshi>
iirc you can't return the result of a function directly
<tsuyoshi>
you should put the result of caml_copy_string into a CAMLlocal variable
<tsuyoshi>
and then return that
<alexyk>
tsuyoshi: do I just declare the local then?
johnnowak has joined #ocaml
alexyk has quit []
r0bby has quit [kornbluth.freenode.net irc.freenode.net]
caligula_ has quit [kornbluth.freenode.net irc.freenode.net]
ppsmimou has quit [kornbluth.freenode.net irc.freenode.net]
maxote has quit [kornbluth.freenode.net irc.freenode.net]
glondu has quit [kornbluth.freenode.net irc.freenode.net]
glondu has joined #ocaml
caligula_ has joined #ocaml
ppsmimou has joined #ocaml
maxote has joined #ocaml
maxote has quit [SendQ exceeded]
maxote has joined #ocaml
r0bby has joined #ocaml
Camarade_Tux has joined #ocaml
slash_ has joined #ocaml
apples` has quit ["Leaving"]
olgen has quit []
marmotine has joined #ocaml
Yoric[DT] has joined #ocaml
<Yoric[DT]>
hi
<flux>
how would one go about submitting a patch to godi? (godi_console in this case, I really was missing that search feature..)
<flux>
perhaps a distributed vcs would make sense with godi..
seafood has joined #ocaml
slash_ has quit [Client Quit]
seafood has quit []
Associat0r has joined #ocaml
vixey has joined #ocaml
nickeldeuce has joined #ocaml
jackie_ has joined #ocaml
Kerris7 has joined #ocaml
<Kerris7>
Could anyone please tell me how to print every line from a file using ExtLib?
jackie_ has quit [Remote closed the connection]
authentic has quit [Read error: 110 (Connection timed out)]
<kig>
i'd do it with eachLine puts myfile, but i don't know how to do it with extlib
<kig>
where eachLine f fn = withFile fn (eachLineIc f) and eachLineIc f ic = tokenizeIter input_line f ic and tokenizeIter t f ic = maybeEOF () (loop (f @. t)) ic and maybeEOF v f x = try f x with End_of_file -> v and loop f x = f x; loop f x and withFile fn f = finally close_in f (open_in_bin fn) and finally fin f x = let r = try f x with e -> (try fin x with _ -> ()); raise e in fin x; r
<kig>
...
<flux>
I'm thinking there is a function that converts a file into a string Enum.t, and then there are functions that work with the enumeration
<kig>
the Stream module has something for that
<Kerris7>
thanks, looking into i
<Kerris7>
it
Jarvellis has joined #ocaml
ivan_chernetsky has joined #ocaml
ivan_chernetsky has left #ocaml []
<kig>
(nevermind Stream though)
<Kerris7>
thanks kig, noted
<kig>
just looked up my snippet to convert a character stream into a line stream and it's a bit involved
<flux>
kerris7, if you have extlib mli-files handy, grepping them for the type you're interested in might be helpful
<flux>
for example starting with grepping for 'string' might be a good start
<Kerris7>
thanks flux
<flux>
even grepping for more complex types like 'Enum.t -> string' can give useful answers
<rwmjones>
flux, in general if you find any 3.11 porting problem, you can see the patches we are using by going up a directory there and looking at our ocaml package
Kerris7 has quit ["Who is Candlejack? Is he going to c"]
blue_prawn has joined #ocaml
Jarv2 has joined #ocaml
Jarvellis has quit [Read error: 110 (Connection timed out)]
mpeter has joined #ocaml
<mpeter>
well as far as i can tell
<mpeter>
this is basically haskell, except less weird
<mpeter>
feel free to dispute that
<flux>
cool, this works, possibly even before 3.11: module M : sig type t = private { mutable foo : int } val mk_int : int -> t end = struct type t = { mutable foo : int } let mk_int v = { foo = v } end;;
<flux>
and after that you expose type t, but others cannot mutate the field foo even if they see it
<thelema>
yup, that's the intent of private types.
<thelema>
they got added in 3.10.something
<flux>
yeah, I was only thinking they'd prevent from constructing new values of that type
<flux>
but they sort of work also as a c++ const qualifier for outside modules
<thelema>
flux: although you don't mutate foo anywhere.
<flux>
thelema, right, that was just an example of the module
<flux>
example of using code would go like: (M.mk_int 42).M.foo <- 42 -> illegal
<Yoric[DT]>
mpeter: care to elaborate?
<flux>
yet (M.mk_int 42).M.foo can be accessed ok
<thelema>
oops, private row types were introduced in 3.09.0
<thelema>
for object and variant types
<flux>
the new feature is that private type abstracting, which is interesting too
<thelema>
I really like the private type abstracting, because having to tag an int to make it private was... unsatisfying
<Yoric[DT]>
It would make sense in a different language.
<Yoric[DT]>
But yeah, in OCaml, it's weird.
<mpeter>
i don't know how to elaborate
<mpeter>
how is this different from haskell?
<mpeter>
do you guys have a split function? ;)
<vixey>
mpeter, stop comparing against haskell
<thelema>
mpeter: to split a string into substrings by delimiter? of course.
slash_ has joined #ocaml
<mpeter>
thank god
<mpeter>
and OpenGL bindings?
<blue_prawn>
what's the problem with openGL bindings?
<thelema>
mpeter: yes
<mpeter>
there's no problem, only a solution, of course
<Yoric[DT]>
mpeter: well, was there a question in your previous sentence?
<Yoric[DT]>
mpeter: and, more importantly, what is "this"?
<mpeter>
ocaml is this
<Yoric[DT]>
ok
<Yoric[DT]>
Could have been a specific library.
<mpeter>
i was hoping that would be taken for granted
<Yoric[DT]>
Well, on this channel, people tend to ask more specific questions :)
<mpeter>
yeah, yeah
<blue_prawn>
mpeter: sorry I'm just coming, I've not seen the beginning of the talk,
<blue_prawn>
mpeter: what is he problem ?
<blue_prawn>
s/he/the/
<thelema>
Yoric[DT]: what do I need to do to fix documentation so it'll build?
<thelema>
(context: batteries)
Jarv2 has quit [Remote closed the connection]
Jarv2 has joined #ocaml
Jarv2 has quit [Remote closed the connection]
* mpeter
wakes up
<mpeter>
no problem
<blue_prawn>
only solutions? OK :)
Snark has joined #ocaml
<mpeter>
./` there are no solutions
<mpeter>
./` the problems stay the same ./`
<blue_prawn>
are you new to ocaml ?
<mpeter>
yes
<mpeter>
not new to FP though
jackie_ has joined #ocaml
<thelema>
Is anyone here not new to OCaml?
* thelema
is new to ocaml - only started around 3.00
marmotine has quit ["mv marmotine Laurie"]
* vixey
is new to ocaml
Jarv2 has joined #ocaml
<mpeter>
hey vixey
<mpeter>
when did you come in
<blue_prawn>
me, it's been several years I use ocaml as my default language, but I'm still a beginner
<blue_prawn>
Gionne: you are using a function named "unique" at line 200
<thelema>
blue_prawn: which looks defined at L181
<blue_prawn>
thelema: indeed
<thelema>
the (" I see are inside comments
<thelema>
and I've been through ocaml's comment handling, and it's quite robust.
<blue_prawn>
is Ast a lib available somewhere ? (I can not run the code)
<thelema>
I can't imagine it failing on ("
<blue_prawn>
one time I have seen that we cannot put an odd number of " inside comments
<thelema>
I assume it mostly defines the data structures
<Yoric[DT]>
thelema: I'll try and take a look at the doc problem today.
<thelema>
(it = Ast)
<thelema>
or just give me an idea where to start on it (without just neutering the current comments)
Jarv2 has quit [Read error: 54 (Connection reset by peer)]
<thelema>
maybe that's a good place to start - making a branch point for fixed comments, and neutering them in master
Jarv2 has joined #ocaml
<Gionne>
the (" is at line 196
<Gionne>
and 142
<thelema>
and why do you have such unmatched strings?
<Gionne>
pasting problem ;)
<Gionne>
resizing the terminal on Mac Os X gives this issues
<Gionne>
these
<thelema>
okay.
<blue_prawn>
so it was not really (" but the odd number of "
<Gionne>
ah k
<Gionne>
funny
<Gionne>
;)
<thelema>
yes, strings inside comments do need to be properly formed.
<blue_prawn>
# (* "*)" *) 3 ;;
<blue_prawn>
- : int = 3
Snark has quit ["Ex-Chat"]
<Gionne>
# (* "*) *) 3 ;;
<Gionne>
*
<Gionne>
;)
<blue_prawn>
means the comment is still opened
<flux>
funny feature that
<blue_prawn>
I imagine that in order to get nested comments, the contents of comments have to be parsed
<flux>
I don't think nesteed comments in any way implies a requirement to understand strings within them
<blue_prawn>
yes the example I gave above (* "*)" *)
<flux>
yes, ocaml does handle strings inside comments, but that feature isn't in any way intrinsic to handling nested comments, right?
<thelema>
flux: agreed, but that's what happens. strings, character constants and \010 (for keeping track of the line number)
<thelema>
from the comment:
<blue_prawn>
here we see that ocaml needs to know if the closing tag is inside a string or not
<thelema>
Lexers comment and action are quite similar,
<thelema>
they should lex both strings and characters,
<thelema>
in order not to be confused by what is inside then
Koordin has joined #ocaml
<Koordin>
hi, i've read this in the man page of Nums : "Numbers (type num ) are arbitrary-precision rational numbers, plus the special elements 1/0 (infinity) and 0/0 (undefined).". But if i try "(num_of_int 1) // (num_of_int 0) i'm getting Exception: Failure "create_ratio infinite or undefined rational number".
anryx has joined #ocaml
<thelema>
heh, gtksourceview's highlighting already handles strings in comments properly.
<blue_prawn>
perhaps num_of_int(1/0)
<thelema>
blue_prawn: not that either.
<thelema>
Koordin: you have to turn off the error_when_null_denominator_flag
<thelema>
It's a little bit hard to read, but the info is there if you de-cross-reference it properly
<thelema>
also, you could read caml/mlvalues.h
<Koordin>
ok thanks a lot
<thelema>
okay, using the right terminology this time: "All ocaml blocks have length info in their header word"
<cygnus_>
is ocaml dying to haskell?
<vixey>
cygnus_, no
<thelema>
cygnus_: no.
<vixey>
cygnus_, why?
<cygnus_>
it seems haskell is more popular
<vixey>
cygnus_, and popular means better right? :p
<cygnus_>
right
<vixey>
not the answer I expected..
seafood has quit []
<thelema>
java is more popular than both - go program in it.
<vixey>
hehe
<cygnus_>
what is ocaml doing that haskell is not fulfuilling
<vixey>
cygnus_, stop comparing haskell and ocaml
<thelema>
cygnus_: are you here to convince us to switch to haskell?
<cygnus_>
no i am trying to convince myself what is better for me
<olegfink>
why not use both?
<thelema>
cygnus_: depends on what you want to do with it, of course.
<vixey>
cygnus_, use both for a couple years then decide
<cygnus_>
what are the stronger areas of ocaml
<olegfink>
speaking of using both, were there any attempts at ocaml<->haskell interoperability at a level higher than what e.g. SWIG might do?
<thelema>
not easy, with the fundamentally different runtime systems. eager vs. lazy
<thelema>
cygnus_: ocaml allows OO, functional and imperative programming when appropriate. haskell - not so much.
<olegfink>
yes, very different code, but many similar data srtuctures (excdept explicitly lazy or exlpicitly imperative)
<olegfink>
uh, I can't type.
<thelema>
not really - I'm trying to imagine ocaml handling of a lazy value from haskell (some sort of thunk with connections to everything needed to run in order to evaluate it)
<cygnus_>
why do you want procedural in a functional programming language
<cygnus_>
it seems like it's just hacks then
<thelema>
cygnus_: because sometimes it's just the right way to do something. Many recursive functions are just while loops in disguise. :)
<Yoric[DT]>
Actually, I tend to believe that the reason why OCaml seems to progress slowly wrt Haskell these days is that focus seems to have moved to Coq.
<vixey>
still it is difficult to write a program in Coq
* thelema
looks up what xavier spends his time on these days
<vixey>
(I mean a program with a strong specification)
<olegfink>
thelema: that probably doesn't make much sense, but I was thinking more of a source-level helpers, that is, some ways to share data structures and type information, because of course I can use FFI or any other low-level way to run the real code, that's not what's interesting
<olegfink>
or in the worst case, I may pass serialiased values between ocaml and haskell binaries
<Yoric[DT]>
vixey: I haven't checked recently but I believe you can write a program without a strong specification without much difficulty.
<vixey>
Yoric[DT], sorry I meant with
<vixey>
of course this is different to programming in ocaml
vixey has left #ocaml []
vixey has joined #ocaml
<Yoric[DT]>
Well, I'll need to brush up my Coq.
<thelema>
Yoric[DT]: I don't see any mention of Coq on the gallium pages
<vixey>
I'm just complaining because it's tricky.. :p
<olegfink>
but what matters is the 'shape', I don't know if the word prototype is applicable here
<Yoric[DT]>
thelema: well, I've talked with Xavier Leroy a few weeks ago and that seemed clear to me :)
<thelema>
are they developing Coq or using it to prove something else?
<Yoric[DT]>
I believe they're improving Coq and using it to prove something else.
<vixey>
I heard this rumor they are going to do an ocaml compiler with a correctness proof
<Yoric[DT]>
Things such as compilers.
<vixey>
is this true ?
<Yoric[DT]>
I'm pretty sure it's true.
<thelema>
I think it is true that you heard that rumor
<Yoric[DT]>
Actually, I've very nearly been offered a job to work on that :)
<Yoric[DT]>
(or, more precisely, I've been offered a job to very nearly work on that)
<vixey>
hehe
<thelema>
"compcert C verified compiler" hmmm...
<Yoric[DT]>
thelema: the output is supposed to be very slow, unfortunately.
<thelema>
Verification only confirms that code performs as specified - specifications can be woefully improper.
<Yoric[DT]>
Sure.
seafood has joined #ocaml
<vixey>
yeah you still have to think :p
<kig>
so how do you verify the spec
<vixey>
use thinking
<thelema>
from reading Xavier's paper, the spec is the semantics of the given language.
<Yoric[DT]>
There are projects that work on checking that specifications are consistent.
<thelema>
so you don't have to verify it, you just have to use it correctly.
<vixey>
bear in mind specification is usually things like f ∘ g = id
<vixey>
or P x <-> P' x
<kig>
like axioms?
<vixey>
there is not a lot can go wrong in a specification
<Yoric[DT]>
vixey: well, you can have forgotten something, for instance.
<Yoric[DT]>
Which may be a big issue.
<vixey>
kig, for encyption or compression algorithm for example I say, decompress ∘ compress = id
<Yoric[DT]>
But for specifying how a plane is expected to fly, it's a tad more complex.
<vixey>
ok I don't know anything about how to program air traffic systems
<Yoric[DT]>
Neither do I.
<Yoric[DT]>
I actually know more about spi-calculus :)
<Yoric[DT]>
Oh, and even simple stuff such as cryptographic axioms can go wrong.
<vixey>
what's a cryptographic axiom?
<Yoric[DT]>
I mean axioms used to specify/prove implementations of cryptographic protocols.
<vixey>
ok it's something else I don't know really anything about :)
<Yoric[DT]>
:)
<Yoric[DT]>
Well, simple example: for reasoning, you typically assume that there's no way the attacker can simply guess the password.
<Yoric[DT]>
Which may not be true if the attacker has physical access to the machine.
<Yoric[DT]>
So even a nice model and a correct proof may end up proving the wrong property.
<Yoric[DT]>
That's the kind of issue they have with smartcards.
<Yoric[DT]>
("they" being the people who attempt to certify smartcards)
<vixey>
I see
<thelema>
Giving someone encrypted data and the means to decrypt it will always result in them having access to the unencrypted version.
<Yoric[DT]>
Indeed.
<Yoric[DT]>
Well, barring any new stuff I don't understand at all such as quantum cryptography.
<Yoric[DT]>
(or hardware tricks to make data readable only once)
<thelema>
I don't see those having much relevance - it's still possible to make a copy of the data that can be read many times.
<thelema>
and quantum cryptography doesn't change the fact that they have the means to decrypt.
CoryDambach has joined #ocaml
<Yoric[DT]>
I'm not quite sure.
<Yoric[DT]>
Still, I'm not going to proceed on a subject I don't know.
ofaurax has joined #ocaml
<thelema>
fair enough.
<thelema>
batteries docs?
Camarade_Tux has quit ["Leaving"]
<thelema>
Yoric[DT]: I'm making a branch yoric/fixdoc for your changes - I'm going to neuter the docs so they compile again.
jackie_ has quit [Client Quit]
alexyk has joined #ocaml
mpeter has joined #ocaml
Koordin has quit [Remote closed the connection]
Jarvellis has quit [Remote closed the connection]
* thelema
realizes the documentation problem wasn't what he thought
Jarvellis has joined #ocaml
<thelema>
luckily it's a much easier problem, I just have to sit through long compiles to find where the problem sits.
Associat0r has quit []
Jarvellis has quit [Remote closed the connection]
<Yoric[DT]>
thelema: ok.
<Yoric[DT]>
The problem is actually easy, yes.
<Yoric[DT]>
I probably won't have the time to finish fixing it today, though.
<thelema>
I think I've got it.
<thelema>
or not...
<thelema>
some problem left with Mutex
* thelema
tries a clean compile
<thelema>
huh, there isn't a batlib_Baselib_Mutex
<Yoric[DT]>
Yeah, it's been removed.
<Yoric[DT]>
There's now ExtMutex.
Jarvellis has joined #ocaml
<Yoric[DT]>
There's now ExtMutex.Mutex, that is.
* thelema
restarts doc generation
Jarvellis has quit [Remote closed the connection]
<thelema>
there's still many references to baselib_mutex
Jarvellis has joined #ocaml
<thelema>
grr, edited an autogenerated file
Jarvellis has quit [Remote closed the connection]
_zack has quit ["Leaving."]
hkBst has quit [Remote closed the connection]
* Yoric[DT]
sympathizes.
<Yoric[DT]>
Gottago, though.
<Yoric[DT]>
I'll continue tomorrow.
<Yoric[DT]>
Cheers.
Yoric[DT] has quit ["Ex-Chat"]
Jarvellis has joined #ocaml
Jarvellis has quit [Remote closed the connection]
Jarvellis has joined #ocaml
Jarvellis has quit [Remote closed the connection]
Jarvellis has joined #ocaml
mellum has quit ["Hey! Where'd my controlling terminal go?"]