gnuvince has quit [Read error: Operation timed out]
gnuvince has joined #ocaml
ivan\ has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ivan\ has joined #ocaml
xenocons has quit [Quit: leaving]
munga has joined #ocaml
bobzhang1988 has joined #ocaml
madroach has quit [Ping timeout: 265 seconds]
Guest85212 is now known as henux
henux has quit [Changing host]
henux has joined #ocaml
TechCel has quit [Ping timeout: 240 seconds]
Progster has joined #ocaml
xenocons has joined #ocaml
munga has quit [Read error: Operation timed out]
contempt has quit [Ping timeout: 250 seconds]
contempt has joined #ocaml
emmanuelux has quit [Quit: emmanuelux]
bobzhang1988 has quit [Ping timeout: 252 seconds]
Progster has quit [Ping timeout: 246 seconds]
bobzhang1988 has joined #ocaml
Progster has joined #ocaml
Progster has quit [Ping timeout: 252 seconds]
ankit9_ has joined #ocaml
bobzhang1988 has quit [Ping timeout: 250 seconds]
ulfdoz has joined #ocaml
sepp2k has joined #ocaml
ankit9_ has quit [Quit: Leaving]
ulfdoz has quit [Ping timeout: 252 seconds]
ontologiae has joined #ocaml
pango is now known as pangoafk
djcoin has joined #ocaml
Cyanure has joined #ocaml
rejabber has quit [Quit: leaving]
ftrvxmtrx has quit [Quit: Leaving]
BiDOrD_ has joined #ocaml
ontologiae has quit [Ping timeout: 244 seconds]
BiDOrD has quit [Ping timeout: 245 seconds]
cdidd has quit [Read error: Operation timed out]
Cyanure has quit [Remote host closed the connection]
ankit9_ has joined #ocaml
wagle has quit [Read error: Operation timed out]
eni has joined #ocaml
ftrvxmtrx has joined #ocaml
wagle has joined #ocaml
Cyanure has joined #ocaml
Submarine has joined #ocaml
Cyanure has quit [Ping timeout: 245 seconds]
munga has joined #ocaml
silver has joined #ocaml
mika1 has joined #ocaml
Cyanure has joined #ocaml
ontologiae has joined #ocaml
Submarine has quit [Ping timeout: 244 seconds]
eni has quit [Ping timeout: 246 seconds]
eni has joined #ocaml
eni has quit [Ping timeout: 246 seconds]
Submarine has joined #ocaml
thomasga has joined #ocaml
Submarine has quit [Ping timeout: 244 seconds]
ocp has joined #ocaml
mnabil has joined #ocaml
mcclurmc_away is now known as mcclurmc
avsm has joined #ocaml
mcclurmc is now known as mcclurmc_away
Guest57254 has joined #ocaml
Guest57254 is now known as akanaka
<akanaka>
Hi! Could somebody help me with ocamlnet and point out to any doc or sample online of how to setup (the simplest way) a Basic auth in http client?
rgrinberg has quit [Ping timeout: 240 seconds]
beckerb has joined #ocaml
<ontologiae>
akanaka: let setLoginPass ~l:l ~p:p = Http_client.Convenience.http_user := l ; Http_client.Convenience.http_password := p; ()
ocp has quit [Quit: Leaving.]
<akanaka>
ontologiae: Merci, will use this. Does the same globals works with pipeline interface (in my samples it doesn't work, but may be I missed something (just started to study this subject)) or it needs separate initialization?
wagle has quit [Read error: Operation timed out]
wagle has joined #ocaml
<ontologiae>
akanaka: never used it in pipeline. But you can look at his code, his module conveniance use pipeline if I remember
<akanaka>
merci again, will dive now into the code for investigation...
Progster has joined #ocaml
eni has joined #ocaml
Progster has quit [Ping timeout: 244 seconds]
eni has quit [Ping timeout: 256 seconds]
mcclurmc_away is now known as mcclurmc
<pippijn>
ontologiae: ~l:l can be abbreviated to ~l
avsm has quit [Read error: Operation timed out]
madroach has joined #ocaml
_andre has joined #ocaml
ankit9_ has quit [Quit: Leaving]
ocp has joined #ocaml
<ontologiae>
pippijn: thx for the tip, I didn't know !
wagle has quit [Ping timeout: 244 seconds]
xcombelle has joined #ocaml
hongboz has joined #ocaml
Progster has joined #ocaml
xcombelle has quit [Quit: I am a manual virus, please copy me to your quit message.]
hongboz has quit [Remote host closed the connection]
wagle has joined #ocaml
munga has quit [Read error: Operation timed out]
gnuvince has quit [Ping timeout: 250 seconds]
gnuvince has joined #ocaml
ocp has quit [Quit: Leaving.]
Kakadu has joined #ocaml
avsm has joined #ocaml
avsm has quit [Client Quit]
avsm has joined #ocaml
<ontologiae>
I'm thinking about a big problem in my 10KLOC Ocaml app i'm writing. It's a document management system, and so I have a LOT of string
<thelema>
ontologiae: do you need faster string concat/slicing for long strings?
sepp2k has quit [Ping timeout: 246 seconds]
<ontologiae>
thelema: no it's not a problem of performance
<ontologiae>
I'm looking for a way to _type_ my string
<ontologiae>
if one string represents a car and one another a dog, i would like to be sure that the compiler doesn't compile
<thelema>
you need to differentiate between different strings?
<thelema>
Another way to do this is with lots of private types: module CarString : sig type t val to_string : t -> string val of_string : string -> t end = struct type t = string let to_string x = x let of_string x = x end
<pippijn>
jane street uses phantom types to encode default values
<Drakken>
thomasga okay, thanks. topfind is in $CAMLLIB, but ocaml can't ocaml find it.
<Drakken>
Is CAMLLIB locked in at compile time?
<adrien>
no
<adrien>
there's a default search path
<adrien>
but OCAMLLIB is an env var
<adrien>
see "man ocamlrun"
<thomasga>
(how people are using topfind when they don't have admin rights on their machine ?)
<thomasga>
(I mean, how do they install it)
<Drakken>
I put everything in ~/ocaml/
<ssbr->
Is it weird to want to have a camlp4 rule that calls itself recursively to build some intermediate structure, but is wrapped in some finalization procedure if the rule is invoked from outside?
<ssbr->
e.g. to have a logical expression syntax, but anybody that allows you to insert a logical expression only sees that expression in CNF when they get a value
<ssbr->
(even though it might be in any form)
<ssbr->
not sure if I'm making myself clear. Basically I wish I didn't have to do "x = some_rule -> wrap x" every tile I invoke some_rule
<Drakken>
ssbr- why can't you call wrap in some_rule?
<Drakken>
because it's recursive?
<ssbr->
Drakken: oh, heh, right
<Drakken>
just define wrap_some_rule and call that
<ssbr->
I could have it do [[ x = real_some_rule -> wrap x]]
<adrien>
Drakken: hmm, in ocaml, ok, there's a #command to add a dir
<adrien>
or use -I when calling ocaml
<samposm>
which gives best error messages, ocaml or ocamlc? (I think ocamlopt gives very short error messages only)
<Drakken>
adrien that's not necessary, is it? Shouldn't it work as is if I fix something?
<adrien>
prefer -I to $CAMLLIB or $OCAMLLIB
<adrien>
much clearer
<adrien>
samposm: ocamlopt!
<adrien>
samposm: they give the same error messages
<orbitz>
adrien: I thought short error messages was one of the optimizations in ocamlopt :)
<adrien>
orbitz: nah, they had nothing to optimize more :P
<orbitz>
Haha
<samposm>
another question: what to put in .ocamlinit to load library from a subdir of the current working dir?
mcstar has joined #ocaml
<samposm>
(or just putting an absolute location is ok, too)
<samposm>
ah, #directory is the directive I need. thanks
K_F has quit [Ping timeout: 240 seconds]
K_F has joined #ocaml
<Drakken>
Hmm. I set OCAMLLIB to std-lib, but now ocaml can't find pervasives.cmi.
<Drakken>
Does that mean topfind was installed in the wrong directory?
<f[x]>
why do you mess with ocamllib?
<adrien>
Drakken: how did you configure ocaml? what does "ocamlc -where" say?
mnabil has quit [Remote host closed the connection]
<samposm>
err, when I use toplevel interactively, I have libraries, but when I run a scrip (ocaml script.ml), it does not find my libraries. what's going on?
<thelema_>
-rw-r--r-- 1 root root 1357 Jun 7 15:54 /usr/local/lib/ocaml/topfind
<Drakken>
adrien ocamlc -where points to $OCAMLLIB, which I changed to std-lib in my ocaml lib directory.
<samposm>
f[x]: can I make it to?
<f[x]>
Drakken, your CAMLLIB doesn't point to std-lib
K_F has quit [Ping timeout: 240 seconds]
<f[x]>
Drakken, if you configure things manually, then you probably know what you are doing?
<Drakken>
f[x] but it didn't. I had a godi directory in my ocaml direcory, so findlib/configure's heuristic thingy tried to put stuff in there.
<f[x]>
samposm, try passing it with explicit -init option
<Drakken>
I deleted /godi/ from the directories, but I didn't delete /std-lib.
<samposm>
f[x]: I tried, does not work
<f[x]>
samposm, no, that won't work
<f[x]>
then specify all the libs in the script - that's robust
<thelema_>
#use "~/.ocamlinit" in the script?
<f[x]>
except the tilde thingy
<thelema_>
sure
<Drakken>
thelema_ I guess I should have specified the lib directory explicitly when I installed findlib. I tried it without args and then edited Makefile.config.
<Drakken>
I guess that didn't work :(
<f[x]>
> edited Makefile.config
<f[x]>
why?
<f[x]>
how?
<Drakken>
because it had a bunch of /godi/ directories.
<Drakken>
with emacs
<adrien>
how could it have that?
<f[x]>
and why did you think it was wrong?
<f[x]>
obv. because ocaml was installed via godi?
xcombelle has joined #ocaml
<Drakken>
the findlib installer heuristic probably saw the godi directory and assumed I was using godi.
<adrien>
it has no heuristic afaik
<f[x]>
the findlib installer doesn't have any such heuristics
<f[x]>
show `ocamlc -where`
<adrien>
but if you have godi in your path while installing another installation, you're doing something bad
<Drakken>
only because the findlib installer assumed I was using it.
<samposm>
thelema_: yes, that works. but is there any way to get the same sourcefile to work both for ocaml and ocamlopt?
<adrien>
no
<adrien>
Drakken: where is godi installed?
<f[x]>
samposm, not without extra handwork
<Drakken>
adrien in <ocaml-prefix>/godi
Progster has joined #ocaml
<Drakken>
along with bin, man, etc, lib, and odb
<adrien>
what is the value of $PATH when you configure ocamlfind?
<Drakken>
adrien well, I changed it in .bashrc, but there's still a bunch of godi directories in PATH of the shell I installed findlib from.
<adrien>
you _have_ to fix that
<thelema_>
samposm: no.
<thelema_>
samposm: this, to me, is a significant weakness of the ocaml programming environment, with at least two solutions
<thelema_>
1) someone comes up with a bit of magic that wraps ocamlopt (and ocamlc) that looks for #require directives and translates them into -package foo for ocamlfind
<adrien>
the "ocaml" binary accepts input from stdin
<adrien>
and you sed over it :P
<thelema_>
2) both the toplevel and compilers gain support for a magic comment (or other new syntax) that indicates compilation and linking dependencies
malc_ has quit [Quit: leaving]
<thelema_>
adrien: sed over the input to 'ocaml' to ... do what?
<adrien>
add comments like
<adrien>
(*#include "foo";;*)
<adrien>
strip the comment markers (or even the first one only)
<thelema_>
to uncomment the directives... yes, that may work.
<thelema_>
except you'd still need that information to be entered in the command line to compile such a program
<adrien>
you could extract it through a wrapper but I don't consider that a big issue since one can use the shell's history
<samposm>
thelema_: ok, thanks for explaining
<thelema_>
I wonder if ocamlbuild/ocamldep could be extended reasonably to auto-detect (*#require "foo"*) and turn it into an ocamlfind dep
<thelema_>
the other reasonable thing would be to have ocamlc and ocamlopt ignore #-directives
<thelema_>
this would remove the need of pre-processing the comments.
<samposm>
I quite much miss end-of-line comments
<thelema_>
samposm: me too, I wonder if there's a mantis bug we can vote up...
<ousado>
adrien: hi again, re yesterdays question, what would be a/the alternative to relying on module evaluation to register plugins?
<samposm>
I am kind of thinking about sume dirty perl solution to just preprocess the source file
<thelema_>
hmm, no mantis bug that I can find
<avsm>
thelema_: OCamlMakefile did the preprocess-first-line trick with (* pp, but its a little fragile
<avsm>
since editors also want that
<thelema_>
avsm: well, first n lines for n ~~ 20 generally solves the conflict
<avsm>
yeah. would be nice to not have to impose that on the source file if possible though
hcarty has quit [Ping timeout: 245 seconds]
<avsm>
between ocamlbuild, ocamlfind, _tags, there's got to be *somewhere* to stash it ;-)
<thelema_>
yes, but having it anywhere outside the source file means it's grouped wrong. like having parallel arrays vs. array of tuples
hcarty has joined #ocaml
<Drakken>
So info in findlib.conf gets hard-coded in when you install findlib.
<thelema_>
Drakken: yes, findlib executable has defaults hard-coded in when it's compiled, these can be overridden by findlib.conf and/or environment variables
<thelema_>
and/or command-line parameters
<Drakken>
thelema I changed findlib.conf, but I still had to recompile.
<Drakken>
thelema_
<thelema_>
Drakken: iird, some constants get set based on configure in the topfind script; these cannot be changed except by editing topfind or reconfiguring
<Drakken>
thelema_ apparently that includes destdir and/or path
<thelema_>
:( opam still uses findlib? I thought that with all the tracking of packages it does, it wouldn't need findlib.
<avsm>
for now. findlib is essential to wrap existing packages
<avsm>
opam doesnt touch the build system of individual packages yet
* thelema_
imagines opam providing a fake ocamlfind binary, but there's just so many options to findlib that it'd be a ton of work
silver has quit [Remote host closed the connection]
<avsm>
findlib is definitely the least evil of all the ocaml build tools. it is, at least, predictable :)
<thelema_>
all unpredictabilities in any computer program are the result of insufficient understanding of "what's going on"
<thelema_>
so saying that findlib isn't terrible because it's predictable...
<thelema_>
doesn't say much.
<flux>
so what's terrible about findlib?
<thelema_>
the maze of code that makes it work is my biggest problem
<thelema_>
it is amazingly featureful, but it's grown a ton of cruft
<flux>
maybe building ocaml programs is just a more complex task than it should be :)
<thelema_>
totally agreed. A simple "require" declaration for outside packages that can be put in source files and the ability for required packages to have deps... this would go a long way
<mcstar>
is there something like 'with-open-file' in stdlib?
<flux>
thelema_, how about byte compilation/native compilation/debug packages, camlp4, camlp5, ..
<thelema_>
?
<flux>
mcstar, no
<flux>
batteries iirc has one, though
<mcstar>
thx
<mcstar>
ill check it out
<thelema_>
mcstar: ah, I see; yes, use batteries, as flux said
<thelema_>
flux: all packages should be compiled in debug mode, so that's not an issue
<thelema_>
pre-processing should also be declared as part of this requires pattern, and not externally to the file being compiled by default
ankit9_ has joined #ocaml
<thelema_>
byte vs. native shouldn't be a problem; the simplest implementation of this "require" would be to have "require foo" add "-I +foo" to compile and "foo.cma/cmxa" to link depending on compiler
<thelema_>
if you try to native compile against a library that doesn't provide .cmxa, the link error could be spruced up to be more useful to beginners
<thomasga>
thelema_: seems that you are trying to rebuild ocamlfind again :-)
thomasga has quit [Quit: Leaving.]
<thelema_>
thomasga: the backend is looking like ocamlfind, yes.
<thelema_>
but without the extreme configurability
<thelema_>
without the longest match labels resolution
<thelema_>
s/labels/predicates/
<flux>
thelema_, how about profiling?-)
<flux>
and multithreading/non-multithreading
eni has joined #ocaml
<thelema_>
flux: a simple convention works here too - foo.prof.cmxa
<flux>
and then the biggest: how about the tons of packages providing findlib data?
<thelema_>
if a library needs threads, it can depend on a "threads" package that turns on compilation with threads
djcoin has quit [Quit: WeeChat 0.3.2]
<thelema_>
as for backwards compatibility, I wish we were in a land where every package had a nice META file
<thelema_>
there's a shift right now, and many packages are being rewritten with _oasis
<thelema_>
I don't see a problem for _oasis to parse these same #requires to figure out most of the package's structure without as much of an _oasis file being written
mcclurmc is now known as mcclurmc_away
<thelema_>
Packages using findlib can still use findlib. ocamlfind will still work on top of this system (well, maybe it won't know that some package sets multithreaded compilation)
<thelema_>
But I'm just making stuff up off the top of my head, this all needs to be thought out a bit better.
<avsm>
thelema_: i like the ocamlbuild %.p.cmx %.d.cmx convention, but it hasnt been plumbed all the way through to %.p.cmx, so doesnt actually work. would be great to see somethign that does that properly
gnuvince has quit [Ping timeout: 255 seconds]
gnuvince has joined #ocaml
avsm has quit [Quit: Leaving.]
pangoafk is now known as pango
Submarine has joined #ocaml
<mcstar>
is there a way, for ocaml packages to put their documentation at one place?
<mcstar>
and why isnt it installed in the first place?
<thelema_>
mcstar: installed documentation is handled... inconsistently
<mcstar>
shame
<thelema_>
I'm mostly satisfied with online documentation
<mcstar>
ok
ontologiae has quit [Ping timeout: 246 seconds]
eni has quit [Quit: Leaving]
<mcstar>
im trying to use gsl from the toplevel
<mcstar>
without success
<mcstar>
i can link against gsl, by providing the -package gsl to findlib
<mcstar>
but i cant load the .cma file, to use the binding interactively
<adrien>
no!
<adrien>
#use "topfind";;
<mcstar>
:(
<adrien>
#require "gsl";;
<mcstar>
i have topfind
<mcstar>
ah require
<mcstar>
ill try
<adrien>
it's written on the screen right after you "#use "topfind";;
<adrien>
"
<mcstar>
ill be damned, its working
<mcstar>
ok ok
<mcstar>
dont be mad
<mcstar>
im once again in your debt
<mcstar>
actually, there is nothing written after "#use "topfind";;
<mcstar>
im using utop
TechCel has joined #ocaml
<adrien>
- : unit = ()
<adrien>
Findlib has been successfully loaded. Additional directives: #require "package";; to load a package
<adrien>
arf, irssi ate one line feed
<mcstar>
adrien: i know thats what it says
<mcstar>
but not in utop
Progster has quit [Ping timeout: 260 seconds]
<mcstar>
anyway, i just wanted to add that, to compensate my bad behavior