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