ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml-lang.org
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 265 seconds]
lggr has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 245 seconds]
ulfdoz_ is now known as ulfdoz
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 276 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 272 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
iago has quit [Quit: Leaving]
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
avsm has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
rwmjones has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
jamii has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 245 seconds]
rwmjones has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
madroach has quit [Ping timeout: 272 seconds]
lggr has joined #ocaml
madroach has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
avsm has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
dwmw2_gone has quit [Excess Flood]
dwmw2_gone has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
rgrinberg has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 276 seconds]
lggr has joined #ocaml
<rgrinberg> is it good/bad practice to have type synonyms in your code?
<rgrinberg> for example type xxx = int, where xxx is something more descriptive
<_habnabit> good practice
<_habnabit> you can even make it an opaque type in your .mli file
<_habnabit> so e.g. just type xxx in your .mli but type xxx = int in your .ml
<rgrinberg> ya thought as much. i used to do it a lot because it made function signatures look a lot clearer
<rgrinberg> but then i discovered labelled arguments...
<rgrinberg> and using both seems a little redundant
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
<_habnabit> no, it's still really helpful there
<_habnabit> if you later decide to change the underlying type, you won't have to go fix a bunch of signatures
<rgrinberg> and in the cases where you're sure the underlying type will not change?
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
avsm has joined #ocaml
paolooo has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
<_habnabit> no harm in extra documentation
Jeaye has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
avsm1 has joined #ocaml
lggr has joined #ocaml
avsm has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
Progster has quit [Ping timeout: 246 seconds]
avsm1 has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 272 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
Jeaye has quit [Quit: WeeChat 0.3.9]
Jeaye has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
rgrinberg has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 256 seconds]
mjonsson has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
rgrinberg has quit [Quit: Leaving]
lggr has joined #ocaml
lggr has quit [Ping timeout: 265 seconds]
paolooo has joined #ocaml
avsm has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
avsm has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
emmanuelux has quit [Quit: emmanuelux]
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
cdidd has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
Neros_ has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 265 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
paolooo has quit [Quit: Page closed]
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
Snark has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
lggr has quit [Ping timeout: 248 seconds]
Jeaye has quit [Quit: WeeChat 0.3.9]
lggr has joined #ocaml
ontologiae has joined #ocaml
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
djcoin has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
ontologiae has quit [Ping timeout: 255 seconds]
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
ftrvxmtrx has joined #ocaml
lggr has joined #ocaml
ftrvxmtrx has quit [Client Quit]
chambart has joined #ocaml
GnomeStoleMyBike has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
ocp has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
ankit9 has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
mcclurmc1 has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
ftrvxmtrx has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
ontologiae has joined #ocaml
ankit9 has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
trotro has joined #ocaml
lggr has joined #ocaml
sepp2k has joined #ocaml
Kakadu has joined #ocaml
Kakadu has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
ansx_ has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
ansx has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
thomasga has quit [Read error: Connection reset by peer]
thomasga1 has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
fraggle_ has quit [Quit: -ENOBRAIN]
fraggle_ has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
Yoric has quit [Quit: Instantbird 1.3a1pre -- http://www.instantbird.com]
Yoric has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
cdidd has joined #ocaml
lggr has joined #ocaml
Yoric has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
ontologiae has quit [Ping timeout: 256 seconds]
ontologiae has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
ankit9 has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
_andre has joined #ocaml
lggr has joined #ocaml
ankit9 has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
sgnb has joined #ocaml
lggr has joined #ocaml
lggr has quit [K-Lined]
malc_ has joined #ocaml
oriba has joined #ocaml
ankit9 has quit [Ping timeout: 248 seconds]
sepp2k has quit [Ping timeout: 246 seconds]
ankit9 has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
sepp2k has joined #ocaml
thomasga has joined #ocaml
thomasga1 has quit [Read error: Connection reset by peer]
Submarine has quit [Ping timeout: 240 seconds]
fraggle_laptop has quit [Quit: Quitte]
fraggle_laptop has joined #ocaml
fraggle_laptop has quit [Client Quit]
fraggle_laptop has joined #ocaml
trotro has quit [Quit: Leaving]
trotro has joined #ocaml
Yoric has joined #ocaml
mjonsson has joined #ocaml
Snark has quit [Ping timeout: 264 seconds]
oriba_ has joined #ocaml
oriba has quit [Ping timeout: 240 seconds]
mjonsson has quit [Remote host closed the connection]
oriba_ has quit [Quit: oriba_]
trotro has quit [Quit: Leaving]
ousado has quit [Ping timeout: 244 seconds]
beckerb has joined #ocaml
<hcarty> Spell checking in the compiler! http://caml.inria.fr/mantis/view.php?id=5768
<adrien> \o/
<hcarty> gasche++
<hcarty> Or incr gasche; ...
<flux> oh it's in :-o
<flux> "what an interesting patch.. too bad it'll never go in.."
<flux> but there it is :)
ng__ has joined #ocaml
<flux> (although I would've liked it to be two patches: one for adding the environment, another for doing the spellcheck)
<ng__> Hello everyone, I'm trying to translate a code in c to ocaml, but gives errors!!!can someone help?
Neros has joined #ocaml
<hcarty> ng__: Go ahead and ask your question(s), you don't have to ask to ask. Can you pastebin the problematic code somewhere? That will probably be necessary to get a good answer.
<ng__> here's the exercise, I'll put my code...
<ng__> here is the code
<ng__> I think my mistake is in calling functions right?
<hcarty> ng__: It's kind of a formatting issue
Neros has quit []
<hcarty> There are a few ways to fix it. You could add ;; after your print lines.
Neros has joined #ocaml
<hcarty> Or you could wrap your code in an outer "let () = ..."
<ng__> how?
<hcarty> ng__: Here's a (mostly untested) edit - http://pastebin.com/EpX68Ds5
<hcarty> ng__: If you have bare expressions outside of a 'let' definition they need to be separated by ;;
<hcarty> ng__: The usual way to handle this is to wrap all expressions in let ... = ...
<ng__> let me see...
<ng__> line 11, characters 6-220:
<ng__> Error: This expression has type unit but an expression was expected of type
<ng__> (('a, out_channel, unit) format -> 'a) -> string -> unit
<ng__> why this error appears?
<hcarty> ng__: What is on line 11?
<hcarty> Or pastebin the whole piece of code ... that looks like it will need some context.
<ng__> if (n==1) then begin
<adrien> use '=', not '=='
<adrien> and no need for parenthesis
<adrien> (that's mostly syntactic remarks)
<hcarty> adrien: Indeed, those both should be changed. But it shouldn't be the cause of the type error.
<hcarty> ng__: Is the using the code I replied with, or something else?
<ng__> hcarty, here is thhe code, I use "=" in line 11
<hcarty> ng__: Sorry - I left an error in there when I made my earlier edit
<ng__> np :D
<hcarty> That works here - I can copy and paste it into the toplevel and it runs and produces output
<hcarty> ng__: http://pastebin.com/U7BHALMj -- same thing but with extraneous ( ) removed
<ng__> Here is my latest code, but is not doing well, you can run?
<hcarty> ng__: You are missing ;; between expressions or wrapping them in let .. = .., as in the example I pasted.
<hcarty> ng__: You either need to add lots of ;; between your statements and definitions, or you need to wrap everything in lets
<hcarty> ng__: Otherwise you end up with ambiguous/incorrect syntax.
<hcarty> ng__: Some of these tutorials may be useful - http://www.ocaml-lang.org/tutorials/index.html
<ng__> hcarty, ah yes, you're right, I'm changing everything, just a little time
<pippijn> oh
<pippijn> I tend to wrap things in lets :)
<hcarty> ng__: Good luck and have fun :-)
<pippijn> actually I tend to wrap things in functions and call one of them in a "let ()"
<hcarty> pippijn: That's definitely the standard approach
<pippijn> that's good to know
<pippijn> also
<pippijn> estrelinhas? :\
<pippijn> public static void 睡觉()
<hcarty> Portuguese maybe?
ftrvxmtrx has quit [Quit: Leaving]
<hcarty> estrelinhas, not 睡觉 :-) I doubt the second is Portuguese
<ng__> thank you very much :D
<ng__> yes
<f[x]> that's zh-PT obv
<ng__> im portuguese
<ng__> :D
<ng__> and you? :D
<pippijn> 我是荷兰人
<Kakadu> f[x]: what is zh-PT obv?
<pippijn> Kakadu: chinese from portugal
<pippijn> obviously
<Kakadu> obviously? R u joking? :)
<pippijn> like zh-CN being chinese from china and zh-TW being from taiwan
<pippijn> "obv" = "obviously"
<Kakadu> aaaa
<pippijn> I'm not joking, just explaining
<hcarty> ng__: I'm across the Atlantic
<f[x]> what he said
<Kakadu> I thought that ovb is a king of abbrevation
<Kakadu> but `obbrevation` :)
<pippijn> I'm across the pacific
<Kakadu> We are across the Universe
trotro has joined #ocaml
ousado has joined #ocaml
<pippijn> how hard would it be to make the ocaml runtime thread-safe?
<Kakadu> ask ocp
<Kakadu> they are doing something about it
<pippijn> is it much more than making some globals thread-local?
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
<ocp> well, if you want good performance, you must change all the primitives to get an extra-argument for the thread-local context
<ocp> instead of using TLS
<ocp> that can be inefficient on some platforms
tufisi has joined #ocaml
<pippijn> ocp: is TLS slow?
<Kakadu> tls=thread local storage?
<pippijn> yes
<ocp> it depends on the system, and how it is implemented
BiDOrD has joined #ocaml
<pippijn> __declspec(thread) is bad, I just learnt
<malc_> ocp: over here TLS access is one ld
<pippijn> it doesn't work with LoadLibrary
<pippijn> but I don't know anything about it or GCC's __thread
<ocp> anyway, there is also the problem of OCaml globals
BiDOrD_ has quit [Ping timeout: 255 seconds]
<pippijn> you mean in ocaml libraries?
ousado has quit [Changing host]
ousado has joined #ocaml
<ocp> well, what is your purpose of making the runtime thread-safe ?
<pippijn> parallelisation
<ocp> the GC is not multi-threaded, so you need to have multiple heaps, so you need to have global values (toplevel modules) in different heaps
<pippijn> ah
<pippijn> yeah
<pippijn> but toplevel modules are immutable, right?
<ocp> if you want parallelisation, you would also need to put locks and memory fences everywhere in the runtime and the libraries
<ocp> toplevel modules can contain mutable values
<malc_> pippijn: what ocp is trying to say boils down to - forget it
<ocp> yeah ;-)
<pippijn> right now I think if I do want parallelisation, I'll spawn new processes
<pippijn> and do message passing
<pippijn> I'm more fond of that idea, anyway
<pippijn> I find it much easier to reason about
Kakadu has quit [Quit: Konversation terminated!]
<ousado> yeah, it's the right thing to do anyway
<pippijn> it seems there is not really an ocaml OS kernel, yet
<pippijn> there is Funk, which is defunct and not nice
<malc_> there are plenty of factorial implementations though
<pippijn> oh, there is DST
<pippijn> but it doesn't seem to exist, anymore
hkBst has quit [Quit: Konversation terminated!]
tac_home is now known as tac
jamii has joined #ocaml
jpdeplaix has quit [Ping timeout: 246 seconds]
tufisi has quit [Read error: Connection reset by peer]
tufisi has joined #ocaml
jpdeplaix has joined #ocaml
Yoric has quit [Ping timeout: 256 seconds]
avsm has joined #ocaml
GnomeStoleMyBike has quit [Ping timeout: 276 seconds]
Cyanure has joined #ocaml
Kakadu has joined #ocaml
Jeaye has joined #ocaml
aod has quit [Quit: leaving]
Zerker has joined #ocaml
djcoin has quit [Quit: WeeChat 0.3.7]
beckerb has quit [Ping timeout: 245 seconds]
<ng__> is giving a result a bit different...
<ng__> what's wrong?
Zerker has quit [Remote host closed the connection]
Zerker has joined #ocaml
GnomeStoleMyBike has joined #ocaml
ousado has quit [Remote host closed the connection]
<Kakadu> ng__: compilation error or what?
ousado has joined #ocaml
Kakadu has quit []
ousado has quit [Changing host]
ousado has joined #ocaml
Kakadu has joined #ocaml
<ng__> Kakadu, error of my conversion :D ... nothing compilation!!!
fraggle_ has quit [Quit: -ENOBRAIN]
trotro has quit [Quit: Leaving]
fraggle_ has joined #ocaml
<Kakadu> use indentation plz
mcclurmc1 has quit [Ping timeout: 246 seconds]
<Kakadu> without it it's unreadable
CoverSlide has quit [Ping timeout: 256 seconds]
<malc_> ng__: your translation is incorrect, precisely because you are fooled by indentation in C code, line 10 is not part of C for loop but is inside the begin end block of for loop in ocaml version
uselpa has joined #ocaml
<ng__> malc Kakadu ok, but continues to give something completely different...
sepp2k1 has joined #ocaml
sepp2k has quit [Ping timeout: 246 seconds]
<Kakadu> ng__: indentation shouldn't correct results. It should make program readable for us
<_andre> does anyone know about this book? http://www.thinkocaml.com/
<_andre> found it by accident, wondering if it's good as a suggestion to someone who wants to learn ocaml
<malc_> ng__: open Printf;; let n, c = print_string "n:"; let n = read_int () in print_string "c:"; let c = read_int () in n, c ;; let rec estrelinhas n c = if n = 1 then begin for i = 0 to c do Printf.printf " "; done; Printf.printf "*"; end else ( estrelinhas (n / 2) (c); Printf.printf "\n"; for k = 0 to c do Printf.printf " "; done; for p=0 to n do Printf.printf "* "; done; Printf.printf "\n"; estrelinhas (n / 2) (c+n) ) ;; let()= Printf.printf "* "; P
<hcarty> _andre: I haven't read it, but there is a decent list here - http://www.ocaml-lang.org/books.html
<hcarty> _andre: Jason Hickey's book is particularly nice
Zerker has quit [Quit: Colloquy for iPad - Timeout (10 minutes)]
Zerker has joined #ocaml
<_andre> hcarty: yeah i know it... i was looking for a gentler introduction to recommend to a friend
<hcarty> I found that really helpful when I started out
<ng__> malc_, let me see
Neros has quit [Remote host closed the connection]
ftrvxmtrx has joined #ocaml
Neros has joined #ocaml
Yoric has joined #ocaml
chambart has quit [Read error: Operation timed out]
<ng__> malc_, It was my mistake, thanks
<ng__> :D
<ousado> "<malc_> there are plenty of factorial implementations though" heh
Neros has quit [Read error: Connection reset by peer]
Neros has joined #ocaml
Snark has joined #ocaml
<malc_> ng__: de nada
<ng__> malc_, Oo :D
ocp has quit [Ping timeout: 246 seconds]
trotro has joined #ocaml
ontologiae has quit [Ping timeout: 255 seconds]
tac has quit [Ping timeout: 245 seconds]
err404 has joined #ocaml
ng__ has quit [Remote host closed the connection]
mcclurmc1 has joined #ocaml
thomasga has quit [Quit: Leaving.]
tac has joined #ocaml
tufisi has quit [Ping timeout: 245 seconds]
ng__ has joined #ocaml
tufisi has joined #ocaml
trotro has quit [Ping timeout: 252 seconds]
trotro has joined #ocaml
tac is now known as tac-tics
metadave has joined #ocaml
ImAlsoGreg has joined #ocaml
uselpa has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
<yezariaely> what module do you use if you have to represent date?
<yezariaely> s/module/library/
<thelema> there's a great calendar library
<thelema> and there's date/time support in core
<thelema> calendar.forge.ocamlcore.org
<yezariaely> thelema: after a dist upgrade I finally have ocaml 3.12.1 installed and can successfully compile batteries ;)
<thelema> yay!
<yezariaely> but there is no date in there!?
<yezariaely> though I found some hints in the previews?
<thelema> ? in calendar?
<yezariaely> no in the batteries
<thelema> yes, there's no date functions in batteries.
<thelema> should there be?
<yezariaely> I don't know. depends on the focus of the library/framework
<yezariaely> Maybe not.
<thelema> batteries has focused on containers and IO more.
<thelema> I thought about putting a calendar library in (well, more specifically, depending on the calendar library) and extending it to play nicely with batteries IO
chturne has joined #ocaml
<yezariaely> sounds like a good idea
<thelema> the reason I didn't was that I was (and have succeeded) at keeping batteries from having too many dependencies, as they were a big problem for people to use batteries
<yezariaely> I totally agree. Is it possible to include calendar in batteries instead of only putting dependencies there?
<thelema> including external libraries into the batteries distribution also seems a poor quality solution
avsm has quit [Quit: Leaving.]
tac-tics has quit [Ping timeout: 245 seconds]
<foo303> Does anyone know how to let ocaml be aware of packages installed by opam while running an ocaml program?
<thelema> what do you mean by "while running an ocaml program"?
<thelema> you're executing opam in your ocaml program
<thelema> and you want to use packages installed by opam in your program?
<foo303> yeah, that's what I want to be able to do.
<foo303> I thought opam is a package manager not a library I use to access packages. (Is there any way to write the code assuming the packages are somehow provided and actually be able to run it, or do I have to add some opam-specific code to get my packages to be visible?)
<thelema> how can ocaml compile your program (including type checking) if it doesn't have access to the libraries
<thelema> the library you should use to access packages is findlib.
<thelema> there's two ways to do what you want: 1) through ocaml's "eval" - using the toploop to execute code that's embedded as strings.
<thelema> or 2) using the dynlink facility, although this will not work for arbitrary opam packages
<foo303> I prefer the first one too, less prone to the kind of problem I'm having right now. :p
cdidd has quit [Remote host closed the connection]
malc_ has quit [Quit: leaving]
<thelema> there's of course restrictions on 1) as well, but they're basically that the code you run will be sandboxed, and it'll be tricky to get values out because you'll have to know their type ahead of time.
<thelema> it'll be possible; it just won't be typesafe.
<thelema> if you get the type wrong, your program will probbaly segfault.
ontologiae has joined #ocaml
<foo303> so 1) seems pretty crappy, if there isn't a proper way to have those types beforehand
<thelema> what do you plan on doing with values of unknown type?
Snark has quit [Quit: Quitte]
<foo303> I was hoping to have things as I do in, say, java
<foo303> just have libraries be precompiled and stored somewhere
<foo303> classpath is set, compile.
<thelema> need much better reflection than ocaml currently provides to do this.
<foo303> i.e. things I do outside the program's code
<foo303> so what's the normal workflow when someone is to decide to use a certain library?
<thelema> install that library, compile against it
<thelema> findlib helps with both
<foo303> install the library using, say, opam, and what use is findlib?
<thelema> findlib does the actual installation, putting it in the right directory with the right metadata so it can be compiled against
<foo303> I'll look at the findlib documentation. I just hoped maybe opam should document this since it's so deceptively simple on their frontpage :p
<thelema> opam does the downloading and building and uses findlib to install
ankit9 has quit [Ping timeout: 246 seconds]
<foo303> ah okay, so opam finishes up the installation. good
<thelema> well, most packages use findlib to install; opam just calls on the package to build and install
<foo303> then I use findlib in my code to get the library loaded?
<thelema> you can use findlib at compile-time to compile against a library
<thelema> or you can use it in the toplevel to use a library interactively
<foo303> right. :) I'll check out both. thanks thelema.
<thelema> you're welcome
<rwmjones> still no gildor? has he gone into hiding?
Yoric has quit [Ping timeout: 252 seconds]
ankit9 has joined #ocaml
_andre has quit [Quit: leaving]
<thelema> rwmjones: I think he's decided not to spend time here.
djcoin has joined #ocaml
ontologiae has quit [Read error: Operation timed out]
Cyanure has quit [Remote host closed the connection]
avsm has joined #ocaml
tac-tics has joined #ocaml
djcoin has quit [Quit: WeeChat 0.3.7]
sepp2k1 has quit [Remote host closed the connection]
mcclurmc1 has quit [Read error: Connection reset by peer]
ankit9 has quit [Quit: Leaving]
ontologiae has joined #ocaml
ng__ has quit [Ping timeout: 240 seconds]
avsm has quit [Quit: Leaving.]
Jeaye has quit [Remote host closed the connection]
Jeaye has joined #ocaml
trotro has quit [Quit: Leaving]
trotro has joined #ocaml
cdidd has joined #ocaml
ng__ has joined #ocaml
chturne has quit [Quit: Leaving]
Kakadu has quit [Quit: Konversation terminated!]
avsm has joined #ocaml
ng__ has quit [Read error: Operation timed out]
ng__ has joined #ocaml
err404 has quit [Remote host closed the connection]
Zerker has quit [Ping timeout: 255 seconds]
ng__ has quit [Ping timeout: 252 seconds]
Yoric has joined #ocaml
ontologiae has quit [Ping timeout: 252 seconds]
Neros has quit [Read error: Operation timed out]
chambart has joined #ocaml
Neros has joined #ocaml
chturne has joined #ocaml
chturne has quit [Read error: Operation timed out]
Neros has quit [Ping timeout: 265 seconds]
Neros has joined #ocaml
chambart has quit [Ping timeout: 245 seconds]
Neros_ has joined #ocaml
avsm has quit [Quit: Leaving.]
Neros has quit [Ping timeout: 245 seconds]
GnomeStoleMyBike has quit [Ping timeout: 260 seconds]
ng__ has joined #ocaml
oriba has joined #ocaml
trotro has quit [Quit: Leaving]
Neros has joined #ocaml
Neros_ has quit [Ping timeout: 246 seconds]