<Demitar>
Well how about not developing at root to begin with? :)
lus|wazze has joined #ocaml
<Defcon7>
yes yes you are right :P
<Defcon7>
same thing as user...
<Defcon7>
probably is the compiler version
<Defcon7>
for sure you know ocaml better than me...im playing with it from 2 days...
<Defcon7>
do you see errors or tricky things in my code ?
<Demitar>
What does your pd file contain?
<Defcon7>
characters and newlines :)
<Defcon7>
i created it with echo "sffsd" >> pd
<Defcon7>
with some lines
<Demitar>
You could of course add a "flush stdout;" right after the print_endline or before the Unix.sleep to ensure it's not breaking on something like that.
<Defcon7>
oh
<Defcon7>
trying
<Demitar>
If that doesn't help it you can add some magic debugging. (Ie print_endline "foo"; to trace the program execution.
<Demitar>
Or simply single-step the progam using ocamldebug.
<Defcon7>
flush flush flush
<Defcon7>
hehe
<Defcon7>
finally works :D
<Defcon7>
it was the flush thing
<Defcon7>
probably because we was using pervasive fds and not Unix fds
<Defcon7>
also unix fds need to be flushed ?
<Defcon7>
ok not important now, the manual will tell me :)
<Defcon7>
another thing about ocaml programming...
<Defcon7>
i know ocaml as a very coincise programming style
<Defcon7>
but this night when async tell me that "if" if has more than one command needs begin and end
<Defcon7>
i was perplessed
<Defcon7>
there is any other way ?
<Demitar>
It's like this:
<Demitar>
if <condition> then <statement>; or if <condition> then <statement> else <statement>;
<Demitar>
Thus "foo ()" is a statement, "foo (); foo ()" is two statements.
<Defcon7>
yep but im talking about begin and end thing...
<Demitar>
You need to wrap them in a block by either begin end or ( ).
<Demitar>
Or why not let () = <statement> in let () = <statement> in <statement> if you want to be obscure. ;-)
<Maddas>
yup, you can use ( and ) if you don't like begin and end, although I find begin and end a bit more readable
<Maddas>
Defcon7: Think of begin and end and ( and ) as something like { and } in other languages.
<Maddas>
(C-like syntax)
<Defcon7>
understood, cool :)
<Demitar>
Maddas, now that was hard to read. ;-) "and end and ..."
<Maddas>
s,rr5 A0
<Maddas>
err
<Maddas>
sorry
<Defcon7>
probably thats because begin...end remembers me pascal\delphi ugly syntax :P
<Demitar>
Well good indention is the key. :)
<Maddas>
Defcon7: O'Caml has its own syntax, very unlike most other languages (who usually copy C's syntax more or less)
<Maddas>
so it probably takes a bit getting used to :)
<Defcon7>
Maddas someone should be totally crazy to choose ocaml
<Demitar>
Maddas, so by copying ml it has it's own syntax? ;-)
<Defcon7>
and the fact im here explains all
<Defcon7>
haha :)
<Maddas>
Demitar: well, ok, not really
<Maddas>
but it's different than most mainstream languages at least :)
<Maddas>
I should have said ML dialects, maybe
<Defcon7>
the syntax is the minor problem...it just needs to be learned...when learned any (logically right) syntax is good
<Demitar>
Defcon7, actually people tend to experiment with ocaml and then get hooked not wanting to go back to languages that can segfault. :)
<Defcon7>
hehe, yes i also noticed this ocaml has a lot of cool features
<Defcon7>
starting from the fact that it can be also called an high-level language and the speed is near to a C program
<Maddas>
Demitar: same here
<Maddas>
except that I'm forced to use C/C++ :)
<Demitar>
Of more importance is usually that you can write slow programs in any language. :)
<Maddas>
Defcon7: yeah, the syntax is just a hurdl in the beginning.
<Maddas>
hurdle, even
<Defcon7>
for now, i like ocam :)
<Demitar>
Yes the first few times I looked at it I was just perplexed by the syntax. ;-) (Far too long in C/C++/python land I guess. :)
<Maddas>
Same here, Demitar
<Maddas>
And seeing all the rules about when you can omit the ';' dazzled me a bit
<Defcon7>
if not eof then
<Defcon7>
(
<Defcon7>
print_endline last_line;
<Defcon7>
Pervasives.flush Pervasives.stdout;
<Defcon7>
tail chid;
<Defcon7>
)
<Defcon7>
coool :)
<Demitar>
The worst part was to come to the realization how function application works, fun(arg1,arg2,...) sits very deep it seems. :)
<Defcon7>
(that ugly begin...end has go away...ghgh)
<Demitar>
Defcon7, Pervasives is the "initially opened module". Ie, just do flush stdout;
<Defcon7>
nope
<Demitar>
Why not?
<Defcon7>
it try to use unix stdout
<Defcon7>
and give an error
<Demitar>
Ah, you opened Unix. ;-)
<Defcon7>
yup i needed sleep
<Defcon7>
theres another sleep out of unix ?
<Defcon7>
sleep or nanosleep or something like that
<Maddas>
You don't need to open Unix to use the functions in Unix
<Defcon7>
oh
<Defcon7>
(*whooops*)
<Maddas>
opening it just "changes namespace", or however you say, by importing Unix functions into "empty" namespace
<Demitar>
Yes, opening is done automagically when doing Module.fun.
<Defcon7>
understood :)
<Maddas>
Yes. The advantage you gain by opening is say "something" instead of "Unix.something"
<Demitar>
Also, you never actually use Printf, print_endline is in Pervasives.
<Defcon7>
i have to go now...but you will see me again in the next hours :§)
<Defcon7>
thanks for the help it was pleasant
<Defcon7>
finally an helpful channel
<Maddas>
heh :)
<Defcon7>
:)
<Demitar>
When we are awake we usually are. :)
<Defcon7>
bbl :)
chrisu has joined #ocaml
chrisu is now known as noss
demitar_ has joined #ocaml
Demitar has quit [Read error: 110 (Connection timed out)]
demitar_ is now known as Demitar
eternite has joined #ocaml
<eternite>
hello!
<Demitar>
Greetings eternite.
malc has joined #ocaml
malc has quit ["no reason"]
whee has joined #ocaml
Etaoin has quit ["Client exiting"]
<noss>
how well does ocaml's Big_int implementation perform?
lus|wazze has quit ["Copyright is a temporary loan from the public domain, not property"]
<eternite>
Lower than C GMP.
<noss>
lower as in better or worse?
<eternite>
worse(a factor 10 or 100) : But during I tests only the multiplication.
<Demitar>
Everything except int and int/float arrays is boxed, go figure. :)
<noss>
are bigints implemented in ocaml or native?
<Demitar>
Umm.. the underlying data is native but it's boxed for the gc.
<eternite>
I think algo are implemented in totaly different way in Big_int and GMP
<eternite>
There are a lot of "asm" in the source of GMP...
<Demitar>
Ah GMP, well I shouldn't say too much then.
<noss>
is there little interest in getting these things fast?
<eternite>
If can go faster, you can have more digits
<Smerdyakov>
MLton has a fast GMP interface!
<noss>
but i want a nice language to implement a slave for crypto-calculations. sigh.
<eternite>
I was talking about 1 or more million of digits...
<eternite>
:)
<Smerdyakov>
noss, you think OCaml is nice but not SML?
<mellum>
I think there are also GMP bindings for Ocaml
<noss>
Smerdyakov: i dont actually thing ocaml is nice in the FP category, it is more that i find FP nice and i want/need a language that compiles to efficient code and has a few features i need.
<Riastradh>
noss, so what's wrong with SML?
<noss>
Riastradh: i dont know. did I say something is wrong with SML?
<Riastradh>
You implied it.
<noss>
if i implied it, then i guess SML isnt a language in the FP category.
<Riastradh>
It isn't?
<Riastradh>
Now you're just confusing me.
<Smerdyakov>
SML is the single language in the world most similar to OCaml.
<Smerdyakov>
SML = Standard ML
<Riastradh>
What about Caml Light?
<Smerdyakov>
Please. You're spoiling my dramatic effect.
<mellum>
Does anybody know why Ocaml has no call/cc?
<Demitar>
Are you asking about FFI?
<Riastradh>
CALL/CC has nothing to do with FFIs. (well, it can make the external language suffer much pain, I guess)
<Riastradh>
s/external/foreign/1
<Demitar>
Ah, now I recognise it. :)
mimosa has joined #ocaml
noss has joined #ocaml
Etaoin has quit [Read error: 104 (Connection reset by peer)]
eternite has quit ["Arlg connection crash!"]
<noss>
what platforms do the compilers target?
<ayrnieu>
The O'Caml distribution describes which platforms the native-code compiler supports; I don't know of any particular limitations on the bytecode compiler.