<flux__>
have you compared how fast it would be if instead of Buffer.contents it would return nothing?
<rongenre>
let me see... that's another memory allocation, you're right
<rongenre>
not a lot differently, actually..
<rongenre>
~19 secs down to ~17
<flux__>
removing Buffer.add_char?-)
<rongenre>
no, not doing that
<rongenre>
checking it out
<rongenre>
yeah.. that's half of it
<rongenre>
down to ~8 secs
<rongenre>
still not as fast as input_line
<flux__>
well, you could scan for the next '\n' within the known valid buffer in a separate function
<flux__>
I imagine ocaml optimizer might be a bit out of the game when you have variables
<rongenre>
yeah, let me try that refactor
<rongenre>
kind of what i'd heard regarding how the optimizer could work
<flux__>
but, I'm off to office, happy hacking.. it doesn't seem likely you'll get much faster than input_line, though ;)
<flux__>
if you're comparing performance to wc -l, maybe you should write a program that does only wc -l
<rongenre>
Yeah I should
<rongenre>
what's nice is it's still faster than wc in perl ;-)
<flux__>
more realistic comparison would be perl -e 'while(<>){++$n}'; or awk '{++n}'
<rongenre>
which means I can justify it at work
<flux__>
oh, well it's still plenty fast ;)
<rongenre>
thanks for your help
<rongenre>
i need to sleep as well, it's late in CA
<flux__>
maybe you could even compare it to #include <string> #include <iostream> int main() { std::string str; while (std::getline(std::cin, str)) { } }
<rongenre>
I dug up the wc code... they do some interesting stuff in terms of optimizing the read
<flux__>
there should be a format_of_string that would check the format string runtime. that is, some function of type string -> 'a, and the compiler would check the rest. unfortunately almost no type information is available runtime
<flux__>
maybe that would lead to less stable environment, everybody would start writing * -> 'a -kind of functions ;)
paolino has joined #ocaml
stesch has joined #ocaml
stesch has left #ocaml []
rongenre has quit [Remote closed the connection]
rongenre has joined #ocaml
dvekravy has quit [Read error: 101 (Network is unreachable)]
jeremy_c has joined #ocaml
pnou_ has quit ["leaving"]
pnou has joined #ocaml
jeremy_c has quit ["leaving"]
jeremy_c has joined #ocaml
ski has joined #ocaml
paolino has quit [Excess Flood]
malc_ has quit ["leaving"]
Alive has joined #ocaml
<Alive>
Hi!!!
<vegai>
Howdy ho.
mkhl has joined #ocaml
<Alive>
Who knows Russian?
* ski
doesn't know
<bluestorm>
hum
<bluestorm>
who knows hebrew ?
<ski>
hehe
<bluestorm>
yesterday i had an error while coding PHP
<bluestorm>
looked like hebrew
<Alive>
ñ ÎÁ ÒÕÓÓËÏÍ ÐÏÇÏ×ÏÒÉÔØ ÈÏÞÕ!
<bluestorm>
so i'm looking for someone to translate :p
* ski
wonders whether bluestorm means ivrit ..
<bluestorm>
may be ivrit yes
<bluestorm>
hum
<bluestorm>
:p
<bluestorm>
i guess 'ivrit is ivrit in ivrit
<Alive>
I no :(
<Alive>
äÁ×ÁÊ ÎÁ ÒÕÓÓËÏÍ, Á?
* ski
wonders whether vodka-goo knows any russian
<Alive>
Not ridiculously
jeremy_c has quit [Remote closed the connection]
<smimou>
ski: I know vodka-goo and unfortunately he doesn't speak a word of russian
<ski>
hmhm
<Alive>
ðÌÏÈÏ, ÞÔÏ ×Ù ÍÅÎÑ ÎÅ ÐÏÎÉÍÁÅÔÅ.
Alive has left #ocaml []
Smerdyakov has joined #ocaml
ski_ has joined #ocaml
ski has quit [Nick collision from services.]
ski_ is now known as ski
Smerdy has joined #ocaml
Smerdyakov has quit [Nick collision from services.]
Smerdy is now known as Smerdyakov
smimou has quit ["bli"]
smimou has joined #ocaml
ski has quit [Nick collision from services.]
ski_ has joined #ocaml
ski_ is now known as ski
jeremy_c has joined #ocaml
jeremy_c has quit [Client Quit]
jeremy_c has joined #ocaml
<jeremy_c>
Is the tuareg-mode the standard Emacs mode for editing OCaml is there a diff one I should begin with?
<Smerdyakov>
I use caml-mode.
<jeremy_c>
Any reason? I actually have them both downloaded.
<Smerdyakov>
Nope.
<jeremy_c>
Smerdyakov: your sopose to tell me : abc is the best, 100% better than the other :-D
<Smerdyakov>
jeremy_c, is English your native language?
<jeremy_c>
yes. Am I confusing you or using bad English?
<Smerdyakov>
Both, but mostly the latter. Come on, "sopose to"?
<jeremy_c>
what's wrong w/that?
<Smerdyakov>
"You're supposed to tell me..."
<Smerdyakov>
^-- correct way
<jeremy_c>
Smerdyakov: many locales have slang that we use, sopose to is just fine, maybe not global.
<jeremy_c>
your was bad, yes.
<jeremy_c>
you are right.
<Smerdyakov>
That's spoken slang. There is no correct written rendition of it.
<jeremy_c>
missed the whole point :-/
<pango>
does caml-mode support ocamldebug ?
<pango>
(because tuareg mode definitely does)
<Smerdyakov>
I don't know.
<jeremy_c>
pango: it comes with camldebug.ml
<jeremy_c>
Just playing with the two and with about 1/2 ounce of knowledge of Ocaml, I tend to enjoy the way Tuareg indents over caml-mode ... However, those preferences may very well change as I learn more.
<pango>
that can be modified too
ptseng has quit ["Leaving"]
mkhl has quit []
Smerdyakov has quit ["Leaving"]
Smerdyakov has joined #ocaml
__DL__ has joined #ocaml
pango has quit ["Leaving"]
pango has joined #ocaml
<jeremy_c>
When running an Ocaml program, I have multiple source files. Can I not just specify all of them on the command line? ocaml abc.ml def.ml ... ?
<Smerdyakov>
Who knows. I usually compile programs separately from running them.
<pango>
if it works, they must specified in the right order (no forward references)
<pango>
check ocamlfind too
<jeremy_c>
I am sure I am doing something goofy. I have a source file Protocol.ml ... it's contents are module type PROTOCOL = ... ... ... end ;;
<jeremy_c>
Then another source file Com.ml which contains module Com = functor (P : PROTOCOL) -> ... ... ... end ;;
<Smerdyakov>
Should be Protocol.PROTOCOL.
<Smerdyakov>
Each source file defines a module, not a set of top-level variables/modules.
<jeremy_c>
Duh. Didn't open it.
<pango>
separate compilation implicitly creates separate modules
skylan has quit [Remote closed the connection]
<pango>
open adds some module visible identifiers to current namespace; it's not a requirement, you can also use fully qualified names
<jeremy_c>
pango: yeah. I thought I had opened it because PROTOCOL is it's only definition, just thought it might be easier.
skylan has joined #ocaml
skylan_ has joined #ocaml
ski has quit ["NMI"]
twobitsprite has joined #ocaml
skylan has quit [Connection timed out]
<twobitsprite>
hey... how would I draw to the X root window with the graphics library? The open_graph function says it accepts a string with arguments, but I'm not sure how to tell it to use the root window...
ski has joined #ocaml
ski has quit ["NMI"]
ski has joined #ocaml
_JusSx_ has joined #ocaml
_fab has quit [Remote closed the connection]
__DL__ has quit [Remote closed the connection]
Smerdyakov has quit ["Leaving"]
Submarine has joined #ocaml
quamaretto_ has joined #ocaml
menace has joined #ocaml
ski_ has joined #ocaml
Smerdyakov has joined #ocaml
ski has quit [Nick collision from services.]
ski_ is now known as ski
humasect has joined #ocaml
Submarine_ has joined #ocaml
Submarine has quit [Nick collision from services.]
Submarine_ is now known as Submarine
malc_ has joined #ocaml
<quamaretto_>
Smerdyakov: What's the URL of that site again? (Lost it)
<quamaretto_>
I was on there but couldn't muster my mad descriptive skillz
<quamaretto_>
I don't think it will be practical to use deep hierarchies as the main way of categorizing languages. It would be better to place languages in categories according to (mostly) orthogonal characteristics such as strong/weak/no type system, target (interpreted/bytecode/native), lazy vs. non-lazy evaluation, etc.
<quamaretto_>
Anyway, I'm gonna go back to work. :) See you later
<Smerdyakov>
Who said anything about deep hierarchies?
<quamaretto_>
It seems like that is the direction you're going, since the only current language is ML in Functional -> Statically Typed, and it could have it's own sub-languages
<quamaretto_>
But if you didn't have that intent, fine
<Smerdyakov>
Many views are possible. That's just the one I started with.
Smerdyakov has quit ["eat"]
<quamaretto_>
>:| COME BACK HERE
quamaretto_ has quit ["ILL GET YOU SMERDYAKOV"]
<flux__>
hmm.. is there a code generator which would allow one embed ocaml inside html, and eventually generate a binary out of it?
<flux__>
akin to php, jsp or perl's mason
<flux__>
or maybe one could just use some generic tool to do that
<flux__>
I can't figure out the keywords to search such beast, though ;)
<flux__>
m4 could work, but I would maybe prefer to use syntax such as mason's <% codehere %> or % code here
<flux__>
otoh.. writing such a 'code generator' could be a task for sed
<flux__>
(or other tool lacking high sophistication, or why not just ocaml lex ;))
Submarine has quit [Connection timed out]
<flux__>
perl -pe 'if (!s/^% (.*)/$1/g) { s/(.*?)<%(.*?)%>/$1 . "\"; printf \"%s\" (" . $2 . "); print \""/ge;s/^(.*)$/print "$1\\n";/; }' - it maybe lacks some sophistication, but atleast it serves as a base ;)