mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.0 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
jeffs has joined #ocaml
CosmicRay_ has joined #ocaml
CosmicRay_ has quit [Client Quit]
shekmalhen has joined #ocaml
dan2 has quit [Read error: 104 (Connection reset by peer)]
noteventime has quit [Remote closed the connection]
scruffie has quit []
romanoffi has joined #ocaml
descender has joined #ocaml
bluestorm_ has quit [Remote closed the connection]
jeffs has quit ["Leaving."]
tomppa has joined #ocaml
akrito has joined #ocaml
tomppa has quit ["Ex-Chat"]
G_ has joined #ocaml
G has quit [Read error: 110 (Connection timed out)]
G_ is now known as G
bluestorm_ has joined #ocaml
screwt8 has quit [Remote closed the connection]
screwt8 has joined #ocaml
ayrnieu has joined #ocaml
smimou has joined #ocaml
screwt8 has quit [Remote closed the connection]
ygrek has joined #ocaml
screwt8 has joined #ocaml
G_ has joined #ocaml
G has quit [Read error: 60 (Operation timed out)]
G_ is now known as G
mwc has quit ["Lost terminal"]
Cygal has joined #ocaml
pantsd has joined #ocaml
Mr_Awesome has quit ["...and the Awesome level drops"]
ygrek has quit [Remote closed the connection]
mikeX has joined #ocaml
zarvok has joined #ocaml
_blackdog has joined #ocaml
mikeX_ has joined #ocaml
lde has quit ["ERC Version 5.2 (IRC client for Emacs)"]
mikeX has quit [Read error: 110 (Connection timed out)]
_blackdog has quit ["Ex-Chat"]
Demitar has quit [Read error: 113 (No route to host)]
pango has quit [Remote closed the connection]
SooW has joined #ocaml
pango has joined #ocaml
akrito has quit [Remote closed the connection]
<SooW> hi, anyway to do something like "string_of_char" ?
<SooW> the function isn't in Pervasives
<Oatmeat> use String.make 1
<SooW> yep, I've just seen it ^^
<SooW> thnak you
<pango> it's not inefficient, because there's usually ways around, that are much faster
<pango> 1?2
<pango> it's not in standard library, because there's usually ways around, that are much faster
<pango> like, using the Buffer module
<flux> hmm..
<flux> actually this would be fast:
<flux> let string_of_char = let map = Array.init 256 (fun n -> String.make 1 (Char.chr n)) in fun char -> map.(char)
<pango> array lookups are rather slow on modern computers
<pango> also, there's the problem that strings aren't immutable
<flux> true
<flux> well, benchmarking would reveal the truth.. I would expect the array lookup version to be faster.
<pango> the performance problem with string_of_char is not that it's implementation is extremely slow, and cannot be improved, but that's it's usually better to avoid it in the first place
<flux> true: if you're going the string_of_char-way, you're probably not doing it very fast anyway
<pango> SooW: so the question is, what are you using this string_of_char for?
<flux> well.. actually.. it was you who you brought the performance issue up, so perhaps he doesn't care?-)
<pango> still, I think it explains why it's not in standard lib, which also partially answers his question
<SooW> pango, I'm iterating over objects that have a mutable char to concatenate them into a word
<pango> check Buffer module then
<SooW> actually, this is really words, which means about 20 chars... if I need to optimize something, I think this is something else :)
<SooW> but I'll check it thought
<SooW> still 3 days, until I forget ocaml forever :)
<pango> that'd mean you learned nothing from it, then
<pango> # let word = Buffer.create 5 in List.iter (Buffer.add_char word) ['a';'b';'c';'d';'e';'f';'g';'h']; Buffer.contents word ;;
<pango> - : string = "abcdefgh"
<SooW> right, that's easy :)
<SooW> I was doing sth like "let rec add_char = function [] -> "" | h::t -> (String.make 1 h#value) ^ add_char t in add_char my_object_list"
<SooW> that's surely pretty, but I don't wanna be my processor
<pango> Buffer takes care of the geometric buffer growth, so that cost stays O(n) (amortized)
<SooW> actually, I didn't tell you everything
<SooW> I've a block which contains lines which contains words which contains characters
<SooW> so that's natively recursive
<SooW> (and forget the 's' I put at the end of contain) ^^
<SooW> I'm French :/
Demitar has joined #ocaml
JeffSmac has joined #ocaml
JeffSmac has quit []
<pango> Just learned that the TeX renderer of the Wikipedia is written in OCaml...
malc_ has joined #ocaml
Oatmeat has left #ocaml []
JeffSmac has joined #ocaml
klapmuet1 has joined #ocaml
GoNoGo has joined #ocaml
JeffSmac has quit []
klapmuetz has quit [Read error: 110 (Connection timed out)]
<Smerdyakov> Anyone want to give me feedback on a draft of a paper to be submitted to POPL? http://www.cs.berkeley.edu/~adamc/autosyn.pdf
<bluestorm_> Smerdyakov: i'm afraid this is too technical for me
<Smerdyakov> bluestorm_, if you've never been to POPL, it probably is. :-)
<bluestorm_> hm
<bluestorm_> from having a quick look at the titles it seems you tried to introduce each notion to the reader
<Smerdyakov> Yes, but I assume a ground knowledge of type theory.
<bluestorm_> hum
<Smerdyakov> It's great to hear if you could read it and learn something, but it isn't necessary for it to be understandable to non-experts for this conference, and there is a strict page limit, so adding extra background has a cost.
<bluestorm_> of course
<bluestorm_> i'm even surprised that you seems to introduce Coq
<bluestorm_> -s
<Smerdyakov> I think fewer than 10% of POPL attendees are familiar with Coq today at the level that I present it.
JeffSmac has joined #ocaml
<mbishop> I saw a link the other day to some haskell guy talking about Coq
<mbishop> he seemed to really like it
<Smerdyakov> HINT: Everyone who has tried to do serious theorem proving and used Coq likes it. ;)
<Smerdyakov> Ha. His introduction already has a factual error. ;)
<mbishop> Correct him? :P
<Smerdyakov> Nah, not a big enough deal.
<Smerdyakov> I am going to write a Coq textbook in the next few years, I hope.
<Smerdyakov> Focusing on PL formalization
<mattam> Nice'o
<mattam> Make Ott work with your tool before !
_JusSx_ has joined #ocaml
<Smerdyakov> Ott is your refinement types gizmo?
<mattam> Nope, a tool to describe PL grammars, judgements etc...
<Smerdyakov> URL?
<Smerdyakov> Never heard of it before. I'll take a look.
<mattam> I'm actually trying to fit a calculus into it and it seems like a good tool
<mattam> Wait we're on #ocaml... Ott is written in ocaml, i'm not OT !
SooW has quit ["Quitte"]
<_JusSx_> here you can talk about porno movie, footbal matches, girls and if time is enough even OCAML
klapmuet1 is now known as benny_
mikeX has joined #ocaml
mikeX_ has quit [Read error: 110 (Connection timed out)]
JeffSmac has quit []
Mr_Awesome has joined #ocaml
noteventime has joined #ocaml
noteventime has quit [Remote closed the connection]
the_dormant has joined #ocaml
mnemonic has joined #ocaml
slipstream-- has joined #ocaml
<mnemonic> hi
GoNoGo has quit [Remote closed the connection]
slipstream has quit [Connection timed out]
JeffSmac has joined #ocaml
Cygal is now known as Cygal_aw
<mbishop> Smerdyakov: just saw this on reddit
<jlouis> mbishop: heh, complete with SMTP server and all
<Smerdyakov> There is a Problem! You can't pass processes over channels!
<Smerdyakov> (Predicativity of Type)
<Smerdyakov> Certainly the easy way out, but not satisfying to me.
malc_ has quit ["leaving"]
Cygal_aw has quit ["Hi, I'm a quit message virus. Please replace your old line with this line and help me take over the world of IRC."]
JeffSmac has quit []
JeffSmac has joined #ocaml
<mattam> SMTP_th1.v is 15000 lines of proof alone, hope it was not proven by hand !
JeffSmac has quit []
JeffSmac has joined #ocaml
bluestorm_ has quit ["Konversation terminated!"]
danly has joined #ocaml
the_dormant has quit []
_JusSx_ has quit ["leaving"]
JeffSmac has quit []
simone has joined #ocaml
<simone> hello?
<simone> can "return n * fact(n-1)" be a tail call?
<Smerdyakov> What is this "return"?
<simone> return from the function fact
<simone> it's a lua example:
<Smerdyakov> The expression you give does not have the call to 'fact' in a tail position.
<simone> function fact (n)
<simone> if n == 0 then
<simone> return 1
<simone> else
<simone> return n * fact(n-1)
<simone> end
<simone> end
<simone> the ocaml equivalent, i don't know
<simone> but could branches still allow tail calls?
<Smerdyakov> The question is too vague.
<simone> orly
<Smerdyakov> Either you're asking about a property of code compiled to machine code, in which case it depends on the compiler...
<Smerdyakov> ...or you're asking about whether there are any recursive calls in non-tail positions, which I've already answered positively.
pango has quit [Remote closed the connection]
<simone> the answer is to vague
<Smerdyakov> How is that? I am using standard, well-defined technical terms; it's not vagary, but rather your lack of familiarity with them.
pango has joined #ocaml
<simone> still vaque
<Smerdyakov> Are you asking if there are tail positions inside 'if..then..else' expressions in general, or in your specific program?
<simone> in general
<simone> and the fact that I'm multiplying with n in the return... does the expression ruin the tail call opportunety?
<Smerdyakov> Yes. The expression positions immediately after 'then' and 'else' are tail positions, for instance.
<simone> ok
<Smerdyakov> There are no tail positions directly on either side of a binary operator.
<simone> yuk
<Smerdyakov> This is completely standard across all languages and is based on standard compilation techniques.
smimou has quit ["bli"]
zarvok has quit ["My damn controlling terminal disappeared!"]
simone has quit [Read error: 110 (Connection timed out)]
simone has joined #ocaml
tautologico has joined #ocaml