kaustuv changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.1 out now! Get yours from http://caml.inria.fr/ocaml/release.html
Arthur_Rainbow1 has joined #ocaml
<Arthur_Rainbow1> Hi
<Arthur_Rainbow1> I would like to know, does anyone know a tutorial about camlP4 wich is not deprecated.
<Arthur_Rainbow1> (I saw there is some undocumented change done, and when I try example in http://caml.inria.fr/pub/old_caml_site/camlp4/tutorial/tutorial007.html with a copy-pasta, I've got a "Parse error: Deprecated syntax, the grammar module is expected" and I've got no clue of what this may mean)
Alpounet has joined #ocaml
_schulte_ has joined #ocaml
^authentic has joined #ocaml
Arthur_Rainbow1 has left #ocaml []
Alpounet has quit ["Leaving"]
authentic has quit [Read error: 110 (Connection timed out)]
_schulte_ has quit [Read error: 110 (Connection timed out)]
verte has joined #ocaml
Tekst has joined #ocaml
Tekst has left #ocaml []
psnively has joined #ocaml
Mr_Awesome has quit [Read error: 104 (Connection reset by peer)]
psnively has quit []
yziquel has quit [Ping timeout: 180 seconds]
purestrain has joined #ocaml
<purestrain> hi; i'm currently trying to learn a new language, my background is mostly oop (like c++, D, c#); is ocam well suited for "every day" tasks and projects or more for specific ones?
rhar has joined #ocaml
<flux> purestrain, it is well-suited. however, for every day -tasks you might want to take a look at batteries: it is a collection of libraries to make those things a bit easier
<flux> purestrain, the standard library that comes with ocaml is not very large
<purestrain> um; i first need to get into it... its like a giant hit in the face
<flux> if batteries seems otoh too big, smaller projects such as extlib (incorporated in it) can be nice
<purestrain> are there any style guidelines if i need someone to check certain parts of code ?
<purestrain> it seems like eclipse is removing tabs...
jeddhaberstro has quit [Client Quit]
<flux> just indenting properly is a good start :)
munga has quit [Read error: 110 (Connection timed out)]
gim has quit [Read error: 110 (Connection timed out)]
<tsuyoshi> personally I don't think ocaml is a good first functional language
<kaustuv> personally, I think you can do a lot worse than ocaml *cough*scheme*/cough*
<tsuyoshi> I was about to recommend scheme, actually
<kaustuv> darn, this means we have to duel, tsuyoshi. meet me at dawn, your pick of sabres or pistols
<tsuyoshi> so you can understand recursion and closures without getting distracted by objects, variants, pattern matching etc.
<kaustuv> but pattern matching with algebraic datatypes are the sine qua non of what I would consider "functional programming"
<tsuyoshi> I think the only crucial part of functional programming is closures
<kaustuv> you can have closures without being functional -- C# has them, Java arguably has them
<tsuyoshi> I would say.. a functional language makes closures easy
<tsuyoshi> ocaml is the best language around but there are so many new aspects to it if you're not coming from another functional language...
<kaustuv> I've probably said this too often here, but the phrase "functional programming language" is mostly meaningless. Functional is a *style*, and a key element of that style I would say is higher-order algebraic reasoning on programs with strong static guarantees. Languages like ML and Haskell make the functional style easy to adopt. Scheme gives you only the higher-order aspect without the algebraic reasoning or the static guarantees
<kaustuv> (unless you use Typed Scheme).
MrEvil has joined #ocaml
<det> what about being distracted by macros and s-expressions and eval etc?
rhar has quit [Read error: 110 (Connection timed out)]
MrEvil has quit ["This computer has gone to sleep"]
<purestrain> theres a lack of good ide's, right? i checked several ones but i'm missing code completion, refactoring and so on
caligula__ has joined #ocaml
<det> OcalDE + eclipse is pretty good
<purestrain> oh
<kaustuv> Code completion is not so important for OCaml because it's not a very verbose language. That being said, I've been meaning to teach M-x hippie-expand about .annot files.
<det> OcalDE > Emacs IMO
<kaustuv> If by > you mean larger, then you're probably right.
<det> larger than emacs? :x
<purestrain> hmm i'm trying to match some elements to oop... is building a class hierarchy with properties, virtual methods and so on 'outdated' in a functional style ?
<purestrain> e.g. i saw a raytracer written in cpp compared to ocaml
<purestrain> seemd 'dirty' to me
<purestrain> http://www.ffconsultancy.com/languages/ray_tracer/comparison.html <- this is what i'm referring to
<det> It really depends on what you are doing
<det> "OOP" is comprised of many separate concepts
<kaustuv> If you absolutely want classes, you can use the OO facilities of OCaml. But in 90% of the cases you don't want OO.
<kaustuv> Data/code encapsulation is done via modules and datatypes.
caligula_ has quit [Read error: 110 (Connection timed out)]
<purestrain> yay; consider writing a small "connect four" game as expample; usually i would have a game-class, a board class, piece classes, maybe a player class
<purestrain> is this different in functional programming?
<kaustuv> In OCaml you'd have a game module, a board module, a piece module defining a datatype of pieces (type piece = Red | Blue), maybe a player module.
<purestrain> um ok; i thought of modules like ordinary namespaces ;-)
<purestrain> need to read more
<kaustuv> Modules are mainly namespaces, yes. But they're different from C++ namespaces because they have interfaces that define exactly what you want to expose
<det> modules are like namespaces
<kaustuv> But objects are also namespaces. Whether you prefer object.method() or method(object) is a matter of taste.
<det> you mean function(value)
<kaustuv> well, sure
Snark has joined #ocaml
<purestrain> its hard to get into it
<wysek> I guess one should use classes if he really needs to inherit some code/class
<wysek> and he don't want to do it any other way ;)
<purestrain> well; i don't really need them; in oop i was mostly using composition instead of inheritance
<wysek> I suggest using module and an init function returning a certain structure defined in that module
<purestrain> but as far as i am with ocaml, everything looks so unusual
<wysek> then you may use this structure as a first arg in functions in modules
<wysek> that's the way I do it right now
<purestrain> isn't that more like imperative programming?
<wysek> hmm, maybe a little :)
<purestrain> so instead of "employee.calculateFoo" i'm ending in a module 'employee" with a structure and functions like "calculateFoo" which takes a employee structure as argument?
<wysek> yeah
<wysek> I needed modules anyway and this way I avoided learning classes in ocaml
<wysek> ;)
<purestrain> at the first sight its like stepping 15 years back into the age of C / Basic
<wysek> probably, but as you said, you use composition
<wysek> so you can do with modules most of the things you want (?)
<wysek> I don't feel the need to use classes if modules are adequate
<wysek> adequate=enough
Le-Chuck_ITA has joined #ocaml
<Le-Chuck_ITA> Hi there, anybody using tuareg-mode in fedora 11? I installed the pacakge but emacs does not "see" it
<det> restart emacs?
<Le-Chuck_ITA> det: indeed :)
<det> does that mean you have tried that already ?
<det> or that it solved your problem?
<Le-Chuck_ITA> det: I tried indeed, and it did not solve my problem
<det> You have no M-x tuareg-mode ?
<Le-Chuck_ITA> det: are you using fedora? I think emacs is not "seeing" the compiled elc files
<Le-Chuck_ITA> det no
<det> No, I am Ubuntu user.
<Le-Chuck_ITA> and no ocaml mode
<Le-Chuck_ITA> det I have been for 4 years :( but that's another story
<det> I guess I can't help you then :/
eevar2 has joined #ocaml
<Le-Chuck_ITA> will try #fedora but I doubt I'll find ocamlers there
<det> sounds like general emacs problem
<Le-Chuck_ITA> thanks anyways and bye
Le-Chuck_ITA has left #ocaml []
<kaustuv> We have some Fedora OCaml maintainers in this channel, I thought? They're probably asleep.
<kaustuv>
<kaustuv>
<kaustuv> Hmm, ERC is behaving strangely. I didn't type those blank lines.
Le-Chuck_ITA has joined #ocaml
<Le-Chuck_ITA> Hi, can someone look at http://pastebin.com/m76b8e37f and tell me if it's correct use of the foreign function interface? It's code generated from camlidl but it's hanging on return
<Le-Chuck_ITA> I think it should use camlreturn and friends!
<Le-Chuck_ITA> that is, the code generated from camlidl is not returning from the call, it's a simple C function; manually inserting a printf before return shows that code passes by there; inserting an (ocaml) printf right after the call to the function does not return anything. That must either be a dirty libc/ocaml problem or a bug in calmidl
<kaustuv> There is nothing wrong with that function because unit is not an allocated value
Le-Chuck_ITA has quit [wolfe.freenode.net irc.freenode.net]
purestrain has quit [wolfe.freenode.net irc.freenode.net]
LeCamarade|Away has quit [wolfe.freenode.net irc.freenode.net]
Proteus_ has quit [wolfe.freenode.net irc.freenode.net]
pwned has quit [wolfe.freenode.net irc.freenode.net]
nimred has quit [wolfe.freenode.net irc.freenode.net]
ertai has quit [wolfe.freenode.net irc.freenode.net]
purestrain has joined #ocaml
LeCamarade|Away has joined #ocaml
Proteus_ has joined #ocaml
ertai has joined #ocaml
mingw has joined #ocaml
nimred has joined #ocaml
<kaustuv> A hung runtime makes me suspect that ml_fuse_init() is not being friendly to the heap
Beelsebob has quit [Remote closed the connection]
Beelsebob has joined #ocaml
munga_ has joined #ocaml
<kaustuv> Generally speaking though there is no harm in using the CAMLparam/CAMLreturn macros always. http://pastebin.com/d37a94c6
gim has joined #ocaml
munga has joined #ocaml
gim has quit [Read error: 60 (Operation timed out)]
munga has quit [Read error: 110 (Connection timed out)]
hkBst has joined #ocaml
munga has joined #ocaml
gim has joined #ocaml
peddie_ has joined #ocaml
julm has joined #ocaml
peddie has quit [Read error: 110 (Connection timed out)]
Pepe___ has joined #ocaml
Pepe_ has quit [Read error: 60 (Operation timed out)]
youscef has joined #ocaml
sramsay has joined #ocaml
Cromulent has joined #ocaml
hkBst has quit [Read error: 104 (Connection reset by peer)]
Cromulent has quit []
Axioplase has joined #ocaml
Narrenschiff has joined #ocaml
julm_ has joined #ocaml
julm has quit [Read error: 60 (Operation timed out)]
psnively has joined #ocaml
psnively has left #ocaml []
julm_ is now known as julm
stan_ has joined #ocaml
bombshelter13_ has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
hkBst has joined #ocaml
Beelsebob1 has joined #ocaml
Narrenschiff has quit []
Beelsebob has quit [Read error: 113 (No route to host)]
ski__ has quit [Remote closed the connection]
eevar2 has quit ["This computer has gone to sleep"]
Beelsebob1 is now known as Beelsebob
fschwidom has joined #ocaml
rhar has joined #ocaml
Axioplase has quit ["/quat"]
lutter has quit ["Leaving."]
fschwidom has quit [Remote closed the connection]
lutter has joined #ocaml
stan_ has quit [Client Quit]
stan_ has joined #ocaml
rhar has quit ["Leaving"]
Pepe___ is now known as Pepe_
munga_ has quit [Read error: 113 (No route to host)]
stan__ has joined #ocaml
stan_ has quit [Client Quit]
verte has quit ["~~~ Crash in JIT!"]
ulfdoz has joined #ocaml
peddie_ is now known as peddie
flx_ has joined #ocaml
cygnus is now known as Guest610
flux has quit [Read error: 145 (Connection timed out)]
purestrain has quit ["Ex-Chat"]
mfp has left #ocaml []
mfp has joined #ocaml
Cromulent has joined #ocaml
Cromulent has quit []
Snark has quit ["Ex-Chat"]
sramsay has quit ["Leaving"]
jeddhaberstro has joined #ocaml
Makoryu has joined #ocaml
BigJ has quit ["Leaving"]
rwmjones is now known as rwmjones-afk
sramsay has joined #ocaml
mfp has quit [Read error: 110 (Connection timed out)]
jimmyb21871 has joined #ocaml
jimmyb2187 has quit [Read error: 60 (Operation timed out)]
jimmyb21871 is now known as jimmyb2187
stan__ has quit [Client Quit]
ulfdoz has quit [Read error: 110 (Connection timed out)]
slash_ has joined #ocaml
bombshelter13_ has quit []
mfp has joined #ocaml
youscef has quit ["KVIrc 3.4.0 Virgo http://www.kvirc.net/"]
hkBst has quit [Read error: 104 (Connection reset by peer)]
Cromulent has joined #ocaml
jeddhaberstro has quit [Client Quit]
^authentic is now known as authentic
Cromulent has quit []
slash_ has quit [Client Quit]