dan2 changed the topic of #ocaml to: OCaml 3.08.2 available! | Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
kinners has joined #ocaml
drewr has quit ["home"]
<TheDracle> There's something about C++ that makes people really irrate it seems.
<vincenz> like what?
<TheDracle> ... I don't know.
<TheDracle> Lol.
<vincenz> and whom are you referring to?
<TheDracle> Go to #c++.
<vincenz> I am there
<TheDracle> Everybody.
<vincenz> always
* vincenz looks up irrate
<TheDracle> They're angry angry people.
<vincenz> nah
<KrispyKringle> irate, he means
<KrispyKringle> it's something about IRC, i believe. Not C++.
* vincenz looks up irate
<KrispyKringle> means angry.
<TheDracle> Oops.
<KrispyKringle> from the latinate root from which "irritate" derives.
<vincenz> KrispyKringle: extremely angry
<vincenz> KrispyKringle: which if one knew italian would know that means irritated
<vincenz> so not exactly the same
<KrispyKringle> makes sense.
<TheDracle> People on #ruby seem happy.. And on #ocaml.
<vincenz> anywho
<vincenz> TheDracle: on ocaml people are just sleepy
<TheDracle> On #c++ they're just taking pot-shots at eachother.
<TheDracle> Lol.
<KrispyKringle> the people on #perl like to be strange. and have strange senses of humor. :P
<TheDracle> Borrring language.
<vincenz> TheDracle: for the fun of it
<TheDracle> let x = yawn... in.. *rubs eyes*.
<vincenz> in the famous words of (whomever invented lambda)
<vincenz> (\x. x x)(\x.x x)
<TheDracle> .. Bastard.
<vincenz> what?
<KrispyKringle> i don't see anything happening on #C++
<vincenz> TheDracle: that was _so_ nonsequitur
<vincenz> s/tur/tir
<TheDracle> Now watch...
* vincenz goes off on his usual tangent
<vincenz> "Did you know I implemented currying with templates"
<Riastradh> vincenz, you were [almost] right the first time: it's 'non-sequitur.'
<vincenz> hmm, thx :)
<Riastradh> ..er, without the hyphen.
lodewijk has quit [Read error: 110 (Connection timed out)]
<vincenz> TheDracle: My main research, as well as that of our group lies in that field
TheDracle has quit [Remote closed the connection]
vincenz is now known as space
<KrispyKringle> space: your main research lies in non sequitors?
<Riastradh> Sequitur!
<space> KrispyKringle: nono
<space> it was referring to a conversation in #c++
<KrispyKringle> oh
<KrispyKringle> i was gonna say...odd research, that.
space is now known as vincenz
monochrom has joined #ocaml
joaopaulo has joined #ocaml
<joaopaulo> no slackware package for ocaml ?
<kinners> have a look for godi
<joaopaulo> thanks
gim has quit [Read error: 110 (Connection timed out)]
lmbdwr has quit ["Leaving"]
joaopaulo has quit [Read error: 104 (Connection reset by peer)]
humasect has joined #ocaml
lodewijk has joined #ocaml
smimou has quit ["?"]
zzorn_away has quit [Read error: 104 (Connection reset by peer)]
cjohnson has joined #ocaml
<vincenz> is godi gainin on standardization?
kuribas has quit ["ERC Version 4.0 $Revision: 1.657 $ (IRC client for Emacs)"]
fsc has quit []
mattam has quit ["Lost terminal"]
fab__ has quit [Read error: 110 (Connection timed out)]
fab__ has joined #ocaml
vinvin has quit ["Leaving"]
monochrom has quit ["Few people understand "understanding"."]
Xolution has joined #ocaml
kinners has quit ["leaving"]
<KrispyKringle> is there some reason "exit 0" wouldn't exit the program?
<humasect> threads?
<KrispyKringle> no
<humasect> technically not much otherwise..
<humasect> considering the command is executed
<humasect> it is directly hooked as an external to libc exit(); i believe
cjohnson has quit [Connection timed out]
Xolution is now known as cjohnson
<KrispyKringle> it prints EOF, but doesn't exit.
<humasect> hmm
<humasect> that is strange
<KrispyKringle> isn't it? :P
<humasect> hm =)
<humasect> i am not familiar /enough/ with ocaml to completely figure it out without digging
<humasect> try before flushing stdout..
<Excedrin> it exits here
<KrispyKringle> humasect: i did flush stdout
<KrispyKringle> Excedrin: im calling it with establish_server
<KrispyKringle> just a little test function, you know? :P
<humasect> it only depends on the environment the function is executed then
<humasect> side..effect..
<Excedrin> I ran it on stdin and stdout
<KrispyKringle> yeah, I don't know. exit 0 works for me otherwise, but not in this case.
<Excedrin> after ctrl-d it exited
<KrispyKringle> ill try it on sdtin/stdout and see what happens.
<KrispyKringle> works for me on stdin/stdout, too.
<KrispyKringle> hmm. ill go ruminate on this while i eat dinner. thanks for the help.
<KrispyKringle> if you think of anything, let me know :P
<humasect> :)
<humasect> hm godi is broken
mrsolo has joined #ocaml
CLxyz has quit [Remote closed the connection]
CLxyz has joined #ocaml
<KrispyKringle> oh, nevermind. im an idiot.
<humasect> =o
<humasect> what was the problem ?
quamaretto has joined #ocaml
monochrom has joined #ocaml
<KrispyKringle> oh, it wasn't a problem.
<KrispyKringle> i forgot that establish_server forks and so when i did exit, i only killed the child :P
<KrispyKringle> :o
<dan2> KrispyKringle: eww, establish_server is bad
<dan2> KrispyKringle: fork per connect
<dan2> ugh
<KrispyKringle> dan2: is it? im going to rewrite with threads, anyway.
<humasect> okay, i theorised on the threads.
<humasect> -_-
<dan2> KrispyKringle: worker pools buddy
<dan2> KrispyKringle: unforteanetly, I have yet to find anything that performed quite as well as java5 java.util.concurrent
<dan2> its excellent threadpooling
<dan2> 4 lines of code I created a threadpool and executed a runnable using a thread from the threadpool
<KrispyKringle> dan2: yeah, well, i abandoned my idea of writing an http server, since it's already been done in the tutorial. boring ;) so performance for what im working on now isn't a big issue.
<KrispyKringle> but yes, i was debating that with myself before. i was curious how boa handles multiplexing, since it doesn't actually use threads or fork. but im too lazy to read that C and figure out.
<dan2> KrispyKringle: I'd use java
<KrispyKringle> bleh
<dan2> KrispyKringle: never thinking about using threads the same in java ever again
<KrispyKringle> i already know java. the purpose of the excercize is to familiarize myself with ocaml :P
<dan2> KrispyKringle: I have one pool of threads that all of my thread bearing processes use
humasect has quit ["Leaving.."]
monochrom has quit ["Few people understand "understanding"."]
<dan2> KrispyKringle: select and make events
<KrispyKringle> hmm?
drewr has joined #ocaml
Submarine has joined #ocaml
Smerdyakov has joined #ocaml
KrispyKr1ngle has joined #ocaml
KrispyKringle has quit [Nick collision from services.]
KrispyKr1ngle is now known as KrispyKringle
vezenchio has quit ["Greenspun's Tenth Rule of Programming: any sufficiently complicated C or Fortran program contains an ad hoc informally-specif]
lodewijk has quit [Read error: 110 (Connection timed out)]
<KrispyKringle> what's the machine-independent method of networking?
mlh has quit [Client Quit]
<Smerdyakov> That question doesn't mean any particular thing to me.
<judge> KrispyKringle: talking
<KrispyKringle> Smerdyakov: what i mean is, rather than the methods in the Unix module, which would presumbaly only work on Unix systems, is there a way that's supported more widely?
<Smerdyakov> There is for SML, but I don't know about OCaml.
<KrispyKringle> oh, ok. thanks anyway.
<Smerdyakov> Who cares about non-UNIX systems without UNIX emulation layers, anyway? :)
<KrispyKringle> heh
<KrispyKringle> i should look at how MLDonkey does it, perhaps.
<det> KrispyKringle: unix sockets are supported just about everywhere
drewr has quit ["zzzzz"]
<KrispyKringle> oh, ok thanks. i don't have a non-unix system, nor have i programmed much on one.
<judge> but .NET..it's soo easy
<judge> and CeeeShaaarp
<judge> nevermind
<judge> it's late
mlh has joined #ocaml
xkb has joined #ocaml
Herrchen has joined #ocaml
KrispyKringle has quit ["Get MacIrssi - http://www.g1m0.se/macirssi/"]
lodewijk has joined #ocaml
m3ga has joined #ocaml
pango has quit ["brb"]
pango has joined #ocaml
mrsolo_ has joined #ocaml
smimou has joined #ocaml
mrsolo has quit [Read error: 60 (Operation timed out)]
xkb_ has joined #ocaml
smimou has quit ["?"]
xkb has quit [Read error: 113 (No route to host)]
xkb_ has quit []
gim has joined #ocaml
m3ga has quit ["Client exiting"]
mlh has quit [Client Quit]
Demitar has quit [Read error: 110 (Connection timed out)]
zzorn has joined #ocaml
avlondono has joined #ocaml
joaopaulo has joined #ocaml
joaopaulo has quit ["Leaving"]
kuribas has joined #ocaml
<kuribas> Is there a way to create inline functions in ocaml?
<Submarine> ocamlopt does automatic inlining in some contexts
<kuribas> I am doing image processing, but it is very slow because ocaml doesn't inline the calls to getpix and setpix
<kuribas> I defined them in another file
<Submarine> do oyu use ocamlopt or ocamlc?
<kuribas> ocamlopt
<Submarine> do you use functors?
<kuribas> no
<kuribas> should I?
<kuribas> I have created an abstraction around Bigarray, so that getpix returns Black or White
<kuribas> It is very slow because ocaml doesn't inline the function call to getpix and setpix
<Submarine> how do you know it's un-inlined?
<kuribas> I looked at the assembler code
<kuribas> Perhaps it's because the code is in another compilation unit?
<pango> try ocamlopt with a higher -inline value
<kuribas> ok
<Smerdyakov> And switch to MLton if you care about performance. :P
<kuribas> hmm, I was just getting to grip with the language ;)
CosmicRay has joined #ocaml
<kuribas> the benchmarks at http://shootout.alioth.debian.org/ list ocaml higher than mlton
<Smerdyakov> They're tiny benchmarks.
<Smerdyakov> MLton is a whole-program compiler.
<Smerdyakov> You can't see the advantage from tiny benchmarks.
<Smerdyakov> For instance, you never need to think about inlining with MLton.
<Smerdyakov> And MLton is listed higher on the scores page that _I_ see....
<kuribas> Is there much difference from the language point of view?
<Smerdyakov> No, unless you're using OCaml OO.
<Smerdyakov> Oh, and another thing; MLton doesn't _need_ a BigArray. It automatically uses a representation just as good as OCaml's for BigArray, when possible.
<kuribas> ok, that's good.
<kuribas> Heh, mlton and ocaml list higher than g++...
<kuribas> That's surprising since ocaml doesn't have an optimizing compiler
<kuribas> The nice thing about ocaml is that it has good supporting tools (like emacs-modes, etc).
<Smerdyakov> So does SML.
<Smerdyakov> sml-mode comes with many default emacs distributions.
<Submarine> what are the advantages of caml over sml?
<Submarine> except that I can shout at the designers easier?
<Smerdyakov> At this point, I think it's just more libraries and (much less importantly) the OO features.
<kuribas> yes, OO looks a bit strange in a functional-language
<Smerdyakov> kuribas, you've been duped if you think OO is fundamentally imperative.
<Smerdyakov> kuribas, I just don't think it's that useful, in any language. :)
<kuribas> I think it is very usefull in Smalltalk, Ruby or Objective-C
<kuribas> OO doesn't make much sence without side-effects
<Smerdyakov> Why not?
<Submarine> why not?
<kuribas> Because that way objects aren't self sufficient
<Smerdyakov> Why not?
<kuribas> Objects should be able to manage their own state
bubbles_ has joined #ocaml
<Smerdyakov> What does that have to do with imperative vs. functional?
<kuribas> just that in functional languages there is no state, so there is no reason to have objects to encapsulate them
<Smerdyakov> "State" and "objects" are orthogonal features.
Nutssh has joined #ocaml
<Smerdyakov> What's the simplest case of an imperative OO idiom that you think you can't do well with functional objects?
slashvar[lri] has quit ["reboot"]
<Nutssh> Can't do, or is annoying to do?
<Smerdyakov> It's a question to kuribas, so I'll leave that up to him.
<Nutssh> Happy new year!
<kuribas> Object manipulation
<Smerdyakov> kuribas, please give the smallest possible concrete code example.
quamaretto has quit [Read error: 60 (Operation timed out)]
<kuribas> well, I am thinking about gui-code
<Smerdyakov> I doubt that's the smallest possible concrete example.
<kuribas> that's the point, OO is about handling interactions between objects, not small expressions
* Nutssh has a concise answer to the question.
<kuribas> array handling: (for example arr.delete_if { |i| i[O].zero? })
<kuribas> delete all even numbers from the array
<kuribas> Nutssh, what did you have in mind?
<Nutssh> I don't know if mutable objects offer any more power on the theory side, but having them can avoid the annoyance of having to thread a whole lot of state around. Eg, a mutable lexbuf versus a functional lexbuf.
<Nutssh> And threading state around can be error prone because with so many states, you can accidently typo the wrong one.
<Smerdyakov> kuribas, arr.delete_if would return the new array, in the functional world.
<kuribas> Smerdyakov, what it you have a window, then window.move cannot return a new window, can it?
<Smerdyakov> Sure it can.
<kuribas> So you copy the window, and kill the old one, but then it is easier to just keep the old one, and modify the state
<kuribas> State is a very natural thing in the real world
<Smerdyakov> That's a performance optimization.
<kuribas> Do you consider yourself a person that gets update every fraction of a second?
<Nutssh> True kuribas, because its hard to duplicate something in the real world and change a small part of it.
<kuribas> I think a functional language is nice because it describes relationships in a mathematical way, but it is not suited for all problems.
<Smerdyakov> kuribas, I don't understand.
<Smerdyakov> I'm just trying to explain why OO is not fundamentally imperative.
<Smerdyakov> Maybe you use it in settings where imperativity is very useful, but that's a separate issue.
<kuribas> well, in the functional world, OO would be nothing more than a way to group functions with the objects they belong to
<kuribas> It is not so usefull that way
<Smerdyakov> Just make some of the fields ref's and you go from functional to imperative....
<Nutssh> And a few other things? implementation inheritance, subtyping, encapsulation/modularity, um....
<kuribas> I don't think 00 == imperative
<kuribas> What's nice about dynamic OO languages it that you can send any method to any object
<kuribas> That wouldn't work in the functional world
<Nutssh> Are you thinking of smalltalk? Or another language?
<Smerdyakov> kuribas, you've confused things again. Perhaps you mean "the world of static typing"?
<kuribas> Nutssh: Ruby, Smalltalk, and I think Objective C works that way too
<kuribas> Smerdyakov: not really
<Smerdyakov> (And I don't see how that is "nice." To me it looks like another great way to cause all sorts of bugs and maintenance nightmares.)
<Nutssh> I keep on learning good things about ruby.
<Smerdyakov> kuribas, then what does it have to do with functional vs. imperative?
<Nutssh> IMHO, I'm beginning to realize that code is written for different purposes ---- how much code doesn't need to be any more than throwaway?
<kuribas> well, I was just explaining why I think OO doesn't really fit in a functional language. Maybe we have a different view of what OO is.
<Smerdyakov> kuribas, you said that objects that can accept any message are somehow not functional. How did you mean this?
<Nutssh> :)
bubbles_ has quit [Client Quit]
<Nutssh> OO means many things to many people.
<kuribas> Nutssh: Ruby is my prefered language, but I don't think it is fit to write compilers in it
<kuribas> Smerdyakov: For example, and object could change it method's behaviour
<Smerdyakov> kuribas, how is that not functional?
<Nutssh> I use a variety... I've been meaning to learn ruby or python to replace my uses of perl.
<kuribas> I think Ruby is a nice replacement of perl, because it borrows the good features, and throws away the cruft ;)
<kuribas> Smerdyakov, I don't see how it could be functional
<kuribas> Smerdyakov, since there is no change of state in a functional language
<kuribas> Anyway, I should be writing code, instead of philosophing about it! ;)
<Nutssh> TTYL.
* kuribas 's dictionary of abbreviations doesn't contain the word TTYL yet
<Nutssh> Talk to you later.
<kuribas> ok
CosmicRay has quit [Read error: 113 (No route to host)]
<Smerdyakov> kuribas, when a method returns an object, that object can respond to messages in different ways than the original.
mrsolo_ has quit [Read error: 110 (Connection timed out)]
<kuribas> Smerdyakov: I still think that copying state is not a natural thing in many cases
<kuribas> But you may think differently about it.
<kuribas> aha, I found a webpage about converting ocaml to sml
<mbh> Smerdyakov: does SML have a native-code debugger?
<pango> kuribas: keeping is not copying
<Smerdyakov> No.
<mbh> why doesn't ocaml? is it too hard to implement technically?
<Smerdyakov> Probably more work than it's worth.
<Nutssh> And the bytecode one works fine.
<kuribas> what does the -inline value stand for in ocamlopt?
CosmicRay has joined #ocaml
<Nutssh> An inlining threshold for small functions. See the docs.
<Nutssh> From my experience, it doesn't have that much of an effect.
CosmicRay has quit [Read error: 113 (No route to host)]
Robot101 has joined #ocaml
<Robot101> is the URL in the topic meant to be http://merjis.com/developers/ocaml_tutorial/ ? :)
<Robot101> I'm looking through the manual for the documentation on the file IO functions, but I can't find which module they're in, I'm probably being blind...
smimou has joined #ocaml
<Robot101> aha, yes I am :)
kuribas has quit ["Leaving"]
xew has quit ["Abandonando"]
cjohnson has quit ["be back in a few hours"]
vezenchio has joined #ocaml
drewr has joined #ocaml
pango has quit ["Leaving"]
CosmicRay has joined #ocaml
pango has joined #ocaml
mrvn_ has joined #ocaml
mrvn has quit [Read error: 110 (Connection timed out)]
Nutssh has left #ocaml []
humasect has joined #ocaml
zxy____ has joined #ocaml
zxy_ has quit [Read error: 60 (Operation timed out)]
zzorn is now known as zzorn_afk
CosmicRay_ has joined #ocaml
mattam has joined #ocaml
mbh has quit [Read error: 104 (Connection reset by peer)]
mbh has joined #ocaml
CosmicRay_ has quit [Remote closed the connection]
monochrom has joined #ocaml
cjohnson has joined #ocaml
CosmicRay has quit ["Client exiting"]
mlh has joined #ocaml
m3ga has joined #ocaml
drewr has quit ["home"]
m3ga has quit ["Client exiting"]
cjohnson has quit [Read error: 110 (Connection timed out)]
cjohnson has joined #ocaml
smimou has quit ["?"]
Submarine has quit ["Leaving"]
monochrom has quit ["Few people understand "understanding"."]