gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
<bitbckt> wchicken2: ask away.
<wchicken2> what is the most compact way to do a cumulative sum?
<wchicken2> say I have [| 0;1;2;3 |]
myu2 has joined #ocaml
<wchicken2> I want to get [| 0;1;3;6 |]
<wchicken2> I could hack up some iterative solution but I feel like I'm doing it "the wrong way"
myu2_ has quit [Ping timeout: 252 seconds]
<thelema> wchicken2: if you just want to get this done, use Batteries' List.sum
<thelema> If you want to understand how to do things like this, a good start would be (Array.fold_left (fun acc x -> acc + x) 0 [|0;1;3;6|])
<wchicken2> the problem is I don't want a final sum -- I want a running sum
<thelema> err, not a list. and batteries doesn't provide an Array.sum, although I think we provide Array.reduce
<thelema> wchicken2: oh, okay
<wchicken2> I could have the fold continually append to a list or keep poking elements into a new array but that feels weird
<thelema> If you want to understand how to do things like this, a good start would be (Array.fold_left (fun (cur,acc) x -> let s = cur + x in s, s::acc) (0,[]) [|0;1;3;6|])
<thelema> There's BatEnum.scanl for doing this in general: http://ocaml-batteries-team.github.com/batteries-included/hdoc/BatEnum.html
<wchicken2> nice, it looks like this is exactly what I needed
<wchicken2> I assume 'array' fits the 'enumerable' type?
<thelema> Array.enum converts an array into an enum
<wchicken2> awesome, now I just need to figure out how to get batteries to work on my system :)
<thelema> linux?
<wchicken2> yeah, ubuntu
<wchicken2> I installed the package
<thelema> that'll work
<wchicken2> (the ubuntu package, not the one from the site)
* thelema makes a note to himself to de-batteries odb
avsm has quit [Quit: Leaving.]
jonafan has quit [Ping timeout: 252 seconds]
<thelema> yay, odb is now de-batterized
<thelema> step 2: remove netclient dependency
<wchicken2> so the tutorial says I should run the toplevel like so:
<wchicken2> ocamlfind batteries ocaml
<wchicken2> sorry, ocamlfind batteries/ocaml
<thelema> no, don't read that tutorial
<wchicken2> ok good, because that *did* seem wrong
<thelema> sorry, old docs
myu2_ has joined #ocaml
<thelema> the new way is to modify your ~/.ocamlinit file
myu2 has quit [Ping timeout: 240 seconds]
<wchicken2> hey neat! thanks thelema
<wchicken2> so what is the difference between findlib vs. OASIS
<wchicken2> coming from a C background I find the ocaml library system scary and unintuitive :)
<thelema> wchicken2: odd - the ocaml library system is surprisingly like C's in many ways
<thelema> findlib helps you use packages that are installed. OASIS helps you configure and install (and categorize) packages
<thelema> configure, make, and install
<wchicken2> if I want to use a library on the toplevel
<wchicken2> do I use ocamlfind
<wchicken2> or is that the 'old' way
<thelema> you use findlib in the toplevel. It's activated by the batteries ocamlinit (#use "topfind")
<thelema> and if you want to use a package, just #require "package";;
<wchicken2> just like ruby, cool
<thelema> yes, it could be much worse
<wchicken2> it seems like there are a lot of different documents floating around
<wchicken2> especially through google searches
<wchicken2> proooobably should have come in here a while ago :)
<thelema> there's a lot of ocaml experience here
<wchicken2> so back to my original question
myu2_ has quit [Ping timeout: 250 seconds]
<wchicken2> I have (BatEnum.scan (+) (Array.enum ([|0;1;2;3|])))
<wchicken2> this gives me another enumeration, how do I make an array out of that?
<thelema> [|0;1;2;3|] |> Array.enum |> Enum.scan (+) |> Array.of_enum
myu2 has joined #ocaml
Amorphous has quit [*.net *.split]
lopex has quit [*.net *.split]
caligula_ has quit [*.net *.split]
bzzbzz has quit [*.net *.split]
Obfuscate has quit [*.net *.split]
<wchicken2> where is that operator documented (|>)? is it added with batteries?
<thelema> yes it's part of batteries. It's defined as [let (|>) x f = f x]
<wchicken2> that. is. awesome.
<thelema> it doesn't do much other than save parentheses and make code clearer
<wchicken2> so. awesome.
<thelema> (sometimes)
<wchicken2> let's say I have a few source files I want to compile with ocamlc
Amorphous has joined #ocaml
lopex has joined #ocaml
caligula_ has joined #ocaml
bzzbzz has joined #ocaml
Obfuscate has joined #ocaml
<wchicken2> and I want to make sure each file can access batteries
<wchicken2> how would I do that?
<thelema> ocamlfind ocamlc -package batteries -linkpkg file.ml -o file
<thelema> and make sure to put "open Batteries_uni" at the top of the files
<wchicken2> ahh, ok
<thelema> (yes, it's ugly)
<thelema> and very not-obvious
<wchicken2> hey, this already has cleaned up a lot of my code
<thelema> if your project is many files being compiled together, use ocamlbuild
<wchicken2> ok, I'll keep that in mind
Amorphous has quit [*.net *.split]
lopex has quit [*.net *.split]
caligula_ has quit [*.net *.split]
bzzbzz has quit [*.net *.split]
Obfuscate has quit [*.net *.split]
Amorphous has joined #ocaml
lopex has joined #ocaml
caligula_ has joined #ocaml
bzzbzz has joined #ocaml
Obfuscate has joined #ocaml
kaustuv_ has quit [Quit: Pervasives.exit 0;;]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 276 seconds]
ulfdoz_ is now known as ulfdoz
<thelema> muhuahaha! odb (maybe related to oasis-db) is alive! (and with minimal ocaml deps - just findlib)
<thelema> curl https://github.com/thelema/odb/raw/master/odb.ml -o odb.ml && ocaml odb.ml <packagename> will install packages from me directly to your computer
<thelema> (you'll still need to modify your findlib.conf to use these new packages)
<thelema> now I just need a good URI to host it from (like cpanmin.us)
<thelema> lol, cpanmin.us redirects to github
myu2 has quit [Remote host closed the connection]
myu2 has joined #ocaml
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
lopex has quit []
myu2 has quit [Remote host closed the connection]
tauntaun has quit [Quit: Ex-Chat]
<wchicken2> thanks again thelema! gotta bounce
wchicken2 has quit [Quit: leaving]
<thelema> please test and send feedback (as well as recommended packages to put on server) for odb: https://github.com/thelema/odb
eye-scuzzy has quit [Quit: leaving]
Oejet has quit [Ping timeout: 264 seconds]
eye-scuzzy has joined #ocaml
enthymeme has joined #ocaml
arubin has joined #ocaml
lamawithonel has joined #ocaml
myu2 has joined #ocaml
lamawithonel has quit [Ping timeout: 264 seconds]
ulfdoz has quit [Ping timeout: 250 seconds]
patronus has joined #ocaml
patronus_ has quit [Read error: Connection reset by peer]
bitbckt has quit [Remote host closed the connection]
bitbckt has joined #ocaml
bitbckt has quit [Changing host]
bitbckt has joined #ocaml
CoryDambach has quit [Ping timeout: 240 seconds]
arubin has quit [Quit: arubin]
CoryDambach has joined #ocaml
myu2 has quit [Remote host closed the connection]
myu2 has joined #ocaml
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
hto has quit [Quit: Lost terminal]
hto has joined #ocaml
philtor has quit [Ping timeout: 240 seconds]
Yoric has joined #ocaml
hto has quit [Quit: Lost terminal]
hto has joined #ocaml
Cyanure has joined #ocaml
vivanov has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
Yoric has quit [Quit: Yoric]
ikaros has joined #ocaml
larhat has joined #ocaml
jdavis has quit [Ping timeout: 264 seconds]
vivanov has joined #ocaml
jdavis has joined #ocaml
vivanov has quit [Ping timeout: 276 seconds]
vivanov has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
sepp2k has joined #ocaml
Oejet has joined #ocaml
mnabil has joined #ocaml
Oejet has quit [Ping timeout: 276 seconds]
mikemc_home has quit [Quit: Leaving]
mikemc_home has joined #ocaml
myu2 has quit [Remote host closed the connection]
myu2 has joined #ocaml
olegfink has joined #ocaml
Yoric has joined #ocaml
ftrvxmtrx has joined #ocaml
<kaustuv> thelema: regarding odb, ISTR there is some issue with using #load on Wundows/Cygwin
<gildor> kaustuv: there is also some issues, with the fact, that it don't set prefix or OCAMLFIND_DESTDIR= for oasis build
<gildor> (prefix -> for oasis build and make install)
sepp2k has quit [Ping timeout: 250 seconds]
edwin has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
eye-scuzzy has quit [Quit: leaving]
eye-scuzzy has joined #ocaml
sepp2k has joined #ocaml
jdavis has quit [Ping timeout: 272 seconds]
ygrek has quit [Remote host closed the connection]
Amorphous has quit [Read error: Operation timed out]
mnabil has quit [Read error: Connection reset by peer]
Amorphous has joined #ocaml
jdavis has joined #ocaml
eye-scuzzy has quit [Quit: leaving]
eye-scuzzy has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
<vivanov> to use with ocamldoc, i want to create references to other definitions: for example i will have smth like (** A function used by <<val OtherModule.prices>> *), and after compiling to html documentation i want to click the word prices and get to prices definition in the documentation. What should i put instead of <<OtherModule.prices>> ?
<thomasga> [OtherModule.prices]
<vivanov> (** A function used by [OtherModule.prices] *) , right?
<vivanov> thanks a lot
_andre has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
lamawithonel has joined #ocaml
ttamttam has joined #ocaml
oriba has joined #ocaml
myu2 has quit [Remote host closed the connection]
lopex has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
myu2 has joined #ocaml
lamawithonel has quit [Ping timeout: 264 seconds]
Oejet has joined #ocaml
olegfink has quit [Ping timeout: 240 seconds]
ftrvxmtrx has quit [Remote host closed the connection]
ftrvxmtrx has joined #ocaml
<adrien> bah: afaict, using pango to draw over a gtk pixbuf which is linked to a gtkimage won't auto-update the display, and I have to write something as stupid as "image#set_pixmap image#(get_)pixmap"
<oriba> hello, when do I need Array.copy?
<oriba> I used an array inside a record
<mrvn> when you want a copy of an array
<oriba> moment
<oriba> I used a record and it contains an array
<oriba> the array will be changed
<oriba> and one function just gives back that array
<oriba> another func is using the extraction of the array and writes it to a loist
<mrvn> then you need a copy or all other references to the array will change as well
<oriba> result: all list entries contain the same array
<oriba> not the changed array
<oriba> it's always just a pointer?
myu2 has quit [Remote host closed the connection]
<flux> ocaml never copies anything by value
<oriba> ok
<oriba> for lists I would expect it
<flux> (or if it does, you cannot really detect it)
<mrvn> everyhing is always a pointer that isn't a trivial value (char, int, bool, unit)
<oriba> with Array I think imperative ;)
<flux> ((well, with == perhaps, but don't do it ;-)))
<oriba> but string can be changed in place
<mrvn> oriba: a string is still a pointer
<oriba> ah ok
<oriba> so what I created without Array.copy was a list that points to the same array every time
<oriba> change the code was easy
<oriba> but I just wanted to know the background
<mrvn> # let s1 = "hallo" in let s2 = s1 in s2.[0] <- 'H'; s1;;
<mrvn> - : string = "Hallo"
<oriba> thanks.
<kaustuv> (string_of_bool true).[0] <- 'g'; string_of_bool true;;
<mrvn> kaustuv: that one is really evil.
mikemc_home has quit [Quit: Leaving]
<oriba> oh
<oriba> mrvn, what the hell....
myu2 has joined #ocaml
<mrvn> if I ever get around to write my ow ocaml like compiler then it will have const, read-only and read-write strings.
<flux> batteries has BatString.Cap
<kaustuv> what is the diff between const and readonly?
<flux> but it would need to be quite pervasive to be really useful..
<mrvn> oriba: string_of_bool true returns a pointer to the literal "true", then you change it to grue and the next call returns the same pointer.
<flux> kaustuv, I guess const couldn't vary, while readonly could vary but you wouldn't be able to mutate it
<mrvn> kaustuv: const can never change, read-only can not be changed by you.
<oriba> mrvn, is this a security boittleneck?
<mrvn> oriba: it's just how ocaml is
<flux> actually one needs to be careful with the module I mentioned as well
<oriba> hmhh.... it throws index out of bounds if I try some too long strings
<oriba> ok
<flux> as conversions from plain strings happens with %identity
* oriba thoughts about code injection
mcclurmc has quit [Remote host closed the connection]
mikemc has quit [Remote host closed the connection]
<mrvn> oriba: nah. you cn only change the contents of the string. The string itself is limited in length.
<mrvn> The code is just something like this: let string_of_bool = function true -> "true" | false -> "false"
<kaustuv> let module String = struct open String let set s x = failwith "no can do" end in let s = "hello" in s.[0] <- 'j';;
mcclurmc has joined #ocaml
<kaustuv> err, let s x c = ...
<mrvn> Warning X: this argument will not be used by the function.
<oriba> mrvn, if I would rely on the "true" string somewhere in code, this might become a problem ;)
<mrvn> I would have thought you get a type error because "set s x" isn't a char ref
<kaustuv> oriba: Not all occurrences of the literal "true" map to the same location. The OCaml compile just "cleverly" lifts the constant string literals out of functions like string_of_bool
<kaustuv> If you live by the rule that you never modify a string you didn't create yourself, you'll be fine.
<oriba> hmhh... or only modify after copying...
<mrvn> kaustuv: isn't it just that string literals are created at compile time?
<kaustuv> I'm not sure if every string literal is lifted out at compile time, but that may well be the case
<mrvn> kaustuv: what would be the point of creating it? you would just ahve to stroe the string verbatim and then memcpy it into a string value. Might as well add the extra word for the string header to it directly.
<mrvn> /stroe/store/
<thelema> kaustuv: what about #load? do you mean running ocaml with a file as argument?
<thelema> gildor: thanks for noticing the OCAMLFIND_DESTDIR bug
<kaustuv> mrvn: the point would be preserving the natural semantics. The string_of_true example demonstrates that it is not always safe to lift mutable values out of closures
<kaustuv> thelema: I once ran into an issue with the ocaml toplevel on Cygwin not being able to #load "unix.cma". This was in 3.10.2 and Windows XP, I believe. It might be fixed now.
<thelema> kaustuv: I'm not #loading, I'm #requiring
<kaustuv> Well, it uses #load internally
<thelema> ah. that sucks
<kaustuv> I'm sure someone can check that it is still broken. Maybe Alain Frisch's dynamic dll gizmo fixes it
<mrvn> kaustuv: that depends on how you define the behaviour of a string literal. Is it a value or is it creating a new value every time?
<mrvn> kaustuv: depending on that you can allways or ever lift it.
<flux> to me it appears strings literals are only ever constructed exactly once
<flux> if there are multiple equal strings, they are not combined
thelema_ has joined #ocaml
<mrvn> flux: that would really screw up semantics.
<flux> it might even be a non-trivial win when dealing with basically consant strings
<flux> mrvn, follow the rules outlined by kaustuv and you'll be fine ;)
<rwmjones> anyone using erlang? is HiPE (the native code compiler) a usable option for production now?
<mrvn> flux: you would have to do a whole code analysis to see if a string literal is constant or not.
<kaustuv> rwmjones: Can't you ask #erlang?
<mrvn> rwmjones: sorry, we all use .net here.
<rwmjones> well, I could do, was hoping for a non-partisan view :-)
<flux> mrvn, if you want to play safe, replace all string literals with String.copy string litreal
<mrvn> flux: that would change the semantics.
thelema has quit [Ping timeout: 276 seconds]
<rwmjones> anyway, as it turns out, #erlang doesn't let me comment, so no
<kaustuv> rwmjones: wow, really?
<mrvn> flux: currently in ocaml a literal is a single value created as compile time. One just has to know that and act acordingly. Holds true for strings, records, tuples,...
<rwmjones> kaustuv: well it may be I need to do something to prove I'm not a spammer ... it's not immediately obvious from the /topic of that channel
<kaustuv> Since the topic on #erlang was set by orbitz who's also here, maybe he can help
<rwmjones> ok maybe I just had to identify myself to nickserv
* rwmjones tries again
<rwmjones> ah yeah, just because nickserv had forgotten about me
myu2 has quit [Remote host closed the connection]
fraggle_ has quit [Ping timeout: 240 seconds]
ftrvxmtrx has quit [Remote host closed the connection]
ftrvxmtrx has joined #ocaml
<adrien> +R (and +q for unidentified) is really annoying and pretty useless currently
thelema_ has quit [Remote host closed the connection]
thelema has joined #ocaml
<gildor> thelema: kaustuv is right, you should not #use or #require or #load, if you want something portable
<gildor> (hehe, this was one of the initial draft of oasis's setup.ml, and one of the reason I have to copy a whole pile of stuff in it)
<thelema> gildor: :(
<thelema> I don't think I'll require compilation until this is verified and no workaround possible...
<thelema> but thanks for the warning. Currently curl is required, and I dunno if that's available as part of default cygwin install
<thelema> possibly this will end up only useful for unix
<gildor> thelema: I think it is wget by default
<gildor> and I am not even sure about that
<thelema> now I just have to find some way to detect the two. Probably not too hard
<thelema> Sys.command "where foo" <> 0
<gildor> and anyway on Windows you should not rely on external software because it is not the way things are (TM)
<gildor> (most Win32 exec comes as standalone apps with all their DLL and external software package together -> no dependencies on windows)
<thelema> yes, but this is at best going to be a windows/cygwin programm, not win32
<gildor> yes, you are right
<gildor> and anyway, this is your program, so you choose your target
<gildor> BTW, don't forget to use --prefix
<thelema> --prefix for configure?
<gildor> e.g. for ocamlify, it installs exec in bin/
<gildor> yes
<kaustuv> gildor: is #load/#use still broken with flexdll and ocaml 3.11.2+?
<gildor> kaustuv: AFAIK, yes, cygwin target while very useful remains a secondary goal on windows
<kaustuv> if I remember correctly, you can run the toplevel as: ocaml unix.cma pcre.cma whateverelse.cma
<gildor> kaustuv: yes it works
<thelema> fair enough - depending on the toplevel failure result from #load, we can just ask windows users to run odb differently
<thelema> gildor: --prefix change pushed
fraggle_ has joined #ocaml
eye-scuzzy has quit [Quit: leaving]
eye-scuzzy has joined #ocaml
sepp2k has quit [Quit: Leaving.]
dnolen has joined #ocaml
<thelema> And more important changes to package handling including instructions on how to set environment variables properly if they're not set
boscop has joined #ocaml
myu2 has joined #ocaml
sgnb has quit [Read error: Operation timed out]
sgnb has joined #ocaml
ymasory_ has quit [Quit: Leaving]
olegfink has joined #ocaml
alpounet has joined #ocaml
myu2 has quit [Remote host closed the connection]
<f[x]> what do you mean by '#load is broken'?
<thelema> f[x]: they seem to be claiming that it won't work under windows (and thus ocamlfind's #require won't work thus odb.ml won't work)
<thelema> btw, does anyone know any tricks to get the same file to be compilable via ocamlfind as well as runnable standalone in ocaml via "#require"s?
lamawithonel has joined #ocaml
olegfink has quit [Ping timeout: 240 seconds]
lamawithonel has quit [Read error: Connection reset by peer]
lamawithonel has joined #ocaml
<f[x]> it works and always worked for me (just checked on ocaml 3.11.0-mingw)
<thelema> f[x]: great. That makes me feel better. would you be willing to test odb for me: https://github.com/thelema/odb
<f[x]> sorry, not now
<thelema> thanks anyway for looking into #load
<kaustuv> note, I am not sure if it is still broken, and anyway it was a problem with cygwin
<f[x]> you mean ocaml cygwin port?
* f[x] wonders how many people do use that port
<kaustuv> yes. More precisely, OCaml 3.10.2 + Cygwin 1.6.something + Windows XP had a broken #load in 2009
<f[x]> I never tried cygwin port
<kaustuv> actually, it was probably Cygwin 1.5.something. It was the stable branch before 1.7.
<thelema> well, I look forward to the first bug or success report from someone running cygwin
* thelema might implement the dumbest HTTP client ever to work around this
myu2 has joined #ocaml
tauntaun has joined #ocaml
<kaustuv> don't you need cygwin to compile the mingw version of ocaml?
<flux> thelema, but then you'll likely screw people with http proxies :)
<thelema> flux: with non-transparent proxies, yes. blah.
<thelema> maybe only people without curl and with non-transparent proxies
kaustuv has quit [Quit: rootin' tootin' rebootin']
<thelema> and I'm explicitly trying to be an 80% solution (well, maybe 90%), so I don't have to contort my code that much for exceptional cases
vivanov has quit [Ping timeout: 252 seconds]
vivanov has joined #ocaml
dnolen has quit [Quit: dnolen]
larhat has quit [Quit: Leaving.]
lopex has quit []
ttamttam has quit [Remote host closed the connection]
ftrvxmtrx has quit [Remote host closed the connection]
ftrvxmtrx has joined #ocaml
er98052 has joined #ocaml
<mrvn> Sending HTTP/1.1 isn't really more work than a dumb HTTP/1.0 client.
olegfink has joined #ocaml
<thelema> mrvn: you're welcome to implement http_get : string -> string for me
<mrvn> thelema: The only thing you need for proxy support is to send an extra "Host: <host>" in the header. That really isn't worth saving.
<mrvn> and some option to specify the proxy url.
<thelema> and I'll have to send that request to the proxy server somewhere, possibly with authentication ... ick
<mrvn> ok, screw proxies with auth. :)
<thelema> :)
<mrvn> unless you support http server with auth in your dumb client. Then you already have the code there.
<mrvn> but at that point it makes more sense to require curl
<thelema> Unlikely
<gildor> thelema: why not use ocurl ?
<thelema> gildor: dependencies - one can't just install ocaml and findlib and be ready to use it
<mrvn> Does anyone know of a image viewer (module) in ocaml?
<thelema> it makes no sense for the program to install ocaml packages to require many ocaml packages to use it. chicken/egg
<gildor> thelema: distribute in binary form ?
<thelema> mrvn: https://github.com/thelema/coml (not really a module, but lots of code that can be reused)
<thelema> mrvn: it's not much more than a wrapper around lablgtk's GdkPixbuf
<thelema> gildor: I bet this is easier, despite the restrictions
<thelema> I don't have to generate binaries for the gazillion possible systems it could run on just fine
kaustuv has joined #ocaml
<thelema> I still like the idea of curl -O http://db.o.o/odb.ml; ocaml odb.ml <packagename>
<thelema> more specifically, ocaml odb.ml batteries
<gildor> I don't want to be bashing about that, but why not start by adding _oasis to batteries ?
<mrvn> What I want to do is write an interactive mirror script for google images. You give it some search terms and it downloads images from googles page and displays them. You then score images images and it branches out to fetch similar images. Highest score first.
<thelema> mrvn: how to get search term for an image result?
lopex has joined #ocaml
<thelema> gildor: on my todo list still.
<mrvn> thelema: the use gives the initial term (or just the url to start from) and then it follows links.
<mrvn> s/use/user/
<mrvn> thelema: ever noticed the "similar images" link below results in an image search?
<thelema> mrvn: nope. if there's that, that solves what I was thinking of...
* gildor gtg
vivanov has quit [Quit: Lost terminal]
jonafan has joined #ocaml
<thelema> then what you want to do seems pretty reasonable
ttamttam has joined #ocaml
vivanov has joined #ocaml
<mrvn> thelema: for other pages I intend to just follow all links and prioritize those branches with high scores.
olegfink has quit [Read error: Operation timed out]
<mrvn> One thing that would be nice would be code to say if 2 images are the same just with different resolution or quality.
enthymeme has joined #ocaml
<mrvn> i.e. my own "similar images" filter.
<thelema> I don't know how that's done, but the geeqie project has code for that.
<kaustuv> thelema: an absolute noob would not have the wherewithall to run ocaml odb.ml batteries, and a less than absolute noob would be able to use oasis (once it's ready).
<kaustuv> So I am a bit surprised you're trying to roll your own package manager
<mrvn> kaustuv: you just click at runme.bat
thelema_ has joined #ocaml
jonafan is now known as jonathanhasasupe
<kaustuv> I think the Haskell Platform-like approach is better for people who like clicking on things
jonathanhasasupe is now known as jonafan
philtor has joined #ocaml
thelema has quit [Read error: Connection reset by peer]
mcclurmc has quit [Ping timeout: 252 seconds]
mcclurmc has joined #ocaml
ymasory has joined #ocaml
er98052 has quit [Ping timeout: 240 seconds]
<hcarty> mrvn: http://gallium.inria.fr/camlimages/ may have what you need
sgnb has quit [Read error: Connection reset by peer]
flux has quit [Read error: Connection reset by peer]
flux has joined #ocaml
sgnb has joined #ocaml
ygrek has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
<mrvn> libcamlimages-ocaml - OCaml image processing library (Runtime library)
<mrvn> nice, already packaged.
<thelema_> mrvn: it doesn't seem to be maintained, and has had some security flaws reported (and maybe fixed in packaged versions)
oriba has quit [Quit: Verlassend]
Yoric has quit [Quit: Yoric]
orbitz_ has joined #ocaml
ikaros has joined #ocaml
orbitz has quit [Ping timeout: 260 seconds]
orbitz_ has quit [Client Quit]
orbitz has joined #ocaml
olegfink has joined #ocaml
<thelema_> gildor: what is filesAB: in an _oasis file?
boscop_ has joined #ocaml
boscop has quit [Read error: Connection reset by peer]
ygrek has quit [Ping timeout: 252 seconds]
ygrek has joined #ocaml
thelema has joined #ocaml
bacam_ has joined #ocaml
avsm2 has quit [Ping timeout: 240 seconds]
bacam has quit [Ping timeout: 240 seconds]
thelema_ has quit [Ping timeout: 240 seconds]
boscop_ is now known as boscop
bacam_ is now known as bacam
avsm2 has joined #ocaml
<hcarty> thelema: I think it is maintained, but it seems to be moving rapidly from location to location...
bacam has quit [*.net *.split]
sgnb has quit [*.net *.split]
flux has quit [*.net *.split]
fraggle_ has quit [*.net *.split]
patronus has quit [*.net *.split]
vouillon has quit [*.net *.split]
<thelema> hcarty: really? whoa. it has a new website, and its version number has jumped. I guess I was wrong about thta.
<hcarty> thelema: I was under the same impression until searching and finding that link just now...
<adrien> wow
bacam has joined #ocaml
sgnb has joined #ocaml
flux has joined #ocaml
fraggle_ has joined #ocaml
patronus has joined #ocaml
vouillon has joined #ocaml
<thelema> and it has a hg tree, with commits within the last year
<hcarty> It's all very pleasantly surprising
<adrien> 10 months ago, I guess everyone had gotten desperate
boscop_ has joined #ocaml
<thelema> yup, that's when it was picked up by camlspotter(?)
<thelema> and I even find another personal standard library: spotlib
kaustuv_ has joined #ocaml
boscop has quit [Ping timeout: 264 seconds]
<hcarty> thelema: Ulib from the Caml Bazaar may be worth stealing from as well
boscop_ is now known as boscop
<thelema> I wish I could say spotlib was full of gems, so far I've found only hashset - sets implemented using hashtbl and a "phantom_head" module that does something scary with Obj.magic
<adrien> camlspotter would be Jun Furuse
flx_ has joined #ocaml
<thelema> can anyone help me with WTF this code does / is useful for: https://bitbucket.org/camlspotter/spotlib/src/8b6c9c1cf13a/phantom_head.mli
ttamttam has quit [Remote host closed the connection]
bacam has quit [*.net *.split]
sgnb has quit [*.net *.split]
flux has quit [*.net *.split]
fraggle_ has quit [*.net *.split]
patronus has quit [*.net *.split]
vouillon has quit [*.net *.split]
bacam has joined #ocaml
flx_ is now known as flux
<kaustuv_> thelema: looks like heterogeneous tagged containers
<thelema> kaustuv_: heterogenous tags? this seems odd to me
fraggle_ has joined #ocaml
<kaustuv_> thelema: I think it started with something to manage phantom types for a specific element container (https://bitbucket.org/camlspotter/spotlib/changeset/c753af160b2b#chg-phantom_intf.ml), and then was generalized over containers
olegfink has quit [Ping timeout: 240 seconds]
<thelema> kaustuv_: okay... thanks for the help
<kaustuv_> Whatever it is meant to be, I doubt it's useful. We don't need phantom type management frameworks.
olegfink has joined #ocaml
<thelema> yup, that's my conclusion too
ygrek has quit [Ping timeout: 252 seconds]
mcclurmc has quit [Ping timeout: 252 seconds]
tauntaun has quit [Ping timeout: 252 seconds]
mcclurmc has joined #ocaml
tauntaun has joined #ocaml
tauntaun has quit [Client Quit]
ygrek has joined #ocaml
lopexx has joined #ocaml
lopex has quit [Ping timeout: 250 seconds]
myu2 has quit [Ping timeout: 250 seconds]
shachaf has quit [Ping timeout: 250 seconds]
shachaf has joined #ocaml
myu2_ has joined #ocaml
lopexx has quit [Client Quit]
<thelema> gildor: E: Unknown extra plugin 'Custom' (available: DevFiles (0.2), META (0.2), StdFiles (0.2))
lopex has joined #ocaml
sgnb has joined #ocaml
patronus has joined #ocaml
vouillon1 has joined #ocaml
vivanov has quit [Ping timeout: 276 seconds]
sgnb has quit [Read error: Connection reset by peer]
vouillon1 has quit [Ping timeout: 260 seconds]
noj has quit [Ping timeout: 260 seconds]
confound has quit [Ping timeout: 260 seconds]
Lor has quit [Ping timeout: 260 seconds]
Lor has joined #ocaml
noj has joined #ocaml
sgnb has joined #ocaml
kaustuv_ has quit [Ping timeout: 260 seconds]
vouillon1 has joined #ocaml
confound has joined #ocaml
Yoric has joined #ocaml
ygrek has quit [Ping timeout: 252 seconds]
ygrek has joined #ocaml
sgnb` has joined #ocaml
avsm2 has quit [Ping timeout: 260 seconds]
vouillon1 has quit [Ping timeout: 260 seconds]
sgnb has quit [Ping timeout: 260 seconds]
coucou747 has quit [Ping timeout: 260 seconds]
cods has quit [Ping timeout: 260 seconds]
vouillon1 has joined #ocaml
coucou747 has joined #ocaml
cods has joined #ocaml
lamawithonel has quit [Ping timeout: 264 seconds]
sgnb` has quit [Remote host closed the connection]
sgnb` has joined #ocaml
noj has quit [Ping timeout: 260 seconds]
noj has joined #ocaml
drunK has joined #ocaml
rossberg has quit [Ping timeout: 260 seconds]
rossberg has joined #ocaml
sgnb` has quit [Remote host closed the connection]
sgnb` has joined #ocaml
ftrvxmtrx has joined #ocaml
coucou747 has quit [Ping timeout: 250 seconds]
joewilliams has quit [Ping timeout: 250 seconds]
ikaros has quit [Ping timeout: 250 seconds]
rossberg has quit [Changing host]
rossberg has joined #ocaml
enthymeme has quit [Ping timeout: 250 seconds]
eelte has joined #ocaml
joewilliams_ has joined #ocaml
ikaros has joined #ocaml
joewilliams_ is now known as joewilliams
joewilliams has quit [Changing host]
joewilliams has joined #ocaml
Pepe_ has quit [Ping timeout: 250 seconds]
patronus_ has joined #ocaml
drunK has quit [Ping timeout: 250 seconds]
willb1 has quit [Ping timeout: 250 seconds]
_unK has joined #ocaml
patronus has quit [Ping timeout: 250 seconds]
Pepe_ has joined #ocaml
kaustuv_ has joined #ocaml
sgnb` is now known as sgnb
willb1 has joined #ocaml
tauntaun has joined #ocaml
milosn has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
ymasory has quit [Remote host closed the connection]
tauntaun has quit [Quit: Ex-Chat]
_unK has quit [Remote host closed the connection]
_andre has quit [Quit: leaving]
bind_return has joined #ocaml
<hcarty> thelema: Do odb package names map to findlib names?
<thelema> yes, or to executables
<thelema> I added this to the info files, as there's no package named ocamlify and there's a rogue executable named expect
<thelema> i.e. the package metadata indicates whether its name corresponds to a findlib package or to an executable (or to both, for oasis)
kaustuv_` has joined #ocaml
kaustuv_ has quit [Remote host closed the connection]
<hcarty> thelema: Where are packages built? Is the "install-*" directory created in pwd or elsewhere?
olegfink has quit [Read error: Connection reset by peer]
<hcarty> In the install function in odb.ml
waern has quit [Read error: No route to host]
<thelema> ~/.odb/install-*
<thelema> first thing the program does is make and enter ~/.odb
<hcarty> Ah... if I'd read the bottom of the file I would have seen that...
<thelema> yup, it's so long of a file, I don't expect you to read the bottom. :)
<hcarty> The 137 lines seemed like they would never end!
<hcarty> In all seriousness though, it looks like a nice stop-gap until oasis-db is up and running
<thelema> well, my coding style is a bit dense - I try to maximize how much fits on a screen
<thelema> hcarty: thank you
ftrvxmtrx_ has joined #ocaml
<hcarty> thelema: A feature requests - a user-configuration $ODB_DIR (= ~/.odb by default)
ftrvxmtrx_ has quit [Client Quit]
ftrvxmtrx_ has joined #ocaml
ftrvxmtrx has quit [Disconnected by services]
ftrvxmtrx_ is now known as ftrvxmtrx
<thelema> hcarty: that's one of my two todo items - 1) command line args, 2) configuration file
<thelema> It'd probably be trivial to read the environment on line 7
<hcarty> It looks that way
<hcarty> Are any of the packages you put up on your site customized, or are they the upstream tarballs?
<thelema> all from upstream. The most I did was rename some of them to have the version number in their name
<thelema> (some were foo-latest)
<thelema> if I want to customize anything, I'll put it in the info file
<thelema> I was tempted to add custom build/install commands, and may still need to
<hcarty> It's quite nice that there are already a dozen packages which don't require customization beyond detecting the build system
<hcarty> And I suppose that logic could be removed if custom configure/build/install commands are added
waern has joined #ocaml
olegfink has joined #ocaml
lamawithonel has joined #ocaml
<thelema> hcarty: well, they don't need customization to work on a pretty vanilla linux system
Amorphous has quit [Remote host closed the connection]
Amorphous has joined #ocaml
Amorphous has quit [Changing host]
Amorphous has joined #ocaml
accel has joined #ocaml
<accel> for a hskeller that can't wrap his head around laziness; what's the best way to learn ocaml?
<thelema> accel: same as most languages - use it. There's some good tutorials, try using them to build a useful program.
Amorphous has quit [Remote host closed the connection]
Amorphous has joined #ocaml
Amorphous has quit [Changing host]
Amorphous has joined #ocaml
avsm2 has joined #ocaml
<jonafan> accel, the standard library is a bit lacking, but there are libraries around if you start running into that particular wall
accel has left #ocaml []
Cyanure has quit [Remote host closed the connection]
bind_return has quit [Quit: Leaving]
ygrek has quit [Ping timeout: 252 seconds]
tauntaun has joined #ocaml
ygrek has joined #ocaml
alexyk has joined #ocaml
lamawithonel has quit [Ping timeout: 264 seconds]
ygrek has quit [Ping timeout: 252 seconds]
alexyk has quit [Quit: alexyk]
edwin has quit [Remote host closed the connection]
lamawithonel has joined #ocaml
tauntaun has quit [Ping timeout: 252 seconds]
Amorphous has quit [Read error: Operation timed out]
<gildor> thelema: filesAB -> files where you will replace $(version) by the version
<gildor> (and other variables found in setup.data)
<gildor> thelema: there is not plugin custom for extra
<gildor> thelema: however there is a custom plugin for build/configure
<gildor> and install
<thelema> okay, how do I activate the custom plugin for a Library?
<thelema> Type: isn't available
<thelema> gildor: ^^^
Yoric has quit [Quit: Yoric]
Amorphous has joined #ocaml
enthymeme has joined #ocaml
tauntaun has joined #ocaml
<gildor> thelema: BuildType
<gildor> thelema: for the whole package
<gildor> there is no way to only pick a specific build for a single library
Oejet has quit [Ping timeout: 276 seconds]
alexyk has joined #ocaml
alexyk has quit [Client Quit]
<thelema> gildor: BuildType: make activates what fields? I only found Post{Build,Clean,Install,Uninstall}Command, which doesn't seem like what I want
thelema_ has joined #ocaml
<gildor> thelema: ^^^
<gildor> BuildType: custom (0.0.1)
<gildor> (but you should use custom (0.2)
<gildor> )
thelema has quit [Ping timeout: 276 seconds]
<thelema_> gildor: thanks for the pointers
<thelema_> I didn't realize I could BuildType: custom
<thelema_> I tried Plugins:custom, and it rejected me
<thelema_> despite custom being listed as a plugin
<gildor> Plugins is in fact Extra(Plugins):
boscop has quit [Ping timeout: 272 seconds]
ikaros has quit [Quit: Leave the magic to Houdini]
<thelema_> that doesn't mean anything useful to me yet.
<gildor> extra plugins are anything not related to configure/build/install
<gildor> e.g. generation of META or README.txt
<thelema_> okay then. I seem to have succeeded in having oasis generate a nice 125KB setup.ml file
<thelema_> I'd read it to check whether it works, but it's 125KB
<gildor> std size
<gildor> have you ever considered the size of a configure ?
<gildor> (just for configure BTW)
<thelema_> sure... I find configure horribly ugly too.
<gildor> ocaml-fileutils$ ls -ahl configure
<gildor> -rwxr-xr-x 1 gildor gildor 128K 6 sept. 12:02 configure
<gildor> and there are chances that setup.ml decrease in size in the next version
oriba has joined #ocaml
<oriba> hello, how can I force a certain type name on a function, for example
<gildor> I will probably remove big part of the property list stuff
<thelema_> I don't know whether it's any better than the 600ish byte setup.ml I made by hand, but I'll assume it is
<oriba> if I use type mytype = int array array I want to have a function using mytype instead of the more general type decl
<thelema_> oriba: let f : int -> int = fun x -> x + 2
<oriba> hmhh
<gildor> if it was designed by you 600b of code is probably far better
<oriba> and with named arguments?
<thelema_> if it's just an argument you want to specify the type of, let f (x:mytype) = ...
<oriba> let f a b c = ....
<oriba> I also want the return value of a certain type
<oriba> how to do that?
<thelema_> let f : f:(int->int) -> g:(int -> int) -> int -> int = fun ~f ~g x -> f (g x)
<oriba> aha
<oriba> thanky ocu I wll try it
<thelema_> gildor: that said, I'm not really concerned about the size, I just hope your codegen doesn't cause too much complexity to maintain
<thelema_> I'm concerned about even trying to debug the result
<gildor> thelema_: as long as you keep _oasis small, there is no pb
<thelema_> I hope you're right.
<gildor> the point is that you can debug the result, this is basic OCaml script and not a complicatd bash script
<thelema_> ok, so I should or shouldn't check this setup.ml into git?
<gildor> that is up to you
<gildor> I generate the setup-dev version and commit it to darcs
<thelema_> I guess we can avoid it (and do the right thing) once we have a proper [make release] that does more than tarball the git tree
<gildor> what is [make release] ?
<thelema_> release: test
<thelema_> git archive --format=tar --prefix=batteries-$(VERSION)/ HEAD \
<thelema_> | gzip > batteries-$(VERSION).tar.gz
<gildor> oh, I have already that
<thelema_> but this will need a setup (not a setup-dev) build.ml checked into svn
<oriba> thelema_, I don't get it running
<thelema_> s/svn/git/
<oriba> thelema_, do you hae a more simple example?
<oriba> is ~f and ~g to bind the names?
<thelema_> oriba: let f : x:int -> y:string -> int = fun ~x ~y -> x + (int_of_string y)
<thelema_> yes, ~foo is a named parameter
<oriba> thelema_, that is necessary here?
<oriba> when using type-names?
<gildor> thelema_: http://darcs.ocamlcore.org/cgi-bin/darcsweb.cgi?r=oasis/oasis;a=headblob;f=/src/tools/oasis-dist.ml
<thelema_> no, only if you want named parameters
<gildor> thelema_: you don't need setup.ml
<gildor> with oasis-dist
<oriba> ok
<gildor> but oasis-dist only support darcs/novcs
<gildor> you are welcome to implement a git class
<thelema_> oriba: if you didn't really want named parameters, it's my first example - let f : int -> int = fun x -> x + 1
<oriba> ok
<oriba> but then there also are names...
<oriba> after the "="
<thelema_> gildor: not at this point. It looks like it'll take some work to migrate batteries to oasis. I see a lot of things being automatable
<thelema_> let <identifier> : <type> = <value>
<oriba> ah ok
<thelema_> identifier is your function name, type is the type you want it to have, and value is "fun <params> -> ..."
<gildor> thelema_: what kind of thing are automatable ?
<oriba> and now it works
<oriba> thanks a lot, thelema_ :)
<thelema_> oriba: you're welcome
<thelema_> gildor: some of the parameter substitution and dependency checking
<gildor> thelema_: don't understand, this is done in oasis ?
<thelema_> gildor: this could be done in oasis, no?
<gildor> yes, so that is not missing
<thelema_> the AB stuff
<gildor> indeed
<gildor> have you commited the resulting _oasis file, maybe I can make some comment about it
<thelema_> Oasis might be able to cut down the number of repetitions of new module names in order to include a module (batteries_uni.mllib, batteries.mllib, batteries.ml)
<thelema_> one sec
<gildor> I don't know enough batteries to say that, but I know that some works has been done about this topic in extunix
<gildor> thelema_: while it doesn't use most of the oasis/ocamlbuild stuff, everything seems correct
<gildor> (and in this case it seems a little bit overkilling to have 125KB files...)
<thelema_> building dead code elimination would take some time, and isn't appropriate for a 0.2 product
<thelema_> it's more of a 2.0 feature
<gildor> that was the point of not optimizing the size right now
<gildor> but there is room for improvement
<thelema_> sure, and batteries is plenty big, so the extra distribution size isn't a problem