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!)
crabstick_ has joined #ocaml
smimou has quit ["bli"]
crabstick has quit [Read error: 110 (Connection timed out)]
crabstick has joined #ocaml
seafoodX has joined #ocaml
crabstick_ has quit [Read error: 110 (Connection timed out)]
buluca has quit [Read error: 113 (No route to host)]
<tsuyoshi> don't worry too much about it.. the first thing I realized after I finally understood functors was that they weren't terribly useful
<Smerdyakov> Luckily, you're wrong! :D
ednarofi has joined #ocaml
Zzompp has joined #ocaml
seafoodX has quit []
CRathman has joined #ocaml
authentic has quit [Remote closed the connection]
authentic has joined #ocaml
Smerdyakov has quit ["Leaving"]
abez has quit ["ugh"]
CRathman has quit [Read error: 110 (Connection timed out)]
ednarofi has quit [Read error: 104 (Connection reset by peer)]
bluestorm_ has joined #ocaml
ednarofi has joined #ocaml
seafoodX has joined #ocaml
seafoodX has quit [Read error: 104 (Connection reset by peer)]
seafoodX has joined #ocaml
smimou has joined #ocaml
pattern has quit [heinlein.freenode.net irc.freenode.net]
pattern has joined #ocaml
<danderson> after a night's sleep, and applying an analogy from the C++ world
<danderson> it looks like functors are somewhat like template classes, with concepts (type-checking for the template parameters, due in the next c++ standard)
<danderson> and generally on crack, thanks to currying
slipstream-- has joined #ocaml
<smimou> danderson: that's right
pattern has quit [heinlein.freenode.net irc.freenode.net]
ygrek has joined #ocaml
pattern has joined #ocaml
slipstream has quit [Read error: 113 (No route to host)]
buluca has joined #ocaml
ktne has joined #ocaml
<ktne> hello
<ktne> anyone here using f#?
<ktne> be aware that i'm a newbie :)
<ktne> oh, found the error, undefined variable :)
<ktne> the f# compiler errors aren't too helpful :)_
<bluestorm_> if you're a newbie, F# errors are likely to be understandable by OCaml users
<ktne> i've got a syntax error pointed at a :>
<bluestorm_> could you show the code ?
<bluestorm_> (unless :> is different from the OCaml one, that does not look like a "newbie" use)
<ktne> the variable before :> isn't declared, but why does it point to syntax error?
<ktne> instead of something like "missing declaration"
<ktne> anyway i've found the problem :)
<ktne> i thought it's function composition
<ktne> i try to do a pipeline processing
<ktne> but thanks anyway, it was that i forgot to define a small function
lde` is now known as lde
G_ has joined #ocaml
Tetsuo has joined #ocaml
G has quit [Success]
Cygaal has joined #ocaml
G has joined #ocaml
lde has quit [Read error: 113 (No route to host)]
lde has joined #ocaml
G_ has quit [Connection timed out]
seafoodX has quit []
smimou has quit ["bli"]
puks has joined #ocaml
G_ has joined #ocaml
G has quit [Read error: 110 (Connection timed out)]
kelaouch1 has quit ["leaving"]
ednarofi has quit [Read error: 104 (Connection reset by peer)]
ednarofi has joined #ocaml
Cygaal has quit []
kelaouchi has joined #ocaml
G has joined #ocaml
G_ has quit [Connection timed out]
ednarofi_ has joined #ocaml
ednarofi has quit [Read error: 104 (Connection reset by peer)]
mr_hugo has joined #ocaml
<mr_hugo> hello
<mr_hugo> how do i read the parameters passed in the shell with my program in ocaml ? (like argc and argv in C)
<flux> Sys.argv is an array that has them
<flux> man Sys for reference on what else it has
<fremo> or the Arg module...
<mr_hugo> sweet
<flux> yeah, Arg is terrific for handling command line arguments
<mr_hugo> i didn't knew the man pages worked with OCaml, thats very nice
<flux> shame its interface isn't functional
<fremo> heh ! :)
<mr_hugo> hehehe
<fremo> flux: yes...
<ktne> anyone here using f#?
<ktne> what is the preffered way of dealing with binary I/O in f#?
<flux> isn't there a channel for f#? (I'm not saying you can't ask that here, just wondering)
<ktne> no
ednarofi_ has quit [Read error: 110 (Connection timed out)]
Demitar has quit [No route to host]
Flynsarmy has joined #ocaml
<Flynsarmy> What is OCaml best used for?
<ktne> implementing complicated algorithms
<rwmjones> as a replacement for where you might use C++ to write applications
<ktne> especially ones that deal with a lot of symbolic information (like compilers, parsers, etc)
<ktne> but yes it's general purpose
<Flynsarmy> Cool. We're doing an assignment on it and i checked out the website but it didn't say anywhere what it was best used for. Just kept going on about how it had 2 compilers
<bluestorm_> wikipedia ? :]
<flux> "on it"? an essay?
<bluestorm_> http://en.wikipedia.org/wiki/OCaml could be improved but is informative
<Flynsarmy> No. It's just a few questions about Python Ocaml and Eiffel
<bluestorm_> i'm just curious : what kind of school is that ?
<mr_hugo> the _ function is the OCaml entrypoint ?
<Flynsarmy> It's a university in Australia
<rwmjones> mr_hugo, no
<mr_hugo> hmm :/
<rwmjones> mr_hugo, everything at top level is evaluated in order
<rwmjones> mr_hugo, the only things which are not evaluated are function definitions
<mr_hugo> hmm ok
<bluestorm_> and _ isn't a function
<bluestorm_> it's a pattern
<mr_hugo> so in the end i just call the entrypoint that i want...
<bluestorm_> (that matches everything)
<bluestorm_> hm
<ktne> mr_hugo there is no entrypoint
<ktne> mr_hugo the code is just executed top to bottom
<mr_hugo> ok
<mr_hugo> what is the order of .ml files it executes ?
<ktne> what do you mean?
<bluestorm_> you choose it a linking time
<bluestorm_> +t
<mr_hugo> ok
<bluestorm_> and that's important for module dependencies : you can't just put files in alphabetical order
<mr_hugo> ok
<bluestorm_> (wich is why simple Makefiles aren't that useful for ocaml)
<mr_hugo> yes i see
<danderson> I have to say, so far, although I find ocaml very cool, I don't yet see how to write stuff in it. That's probably my imperative background resisting :)
<mr_hugo> is there any example of a simple compiler on the net that i can read the code ?
<mr_hugo> a simple parser i mean
<bluestorm_> parser for what ?
rwmjones has left #ocaml []
<mr_hugo> a computer language
<mr_hugo> C for instance
<bluestorm_> danderson: exercice yourself !
<bluestorm_> hm
<danderson> dunno about simple, but LiquidSoap (savonet.sf.net) is a radio streaming application in ocaml
<danderson> and the configuration is a scripting language
<mr_hugo> i would like to see how to define parsing tree's
<mr_hugo> ah good
<danderson> where 'sources' are first order types, that you assemble to build a pipeline
<danderson> dunno how easy it is to understand though, it's no small app.
<flux> mr_hugo, actually I think the documentation has an example of a simple parser for a calculator
<ktne> i'm working on a small xml parser right now :)
<ktne> i'm using the composition operator in order to compose EBNF rules :)
<ktne> each EBNF rule is a function, each function is a composition of several other rules :)
<ktne> it's so simple :)
<ktne> that book is not good
<bluestorm_> hm
<ktne> it teaches you how to use things like ocamlyacc
<ktne> ocamllex, etc
<ktne> now that's fine
<bluestorm_> ( i learned ocaml with that book :] )
<ktne> but now what you want to see when you learn ocaml :)
<bluestorm_> it present stream-based parsers before teaching ocamlyacc
<ktne> i mean, not what you want to see when you want to implement a parser by yourself :)
<bluestorm_> and i'm not sure he wants to learn ocaml
<mr_hugo> i want to learn ocaml
<mr_hugo> yes
ednarofi has joined #ocaml
<bluestorm_> maybe the question is "What is the simplest way to write a compiler in that language"
<bluestorm_> in that case you're likely to use ocamlyacc because the parsing is not the important part of compiler writing
<mr_hugo> i want to generate C code from several hardcoded snippets, and some parsing intuition
<ktne> this chapter of that book is interesting: http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora058.html
<bluestorm_> ( of course, it depends on what you're intersted in, but compiler writers usually care about compilation )
<ktne> "BASIC interpreter"
<flux> hmm.. reddit linked quite a while ago to an ocaml software that parsed makefile-like syntax and produced c-code
<flux> that'd be almost exact match to what mr_hugo is doing
<mr_hugo> oh yes
<mr_hugo> that sounds good
<bluestorm_> is that in the Hump ?
<flux> I don't remember
<bluestorm_> ( "on" the Hump ? ^^ )
<flux> I can't find it now, though
authentic has quit ["reboot"]
<mr_hugo> what is wrong with my 3 lines code: http://pastebin.com/d6ea3a0fd ?
<mr_hugo> i saved it into a file "test.ml" and run ocaml test.ml test1 test2 test3
<mr_hugo> but it displays a line 3, characters 0-3:Syntax error
<mr_hugo> :/
<flux> put ;; after open
<mr_hugo> ah ok
<flux> however you can write ;;less code if you put everything into definitions
leo037 has joined #ocaml
<flux> like: let _ = for ..
<mr_hugo> wierd ;; definition :/
<mr_hugo> why isn't ;; needed at the end of the for loop ?
tty56 has quit [Read error: 60 (Operation timed out)]
<flux> I think it goes like: a section can either contain definitions or an expression
<flux> and ;; separate sections
<mr_hugo> ohh nice
<mr_hugo> yes, that makes it simple
<mr_hugo> i was trying to memorize where to put the strange ;;
<xavierbot> Characters 1-2:
<mr_hugo> heheh
<xavierbot> i was trying to memorize where to put the strange ;;
<xavierbot> ^
<xavierbot> Unbound value i
<xavierbot> Characters 14-16:
<xavierbot> Parse error: illegal begin of top_phrase
<flux> :)
<Flynsarmy> ocaml is a higher level language than python?
<mr_hugo> ahaha very cool
<flux> flynsarmy, I think they are pretty much the same level
<flux> a higher level language would be something fully declarative, such as prolog
<Flynsarmy> yea that's what i'd been reading. Ocaml/Python/Eiffel are all high level languages. Kind of makes it difficult to answer the question :S
<danderson> Flynsarmy: I would say that ocaml is somewhat higher, since python lacks a few functional tools
<mr_hugo> i would like a "inline C" feature to ocaml :)
<mr_hugo> __C__
<flux> mr_hugo, hey, you could do that with camlp4 :)
<flux> hm, infact that'd be great for writing ocaml/c-wrappers..
<fremo> heh, yes :)
<mr_hugo> oh i see
<flux> mr_hugo, if you're attempting to interface with a c-library, don't miss ocamlidl
<flux> or swig (but I haven't used swig)
<flux> but swig documentation looked great for c++: it even adds a language extension so that you can user object->method -kind of syntax in ocaml, for c++ objects
cpst has quit []
<bluestorm_> flux: altought introspection features of Python could be considered as a "high level" feature
CRathman has joined #ocaml
<flux> hmph.. this is getting old, writing almost-the-same sql queries over and over, wish there was a good statically typed dynamic sql query generator library for ocaml
<flux> (my own hack doesn't even pass my own tests, plus it doesn't cover everything I can do directly)
<flux> ((of course, composability would be a requirement for such a generator))
CRathman has quit ["ChatZilla 0.9.78.1 [Firefox 2.0.0.6/2007072518]"]
easports has joined #ocaml
Flynsarmy has quit ["ChatZilla 0.9.78.1 [Firefox 2.0.0.6/2007072518]"]
piggybox has quit [Connection timed out]
ygrek has quit [Remote closed the connection]
authentic has joined #ocaml
slipstream-- has quit [Remote closed the connection]
slipstream has joined #ocaml
smimou has joined #ocaml
slipstream-- has joined #ocaml
piggybox has joined #ocaml
crathman has joined #ocaml
seafoodX has joined #ocaml
piggybox_ has joined #ocaml
slipstream has quit [Connection timed out]
seafoodX has quit []
ednarofi has quit [Read error: 110 (Connection timed out)]
piggybox__ has joined #ocaml
piggybox has quit [Connection timed out]
piggybox_ has quit [Read error: 110 (Connection timed out)]
piggybox_ has joined #ocaml
ednarofi has joined #ocaml
piggybox__ has quit [Read error: 110 (Connection timed out)]
pango has quit [Remote closed the connection]
pango has joined #ocaml
Mr_Awesome has quit ["aunt jemima is the devil!"]
crathman has quit ["ChatZilla 0.9.78.1 [Firefox 2.0.0.6/2007072518]"]
Smerdyakov has joined #ocaml
ygrek has joined #ocaml
mr_hugo has quit [Remote closed the connection]
CRathman has joined #ocaml
ygrek has quit [Remote closed the connection]
abez has joined #ocaml
G_ has joined #ocaml
ygrek has joined #ocaml
G has quit [Connection timed out]
buluca has quit [Connection timed out]
buluca has joined #ocaml
ednarofi has quit [Read error: 110 (Connection timed out)]
ednarofi has joined #ocaml
ktne has quit []
mr_hugo has joined #ocaml
mr_hugo has quit [Read error: 104 (Connection reset by peer)]
<hcarty> flux: Have you ever received this error from camlidl: File /usr/include/bits/types.h, line 50, column 0: syntax error
<hcarty> Or anyone else using camlidl, for that matter...
<hcarty> The line in question starts __extension__ ... and defines a __int64_t typedef
scruffie has quit [Read error: 110 (Connection timed out)]
cpst has joined #ocaml
<flux> I wouldn't try including system headers with camlidl
<flux> it is not a c-compiler, it is its own language which just very much resembles C struct definitions
<flux> so you probably still need to go through the header file
<hcarty> Would you recommend just copying over any required #defines, etc, manually?
<flux> with my very incomplete esd-bindings I used that approach
<hcarty> Ok, thank you
<flux> copied the original esd.h, commented everything out and then started basically copying stuff
<hcarty> Do you know of a way to force an array to be an array of int32 values?
<Tetsuo> use a bigarray
<flux> I think there's a way but I don't remember offhand
<hcarty> Tetsuo: Thanks, I'll give it a shot
<hcarty> I don't know if this is the best way, but it can be set at the interface and/or individual function level with (long|int)_default(...)
aij has joined #ocaml
ygrek has quit [Remote closed the connection]
Mr_Awesome has joined #ocaml
mav_ has joined #ocaml
magnus_ has quit ["leaving"]
malc_ has joined #ocaml
Cygaal has joined #ocaml
malc_ has quit ["leaving"]
tty56 has joined #ocaml
crabstick_ has joined #ocaml
authentic has quit [Read error: 113 (No route to host)]
Demitar has joined #ocaml
easports has quit ["leaving"]
G has joined #ocaml
crabstick has quit [Read error: 110 (Connection timed out)]
joshcryer has quit [Client Quit]
G_ has quit [Read error: 110 (Connection timed out)]
authentic has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
<hcarty> Another camlidl issue - gcc is complaining about camlidl-created variables being declared as void
m3ga has joined #ocaml
<hcarty> flux or Tetsuo: Have you seen this before?
<hcarty> Oh, nevermind...
<hcarty> The wrapped function takes a void* argument. I think the problem is there.
m3ga has quit ["disappearing into the sunset"]
netx has quit ["Leaving"]
magicjm has joined #ocaml
magicjm has left #ocaml []
mbishop has quit ["brb"]
martin__ has joined #ocaml
CRathman has quit ["ChatZilla 0.9.78.1 [Firefox 2.0.0.6/2007072518]"]
martin__ is now known as mbishop
mav_ has quit [Read error: 113 (No route to host)]
piggybox_ has quit [Read error: 110 (Connection timed out)]
Tetsuo has quit ["Leaving"]
ednarofi_ has joined #ocaml
joshcryer has joined #ocaml
ednarofi has quit [Read error: 110 (Connection timed out)]
bluestorm_ has quit ["Konversation terminated!"]
ednarofi has joined #ocaml
ednarofi_ has quit [Read error: 110 (Connection timed out)]
piggybox has joined #ocaml
ednarofi has quit [Read error: 104 (Connection reset by peer)]
ednarofi has joined #ocaml
Smerdy has joined #ocaml
Smerdyakov has quit [Nick collision from services.]
Smerdy is now known as Smerdyakov