Yurik changed the topic of #ocaml to: http://icfpcontest.cse.ogi.edu/ -- OCaml wins | http://www.ocaml.org/ | http://caml.inria.fr/oreilly-book/ | http://icfp2002.cs.brown.edu/ | SWIG now supports OCaml| Early releases of OCamlBDB and OCamlGettext are available
hertz has joined #ocaml
jao has joined #ocaml
<hertz> Newbie question? Can I set up functions and then have the inputs change and then everything 'recalculates' like a spreadsheet.
<whee> hertz: that's kind of vague, but I would assume it's possible
<hertz> whee: I'm trying to decide which programming language to use for a particular task...
<hertz> The basic problem is to display a box that is resizable and there is a user defined function to calculate the color of the box as the user resizes it.
<hertz> I was thinking it might be a lot easier to program this functionally.
<hertz> I was also thinking of using evas for the gui
<hertz> s/gui/canvas/
<whee> I'm not really a gui person, but that should be fairly simple
<hertz> Can the inputs of a function be mutable? I want to create something like a control system (with feedback).
<whee> yes, you could have a function with inputs that depend on user interaction
<hertz> example? or URL?
<whee> there should be quite a few examples linked from http://caml.inria.fr/
<whee> probably not many gui examples, but general programming examples
<hertz> Any GUI advice?
<whee> ocaml isn't a purely functional language, so there's no huge gap between mutable values and others
<whee> I'd probably look at lablgtk for guis
<hertz> The gnomecanvas kind of sucks for my application. I want high performance, alpha bending, transparencies and anti-aliasing :)
<whee> you want OS X :)
<hertz> yeah :)
<whee> but really with most XFree86 GUIs you're just programming for some toolkit and the rest is left up to the window manager
<whee> unless you decide to do lowlevel things
<hertz> Experiment: to convert fahrenheit to celcius it is: let f2c f = (f -. 32.0 ) *. 5.0 ./ 9.0;; ....
<whee> that should probably be /. but yes that looks good
<hertz> Or you could express x*5/9 as let rec fiveninths x = x /. 2.0 +. fiveninths(x ./ 10.0) ;;
<hertz> Is there a way to limit the depth of recursion for the function ?
<hertz> Without passing args around ?
jao has quit ["ERC Version 3.0 $Revision: 1.351 $ (IRC client for Emacs)"]
<whee> well yes
<whee> typically you use pattern matching for that
<hertz> can you post an example?
<whee> also I'd place a space between the function name and its arguments so it's not confusing later on
<whee> let rec fiveninths x = let p = x /. 2.0 and q = match x with n when n < 0.0005 -> 0.0 | n -> fiveninths (n /. 10.0) in p +. q
<whee> that probably won't work. I don't know :)
<hertz> It works for me :)
<whee> I don't have a compiler handy heh
<whee> pattern matching is extremely powerful
<whee> that could be rewritten as let rec fiveninths = function n when n < 0.0005 -> x /. 2.0 | n -> x /. 2.0 +. fiveninths (n /. 10.0) as well
<whee> and probably 30 other variations
<whee> err
<whee> those x's should be n's
<hertz> ....I'm going to read up on pattern matching...one minute
<hertz> ok
<whee> you'll use pattern matching a lot when dealing with lists, tuples, variants, things like that
<whee> what kind of programming background do you have?
<hertz> went from pascal, to fortran, to C, to assembly, to C++, to tcl, to python. Now either to ruby or ocaml.
<whee> I'd go for ocaml or a similar functional language; ruby is more of the same
<whee> I like to lump ruby and python together heh
<hertz> yeah
<emu> i dunno
<hertz> Actually I started programming with the C64 :)
<emu> python strikes me as distinctly non-functionally oriented
<emu> and ruby is more like smalltalk
<whee> right, but the languages have similar goals
<emu> replacing perl? =)
<whee> they have roughly the same feature set as well
<whee> it'd be more fun learning ocaml or lisp or scheme or haskell
<emu> indeed
<hertz> They are just painfully slow
<emu> and also Smalltalk
<emu> skip ruby ;)
* whee dislikes OO
* hertz thinks OO is overhyped
<emu> yeah, except when I learned smalltalk, I discovered that they were clever and combined functional programming with OO
<emu> which makes it really powerful
<emu> whereas Java looks like shit in comparison
<whee> smalltal k is how OO should be done, but most languages like C++ and Java are bad implementations of the concept
<emu> hertz: what's painfully slow?
<whee> I like Objective-C in terms of how it handles it, though
<hertz> emu: ruby, pythong
<emu> I was always wondering why people were so happy with languages without a decent compiler
<emu> i figured there were areas where it didn't matter
<whee> I picked up ruby when it wasn't nearly as popular as it is now, it was insanely slow (and that's why I dropped it)
<emu> i think it still has a mark-sweep gc
<hertz> too bad smalltalk isn't on the computer language shootout
<whee> hertz: if you can wrap your head around it, I'd try learning haskell too
<emu> i would take that page with a large grain of salt
<whee> I'm doing that now with the GHC compiler, it's a lot of fun
<emu> yes, I think haskell has some nice ideas
<emu> and seems more flexible than ML type-system-wise
<emu> I could be wrong
<whee> yes, it is
<whee> it's comparable to ocaml in terms of speed (depending on the project, of course)
<emu> the efficiency model is very different
<whee> but being purely functional and lazy it can be hard to get used to
<whee> ocaml's a nice bridge between 'other' languages and the functional side, though
<hertz> emu: is there a better page than the language shootout? what are its main issues ?
<emu> toy examples
<emu> i've heard that some ppl attempted to submit better code snippets that weren't accepted
<emu> there are other measures it doesn't do...
<whee> the shootout is nice to get an idea of syntax and some general idea of the language, but not much more
<whee> some of the tests don't reflect the typical style of programming for a language due to the rules of the shootout
<emu> it's hard to quantify things like clarity of code, ease of program interaction
<emu> development cycle
<whee> that too
<whee> most functional language compilers do a lot of work for you, which cuts down on debugging time
<emu> yes, but they provide shit for debuggers or interactivity
<whee> I haven't run into that problem yet
<emu> have you ever used a decent lisp compiler?
<whee> I used cmucl, it was pretty good
<emu> eh, it's so so
<whee> although it sucks for platform support
<emu> in this respect
<emu> it's compiler is wonderful
<emu> one like allegro will, upon an error, let you recompile the fix and continue where you left off
<emu> or return an alternative value from some stack frame
<whee> I think you really need to go commercial for some languages like lisp
<emu> cmucl slowly picks up these features
<whee> the thing that gets me hooked on languages now is mostly language features, the rest is just icing
<emu> I was looking for a trace feature in smlnj not too long ago, much like trace in CL
<emu> couldn't even get that
<whee> smlnj sucks :P
<emu> these features are generally implemented using condition restarts, which i haven't seen in very many languages at all
<emu> (well, maybe not trace, but others)
Xuz has joined #ocaml
<Kinners> has anyone here tried SWIG ocaml?
hertz has quit [Remote closed the connection]
Kinners has quit ["leaving"]
TimFreeman has joined #ocaml
Xuz has quit ["[BX] Occifer, I'm not as think as you stoned I am!"]
TimFreeman has left #ocaml []
polin8_ has joined #ocaml
polin8_ has quit [Client Quit]
Zadeh has joined #ocaml
Zadeh_ has quit [Read error: 113 (No route to host)]
xtrm has joined #ocaml
<xtrm> Hello World\n
TachYon26 has joined #ocaml
lament has joined #ocaml
aleksi has quit [Remote closed the connection]
TachYon26 has quit [calvino.freenode.net irc.freenode.net]
merriam_ has quit [calvino.freenode.net irc.freenode.net]
Zadeh has quit [calvino.freenode.net irc.freenode.net]
asqui has quit [calvino.freenode.net irc.freenode.net]
whee has quit [calvino.freenode.net irc.freenode.net]
lam has quit [calvino.freenode.net irc.freenode.net]
TachYon26 has joined #ocaml
Zadeh has joined #ocaml
asqui has joined #ocaml
whee has joined #ocaml
merriam_ has joined #ocaml
lam has joined #ocaml
whee has quit [calvino.freenode.net irc.freenode.net]
Zadeh has quit [calvino.freenode.net irc.freenode.net]
asqui has quit [calvino.freenode.net irc.freenode.net]
lam has quit [calvino.freenode.net irc.freenode.net]
Zadeh has joined #ocaml
asqui has joined #ocaml
whee has joined #ocaml
lam has joined #ocaml
systems has joined #ocaml
<systems> hi
asqui has quit [Excess Flood]
asqui has joined #ocaml
Zadeh has quit [calvino.freenode.net irc.freenode.net]
whee has quit [calvino.freenode.net irc.freenode.net]
lam has quit [calvino.freenode.net irc.freenode.net]
TachYon26 has quit [calvino.freenode.net irc.freenode.net]
merriam_ has quit [calvino.freenode.net irc.freenode.net]
lam has joined #ocaml
whee has joined #ocaml
Zadeh has joined #ocaml
TachYon26 has joined #ocaml
merriam_ has joined #ocaml
asqui has quit [Read error: 60 (Operation timed out)]
mattam_ has joined #ocaml
mattam has quit [Read error: 60 (Operation timed out)]
systems has quit [Read error: 104 (Connection reset by peer)]
TachYon26 has quit [Remote closed the connection]
TachYon26 has joined #ocaml
TachYon26 has quit ["bez ki³y nie ma zaliczenia (z prawd studentek AM)"]
asqui has joined #ocaml
asquii has joined #ocaml
asqui has quit [Read error: 60 (Operation timed out)]
asquii is now known as asqui
lament has quit ["It's not like I'm using."]
lament has joined #ocaml
mattam_ has quit ["-> GTA"]
mattam has joined #ocaml
TimFreeman has joined #ocaml
TimFreeman has left #ocaml []
two-face has joined #ocaml
<two-face> hi
lament has quit ["It's not like I'm using."]
lament has joined #ocaml
lament_ has joined #ocaml
lament_ has quit [Read error: 104 (Connection reset by peer)]
vegai has quit [Remote closed the connection]
two-face has left #ocaml []
gehel is now known as THX-1138
taw has joined #ocaml
THX-1138 is now known as gehel
gene9 has joined #ocaml
gene9 has quit [Client Quit]
<Begbie> http://www.riaa.org <-- haha
<kev_> hacked again?
<Begbie> yeah
<kev_> nice
<kev_> not as amusing this time though
polin8 has quit ["Lost terminal"]