Alpounet changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.1 out now! Get yours from http://caml.inria.fr/ocaml/release.html
tu has quit ["On the move"]
zhijie1 has joined #ocaml
zhijie has quit [Read error: 110 (Connection timed out)]
marteo has joined #ocaml
dark_light has quit [Remote closed the connection]
<gildor> (these slides will be available soon)
<Camarade_Tux> :-)
ttamttam has joined #ocaml
<ski_> mrvn : well, it's the unit of the direct sum operation on vector spaces
<ski_> and as we all (should) know, "one shouldn't discriminate on zero" !
<schme> Hrrm. Do any of you people know of a F#+linux support place / channel?
Associat0r has quit [Read error: 104 (Connection reset by peer)]
Associat0r has joined #ocaml
bogen has quit [Read error: 148 (No route to host)]
CcSsNET has joined #ocaml
bogen has joined #ocaml
Yoric has joined #ocaml
CcSsNET has quit [Remote closed the connection]
CcSsNET has joined #ocaml
<gildor> schme: F# doesn't target linux at al, the fact that it can run on Mono is a "good" side-effect, but I doubt it is officialy supported
<gildor> (there is some statement and howto on F# homepage, but maybe upcoming version won't support it...)
<schme> gildor: I am aware of it not targetting linux. I am just interested in finding someone who can help me to actually get it to work on Mono here for me.
<schme> I fire up the fsi and I get glorious sigsegv. :)
<Camarade_Tux> tried an older version? something like one year-old?
<gildor> Camarade_Tux: good idea
<schme> Camarade_Tux: Thanks, I'll give that a go.
<gildor> schme: there is also a mailing list about F#, but it has been very quiet since months
<schme> gildor: Cools. I'll do some more googling for that :)
<gildor> schme: fsharp@list.research.microsoft.com
<gildor> schme: people asked there howto run recent F# CTP on Mono
<schme> cools
bogen has quit [Read error: 110 (Connection timed out)]
bogen has joined #ocaml
<Yoric> Actually, I know that some people at MSR are working specially at getting F# to work on Linux.
CcSsNET has quit [Read error: 104 (Connection reset by peer)]
<schme> Yoric: horrah!
<schme> The install script from the microsoft download worked fine and all. so they're doing something right :)
ubuntu has joined #ocaml
ubuntu is now known as EliasAmaral
animist has quit [Read error: 110 (Connection timed out)]
suricator has joined #ocaml
_zack has joined #ocaml
_zack has quit [Read error: 104 (Connection reset by peer)]
_zack has joined #ocaml
EliasAmaral has quit [Remote closed the connection]
_unK has joined #ocaml
Pimm has joined #ocaml
<Dodek> how can i find out what is the greatest positive integer?
<julm> max_int
<Dodek> thanks
gareth_0 has joined #ocaml
<gareth_0> hi, is the libsqlite3-ocaml-dev package in ubuntu broken - doesnt seem to work?
<gareth_0> anyone have any guesses?
<mfp> gareth_0: what does "doesnt seem to work" mean exactly here?
<gareth_0> the module cant be found in the top level, or by eclipse
<gareth_0> # module M = Sqlite3;;
<gareth_0> Unbound module Sqlite3
<mfp> did you #require the package first?
ulfdoz has quit ["deprecated"]
<gareth_0> i didnt know i had to!
<mfp> OK, try this: #use "topfind";; #require "sqlite3";;
<mfp> (including the '#')
<mfp> uh seems the ocamlfind package name is Sqlite3, so make that #require "Sqlite3";;
<gareth_0> hmm, i got: No such package: Sqlite3
<mfp> you can get the list of packages with ocamlfind list
<mfp> it should be there (maybe it's sqlite3 after all)
Pimm has quit [Read error: 110 (Connection timed out)]
<gareth_0> yup it is lowercase
<gareth_0> thanks
* gareth_0 goes to look for docs on using ocaml libraries..
<mfp> gareth_0: essentially, you need to compile with ocamlfind ocamlopt -package sqlite3 -c foo.ml
<mfp> and then link with ocamlfind ocamlopt -package sqlite3 -o foo foo.cmx bar.cmx -linkpkg
<mfp> that is, prefix with "ocamlfind", add -package comma,separated,pkg,list, and also -linkpkg when linking
<gareth_0> heh, im trying to do this all using the eclipse plugin
Yoric has quit []
<mfp> don't know eclipse, but it should be possible to specify the compiler ("ocamlfind ocamlopt") and the options somewhere
<suricator> i am having trouble running ocamlbuild and ocamldoc with the same directory structure... anyone familiar with ocamldoc?
Yoric has joined #ocaml
<suricator> I have files Lib.ml and Arith.ml. Lib.ml doesn't require any external files, but Arith.ml uses functions defined in Lib.ml. Everything is defined at the top-level in each file (no submodules). Both files are in a directory "src". I can compile fine using "ocamlbuild src/Arith.native". However, if I use "ocamldoc -latex src/Lib.ml src/Arith.ml" I get
<suricator> File "src/Arith.ml", line 37, characters 28-39:
<suricator> Error: Unbound value Lib.explode
<suricator> 1 error(s) encountered
<suricator> Any ideas?
<suricator> (And function "explode" is defined in Lib.ml -- it compiled with ocamlbuild.)
<gareth_0> mfp, there is an option for "Libraries", which works as expected with the Graphics module, but not so with Sqlite3
<mfp> suricator: try with -I src
<suricator> ah... what's the -l?
<suricator> is that capital i?
<mfp> capital i
Olalalili has joined #ocaml
<mfp> -I <dir> Add <dir> to the list of include directories
ulfdoz has joined #ocaml
<suricator> it compiled! :-)... but the produced pdf only has the word "Contents" in it, and nothing else
<suricator> wait... let me try again...
<suricator> might have made mistake
<suricator> hmm...
<suricator> ocamldoc -latex -I src/ src/Lib.ml src/Arith.ml
<suricator> gives same error
<suricator> :(
<mfp> hmm mkdir doc; ocamldoc -d doc -html -I src src/*.ml
<suricator> File "src/Arith.ml", line 37, characters 28-39:
<suricator> Error: Unbound value Lib.explode
<suricator> 1 error(s) encountered
<suricator> it produced a lot of html though... for Lib.ml
<suricator> for some reason, it doesn't see Lib.ml when processing Arith.ml
<suricator> does ocamldoc need for Lib to be open within Arith.ml?
<suricator> with an "open Lib;;" directive?
<suricator> and then Lib functions to be executed without the prefix Lib.?
<mfp> suricator: did you compile the ml files first?
<mfp> ocamldoc needs to access the .cmi files
<suricator> ah
<suricator> ok... problem is I'm using ocamlbuild
<suricator> which compiles everything in a _build/ directory
<suricator> should i ran ocamldoc in there?
<mfp> that should work
<mfp> ocamlbuild should also have some ocamldoc magic
<mfp> it's most unlikely undocumented, though :-(
<suricator> hmm.. so, how do you deal with different files usually (i suppose it's not ocamlbuild from what you're saying)?
<suricator> make? ocamlc?
<mfp> omake
<suricator> omake?
<suricator> ocaml make?
<suricator> i'll have a look!
<mfp> OMake is a general-purpose build sys which happens to be implemented in OCaml
<suricator> i'll still try to run ocamldoc within _build/ just to see
<suricator> but does it have specific ocaml stuff too? like that ml and mli files are relevant, etc?
<suricator> it works fine
<suricator> thanks a lot mfp!!
<suricator> :)
<mfp> np
ulfdoz has quit ["next shot"]
<mfp> suricator: yes, OMake has got specific support for OCaml, see http://omake.metaprl.org/manual/omake-quickstart.html#toc7
<suricator> do you use it? is it the one you prefer?
<mfp> that's what I'm using, yes
<suricator> cool!
<mfp> it handles subdir dependencies and stuff much better than make
<suricator> how does it compare to ocamlbuild?
<mfp> and unlike ocamlbuild is fully documented
<suricator> ah ok
<suricator> i like the fact with ocamlbuild that you don't need to pay much attention to where the files are and such
<suricator> as long as they reference each other correctly
<suricator> i'll have a look at omake...
<mfp> I have 2 main pbs with ocamlbuild: lack of documentation, and the inability to nest subprojects (= multiple myocamlbuild.ml plugins)
ikaros has joined #ocaml
<suricator> i wasn't very happy with make
<suricator> as i had to write too much
ulfdoz has joined #ocaml
<suricator> ok, so that leads me to another thing... when i have several .ml files, it would make sense in my mind to group stuff as a module inside each file.
<suricator> so, instead of having two ml files with top-level stuff inside
<suricator> i would have two files each of which would start
<suricator> module foo =...
<suricator> but, for ex for ocamlbuild, the simple fact that they are in different files
<suricator> already makes them modules
<suricator> that's a bit confusing for me...
<mfp> that's imposed by the compiler (ocamlc/ocamlopt), not ocamlbuild
<suricator> so, if I define stuff as a module on one of those files, i would need to call functions with Foo.Foo.foo_function
<mfp> there are some proposals for namespace management related to that
<mfp> yes
<suricator> which doesn't make any sense
<suricator> :)
<suricator> so now I'm defining everything at toplevel inside each file
<suricator> it doesn't look pretty :)
<mfp> why?
<mfp> you can create a new module that includes the others if you want to group them: baz.ml -> include Foo include Bar
<mfp> but this might just mean that it all belongs in a single file
<suricator> well... it makes you having to decide on separate files or not from the start...
<suricator> am I making sense?
<suricator> (i am not sure that's the case, now that i've written it down...)
<mfp> you mean regarding cross-refs amongst modules?
<suricator> yes
<suricator> if make a change
<suricator> you have to change all your code
<mfp> they're guaranteed to be in only one direction (otherwise they'd be mutually recursive)
<mfp> so the difference is at most one open Foo
<mfp> unless you choose to use the full module path all the time
CcSsNET has joined #ocaml
<suricator> that's what i usually do, yes...
<suricator> but maybe i should use more of "open"
<mfp> there's no harm in defining a Foo module both in a.ml and b.ml, and then doing module Foo = module include A.Foo include B.foo end
<mfp> that way you can use Foo.xxx to refer to both A.Foo.xxx or B.Foo.xxx
<suricator> i don't like open that much for two reasons: (i) i need to keep track of what i've opened or not; (ii) i don't like to have stuff opened when not need; (iii) it takes out that functional beauty :)
<suricator> ah, ok
<mfp> yeah, open makes it harder to track what you're actually using
<suricator> so, this Foo module above would be defined exactly the same in A.ml and B.ml?
<mfp> you'd do module Foo = struct ... end in both a.ml and b.ml, with different contents
<suricator> ah
<mfp> then you can combine them into a new module named Foo if wanted
<suricator> and then the Foo.xxx would contain all of them
<mfp> yes
<suricator> ok
<suricator> that can lead to trouble, i guess, no? like duplicate names...
<mfp> if you later decide that it's better to have just one Foo, you can extract the code from a.ml and b.ml, put in in foo.ml, and remove the module Foo = .... bit
<suricator> ok
<mfp> right, you cannot duplicate type/module names
<mfp> as for regular values, the last one (in this case, B.Foo's, since it's included last) would be kept
<mfp> in general, just using foo.ml = simplest and probably best, though
<gareth_0> thanks mfp, got it working (i think!)
CcSsNET has quit [Remote closed the connection]
<suricator> thanks!!
<suricator> i have set up some shell commands to compile the documentation in html and latex to the directory i want...
<suricator> i love it! :)
<suricator> omake may be too complicated just for now...
<suricator> i think i'll stick to ocamlbuild and then may revert if necessary
<suricator> mfp: do you know if can i use the same exact sources with both?
<mfp> the .ml and .mli?
<mfp> the build sys should adapt to build them properly, not the other way around
<mfp> the answer is yes unless you're doing unusual things in myocamlbuild.ml
<suricator> ok, good to hear that :)
Snark has joined #ocaml
ski_ has quit ["Lost terminal"]
<suricator> so, if you have a foo.ml file with a lot of stuff define, but then foo.mli only exports one function, shouldn't the documentation only show that one function?
thrasibule has joined #ocaml
Alpounet has joined #ocaml
ski_ has joined #ocaml
gareth_000 has joined #ocaml
gareth_0 has quit [Remote closed the connection]
CcSsNET has joined #ocaml
ulfdoz has quit [Remote closed the connection]
ulfdoz has joined #ocaml
Pimm has joined #ocaml
suricator has quit []
ulfdoz has quit [Read error: 60 (Operation timed out)]
ulfdoz has joined #ocaml
Amorphous has quit [Operation timed out]
Olalalili has quit ["Leaving"]
_zack has quit ["Leaving."]
gareth_000 has quit [Remote closed the connection]
gareth_000 has joined #ocaml
Amorphous has joined #ocaml
<gareth_000> hmm
<gareth_000> if i make ocaml segfault, is it a bug?
<bogen> I'm new to ocaml, but my opinion would be, yes, of course, it is a bug....
<flux> gareth_000, bug, unless you've used its unsafe features
<flux> even native code stack overflows should produce an exception these days..
<gareth_000> its in the sqlite3 library
<flux> perhaps the author of the bindings would be interested
<gareth_000> il see..
<shazam> flux, I've had native code overflow produce a segfault
<shazam> about 9 months ago
shazam is now known as palomer
<flux> palomer, well, I suppose it's a bug then :). maybe it segfaults when it happens to be in C code when it happens?
<palomer> on 3.10.2
<palomer> it was an ocaml only interpreter
<palomer> pretty standard stuff
<palomer> jacques garrigue said it only happens in linux
<flux> my naive test case properly produces Stack_overflow
<Camarade_Tux> //win 14
<Camarade_Tux> bah ='(
suricator has joined #ocaml
jeddhaberstro has joined #ocaml
<gareth_000> i tried the latest version but it wont compile :/
<Camarade_Tux> what is the error?
<gareth_000> segmentation fault when calling pragma table_info in sqlite3
<Camarade_Tux> how old is your sqlite and do you know if the sqlite bindings are meant for your version?
<gareth_000> ah, you mean for the compile, sorry, here: http://pastebin.com/m5e2facd6
<palomer> anyone have "types and programming languages" handy?
<Camarade_Tux> gareth_000: which ocaml version?
<gareth_000> Camarade_Tux, I have: SQLite version 3.6.10, Objective Caml version 3.10.
<gareth_000> that would explain the error
Snark has quit ["Ex-Chat"]
<Camarade_Tux> this function seems available on 3.11, maybe it isn't on 3.10
<gareth_000> probably :(
<gareth_000> package managers suck!
<Camarade_Tux> which distribution?
* palomer hopes to one day manage a package
<gareth_000> ubuntu
<gareth_000> i always find them out of date
<gareth_000> (really the whole ecosystem though! if there was a single package standard then developers might actually run their own repositories)
<Camarade_Tux> well, you can try with godi
Yoric has quit []
<Camarade_Tux> it's a source-based package manager
* palomer remembers using godi to circumvent the school's lack of packages
<palomer> didn't work because everything requires tcl/tk ;(
<gareth_000> brb breaking system
gareth_000 has quit ["http://www.pirateparty.org.uk/ - stick it the Mandelson"]
<Camarade_Tux> palomer: you could have done a local installation of tcl/tk, also everything doesn't need tcl/tk ;è)
CcSsNET has quit [Read error: 104 (Connection reset by peer)]
slash_ has joined #ocaml
zarvok has joined #ocaml
zarvok is now known as ccasin
marteo has quit [Read error: 131 (Connection reset by peer)]
ccasin has quit ["Leaving"]
suricator has quit []
suricator has joined #ocaml
ttamttam has quit ["Leaving."]
trasz has joined #ocaml
<trasz> i think i need to learn some functional language, and i need to choose one. why should i choose ocaml instead of e.g. haskell?
<schme> trasz: If your goal is to get emerged deeply into functional programming then haskell might be a better choice. It forces you to do it all functional nonstop. ocaml on the other hand easily lets you out of that restriction.
<trasz> schme: well, i'm looking for a language that will be practical to use.
<trasz> schme: so i guess forcing me to do anything is a drawback.
<schme> trasz: Then ocaml seems a better choice imo.
<schme> Though people seem to be doing amazing things with haskell. Like xmonad :) and the community is vibrant.
* schme prefers ocaml.
Yoric has joined #ocaml
<schme> trasz: You might want to look at both. And maybe erlang which has some functionalness to it.
<trasz> schme: ok, thanks!
<schme> making choices easier by offering more choices :D
thrasibule has quit [Connection timed out]
tab_ has quit [farmer.freenode.net irc.freenode.net]
tonyIII has quit [farmer.freenode.net irc.freenode.net]
noj has quit [farmer.freenode.net irc.freenode.net]
safire has quit [farmer.freenode.net irc.freenode.net]
Yoric has quit []
tab_ has joined #ocaml
ikaros has quit [Read error: 110 (Connection timed out)]
ikaros has joined #ocaml
noj has joined #ocaml
safire has joined #ocaml
tonyIII has joined #ocaml
safire has quit [SendQ exceeded]
noj has quit [Connection reset by peer]
safire has joined #ocaml
noj has joined #ocaml
valross has joined #ocaml
<trasz> utf-8 strings work in a transparent way, or do i need to do anything strange to get them to work?
<gildor> string in ocaml are byte array, if you want to manipulate UTF-8 char you'll have to look at Camomile (for example), which will provide functions to manipulate UTF-8
<gildor> (but you can go a long way with simple byte array)
<gildor> trasz: depends on what utf-8 strings means for you
<trasz> gildor: well, strings that contain utf-8 characters. so e.g. string[offset] can return correct multibyte sequence that happens to be a character number 'offset' in that string.
<trasz> gildor: i'll look at camomile.
<gildor> trasz: If you need to take into account multibyte sequence -> Camomile, if you just use string as data buffer -> std OCaml string is ok
<gildor> trasz: you can also have a look at extlib, AFAIK there are a simple, utf-8 only, string manipulation
<gildor> functions
<gildor> (you can consider String in ocaml just as like char * in C)
Yoric has joined #ocaml
Yoric has quit [Remote closed the connection]
_Jedai_3 has joined #ocaml
|Jedai| has quit [Read error: 60 (Operation timed out)]
suricator has quit []
patronus_ has quit [farmer.freenode.net irc.freenode.net]
patronus has joined #ocaml
slash_ has quit [Client Quit]
suricator has joined #ocaml
minddog has joined #ocaml
ikaros has quit [Remote closed the connection]
Associat0r has quit []
ofaurax has joined #ocaml
ofaurax has quit [Read error: 54 (Connection reset by peer)]
suricator has quit []
ofaurax has joined #ocaml
mattam has joined #ocaml
valross has quit [Remote closed the connection]
ofaurax has quit ["Leaving"]
Pimm has quit [Read error: 110 (Connection timed out)]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz_ is now known as ulfdoz
caligula__ has quit [Read error: 104 (Connection reset by peer)]
_unK has quit [Remote closed the connection]
caligula__ has joined #ocaml
ski_ has quit ["Lost terminal"]
pad has joined #ocaml
jknick has joined #ocaml
<pad> let x = 1;;
<mrvn> val x : int = 1
<pad> xavierbot is not here :(
<julm> let x = let rec f = function 1 -> 1 | n when n land 1 = 0 -> f (n / 2) | n -> f (3 * n + 1) in f max_int;;
<mrvn> val x : int = 1
<mrvn> julm: you should use a hard case.
<julm> he overflow does not hurt =)
<mrvn> julm: run it with f 0 :)
<julm> bleh :P
<mrvn> Has anyone proven yet that it always reaches 1?
<julm> for any integer, not to my knowledge
rhCYdj0 has joined #ocaml
<rhCYdj0> salut
rhCYdj0 has quit [Remote closed the connection]
<julm> % whois 69.63.179.35 | grep OrgName
<julm> OrgName: Facebook, Inc.
jeddhaberstro has quit [Client Quit]
thrasibule has joined #ocaml
caligula_ has joined #ocaml
caligula__ has quit [Read error: 110 (Connection timed out)]
pad has quit [Remote closed the connection]
valross has joined #ocaml
thieusoai has quit [SendQ exceeded]
zhijie has joined #ocaml