dark_light changed the topic of #ocaml to: OCaml 3.09.2 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | 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/
rillig has quit ["exit(EXIT_SUCCESS)"]
jacobolus has joined #ocaml
mikeX has quit ["zzz"]
pango has quit [Remote closed the connection]
clog has joined #ocaml
khaladan has joined #ocaml
jacobolus has joined #ocaml
chessguy2 has joined #ocaml
chessguy has quit [Connection timed out]
Smerdyakov has quit ["Leaving"]
tristram has joined #ocaml
ramkrsna has quit [Connection timed out]
gribozavr has quit [Read error: 110 (Connection timed out)]
sponge45 has joined #ocaml
ramkrsna has joined #ocaml
chessguy2 has quit [Connection timed out]
Itkovian has joined #ocaml
Itkovian has quit []
chessguy has joined #ocaml
love-pingoo has joined #ocaml
pango has joined #ocaml
pango has quit [Read error: 104 (Connection reset by peer)]
pango has joined #ocaml
Schmurtz has joined #ocaml
revision17_ has joined #ocaml
Revision17 has quit [Read error: 110 (Connection timed out)]
smimou has joined #ocaml
Itkovian has joined #ocaml
sponge45 has quit ["zzzzzzzz"]
ramkrsna has quit [Connection timed out]
ramkrsna has joined #ocaml
Itkovian has quit [Read error: 110 (Connection timed out)]
Itkovian has joined #ocaml
ramkrsna has quit [Read error: 110 (Connection timed out)]
ramkrsna has joined #ocaml
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- Leading Edge IRC"]
Schmurtz has quit ["L'énergie semble manquer : dodo !"]
ramkrsna has quit [Read error: 110 (Connection timed out)]
ramkrsna has joined #ocaml
Itkovian has quit []
Schmurtz has joined #ocaml
chessguy has joined #ocaml
mikeX has joined #ocaml
Itkovian has joined #ocaml
Itkovian has quit []
jacobolus has quit [Read error: 104 (Connection reset by peer)]
ramkrsna is now known as rk_afk
mnemonic has joined #ocaml
<mnemonic> hi
jacobolus has joined #ocaml
slipstream-- has joined #ocaml
slipstream has quit [Connection timed out]
finelemo1 has joined #ocaml
Smerdyakov has joined #ocaml
finelemon has quit [Read error: 113 (No route to host)]
jacobolus_ has joined #ocaml
jacobolus has quit [Read error: 104 (Connection reset by peer)]
xjjk has joined #ocaml
<xjjk> hallo
<xjjk> I've been glossing over the manual, and perhaps I am missing something...
<xjjk> is it possible to "load" and execute ocaml code from a C program?
<xjjk> without having to link the C program's object files?
<xjjk> I'm considering using OCaml as an embedded language
<Smerdyakov> Why not write everything in OCaml?
<xjjk> ala lua/guile
<xjjk> Smerdyakov: performance
<xjjk> for some parts of the application, anyway
<xjjk> I want to farm out the rest to a language like OCaml
<Smerdyakov> xjjk, do you have figures backing up the sensibility of your choice?
<Smerdyakov> xjjk, you are aware that OCaml is one of the top languages for producing efficient native binaries, yes?
<xjjk> Smerdyakov: no... but it's something I can evaluate later...
<xjjk> and intend to actually
<Smerdyakov> The standard intelligence is to do optimizations after you have a working program.
<Smerdyakov> And it's easier to create a working program in one language than two!
<xjjk> Smerdyakov: if you want to know, the program is going to be a highly multithreaded proxy
<Smerdyakov> I bet ML would work very well for that.
<xjjk> we're wanting to do all the networking in C, and farm out stuff like ACLs and perhaps logging to a separate language
<Smerdyakov> The only issue with current ML implementations is that they don't allow taking easy advantage of multiple processors with multi-threaded code.
<xjjk> we're wanting to create a squid alternative, without the bloat of having implemented -everything- in C
<xjjk> yes that's extremely important to us
Itkovian has joined #ocaml
<xjjk> especially as processors become multicore
<Smerdyakov> BUT... using something like Concurrent ML, I believe it's not much more work to roll your own multicore-friendly code.
<xjjk> well, I can look at it later...
<Smerdyakov> Why not use OCaml (or Standard ML, which I prefer) for at least a "rapid prototype" and then make decisions from there?
<xjjk> answering my original question, is executing without having to link possible?
<xjjk> Smerdyakov: ATM I don't have so much freedom over this project, it's not my own
<Smerdyakov> I don't know the answer to that question. It's not a common mode of usage.
<xjjk> hrm
<xjjk> the use case we're trying to satisfy at the moment is a sysadmin somewhere writing an ACL in OCaml/whatever scripting language
<xjjk> and the proxy daemon being able to add it to it's processing
<Smerdyakov> Most sysadmins would complain about using OCaml, anyway.
<xjjk> yeh well
<Smerdyakov> Either go for the objective best decisions and choose OCaml for it all, or declare yourself to be governed by social concerns and avoid OCaml because your user base will refuse to touch it. ;)
chessguy has quit [" Want to be different? HydraIRC -> http://www.hydrairc.com <-"]
jacobolus_ has quit [Read error: 104 (Connection reset by peer)]
jacobolus has joined #ocaml
<Smerdyakov> Hey look, jacobolus is on the same IP address as xjjk!
<Smerdyakov> Oh wait.
<xjjk> we're not...
<jacobolus> Smerdyakov: indeed!
<xjjk> same network, he's sitting 5 ft away from me
<Smerdyakov> Same teeny little piece o' the net.
<jacobolus> we're right next to each-other
<Smerdyakov> Grad students?
<aref> I have a quick question. I've just gotten into Ocaml, which I chose over Haskell on a hunch that it was "neater". What's the standard library like? Are there many things I am going to miss?
<jacobolus> Smerdyakov: nah, summer interns
<Smerdyakov> At the Media Lab?
<xjjk> yes
<xjjk> well, external media lab spin-off project
<Smerdyakov> I didn't know they would have a program called "internships."
<Smerdyakov> That makes more sense. =)
<Smerdyakov> aref, there are things you're going to miss. :)
<Smerdyakov> aref, you can browse the standard library documentation for yourself.
<aref> Smerdyakov: Heh, had a feeling about that.
<aref> Yeah, I'm gonna do that, just thought I'd hear what a seasoned Ocam'er thought
<Smerdyakov> xjjk, jacobolus, are you normally MIT students, or do you come from somewhere else?
<jacobolus> Smerdyakov: elsewhere
<jacobolus> I'm go to school on the other side of cambridge
<jacobolus> s/I'm/I
<Smerdyakov> aref, I don't think any functional language has a truly satisfactory infrastructure librarywise yet.
<xjjk> Smerdyakov: elsewhere
<xjjk> I don't even normally do software engineering either actually =/
<xjjk> but oh well
<Smerdyakov> xjjk, what do you do normally?
<xjjk> Smerdyakov: bioinformatics
<Smerdyakov> Fad-follower. ;)
<xjjk> more on the biology side than the CS side
<aref> Smerdyakov: Heh, no. I am just playing with it now, enjoying my play time.
<aref> Smerdyakov: Is there a lot of life in Ocaml? I see #haskell exploding with people, this is the first time I've witnessed conversation in here :)
<Smerdyakov> aref, yes, there is.
<aref> Well, seems like the standard library has what I
<aref> eh
<aref> ... I'd need it for right now
<aref> I usually use a Kinesis keyboard, this regular old qwerty is screwing me over a bit, like hammering the spacebar when I want backspace
gribozavr has joined #ocaml
<ulfdoz> gone
Itkovian has quit []
xjjk has quit [Read error: 110 (Connection timed out)]
xjjk has joined #ocaml
Schmurtz has quit [Remote closed the connection]
Ahnfelt has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
Itkovian has joined #ocaml
<Ahnfelt> hey
<Ahnfelt> would any of you happen to be familiar with the algorithm behind type inference?
<Ahnfelt> or know of some good resources concerning it?
<Smerdyakov> Probably "Types and Programming Languages," by Benjamin Pierce.
<Ahnfelt> Thank you
<Ahnfelt> I'll search for it
Ahnfelt has left #ocaml []
BetaTEST has joined #ocaml
<Smerdyakov> POPL submission... away!
<aref> Out of ignorance, I ask, what is POPL?
<aref> Out of Google, I have been told.
<aref> What did you submit?
<Smerdyakov> POPL is one of the two biggest programming language research conferences. Compared to the other (PLDI), it is the one more on the theoretical/functional side (vs. practical/OO).
<Smerdyakov> I submitted a paper on a programming language for web development.
<aref> Interesting.
<aref> What's your angle?
<Smerdyakov> Higher-order type systems and metaprogramming
<aref> What's meant by metaprogramming in this context?
<Smerdyakov> The same thing it always means. Do you not know what it means at all?
<aref> Hm, to my somewhat limited knowledge, it has to do with writing a type of program that writes another program (afaik)
<aref> But imagining it for the web had me stumped.
<Smerdyakov> You can't imagine a program that writes a program that interacts with the web?
<aref> Well, I can imagine it, I guess the question then becomes "How" and "Why"
<aref> and so on.
<Smerdyakov> You can read my old walk-through: http://laconic.sourceforge.net/demo/
<Smerdyakov> Man, it's so awesome how Tim Sweeney replies on the TYPES list to a question about semantics of metaprogramming!
<aref> Alright, I've looked laconic over, and I get what you mean.
<Smerdyakov> That was fast!
<aref> To be honest, I did not read every bit of text on the page :)
<Smerdyakov> It's also fast to understand how metaprogramming is used.
<aref> In the deed.
<aref> Which was what I was aiming for, in this case.
<aref> I have extremely limited experience with webstuffs. How would this compare to perls Mason?
<Smerdyakov> No idea, but anything in Perl is going to be crap, so we can skip that step.:P
<aref> (which is just about the only thing in this vein I have next-to-none experience with)
<aref> hahha
<aref> Indeed.
<Smerdyakov> Nothing lacking static type checking can be very close to Laconic
<aref> It would be very interesting, if it could make webpages more interesting to make
<aref> I stay very spartan with my own, the most advanced usage being some css and ssi
<Smerdyakov> CSS is orthogonal to the point of Laconic.
* dylan doesn't use any dynamic content.
<aref> dylan: A good thing indeed.
<aref> Smerdyakov: Hey, get it out there and have it working, and I'd be most interested in it.
<Smerdyakov> dylan, you're missing out.
<dylan> it's generated, but only when I type a build command in my shell or text editor.
<Smerdyakov> aref, it is out there and working.
<aref> As far as my web interest goes, though.
<Smerdyakov> aref, but not working well enough that I recommend you use it.
<dylan> Smerdyakov: it's a collection of words. It doesn't need a DB or anything.
<aref> Smerdyakov: Heh, well, the "working well enough" part was implicit :)
<Smerdyakov> dylan, for instance, having a private wiki is very helpful for organizing your life.
<aref> I know what my life is like already.
<aref> It's very strictly organized.
<dylan> well, I could run a wiki.
<dylan> But for my personal web page, it's all very simple
<Smerdyakov> The most useful function of my private wiki is tracking conference submission deadlines.
<dylan> I use remind for that.
<Smerdyakov> dylan, which conferences do you submit to?
<aref> Luckily, I have post its, and no conferences to sumbit anything to.
<aref> Life is _sweet_
<dylan> Smerdyakov: err, I use remind to keep track of several hundred things I need to remember to do.
<dylan> % wc -l ~/.reminders
<dylan> 118 /home/dylan/.reminders
<Smerdyakov> dylan, my wiki also tracks notes on the projects I'm working on, cross-referenced with the conferences I want to submit them to.
<dylan> my reminder is linked in with my devtodo todo list.
<dylan> (devtodo == program for keeping notes and todo items
<Smerdyakov> Probably ugly and hard to use compared to a nice wiki :
<dylan> Now, I *also* use wikies.
<dylan> well, to make a note:
<dylan> tda "I must steal my neighbor's pants"
<dylan> prompts for a priority
<dylan> I type "veryhigh"
<dylan> it stores this in a .todo file in the current directory
<dylan> any time I cd into that directory, it'll print a color-coded list of todo things I need to take care of
<dylan> the .todo file in $HOME reads in all these files and prints a nice, very long, list.
<dylan> If I'm so inclined, my graphical file manager can display whatever todo items are associated with the directory
<dylan> of course, I value programs which allow me to not use the mouse/touchpad/trackball.
<dylan> anyway, the nifty thing is, if I say 'remind-send', it'll upload them to an ical server.
<dylan> todo items arn't sent yet, but I'm working on that.
<dylan> Also, as a reminder deadline draws near, my computer uses festival to tell me.
<dylan> oh, and a cronjob also pops up gmessage boxes with other reminders, and my todo list every week day at 8 O'clock
Itkovian has quit []
Schmurtz has joined #ocaml
chessguy has joined #ocaml
<jacobolus> what's the best way to count the elements of a list that satisfy a predicate? Is it best to use List.filter, and then take the length, or is there a more efficient way?
<BetaTEST> you can do it using List.fold_left which is tail-recursive
<dylan> let count f n x = if f x then succ n else n
<dylan> let filter_count f l = List.fold_left (count f) 0 l
<dylan> (untested)
BetaTEST is now known as asbeta
<asbeta> hmm... have you seen implementation of list comprehensions for ocaml? is it possible to make them look like "genuine math"? like [ exp | val <- exp1; predicate; val <- exp2; ...] ?
<asbeta> i've seen implementation which look like [+ exp | val <- exp1 | with predicate | val <- exp2 ... ]: http://oandrieu.nerim.net/ocaml/#pa_compr
<dylan> I'm not sure an implementation like the former is possible with camlp4
<asbeta> hmm, here it looks like [ exp | val <- exp1 with predicate; val <- exp2 ... ]: http://cl-informatik.uibk.ac.at/teaching/ss06/ocaml/content/listcompr.ml
<jacobolus> dylan: thanks
cmeme has quit ["Client terminated by server"]
cmeme has joined #ocaml
<jacobolus> is there any way to supress output when using the ocaml interpreter
<jacobolus> ?
<smimou> jacobolus: what do you mean by that ?
<jacobolus> well, when I run a script with the interpreter, it shows me everything that happens in the toplevel
<jacobolus> I don't need it to output anything
_ita_ has joined #ocaml
<_ita_> hi all
<smimou> jacobolus: you shouldn't use the interpreter to run scripts
<smimou> _ita_: hi
<jacobolus> smimou: how should I run a script?
mnemonic has quit ["leaving"]
<jacobolus> i'm an ocaml newbie
<_ita_> when using ocamlc, the -o flag does not seem to put the object file where i want : /usr/local/bin/ocamlc -I ../src/solver -I default/src/solver -c ../src/solver/datastruct.mli -o default/src/solver/datastruct.cmi <- is there anything wrong with this command-line ?
<pango> _ita_: when you use -o, ocamlc is used as a linker
<_ita_> pango: even with the -c flag ?
<pango> _ita_: I suppose ocamlc should barf when you use both flags at once, because the flags descriptions are not compatible
<pango> _ita_: if anything else happens, consider yourself lucky (or not)
<_ita_> holy shit, ocamlc expect flags to be in a particular order
<_ita_> pango: beep wrong
<smimou> jacobolus: err, I said a wrong thing
<smimou> what do you do exactly to run ocaml scripts?
<smimou> here it does not output anything
<_ita_> works now : /usr/local/bin/ocamlc -I ../src/solver -I default/src/solver -o ../src/solver/datastruct.cmi -c ../src/solver/datastruct.mli (mind the order of the flags)
chessguy has quit [Success]
love-pingoo has joined #ocaml
<jacobolus> smimou: right now I'm just piping text to the interpreter I think
<pango> _ita_: internal documentation is more accurate because it's less precise: "-o <file> Set output file name to <file>" ;)
<jacobolus> is there a better way to run a script than just pipe it into `ocaml`?
<pango> jacobolus: #!/usr/bin/ocaml as first line and executable attribute ?
<jacobolus> pango: hmm.. okay
<jacobolus> thanks
<smimou> yes you should to as pango said
<smimou> or ocaml toto.ml
<pango> ocamlscript ?
love-pingoo has quit ["Connection reset by pear"]
malc_ has joined #ocaml
smimou has quit ["bli"]
<aref> Anyone have any experience with Tuareg mode in Emacs?
<aref> I am trying to set the default indent on let ... in, but it doesn't heed my 0 and insists on 2
<jacobolus> what's a function for timing part of an ocaml script?
<_ita_> and now for something entirely new .. http://freehackers.org/~tnagy/ocabld.tar.bz2
<_ita_> jacobolus: the profiler ?