mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.0 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
hsuh has joined #ocaml
hkBst has quit ["Konversation terminated!"]
ygrek_ has quit [Remote closed the connection]
gim has joined #ocaml
seafood_ has joined #ocaml
pippijn_ has quit [Read error: 113 (No route to host)]
ikaros has quit [Remote closed the connection]
pippijn has joined #ocaml
<Jeff_123> If I have a function f and I do something like "let f1 = f;; let f2 = f", does ocaml store more than one copy of the function?
<Smerdyakov> What do you mean by "the function" there?
madroach has quit [Remote closed the connection]
<Jeff_123> f
<Jeff_123> let f x = x+1;; let a = f;; let b = f;;
<Jeff_123> is f now in memory 3 times with 3 different names, or 1 time with 3 names?
<cygnus_> 1 time i belive
hsuh has left #ocaml []
<Smerdyakov> The question is still not well-defined.
<Smerdyakov> If OCaml had a formal semantics, it would no doubt lack any idea of what it means for "a function to be in memory N times."
<Smerdyakov> Are you talking about the code of the function, or a closure, or what?
hsuh has joined #ocaml
smimou has quit ["bli"]
Torment has joined #ocaml
<Jeff_123> the bytecode or assembly code corresponding to f
Jedai has quit [Read error: 110 (Connection timed out)]
hsuh has quit ["bye"]
seafood_ has quit []
yminsky has joined #ocaml
yminsky has quit [Client Quit]
lbc has left #ocaml []
lbc has joined #ocaml
jlouis has quit [Remote closed the connection]
jlouis_ has joined #ocaml
jlouis has joined #ocaml
jlouis has quit [Read error: 104 (Connection reset by peer)]
seafood_ has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
gunark has quit [Read error: 110 (Connection timed out)]
gunark has joined #ocaml
lbc has left #ocaml []
qpu has joined #ocaml
qpu has quit ["kthxbye"]
qpu has joined #ocaml
olleolleolle has joined #ocaml
olleolleolle has quit [Client Quit]
seafood_ has quit []
Yoric[DT] has joined #ocaml
<Yoric[DT]> hi
seafood_ has joined #ocaml
olleolleolle has joined #ocaml
ttamttam has joined #ocaml
Mr_Awesome has quit ["aunt jemima is the devil!"]
seafood_ has quit []
seafood_ has joined #ocaml
seafood_ has quit [Client Quit]
Yoric[DT] has quit ["Ex-Chat"]
lbc has joined #ocaml
ertai has joined #ocaml
olleolleolle has quit []
Mr_Awesome has joined #ocaml
acatout has quit [Connection reset by peer]
acatout_ has joined #ocaml
rwmjones has joined #ocaml
madroach has joined #ocaml
suppaman has joined #ocaml
filp has joined #ocaml
ertai has quit [Read error: 110 (Connection timed out)]
ikaros has joined #ocaml
ikaros has quit [Read error: 104 (Connection reset by peer)]
ikaros has joined #ocaml
sergez has joined #ocaml
qpu has quit []
suppaman has quit ["all your bye are belong to us"]
qpu has joined #ocaml
acatout_ is now known as acatout
smimou has joined #ocaml
madroach has quit [Remote closed the connection]
thesnowdog has quit [Read error: 104 (Connection reset by peer)]
hkBst has joined #ocaml
Jeff_123 has quit ["Quit"]
jeremiah has quit [Read error: 104 (Connection reset by peer)]
smimou has quit ["bli"]
buluca has joined #ocaml
marmottine has joined #ocaml
qpu has quit []
jeremiah has joined #ocaml
asmanur has joined #ocaml
seafood_ has joined #ocaml
hsuh has joined #ocaml
hsuh has quit [Remote closed the connection]
qpu has joined #ocaml
qpu has quit [Client Quit]
qpu has joined #ocaml
ertai has joined #ocaml
det has quit [Read error: 104 (Connection reset by peer)]
suppaman has joined #ocaml
ikaros has quit [Read error: 110 (Connection timed out)]
ikaros has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
asmanur_ has joined #ocaml
buluca has joined #ocaml
buluca has quit [Remote closed the connection]
asmanur has quit [Read error: 110 (Connection timed out)]
qpu has quit []
qpu has joined #ocaml
ser_ has joined #ocaml
RobertFischer has joined #ocaml
ertai has quit [Read error: 113 (No route to host)]
qpu has quit []
ser_ has quit [Remote closed the connection]
ser_ has joined #ocaml
ertai has joined #ocaml
nuncanada has joined #ocaml
ertai_ has joined #ocaml
ertai_ has quit [Client Quit]
ertai has quit ["leaving"]
ertai has joined #ocaml
delamarche has joined #ocaml
suppaman has quit ["all your bye are belong to us"]
kelaouch1 has quit ["leaving"]
kelaouchi has quit [Remote closed the connection]
madroach has joined #ocaml
ser_ has quit [Read error: 110 (Connection timed out)]
qpu has joined #ocaml
qpu has quit [Client Quit]
delamarche has quit []
Submarine has joined #ocaml
<Submarine> yo
<Submarine> Smerdyakov: Are you there?
<Submarine> Smerdyakov: I'd need expert advice on US universities and their libraries, if you can.
pango has quit [Remote closed the connection]
ygrek_ has joined #ocaml
kelaouchi has joined #ocaml
kreaturr_ has quit [Remote closed the connection]
Associat0r has quit []
pango has joined #ocaml
crathman has joined #ocaml
bluestorm has joined #ocaml
wy has joined #ocaml
<wy> Is there a good ocaml-mode around?
<rwmjones> wy look up tuareg-mode for emacs
<wy> Thanks!
buluca has joined #ocaml
<wy> It's really good! Thanks a lot!
<wy> How do you usually evaluate a piece of code? C-c C-r?
crathman has quit ["ChatZilla 0.9.79 [Firefox 2.0.0.11/2007112718]"]
<wy> Why isn't here many discussions? Haskell channel is so hot...
ikaros has quit [Remote closed the connection]
<Proteus> what do you guys generally use as an IDE for ocaml development? What's the general opinion of the eclipse plugin?
<rwmjones> Proteus, there was some work happening on an eclipse plugin, but I think most people use emacs
<rwmjones> there's a compile time option to generate auxiliary type information files, so you can pointy-clicky in emacs to see types
<RobertFischer> I wasn't impressed with the Eclipse plug-in (and I'm paid to use Eclipse day in and day out).
<RobertFischer> I tend to use vi.
<Proteus> I've never actually used emacs. It seems frightening..... and eclipse has so many pretty buttons. I'm weak.
<RobertFischer> My experience is that OCaml really doesn't seem to reward the work it would take to use an IDE.
<Proteus> I've been using gvim most of the time, or gedit
<Proteus> hrmm
<RobertFischer> If you've got the toplevel open on one screen and vi on the other, you're doing just as well as an IDE, IMHO.
<RobertFischer> I'm not sure what else you'd be looking for.
<Proteus> huh. Just thought I'd ask.
<RobertFischer> That was more of a question than a statement.
<RobertFischer> What else are you looking for in an IDE?
<wy> tuareg-mode suggested by rwmjones is pretty good IDE with emacs :-)
<rwmjones> Proteus, have a look at: http://www.bononia.it/~zack/stuff/ocaml-dtypes.vim
<Proteus> ok
<rwmjones> I think the second one is a more recent version of the first
<rwmjones> anyway, the *.annot files can be generated by the compiler, and they specify the type of each expression in the code
<rwmjones> and the editor can be modified to print types when you mouse-over a value
<flux> wy, I think I most often use C-c C-e
<rwmjones> to be honest I would never use such a thing, but I guess this gives you some IDE-ish qualities
<wy> What does this compile error mean?
<wy> 'ml' is not recognized as an internal or external command,
<wy> operable program or batch file.
<wy> Assembler error, input left in file C:\DOCUME~1\wy\LOCALS~1\Temp\camlasmaf4a59.a
<wy> sm
<wy> Native build failed: error 2
<wy> You can still use the bytecode version
<wy> Now ready to use on an OCaml MSVC port
<rwmjones> uh oh, windows
<rwmjones> wy, it needs ML.EXE which is some Microsofty thing
<rwmjones> the linker IIRC
<wy> rwmjones: I have Linux too, but it seems windows still displays fonts better
<rwmjones> it's part of VC++ etc and I think you can download it from microsoft.com
<rwmjones> OCaml under Linux is generally a lot smoother
<wy> oh, I thought that was ML
<rwmjones> & there are more packages available
<wy> rwmjones: alright. So I'll try that later.
<flux> has anyone written a desktop app for windows in ocaml?
<rwmjones> flux, oh yes
<flux> rwmjones, surprising, really :), does it work?
<rwmjones> flux, the app I wrote was closed source
<rwmjones> but the link above distills the main lessons learned
<flux> rwmjones, well, did it work, was it usable?-)
<rwmjones> and yes, basically it worked fine
<rwmjones> it was quite a highly graphical/interactive thing
<flux> rwmjones, would you choose the same tool were you tasked to do a desktop app for windows again?
<rwmjones> lots of 2D graphs of a simulation running in realtime
<rwmjones> flux, yes
<wy> Thanks. I must run to my final exam. See you later! :-)
wy has quit ["Leaving"]
<rwmjones> at the moment I'm porting a python program to Windows & it's a fscking nightmare
<rwmjones> ocaml was actually a lot simple
<rwmjones> simpler
<flux> funny
<flux> what are python's greatest problems?
<flux> I haven't personally written any python code so I don't know if it has some other problems..
<rwmjones> well the particular problem is that the program I'm porting depends on lots of C libraries, and they only compile with Cygwin, and you can mix Cygwin Python plugins with Win32 python plugins
<rwmjones> python itself is a horrible language, the VB6 of the Unix world
<rwmjones> endless problems caused by the 'meaningful-indenting' (eg. applying patches causes the indenting to get lost, changing the meaning of the code)
<flux> those are the harhest words I've heard about python yet :)
<rwmjones> and lots and lots of runtime bugs which could have easily been found by static analysis in the compiler
<flux> I hear that was the reason why sun picked tcl for purpose X, instead of python.
<flux> actually some java-version of tcl instead of jpython
<flux> well yes, there's always the dynamic typing versus static typing-issue
qpu_ has joined #ocaml
<rwmjones> every single code bug (rather than missing feature bug) I've seen reported against virt-manager would have been prevented with static analysis
<flux> have you let this information pass forward, what have been the responses?-)
<Submarine> AAAH STATIC ANALYSIS
<Submarine> www.astree.ens.fr roxxors
<flux> rwmjones, that xphelloworld-thingy might actually be useful for me some day, thanks
<rwmjones> flux, not positive .. they associate static analysis with monsters like java. Almost no one understands type inference.
<RobertFischer> I was just on a panel where I tried to explain that to people.
<RobertFischer> A bunch of Ruby-ists talking about how awesome Ruby was, and everything they liked about that type system (with the exception of Mix-Ins) is on Ocaml.
<RobertFischer> Plus you get C++-level performance and code checking.
qpu_ is now known as qpu
Yoric[DT] has joined #ocaml
<Yoric[DT]> hi
Snark has joined #ocaml
ttamttam has left #ocaml []
pango has quit [Remote closed the connection]
pango has joined #ocaml
Submarine has quit ["Leaving."]
ttamttam has joined #ocaml
olleolleolle has joined #ocaml
ertai has quit [Read error: 110 (Connection timed out)]
filp has quit ["Bye"]
ertai_ has joined #ocaml
qpu has quit []
olleolleolle has left #ocaml []
qpu has joined #ocaml
buluca has quit [Read error: 110 (Connection timed out)]
bluestorm has quit [Remote closed the connection]
<Yoric[DT]> mmmhhh....
<Yoric[DT]> I'm looking for syntax ideas.
<Yoric[DT]> I've realized that my current syntax is ambiguous.
<Yoric[DT]> That is, if I allow writing "[i | (List) i <- [1;2;3;4;5]]"
<Yoric[DT]> it's bound to make things such as
<Yoric[DT]> "[i | (i) <- [1;2;3;4;5]]"
<Yoric[DT]> ambiguous
<Yoric[DT]> So either I make the module name compulsory or I need to find something to differentiate between the module name and possible patterns.
smimou has joined #ocaml
Tetsuo has joined #ocaml
bongy has joined #ocaml
ttamtta1 has joined #ocaml
filp has joined #ocaml
ttamttam has quit [Read error: 110 (Connection timed out)]
<flux> it's not ambigious, the first one has a constructor in parenthesis while the second one doesn't?
<flux> but what is it supposed to do? contruct a list, or perhaps a stream instead?
<Yoric[DT]> Actually, in that case, it builds a stream and, with my current syntax, the (List) is optional.
<Yoric[DT]> However,
<Yoric[DT]> [i | (MoreArray) i <- [|1;2;3;4;5|] ]
<Yoric[DT]> is necessary for cross-comprehension
<Yoric[DT]> i.e. building a list from an array.
<Yoric[DT]> Now, on the left of <-, what I have is any pattern.
<Yoric[DT]> So a no-argument-constructor would be alright.
<Yoric[DT]> Which means that I can't necessary differentiate just by looking at what comes directly after |.
<Yoric[DT]> I have to be willing to parse it twice, either as a pattern or as a module name.
<Yoric[DT]> Camlp4 doesn't like this kind of things too much.
<flux> :)
Snark has quit ["Quitte"]
ertai_ has quit ["leaving"]
ertai has joined #ocaml
olleolleolle has joined #ocaml
olleolleolle has left #ocaml []
dbueno has joined #ocaml
dbueno has left #ocaml []
bongy has quit [Connection timed out]
asmanur_ has quit [Remote closed the connection]
rwmjones has quit ["Closed connection"]
ttamtta1 has left #ocaml []
ttamttam has joined #ocaml
ttamttam has left #ocaml []
ygrek_ has quit [Remote closed the connection]
<Yoric[DT]> Ok, fixed.
<Yoric[DT]> Now, I'm looking for an idea for a nice syntax for folds.
<Yoric[DT]> Currently, my for-each applies to map and iter.
<Yoric[DT]> for each i in Array [|'a';'b';'c';'d'|] do
<Yoric[DT]> print_char i
<Yoric[DT]> done;
<Yoric[DT]> for each i c in Array.iteri [|'a';'b';'c';'d'|] do
<Yoric[DT]> print_int_char (i,c)
<Yoric[DT]> done;
<Yoric[DT]> for each i in Array.map [|1;2;3;4;5|] do
<Yoric[DT]> i + 1
<Yoric[DT]> done;
<Yoric[DT]> etc.
<Yoric[DT]> There must be an elegant way to make that syntax work also for folds.
<qwr> for each i, j in ... ?
<Yoric[DT]> What do you mean ?
<qwr> that fold wants two arguments... or for each a b in
<Yoric[DT]> that already works (cf. iteri)
<Yoric[DT]> My main problem is that folds take one additional argument: the initial value.
<Yoric[DT]> I can't see any nice place to put it.
<mbishop> Yoric[DT]: where is your camlp4 code anyway?
<Yoric[DT]> Not published yet.
<qwr> Array.fold v [|1;2;3|] ?
<Yoric[DT]> I'll try and finish it / clean it up / figure out licensing issues by the end of the week.
<Yoric[DT]> qwr: if I do that, I have a syntactic ambiguity
<Yoric[DT]> That is, if I understand correctly that you imply "for each acc x in Array.fold v [|1;2;3|] do ... "
<qwr> yes.
<Yoric[DT]> Mhhh...
<Yoric[DT]> Actually, if I assume it's left-associative, that should be ok.
RobertFischer has quit ["Check out more about me at http://www.SmokejumperIT.com"]
<Yoric[DT]> erf, no
* Yoric[DT] is unsure about that.
<Yoric[DT]> Array.fold v [|1;2;3|] could be understood either as
<Yoric[DT]> (Array.fold v) [|1;2;3|]
<Yoric[DT]> or
<Yoric[DT]> Array.fold v [|1;2;3|]
<Yoric[DT]> Usually, there's no difference.
<Yoric[DT]> Except here, there's one.
<Yoric[DT]> Because I actually need to alter the order of arguments at some point.
<Yoric[DT]> Array.fold function init array.
<Yoric[DT]> So the actual content of my do...done should be inserted between Array.fold and the init.
qpu is now known as qpu_away
<Yoric[DT]> I probably need to write something such as
<Yoric[DT]> for each acc c in Array.fold_left [|'a';'b';'c';'d'|] bla [] do
<Yoric[DT]> ...
<Yoric[DT]> done;
<Yoric[DT]> for some nice "bla".
<Yoric[DT]> But this doesn't look like it can scale up.
<Yoric[DT]> or I could make use of labels
<Yoric[DT]> Actually, that doesn't sound too possible.
bringert has joined #ocaml
<Yoric[DT]> The situation is even worse if you start to take into account the fact that fold_right takes arguments in the opposite order.
bringert has quit [Remote closed the connection]
qpu_away has quit []
marmottine has quit [Remote closed the connection]
dibblego has joined #ocaml
<dibblego> does OCaml allow higher-ranked types?
<mattam> as in rank-n polymorphism ? I think it doesn't. Try defining a recursive polymorphic function which calls itself on two different types.
<dibblego> as in say, the monad abstraction
<dibblego> having a type argument over a type argument
<mattam> > let x = 1
<mattam> # let x = 1
<mattam> what's the syntax for calling the bot ?
<pango> it's not running
<mattam> argh
<Yoric[DT]> dibblego: if I understand correctly your question, the closest thing you have is functors.
<mattam> I don't think so, you cannot abstract on a type constructor with simple polymorphic types.
ertai_ has joined #ocaml
<dibblego> is a functor a language primitive or a library abstraction?
<Yoric[DT]> It's a language primitive.
<Yoric[DT]> More precisely, it's a kind of module.
<Yoric[DT]> (or is that a "sort" ? I always get lost at that level)
<Yoric[DT]> A functor is a higher-order function insofar as it takes as argument a module and returns a module.
ertai has quit [Read error: 110 (Connection timed out)]
Demitar has quit [calvino.freenode.net irc.freenode.net]
cygnus_ has quit [calvino.freenode.net irc.freenode.net]
Demitar has joined #ocaml
cygnus_ has joined #ocaml
Associat0r has joined #ocaml
Associat0r has quit [Client Quit]
<Yoric[DT]> Well, my syntax for folds is not very nice.
wy has joined #ocaml
<wy> hi
filp has quit ["Bye"]
<Yoric[DT]> hi
<wy> I'm configuring my Ocaml system on Ubuntu. Any good suggestions? I'm pretty new to OCaml but I've used Haskell before
<jonafan> getting ocaml running on ubuntu is pretty straightforward...
<wy> I just want to know some fancier configurations. I've installed tuareg.
<wy> Any ideas about the best way to get the libraries? I haven't openGL yet
<jonafan> taureg is ocaml inside emacs?
<wy> yes
<Yoric[DT]> Most libraries are included with Ubuntu.
<Yoric[DT]> And work out of the box.
<Yoric[DT]> For OpenGL, you may use, for instance liblablgl-ocaml-dev .
<wy> What about lablgtk2?
<Yoric[DT]> I've used it, some time ago, and it works, too.
* Yoric[DT] wonders whether "fold" is such a good thing.
<wy> So most of you use Emacs with some ocaml mode?
<Yoric[DT]> I do.
<Yoric[DT]> I've tried the Eclipse plug-in, but it's not complete enough yet and it doesn't work well enough with syntax extensions.
<wy> What's syntax extensions?
<Yoric[DT]> The stuff I'm currently having fun with :)
<Yoric[DT]> Basically, OCaml's syntax can be customized.
<wy> That's metaprogramming?
<wy> So that's the only thing missing from the eclipse plugin?
<wy> Does the refractoring and function look up work?
<Yoric[DT]> I haven't tried.
<Yoric[DT]> The syntax extension stuff was a blocker for me.
<Yoric[DT]> Note that it works in Eclipse, it's just very slow.
<jonafan> vim++
<wy> vim++?
<jonafan> i like vim
<jonafan> it matches my parentheses and autoindents lines and that's good enough for me
seafood_ has quit [Read error: 110 (Connection timed out)]
<wy> Can it also do the interaction now. I remember vim was weak in interprcess communication
<jonafan> i just use screen if i want to use other programs
<wy> So you can't evaluate expressions one by one?
<jonafan> what do you mean?
ertai_ has quit [Read error: 110 (Connection timed out)]
<jonafan> interactive ocaml?
<wy> I mean, when I type in an expression in Emacs, I can evaluate it right there by hitting a key
<jonafan> that seems like it requires a lot of context
qpu has joined #ocaml
qpu has quit ["kthxbye"]
smimram has joined #ocaml
ita has joined #ocaml
smimou has quit [Read error: 110 (Connection timed out)]
smimou has joined #ocaml
Tetsuo has quit ["Leaving"]