flux-_ has quit [Read error: 104 (Connection reset by peer)]
flux__ has joined #ocaml
Mr_Awesome has joined #ocaml
chessguy has joined #ocaml
david_koontz_ has joined #ocaml
CosmicRay has joined #ocaml
Mr_Awesomer has joined #ocaml
david_koontz has quit [Read error: 110 (Connection timed out)]
duncanm has joined #ocaml
danly has quit [Read error: 110 (Connection timed out)]
batdog is now known as batdog|gone
batdog|gone is now known as batdog
sponge45 has joined #ocaml
Mr_Awesome has quit [Read error: 113 (No route to host)]
dibblego has quit ["Leaving"]
CosmicRay has quit ["Client exiting"]
<jordan->
what is illegal about doing: let f = (fun x -> match x with (x <> x) -> false) ;;
<sponge45>
(x <> x) is not a valid pattern. Do you mean: let f = fun x -> x <> x ?
<sponge45>
which is weird by the way.
ramkrsna has joined #ocaml
<jordan->
Ah Isee
<jordan->
another quick question: how can I convert a char to a string?
<jordan->
I don't see a function in the pervasives
<jordan->
or the char or string libraries
<sponge45>
String.make 1 'x'
<Mr_Awesomer>
that always annoyed me that you have to do that
<jordan->
ah! great thanks
Mr_Awesomer is now known as Mr_Awesome
duncanm has quit [Read error: 110 (Connection timed out)]
Mr_Awesome has quit ["and the Awesome Level drops"]
buluca_ has joined #ocaml
duncanm has joined #ocaml
buluca has quit [Read error: 145 (Connection timed out)]
Smerdyakov has quit ["Leaving"]
<Shimei>
You could always just "string_of_char c = String.make 1 c" if it bugs you.
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- 100,000+ downloads can't be wrong"]
danly has joined #ocaml
danly has left #ocaml []
khaladan_ has joined #ocaml
khaladan has quit [Connection timed out]
khaladan_ is now known as khaladan
falconair has quit [Read error: 110 (Connection timed out)]
_velco has joined #ocaml
danly has joined #ocaml
buluca_ has quit [Read error: 104 (Connection reset by peer)]
danly has quit [Read error: 113 (No route to host)]
delamarche has joined #ocaml
sponge45 has left #ocaml []
danly has joined #ocaml
delamarc1e has joined #ocaml
_velco has quit ["I'm outta here ..."]
delamarche has quit [Read error: 110 (Connection timed out)]
danly has quit [No route to host]
khaladan_ has joined #ocaml
_velco has joined #ocaml
bluestorm has joined #ocaml
khaladan has quit [Connection timed out]
khaladan_ is now known as khaladan
<eradman>
j
Snark has joined #ocaml
buluca has joined #ocaml
Skal has joined #ocaml
x__ has joined #ocaml
velco has joined #ocaml
love-pingoo has joined #ocaml
pango_ has quit [Remote closed the connection]
x__ is now known as pango
Skal has quit [Read error: 104 (Connection reset by peer)]
_fab has joined #ocaml
yondalf has joined #ocaml
bluestorm has quit [Remote closed the connection]
_shawn has quit [Read error: 104 (Connection reset by peer)]
kral has joined #ocaml
<kral>
hi
<kral>
what do you guys think about "Practical OCaml"? Can it be a good buy for a ocaml newbie?
yondalf has quit [Read error: 110 (Connection timed out)]
slipstream has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
yondalf has joined #ocaml
yondalf_ has joined #ocaml
yondalf has quit [Read error: 110 (Connection timed out)]
fab_ has joined #ocaml
_fab has quit [Read error: 110 (Connection timed out)]
kral has quit [Remote closed the connection]
swater has joined #ocaml
yondalf__ has joined #ocaml
yondalf_ has quit [Read error: 110 (Connection timed out)]
duncanm has quit [Read error: 110 (Connection timed out)]
yondalf__ has quit ["leaving"]
khaladan_ has joined #ocaml
pango has quit [Excess Flood]
pango has joined #ocaml
benben has quit [Read error: 110 (Connection timed out)]
benben has joined #ocaml
khaladan has quit [Read error: 110 (Connection timed out)]
khaladan_ is now known as khaladan
bluestorm_ has joined #ocaml
duncanm has joined #ocaml
khaladan_ has joined #ocaml
bluestorm_ has quit [Read error: 104 (Connection reset by peer)]
khaladan- has joined #ocaml
khaladan has quit [Read error: 110 (Connection timed out)]
khaladan- is now known as khaladan
khaladan- has joined #ocaml
Foxyloxy has joined #ocaml
khaladan_ has quit [Connection timed out]
bluestorm_ has joined #ocaml
khaladan has quit [Connection timed out]
khaladan- is now known as khaladan
Sweetshark has joined #ocaml
<Sweetshark>
Hi guys! Im thinking about learning a modern language that compiles to fast native code. My requirements are: good interfaces to Python and C for generic API support, clean language enabling OOP and functional programming, platformindependance, compiler producing fast native code. Can ocaml provide this? How does it compare to Haskell and Eiffel?
<flux__>
there is a mechanism for interfacing perl from ocaml, but I haven't seen a similar one for python
<flux__>
though, given there there is ocaml4perl, I would imagine ocaml4python wouldn't be impossible to develope
<flux__>
interfacing with C is quite easy. I understand there are some easier mechanism for some other languages, though (MLton?)
<flux__>
I know nothing of eiffel, so..
<flux__>
compared to haskell ocaml provides (mostly) strict evaluation, module-system, built-in oo, no type classes
<mellum>
I find the C interface to be *very* error prone.
<mellum>
But maybe that's just me.
<flux__>
without comparing to anything else, I would say ocaml is a solid language with a solid implementation (only one, though), generates somewhat fast code, while the bytecode is sufficient for many uses. it also has many libraries and c-bindings around, including opengl, sdl and libgtk2.
<flux__>
mellum, yeah, well it depends what kind of interface you're porting..
<flux__>
mellum, it can be tedious
<mellum>
But interfacing C with *any* garbage-collected language is probably error prone.
<flux__>
frustrations such as missing labeled/optional arguments (can be mostly worked around with anonymous records), no object system, no variants, no polymorphic record fields..
<dbueno>
You create a file that lists your source files... it figures out the build order, builds everything necessary, and loads everything necessary into the running toplevel.
<flux__>
I don't think the current system is too much of a barrier
<flux__>
although of course there is room for improvement
<flux__>
you are aware of ocamldsort, aren't you?
<dbueno>
flux__: It's a barrier if you're used to CM. =]
<dbueno>
But not "too much" of one, I agree.
<flux__>
I must admit I sometimes fix my ocaml builds with make clean ;)
<flux__>
fortunately the interface checking is quite strict
<flux__>
so it's extremely difficult to get a broken build..
<flux__>
ocaml could maybe integrate something like ocaml -build *.ml{i,} -o endproduce and it would Just Work (TM) ;)
<dbueno>
Right --- that would be cool.
<flux__>
actually ocamlfind could have some potential for that
<flux__>
which is a great tool
<flux__>
I put my own software into ocamlfind too, so I can easily link them in from anywhere
<dbueno>
I've never used ocamlfind.
<dbueno>
I don't even know what it does.
<flux__>
it's a 'package manager' for ocaml libraries
<dbueno>
Ah.
<flux__>
so like ocamlfind ocamlc -linkpkg -package postgresql -o myprogram mysource.ml will compile it with postgresql and with its dependencies
<flux__>
ocamlfind ocamlc -linkpkg -package sdl,sdl.sdlttf,unix,threads .. works also
<dbueno>
Interesting.
<dbueno>
I'll have to look into that.
<pango>
I've found "A critique of standard ML", by Appel, an interesting read. Even if the interest is slowly becoming historical (the paper has been written in late '92), it states very clearly the strong points of ML (SML/OCaml/Haskell) languages
<pango>
it's also probably interesting to see how the different language variants tackled with the mentionned problems (for example, it explains why OCaml uses capitals for constructors)
<flux__>
does it explain, why they cannot be partially evaluated ;(
<pango>
flux__: I think Xavier says somewhere that constructors-as-functions was not very readable in his opinion, so the feature was dropped after Caml light
<flux__>
use it like (fe. in emacs): annotgrep Mymodule.mytype *.ml
<Sweetshark>
flux__: oh, and I think python is worth learning when knowing perl. dunno about ocaml and if it makes up everything else python has going for it ...
<pango>
ic... btw my implementation is not optimally efficient :)
<flux__>
pango, I can see that, it takes seconds on a small file :)
<pango>
since beginnings and endings are scanned in increasing order, hashtables are not the best datastructure
<flux__>
but, atleast it's simple
<pango>
flux__: you can even call it a hack ;)
<flux__>
well, it could easily be so slow that it would be unusable ;)
<flux__>
I wonder how the Map-module without iterators fits this
khaladan has quit [Connection timed out]
khaladan_ is now known as khaladan
<flux__>
performance-optimization-wise that is
<flux__>
I suppose you could replace Hashtbl with an array
<flux__>
to get a tremendous performance boost
<flux__>
it would waste some memory, though ;)
<pango>
flux__: I wonder if streams could be used, to iterate over three streams in parallel :)
<flux__>
pango, I was actually thinking that too.. might be doable
<flux__>
it would then take practically no time
<flux__>
is the input already sorted?
<pango>
the annotation file you mean ? well, maybe sorted by beginning offsets, but I'm not sure
<pango>
I didn't think of using streams to rule out maps for sorting... Still, better maps (extlib's ?) would be needed
<flux__>
with streams you could just sort the input and never use maps?
<pango>
mmh I'm not sure... it could also make the design more fragile
<pango>
mmh it must be possible to generate a stream of sorted elements out of a standard Set
<pango>
removing smallest elements as we go
khaladan_ has joined #ocaml
<flux__>
pango, so, did you figure out how to use functional streams?-)
<pango>
uh, didn't had time to look into that again
<pango>
seems one needs to use revised syntax... http://209.85.129.104/search?q=cache:SRrMMSW-KZAJ:www.frbox.net/viewtopic-177424.html+fparser+ocaml&hl=fr&gl=fr&ct=clnk&cd=12&client=firefox
khaladan has quit [Connection timed out]
khaladan_ is now known as khaladan
<flux__>
hmm.. funny.. debian only has fstream.{cmx,cmi,mli}, but no fstream.cmo..
<flux__>
but the generated code (camlp4o pa_extend.cmo pa_fstream.cmo pr_o.cmo foo.ml) doesn't seem very bright (also witnessed by the produced warning)
<flux__>
I also think that fstream.cmo needs to be available for that to compile
descender has quit ["Why has elegance found so little following? Elegance has the disadvantage that hard work is needed to achieve it and a good e]
smimou has joined #ocaml
chessguy has joined #ocaml
Smerdyakov has joined #ocaml
<pango>
flux__: in 3.10 snapshot, the only mentions of fparser are in old Changelog entries and camlp4-old subdir, so I suspect it won't be supported by 3.10
<malc_>
marti1: read what i said to you, read what bluestorm did
<malc_>
it's all there
<malc_>
i belive
<marti1>
ok, thanks guys
<malc_>
s;belive;believe
<marti1>
bluestorm_, malc_: check out http://pastebin.be/3396/ -- it shows what I'm trying to do. I've implemented added the 'a to the type declaration in OrderedSet, and I've added the compare function. Now my error says: Unbound module type OrderedSet. I still feel like there's something deeply wrong.
<marti1>
ok - if anyone can check this out and tell me what I'm doing wrong -- no more silly errors! ;-) http://pastebin.be/3398/
<marti1>
bluestorm_: thx
<malc_>
marti1: your t type can not be polymorphic
fab_ has quit [Read error: 110 (Connection timed out)]
<marti1>
ok, pardon if this sounds intransigent but why not?
<malc_>
because Set.OrderedType is monomorphic :)
<marti1>
ok, fair enough ;-)
fab_ has joined #ocaml
<marti1>
could you think of a work around? I'd like to be able to use the symbol tables to bind strings to "anything" - e.g. one for variables, one for types, etc..
<malc_>
i will go and have a smoke and think about it.. and knowing myself i'm 100% sure nothing good will come out of it
<marti1>
cool, thx
<marti1>
quick question: what does +'a mean? I know 'a === <T> in C++...
<marti1>
malc_: thx again - did the smoke enlighten you ? I think I'm screwed - you're right, Set is monomorphic, but Map is polymorphic. I probably can't reconcile the two in a module.
postalchris has left #ocaml []
<marti1>
at least without concretizing the table entries in the map
<malc_>
marti1: i have this intuition too.. but i guess asking this on ML would be a good thing
<malc_>
and ... no ...
<malc_>
not yet at least
<marti1>
ok, malc_ thanks for you're help. And what does mattam mean?
<marti1>
oh it's a name
<marti1>
anyway, time to go to bed
<marti1>
bye everyone!
<malc_>
ciao
marti1 has left #ocaml []
delamarche has quit []
bluestorm_ has quit [Remote closed the connection]