gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
munga has joined #ocaml
fraggle_ has quit [Remote host closed the connection]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
ulfdoz_ is now known as ulfdoz
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
munga has quit [Ping timeout: 264 seconds]
lopex has quit []
fraggle_ has joined #ocaml
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
NaCl is now known as SpanishInquisitr
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
SpanishInquisitr is now known as NaCl
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
ftrvxmtrx has quit [Read error: Operation timed out]
ftrvxmtrx has joined #ocaml
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
lpereira has joined #ocaml
jamii has joined #ocaml
Derander_ has quit [Quit: ZNC - http://znc.sourceforge.net]
Derander has joined #ocaml
philtor has joined #ocaml
joewilliams_away is now known as joewilliams
lpereira has quit [Read error: Connection reset by peer]
vivanov has joined #ocaml
philtor has quit [Ping timeout: 255 seconds]
jamii has quit [Ping timeout: 240 seconds]
jamii has joined #ocaml
joewilliams is now known as joewilliams_away
aspect has joined #ocaml
vivanov has quit [Ping timeout: 258 seconds]
vivanov has joined #ocaml
axiles has joined #ocaml
jamii has quit [Ping timeout: 252 seconds]
Obfuscate has quit [Ping timeout: 240 seconds]
philtor has joined #ocaml
Obfuscate has joined #ocaml
zorun has quit [Read error: Connection reset by peer]
rgrinberg_ has joined #ocaml
rgee has quit [Ping timeout: 244 seconds]
goncalo_ has joined #ocaml
goncalo has quit [Read error: Connection reset by peer]
philtor has quit [Ping timeout: 246 seconds]
zorun has joined #ocaml
rgrinberg__ has joined #ocaml
rgrinberg_ has quit [Ping timeout: 260 seconds]
Associat0r has joined #ocaml
Associat0r has quit [Quit: Associat0r]
<gildor> gnuvince: there are alos videos of OCaml Meeting 2008 on Google Video
<gildor> gnuvince: and some videos of OCaml Meeting 2010 on Vimeo
bzzbzz has quit [Ping timeout: 244 seconds]
bzzbzz has joined #ocaml
ulfdoz has quit [Ping timeout: 255 seconds]
ulfdoz has joined #ocaml
Snark has joined #ocaml
edwin has joined #ocaml
edwin has quit [Client Quit]
edwin has joined #ocaml
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
Tommytom has joined #ocaml
sepp2k has joined #ocaml
lpereira has joined #ocaml
ztfw has joined #ocaml
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
Tommytom has left #ocaml []
avsm has quit [Quit: Leaving.]
ikaros has joined #ocaml
rgrinberg__ has quit [Read error: Connection reset by peer]
lopex has joined #ocaml
lopex has quit []
itewsh has joined #ocaml
sepp2k has quit [Ping timeout: 255 seconds]
avsm1 has joined #ocaml
sepp2k has joined #ocaml
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 255 seconds]
impy has quit [Read error: Connection reset by peer]
<EM03> if anyone has experience with fastcgi apps in ocaml, I would like to ask a few questions on deployments
boscop has joined #ocaml
boscop_ has quit [Ping timeout: 255 seconds]
itewsh has quit [Quit: o/]
TaXules has joined #ocaml
<EM03> how are let expressions not real variables?
<flux> ?
<EM03> I was just reading this book on ocaml flux and it said let expressions are not real variables and made an inclination that they can't be changed later
<flux> well, even immutable variables are.. variables
<flux> the term 'variable' can be understood as 'it varies from call to call', not that it varies from line to line.
<flux> of course, top-level variables can only vary between invocations of the program.
<EM03> let x = 10;; can be changed later
<flux> nope.
<EM03> it can't?
<flux> you can, however, create a new binding for x later
<flux> but that particular x cannot be changed.
<EM03> mind explaining the usable difference
<flux> so if you write let x = 42;; later, you haven't changed anything. you've created a new x.
<flux> let x = 10;;
<EM03> but the old is now gone?
<flux> let test () = Printf.printf "%d\n%!" x
<flux> ;;
<flux> let x = 42;;
<flux> test ();;
<flux> and then it prins 10
<flux> as you can see, it's not gone
<flux> well, if you don't refer to it, it will be eradicated by the GC
<EM03> so let x = 42 is ignored?
<flux> no
<flux> you can ask the value of x with x;;
<flux> so the new x is 42
<flux> but the old code still uses the old x
<EM03> well if you called test () amd it printed 10?
<EM03> ah
<flux> should you define test () again, it would end up printing 42
<EM03> I see
<EM03> which is why we should use references if we need stuff to change globally
<flux> yes
<flux> although, actually using mutability (references) isn't that often required for achieving stuff
<flux> it's the imperative way of doing things :)
<flux> but at times it can be very convenient.
<EM03> C style I understand
<EM03> I prefer less references and more OO myself :P
<EM03> well OO is not related but most OO people don't go crazy with references
<flux> but they do go crazy with state..
edwin has quit [Remote host closed the connection]
cyy has joined #ocaml
cyy has left #ocaml []
bzzbzz has quit [Ping timeout: 240 seconds]
bob` has joined #ocaml
<EM03> flux: which?
edwin has joined #ocaml
<flux> OO is about sending messages that mutate the internal state of the object.
<EM03> yes
<EM03> ah I see what you mean
<EM03> flux: so whats your advice
jamii has joined #ocaml
<flux> em03, with ocaml, better try the functional approach
<EM03> just passing functions as values?
<flux> writing things in a fashion that doesn't mutate things or have side effects
<flux> when you find that isn't effective, use references or even objects with caution ;)
<EM03> well i mean every program has to have side effects to some degree
<flux> it depends on what side effects mean. if they are encapsulated into monads, you turn the program into a level where the effects are values, and they are only evaluated by the runtime, not your program
<flux> using monads in ocaml is quite rare, though. an example of a language where monads are the norm would be haskell.
<flux> they are useful in ocaml, nevertheles. for example lwt and pgocaml use them to a great success.
bob` has quit [Ping timeout: 246 seconds]
robocop has joined #ocaml
impy has joined #ocaml
<EM03> flux: print_endline a side effect to you?
lopex has joined #ocaml
<flux> em03, it does
<EM03> it does what flux ? returns a value or is a side effect?
<EM03> dfdsfsdf
<EM03> - : unit = ()
<flux> it returns a unit value and as a side effect output has been written to a file descriptor
<EM03> yes ....so would you consider it a side effect?
<flux> sure
<EM03> so how can some people say, I don't program with side effects?
<EM03> sound elusive
<flux> let's say you have only one function that can perform side effects
<flux> let's call it 'run'
<flux> and you cannot call run yourself, only compiled binaries can
<flux> do you then write programs that have side effects?
<EM03> did you still program that one function?
<flux> well, another example. I have a program that outputs: "echo 'hello world'"
<flux> hm, actually scratch that
<flux> you have a function that returns "hello world" to the operating system
<flux> and operating system outputs that string.
<flux> did your program have side effects?
<EM03> i guess not
<EM03> but your os created a side effect I guess
<flux> yes
<flux> and in that way you have all the good sides of pure functions in your program
<flux> for example, results are always reproduciple
<EM03> so your saying pass around values and let that function itself cause side effects?
<flux> if it returns "hello world" once, it must return it always, because it has no means to depend on any dynamic value
<EM03> but to do anything practical we will have to write side effects, a db query etc
<flux> well, the causing of side effects in monadic programming are sort of outside your program
<flux> ok, then example2: you write two functions. progarm 1 says: "ask user input" and program 2 "if argument = 'hello' then 1 else 2"
<flux> if the OS runs first program 1 and then program 2 with the argument it received from the user, has your program performed a side effect?
<flux> in monadic program you sort of construct a script for the runtime in a fashion very similar to imperative programming
<flux> that results in actions becoming values
<flux> but it also limits you: if your function signature says the function returns an integer, it WILL always return an integer (or not terminate), and it cannot ask the user any input
<flux> in any case, in ocaml doing monadic programming is sort of an advanced subject
<flux> perhaps less so in haskell, because you cannot achieve anything without using them
<flux> continuation passing is btw a related concept
<flux> in fact I believe haskell used that before the idea of using monads as an IO abstraction was implemented
jamii has quit [Ping timeout: 240 seconds]
<flux> you should take a look into it (CPS)
lamawithonel has quit [Ping timeout: 260 seconds]
lamawithonel has joined #ocaml
rpearl has joined #ocaml
rpearl has left #ocaml []
robocop has quit [Quit: Quitte]
efaust has joined #ocaml
efaust has left #ocaml []
jamii has joined #ocaml
likebike has quit [Ping timeout: 252 seconds]
Snark has quit [Quit: Ex-Chat]
jamii has quit [Ping timeout: 258 seconds]
jamii has joined #ocaml
wagle has quit [Read error: Operation timed out]
wagle has joined #ocaml
<EM03> flux: some people think side effects are bad, but are they? maybe thats another issue though
avsm1 has quit [Quit: Leaving.]
<EM03> some say a side effect is just changing *anything*
philtor has joined #ocaml
ymasory has joined #ocaml
vivanov has quit [Ping timeout: 276 seconds]
rgee has joined #ocaml
rgee has quit [Client Quit]
rgee has joined #ocaml
jamii has quit [Ping timeout: 258 seconds]
rgee has quit [Client Quit]
jamii has joined #ocaml
rgee has joined #ocaml
rgee has quit [Client Quit]
rgee has joined #ocaml
robthebob has joined #ocaml
jamii has quit [Ping timeout: 258 seconds]
axiles has quit [Remote host closed the connection]
<EM03> flux: how long have you been using ocaml? you seem fairly knowledgable
lpereira has quit [Quit: Leaving.]
ztfw has quit [Remote host closed the connection]
edwin has quit [Remote host closed the connection]
ymasory has quit [Quit: Leaving]
jamii has joined #ocaml
<NaCl> hmmmm.
<NaCl> the lwt toplevel looks funny
<NaCl> oh
<NaCl> that's auto-completion
<NaCl> uh
<NaCl> that's not the best way to do it. >_<
avsm has joined #ocaml
munga has joined #ocaml
jamii has quit [Ping timeout: 258 seconds]
philtor has quit [Ping timeout: 240 seconds]
jamii has joined #ocaml
jamii has quit [Ping timeout: 258 seconds]
rgee has quit [Quit: Leaving]
rgee has joined #ocaml
<NaCl> is there any documentation on how to use lwt with lablgtk?
avsm has quit [Quit: Leaving.]
munga has quit [Ping timeout: 240 seconds]
jamii has joined #ocaml
EM03 has left #ocaml []
rgee has quit [Ping timeout: 276 seconds]
goncalo_ is now known as Goncalo
rgee has joined #ocaml
jamii has quit [Ping timeout: 258 seconds]
jamii has joined #ocaml
Morphous_ has quit [Ping timeout: 260 seconds]
ikaros has quit [Quit: Ex-Chat]
Morphous_ has joined #ocaml
sepp2k has quit [Quit: Leaving.]
ymasory has joined #ocaml
jamii has quit [Ping timeout: 258 seconds]