smimou changed the topic of #ocaml to: OCaml 3.08.3 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/
Sonarman has joined #ocaml
smimou has quit ["?"]
mattam has quit ["leaving"]
CosmicRay has joined #ocaml
_fab has quit [Read error: 110 (Connection timed out)]
_fab has joined #ocaml
palomer has quit ["Leaving"]
cjohnson has quit [""We live like penguins in the desert...""]
gim_ has joined #ocaml
CosmicRay has quit ["Leaving"]
gim has quit [Read error: 110 (Connection timed out)]
mlh has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: 60 (Operation timed out)]
Snark has joined #ocaml
Sonarman has quit ["leaving"]
gim_ has quit [Read error: 110 (Connection timed out)]
gim__ has joined #ocaml
Submarine has joined #ocaml
Hadaka has quit [Read error: 110 (Connection timed out)]
__DL__ has joined #ocaml
pango has quit [Remote closed the connection]
Submarine has quit ["Leaving"]
pango has joined #ocaml
karryall has quit ["ERC Version 5.0.1 $Revision: 1.726.2.3 $ (IRC client for Emacs)"]
tintin has quit [Read error: 104 (Connection reset by peer)]
grom358 has joined #ocaml
<grom358> just curious: is there web application server (eg. like J2EE or Zope or FastCGI interface) for OCaml?
<mflux> grom358, maybe you mean mod_ocaml?
<mflux> it allows you to write apache module in ocaml
<grom358> does it avoid process creation overhead of CGI (like FastCGI)?
<mflux> yes
<mflux> it links your code into the apache webserver
<grom358> mflux: cool :)
<mflux> well, apache forks sometimes
<mflux> but it still uses the same process to handle multiple requests
<grom358> mflux: yeap. Thanks
<grom358> also.. does OCaml have bignum support? especially, exact decimal numbers
<mflux> yes, it comes with Num-module
<mflux> (and Big_int)
<grom358> (Sorry for all the questions) I am just getting OCaml setup on windows again. I have Cygwin installed, so can I compile true win32 executables on Cygwin if I have gcc-mingw package installed
Submarine has joined #ocaml
<mflux> ocaml doesn't use gcc
<mflux> but I believe you can build either cygwin or native binaries with ocaml.. there are atleast two sets of binaries around
<mflux> (also I don't use windows)
<Submarine> actually, I think it uses cc to do the linking phase
<Submarine> There are 3 ways to build OCaml under Windows.
<mflux> well that is true
<Submarine> 1) Under MSVC
<Submarine> 2) Under Cygwin in Cygwin mode.
<Submarine> 3) Under Cygwin in Mingw mode.
<grom358> Submarine: so can you produce native win32 binaries in Cygwin if you have the gcc-mingw package?
<grom358> but not Mingw itself
<Submarine> er...
<Submarine> Mingw exists in two forms.
<Submarine> 1) A standalone form, which, if I remember well, has target=mingw and host=mings.
<Submarine> mingw, sorry
<grom358> it says for Cygwin port "The compilers generate executables that do require Cygwin". But wonder if that is true if you have Mingw package that comes with Cygwin
<Submarine> 2) A Cygwin form: target=mingw and host=cygwin.
<Submarine> Essentially, the complexity under Win32 is that there are actually TWO kinds of Win32 platforms.
<Submarine> 1) "True" Win32
<Submarine> 2) Win32 + Cygwin.DLL emulation layer
<Submarine> You should treat them essentially as two different operating systems.
<Submarine> Plus, a compiler's host and target are not necessarily the same.
<Submarine> So you have 3 choices:
<Submarine> 1) host=Cygwin and target=Cygwin
<Submarine> 2) host=Cygwin and target=Win32(aka mingw)
<Submarine> 3) host=Win32 and target=Win32
<Submarine> 1) is Cygwin in default mode
<Submarine> 2) is Cygwin gcc in mingw mode
<Submarine> 3) is, if I'm not mistaken, standalone Mingw
<Submarine> OCaml only compiles under 1) and 2), not 3).
<grom358> Submarine: thanks for that. Yeah I was wanting option 2
<Submarine> So if you want to compile ocaml yourself, you need Cygwin.
<Submarine> But, beware!
<Submarine> The resulting OCaml compiler will have host=target=mingw.
<Submarine> You essentially have to consider gcc in mingw mode (it's a -msomething command line option) as a cross-compiler.
<grom358> submarine: okay. I was installing OCaml package from Cygwin installer
<grom358> so can I still do option 2 with that?
<Submarine> this is 1)
<Submarine> this is a ocaml with host=target=cygwin
<Submarine> remember, ocaml is not usually built as a cross compiler
<grom358> Submarine: oh. Okay so todo 2 I have to built ocaml myself?
<Submarine> no, you just download it from the official site, for instance
<Submarine> or you build it yourself at your choice
<Submarine> basically, ocaml can be 1) or 3) but not 2)
<Submarine> and cygwin can be 1) or 2)
<grom358> errr... you lost me. What options do I have if I want to produce standalone win32 executables that are written in OCaml language?
<grom358> by standalone win32 executables, I mean executables that do *not* require cygwin.dll
<Submarine> You need OCaml with host=target=mingw.
<mflux> and how about the difference between creating native binaries and byte code binaries with integrated byte code runner?
<Submarine> mflux, we're talking ocamlopt here :-)
<mflux> we are?-)
<Submarine> To obtain OCaml with host=target=mingw, you either need to download it from the OCaml page, either need to build it under Cygwin, with Cygwin gcc used as a cross-compiler to Win32/mingw.
cmeme has quit ["Client terminated by server"]
cmeme has joined #ocaml
<grom358> so does the mingw ocaml run on Cygwin?
<Submarine> No, but you need Cygwin to build it.
<Submarine> You cannot build it with the standalone mingw.
<Submarine> Been there done that.
<Submarine> I think that the Makefile etc. assume that they are running on a Unix-like system.
<Submarine> You also need to use a special Makefile that is in the distribution.
<grom358> mmm.. yeah I already have Cygwin. So with the pre-built ocaml for mingw. Does that work with Cygwin? or do I need standalone mingw?
* Submarine built Astrée on this
<Submarine> The pre-built OCaml shipping with cygwin, if I remember well, runs under cygwin and produces cygwin binaries.
<Submarine> You should NOT have standalone mingw.
<Submarine> The pre-built OCaml for mingw produces standalone binaries.
<mflux> the page grom358 mentioned has three versions, mingw, msvc and cygwin
<Submarine> mflux, Yes, see discussion above.
<Submarine> OCaml *CANNOT* be built under standalone Mingw.
<Submarine> *However*, you can use the -mIdon'tremembertheoption option of Cygwin to produce Mingw (Win32) executables. If you compile OCaml in that way (and you need to use a special Makefile for that), you obtain a OCaml that consists of Win32 executables and produces Win32 executables.
<grom358> sorry if I am being dense. So if I get the mingw-port at http://caml.inria.fr/ocaml/release.en.html I can use that in combination with Cygwin and produce native win32 apps?
<Submarine> Yes.
* Submarine compiled Astrée (www.astree.ens.fr) in that configuration
* Submarine then wrote the "Astrée Win32 compilation HOWTO, or 'how not to spend your afternoon figuring out the mess'"
<grom358> Submarine: thank you very much for the help
<grom358> it is confusing all the options under windows
<Submarine> yes
<Submarine> ah, if you wish to link in some C modules
<Submarine> remember to compile them with the right options
<Submarine> I think that invoking ocamlc -c on a C file will compile it with the right options.
<Submarine> Cygwin.DLL is an annoyance, because, if I remember well, it is GPL.
<grom358> yeah, it is
Naked has joined #ocaml
Naked has quit [Client Quit]
ejt has joined #ocaml
Naked has joined #ocaml
Naked has quit [Client Quit]
mlh has quit [Client Quit]
Naked has joined #ocaml
Naked is now known as Hadaka
<slashvar[lri]> Yop
Tachyon76 has joined #ocaml
cognominal has quit [Remote closed the connection]
cognominal has joined #ocaml
cognominal has quit [Read error: 54 (Connection reset by peer)]
cognominal has joined #ocaml
grom358 has quit []
Snark has quit ["Leaving"]
cognominal has quit [Remote closed the connection]
cognominal has joined #ocaml
inka has joined #ocaml
Tachyon76 has quit ["Leaving"]
inka has left #ocaml []
yangsx has joined #ocaml
mlh has joined #ocaml
mattam has joined #ocaml
yangsx has left #ocaml []
_JusSx_ has joined #ocaml
cjohnson has joined #ocaml
inka has joined #ocaml
cognominal has quit [Remote closed the connection]
cognominal has joined #ocaml
CosmicRay has joined #ocaml
mlh has quit [Client Quit]
bzzbzz has joined #ocaml
grom358 has joined #ocaml
<grom358> why does OCaml use ;; to terminate statements, instead of say ;
<mflux> you need to use ;; only with interactive sessions
<mflux> normally you don't need any ;'s separators
<mflux> hm, or was it required with open
<grom358> still, why two of them?
<mflux> I would imagine because ; is used elsewhere
<mflux> ;; is a token that terminates the input
<grom358> mflux: okay. Sorry new to OCaml
<mflux> happy to be of help
Snark has joined #ocaml
ianxek has joined #ocaml
vezenchio has joined #ocaml
grom358 has quit []
ejt has quit ["bye"]
veleno has joined #ocaml
<veleno> anyone can explain me what how this function works (it checks if set1 is a subset of set1):
<veleno> let subset set1 set2 =
<veleno> List.for_all
<veleno> (function x -> List.mem x set2)
<veleno> set1
<veleno> expecially, the ( (function x -> List.mem x set2) declaration is not clear to me, the rest is ok
<Hadaka> function x -> List.mem x set2 defines a function
<Hadaka> same as
<__DL__> function x -> List.mem x set2 is an anonymous function that will return true if x in set2
<Hadaka> let f x = List.mem x set2
<Hadaka> except that it is anonymous
<veleno> Hadaka: so if i want to avoid anonymous function, i coudl replace that part with ...what ?
<__DL__> First, why do you want to avoid anonymous function ?
<__DL__> then you could use a local function :
<__DL__> let subset set1 set2 =
<veleno> and also: i defined an equivalent, recursive function, let rec subset set1 set2=...; which does the same, how to test which one is more efficient ?
<Hadaka> let subset set1 set2 =
<Hadaka> let f x =
<Hadaka> List.mem x set2
<Hadaka> in
<Hadaka> List.for_all f set1
<veleno> __DL__: i think they are less readable (and surely less usable)
<veleno> ah okk
<__DL__> let is_in x = List.mem x set2 in
<Hadaka> veleno: but I do want to urge you to consider keeping such a thing as an anonymous function
<__DL__> Well Hadaka is more quick then me, it is what I was writing.
<__DL__> veleno: if effictiency is what you need, then use the Set or Hastabl module, set as list are ineficient...
<Hadaka> veleno: anonymous functions are really handy in many circumstances, and more readable once you get used to them
<Hadaka> veleno: and everybody else uses them be default, so you are going to run into them
<__DL__> then, just run both function 10000x on a random-generated and use time to know how long bith take to run.
<veleno> __DL__: i don't "need" it, just to understand if a apparently non-recursive solution is more or less efficient
<__DL__> well, both List.mem and List.for_all are recursive, so I believe that you function may be as efficient as this (because I don't see how you could be far more less efficient...)
<veleno> Hadaka: are you saying that there are specific places where anonym funcs are suggested ?
<Hadaka> veleno: yes, they are used quite commonly for small pieces of code or for binding a specific value to an argument like in your case
Gueben has joined #ocaml
<veleno> i'm quite new to ocaml, so basic things not clear: what is the key difference when doing explicit pattern matching : "let func n = match n with..." and let func n= function .." ?
<mellum> veleno: nothing.
<Hadaka> veleno: none, except that the parameter is *not* named
<Hadaka> let func n = match n with ... <-> let func = function ...
<Hadaka> not let func n = function, that would be the same as: let func n x = match x with ...
<veleno> Hadaka: whit the second one, how ocaml understand which parameters are allowed for the function ??
<Hadaka> veleno: you probably should read up on currying
<veleno> Hadaka: i read some stuff about currification, but what i'm asking is: does ocaml infer type arguments and also their numbers at compile time ?
<Smerdyakov> There is no such thing as "number of arguments" in ML.
<Smerdyakov> Every function has exactly one argument.
<Hadaka> veleno: since everything is curried, everythign is applied as many times somebody tries to apply them
<Smerdyakov> And you should also be extra careful with your English when describing OCaml.
<Smerdyakov> "Type arguments" and "types of arguments" are both well-defined ML ideas, but they mean different things.
<Hadaka> let f a b c = ... can be written as let f = function a -> function b -> function c -> ...
<veleno> Smerdyakov: it's not a matter of my english, i think is a matter of my ocaml, but ok, i'll try to be as precise as possible
<Smerdyakov> veleno, well, I think you really meant "types of arguments," given the context.
TeXitoi has joined #ocaml
smimou has joined #ocaml
Herrchen has joined #ocaml
pango has quit ["Leaving"]
smimou has quit ["?"]
<veleno> is there some predefined function in the List module that get the first n elements reporting a list of them ?
pango has joined #ocaml
inka has quit []
<TeXitoi> veleno: see the doc
<TeXitoi> I don't think, but it's easy to do
dan2 has quit [Read error: 104 (Connection reset by peer)]
Submarine has quit ["Leaving"]
dgesr has joined #ocaml
__DL__ has quit [Remote closed the connection]
Snark has quit ["Leaving"]
Herrchen has quit ["good night"]
Submarine has joined #ocaml
Submarine has quit ["Leaving"]
CosmicRay has quit [Remote closed the connection]
_JusSx_ has quit ["leaving"]
Gueben has quit ["Leaving"]
mlh has joined #ocaml
gim__ is now known as gim
ianxek has quit ["Leaving"]
vezenchio has quit [""Under democracy one party always devotes its chief energies to trying to prove that the other party is unfit to rule—and bot]
mr_pengy has joined #ocaml
veleno has quit ["Client exiting"]
dgesr has quit ["Leaving"]