adrien 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 | Public logs at http://tunes.org/~nef/logs/ocaml/
thelema has quit [Ping timeout: 246 seconds]
thelema has joined #ocaml
jamii has quit [Read error: Connection reset by peer]
leoncamel has quit [Ping timeout: 252 seconds]
<pippijn> how can I get rid of this warning:
<pippijn> <W> Grammar extension: in [expr] some rule has been masked
leoncamel has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
ulfdoz_ is now known as ulfdoz
emmanuel__ has quit [Quit: emmanuel__]
emmanuelux has joined #ocaml
as has quit [Quit: as]
Neros_ has quit [Read error: Operation timed out]
tane has quit [Quit: Verlassend]
madroach has quit [Ping timeout: 244 seconds]
madroach has joined #ocaml
eikke has quit [Ping timeout: 252 seconds]
as has joined #ocaml
Yoric has joined #ocaml
gustav__ has quit [Remote host closed the connection]
vulck has quit [Quit: Leaving]
mjonsson has quit [Ping timeout: 260 seconds]
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
thelema has quit [Remote host closed the connection]
thelema_ has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
leoncamel has quit [Ping timeout: 252 seconds]
leoncamel has joined #ocaml
sepp2k has joined #ocaml
answer_42 has joined #ocaml
answer_42 has left #ocaml []
gnuvince has quit [Ping timeout: 264 seconds]
cross has joined #ocaml
as has quit [Quit: as]
Kakadu has joined #ocaml
ocp has joined #ocaml
cdidd has quit [Remote host closed the connection]
cdidd has joined #ocaml
srcerer has quit [Ping timeout: 245 seconds]
covi has joined #ocaml
thelema_ has quit [Read error: Operation timed out]
thelema has joined #ocaml
Yoric has quit [Ping timeout: 246 seconds]
thelema has quit [Ping timeout: 246 seconds]
srcerer has joined #ocaml
Snark has joined #ocaml
thelema has joined #ocaml
thelema has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
thelema has joined #ocaml
srcerer_ has joined #ocaml
srcerer has quit [Ping timeout: 246 seconds]
ocp has quit [Ping timeout: 246 seconds]
leoncamel has quit [Ping timeout: 260 seconds]
Oejet has joined #ocaml
larhat has joined #ocaml
xavierm02 has joined #ocaml
mindbender1 has joined #ocaml
leoncamel has joined #ocaml
Anarchos has joined #ocaml
Snark has quit [Ping timeout: 246 seconds]
Snark has joined #ocaml
ontologiae has joined #ocaml
Oejet has quit [Quit: Leaving.]
thelema has quit [Ping timeout: 260 seconds]
Neros_ has joined #ocaml
thelema has joined #ocaml
thelema has quit [Read error: Connection reset by peer]
thelema has joined #ocaml
eikke has joined #ocaml
<pippijn> I don't know how else to ask, so I'll just ask again: does anybody know how to get rid of this warning: "<W> Grammar extension: in [expr] some rule has been masked" from this grammar extension: http://paste.xinu.at/wvsYGE/
bru has joined #ocaml
__lrk__ has joined #ocaml
<Anarchos> pippijn no idea
bru has quit [Remote host closed the connection]
fusillia has joined #ocaml
tane has joined #ocaml
andreypopp has joined #ocaml
mfill has joined #ocaml
ocp has joined #ocaml
mindbender1 has quit [Quit: Leaving.]
ocp has quit [Ping timeout: 245 seconds]
deu5 has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
<wieczyk> pippijn: maybe it is due to level?
<pippijn> hmm
<pippijn> what levels are there? where can I find that information?
<wieczyk> w8
<wieczyk> I dont know how to get list of levels and some explanasions, but I see some other levels in source of some syntax extensions.
<wieczyk> Give me a second.
<wieczyk> I have used '+' level :D
<wieczyk> I think that the "top" level is too high, you probably are interested in the ,,application'' level.
<pippijn> hmm
<wieczyk> But i dont know what name it has.
<wieczyk> maybe %app ? :D
mjonsson has joined #ocaml
<wieczyk> Hm, good syntax extensions would be something similar to haskell infix notation for functions
<wieczyk> instead of writing 'List.for_all p xs' would be possible 'p `List.for_all` xs'
<wieczyk> another syntax extension, maybe in core language, are SML's local declarations.
<wieczyk> It is just nice syntax
__lrk__ has quit [Quit: __lrk__]
eikke has quit [Ping timeout: 265 seconds]
<pippijn> wieczyk: local declarations?
<wieczyk> local
<wieczyk> let id x = x
<wieczyk> let f x = x + x
<wieczyk> in
<wieczyk> let global_decl x = f (id x)
<pippijn> ah
<pippijn> yes, that's nice
<pippijn> basically:
<wieczyk> It is much more readable than
<pippijn> let global_decl = let id x = x and f x = x + x in fun x -> f (id x)
<wieczyk> let global_decl x = let ... in ...
<wieczyk> yes.
<pippijn> I don't really agree
<wieczyk> Why/
__lrk__ has joined #ocaml
<pippijn> because the latter will let you indent functions that belong to the global decl
<Kakadu> hey. Can you tell me why type t there is not in generated file? http://paste.in.ua/7730/raw/
<wieczyk> local
<wieczyk> [inent] id x = x
<wieczyk> [indent] let f x = x + x
<wieczyk> in
<wieczyk> let global_decl x = ...
<wieczyk> ?
<pippijn> no
<pippijn> the "local/in" block looks separate from global_decl
<wieczyk> Hard to say, yes it is before global declartion, but seeing ,,local'' keyword and with proper indentation you can easily localize the global declaration.
<wieczyk> But in my point of view
<wieczyk> it would be better to have locals after the global declaration, like 'where' in haskell
<wieczyk> The first one is more readable for me.
<wieczyk> In second it is hard to see where main declarations starts, and if you dont want to use arguments of main declarations in local definitions
<wieczyk> you need to use 'fun x ->', as in your example, what looks ugly for me.
<pippijn> wieczyk: actually
<pippijn> I agree
<pippijn> and ocaml generates better code for true global functions
<pippijn> ocamlopt, that is
<wieczyk> Here is my ideal.
<wieczyk> at bottom
<pippijn> your pastebin is slow
<pippijn> ok, there it is
<pippijn> wieczyk: I don't know..
<pippijn> I like definition before use
<wieczyk> Some local definitions are understable by name, not always need to read definition of local helper.
<wieczyk> For example 'is_even' etc.
<wieczyk> For me, it is more readable to read normal definitions and lookup for notunderstable/interesting helpers.
<wieczyk> But it is taste, proobably each programmer has own definition of good taste :D
<wieczyk> There is some ,,where''-extension for Ocaml, i did not remember how it works.
<wieczyk> btw: I am writing library in Ocaml and I have file 'A.ml'
<wieczyk> what if some project has A.ml and use my library?
<adrien> conflict
<wieczyk> ;/
<adrien> so you can use packs
<adrien> but what is the actual name?
<adrien> if it's Shell, yes, it's a bad idea :P
<adrien> or Graph or ...
<wieczyk> So we wait for namespaes in ocaml.
<pippijn> wieczyk: use packs
<wieczyk> ;]
<adrien> you already have packs
<pippijn> I use packs for almost everything, now
<wieczyk> But does pack solve this problem?
<wieczyk> I think that pack is only a set of archived files
<pippijn> yes
__lrk__ has quit [Quit: __lrk__]
<pippijn> no
<adrien> for lablgtk, that would create Lablgtk.GWindow for instance
<adrien> instead of only "GWindow"
<pippijn> wieczyk: pack makes one big module out of many modules
<wieczyk> Create from file 'Lablgtk/GWindow.ml' ?
<pippijn> for example, you have A.ml B.ml C.ml
<wieczyk> But how it works? I understand what you told me
<pippijn> and pack it as MyLib
<wieczyk> that
<wieczyk> it just creates an additional module
<wieczyk> Lablgtk.ml
<wieczyk> where it has
<pippijn> then it will be as if you had done cat A.ml B.ml C.ml > MyLib.ml
<wieczyk> module GWindow = ...module.from.file.. GWindow.ml
<wieczyk> ah.
<pippijn> and put "module A/B/C = struct" around each
<wieczyk> So A.ml will be not compiled as seperate compilation unit and puted into pack?
<pippijn> it will
<wieczyk> So it is not
<wieczyk> 14:35 < pippijn> then it will be as if you had done cat A.ml B.ml C.ml > MyLib.ml
<pippijn> "as if"
<wieczyk> But is not true.
<pippijn> the effect is the same
<wieczyk> Because if I would do
<pippijn> the resulting .cmx/.cmo/.cmi files are as if you had done that
<pippijn> but you don't lose separate compilation
<pippijn> because you pass -for-pack MyLib to the compiler
<adrien> wieczyk: how it works <- for native code, you need to add a -for-pack Foo option to the command-line: it works with no magic :-)
<pippijn> and then -pack when linking
<wieczyk> Sorry internet.
<adrien> you should try it on a simple example, it'll take you five minutes or so and you'll understand pretty well
<wieczyk> Moment, we need to distinguish ,,how it is compiled'' between ,,how to use tools to create a pack'
<wieczyk> I have
<wieczyk> Lib/A.ml
<wieczyk> Lib/B.ml
<wieczyk> Lib/C.ml
<wieczyk> or
<wieczyk> Lib/A.ml
<wieczyk> B and C are not important in our discussion :D
<wieczyk> I can do something like this:
<wieczyk> Lib.ml with 'module A = A'
<wieczyk> It allow me to address the A module as 'Lib.A'
<pippijn> wieczyk: yes, and pack does the same, except the A module will be gone
<wieczyk> but still.. Lib/A.ml is compiled as Lib/A.cmo and conflict can occur.
<wieczyk> Hm.
<wieczyk> How it is done that it is done?
<wieczyk> gone*
<pippijn> you don't install A.cmo
<pippijn> only Lib.cmo is installed
<wieczyk> Lib.cmo or Lib.cma?
<pippijn> whatever
<pippijn> Lib.cma is just an archive with Lib.cmo in it
<pippijn> (and not A.cmo)
<wieczyk> I understand.
<wieczyk> I thought that Lib.cma will contain artifical Lib.cmo and A.cmo
<wieczyk> Interesting.
<wieczyk> So, finally
<wieczyk> I can use normal module names in library
<wieczyk> ?
<Kakadu> http://paste.in.ua/7730/raw/ So, any ideas about my ocamlyacc problem? Why `type t` is not in generated file?
<pippijn> Kakadu: yes
<pippijn> Kakadu: %{%} code is never it the .mli
<pippijn> only in the .ml
<wieczyk> Yeah.
<wieczyk> I have one another question about libraries :-)
<pippijn> Kakadu: what happens if you write %{ let foo = 3 %}
<pippijn> and it would output that into the .mli?
<pippijn> that would not compile
andreypopp has quit [Quit: sleep]
<pippijn> Kakadu: you need to make a separate "ast.ml" or something
<wieczyk> In Java languaes we have 'package' and the ,,protected'' access modifier in class definitions
<Kakadu> okay
<wieczyk> allows to use those member from package, but denies it from outside package.
<pippijn> wieczyk: not in ocaml
<wieczyk> Can I achieve something similar with packs?
<pippijn> I don't think so
<wieczyk> ;/
<wieczyk> It would be nice in my opintion.
<pippijn> yes, it would
<wieczyk> Thanks for your time.
<wieczyk> This packing mechanism
<wieczyk> It is possible to put own Lib.mli file?
<wieczyk> Because it would allow us to do the ,,protected'' trick.
<pippijn> hmm
<pippijn> I'm not sure, maybe you can
<wieczyk> Ok I will check it later.
<pippijn> because the pack is just a .cmx/.cmo
<pippijn> so you could make a .mli and make a .cmi out of it
<pippijn> but I don't know :) you can try it and let us know
BiDOrD has joined #ocaml
BiDOrD_ has quit [Ping timeout: 268 seconds]
<deu5> Have any of you use ocaml for write web app ?
andreypopp has joined #ocaml
<wieczyk> I dont like webapps, but I heard about Ocsigen framework for Ocaml.
<wieczyk> It has nice tool - 'js_of_ocaml' which allow you to write client-side application in ocaml (it is compiled to javascript), I believe it is good thing.
<wieczyk> OK, one more question about packs :-)
<wieczyk> Can I add some global definitions in my library, for example
<wieczyk> instead of forcing use to
<wieczyk> open Lib.SomeModule
__lrk__ has joined #ocaml
<wieczyk> allow type
<wieczyk> open Lib
<wieczyk> to get some basic definitions?
__lrk__ has quit [Client Quit]
andreypopp has quit [Quit: sleep]
andreypopp has joined #ocaml
__lrk__ has joined #ocaml
andreypopp has quit [Client Quit]
leoncamel has quit [Ping timeout: 252 seconds]
emmanuelux has joined #ocaml
leoncamel has joined #ocaml
__lrk__ has quit [Quit: __lrk__]
<pippijn> wieczyk: I don't think so
lambdas has joined #ocaml
gustav__ has joined #ocaml
mfill has quit [Quit: leaving]
ocp has joined #ocaml
ontologiae has quit [Ping timeout: 245 seconds]
gnuvince has joined #ocaml
The_third_man has joined #ocaml
__lrk__ has joined #ocaml
__lrk__ has quit [Quit: __lrk__]
fraggle_laptop has joined #ocaml
fraggle_laptop has quit [Remote host closed the connection]
Yoric has quit [Ping timeout: 256 seconds]
Kakadu has quit []
ocp has quit [Ping timeout: 268 seconds]
fraggle_laptop has joined #ocaml
cdidd has quit [Remote host closed the connection]
fraggle_ has quit [Remote host closed the connection]
fraggle_laptop is now known as fraggle_
deu5 has quit [Remote host closed the connection]
fraggle_ is now known as fraggle_laptop
__lrk__ has joined #ocaml
fraggle_laptop is now known as fraggle__
fraggle__ is now known as fraggle_droid
gnuvince has quit [Ping timeout: 246 seconds]
__lrk__ has quit [Read error: Connection reset by peer]
__lrk__ has joined #ocaml
fraggle_droid is now known as fraggle_
fraggle_ is now known as fraggle_droid
__lrk__ has quit [Client Quit]
fraggle_droid has quit [Quit: Quitte]
fraggle_laptop has joined #ocaml
__lrk__ has joined #ocaml
__lrk__ has quit [Quit: __lrk__]
mye has joined #ocaml
andreypopp has joined #ocaml
gnuvince has joined #ocaml
xavierm02 has quit [Ping timeout: 244 seconds]
Xizor has joined #ocaml
xavierm02 has joined #ocaml
__lrk__ has joined #ocaml
__lrk__ has quit [Client Quit]
gnuvince has quit [Ping timeout: 246 seconds]
__lrk__ has joined #ocaml
tani has joined #ocaml
tani has quit [Read error: Connection reset by peer]
sepp2k1 has joined #ocaml
caligula_ has quit [Ping timeout: 245 seconds]
sepp2k has quit [Ping timeout: 246 seconds]
fraggle_laptop has quit [Remote host closed the connection]
mye has quit [Ping timeout: 246 seconds]
travisbrady has joined #ocaml
travisbrady_ has joined #ocaml
mye has joined #ocaml
mye_ has joined #ocaml
travisbrady has quit [Ping timeout: 252 seconds]
travisbrady_ is now known as travisbrady
travisbrady has quit [Quit: travisbrady]
mye has quit [Read error: Operation timed out]
mye_ is now known as mye
__lrk__ has quit [Quit: __lrk__]
walter has quit [Remote host closed the connection]
__lrk__ has joined #ocaml
jamii has joined #ocaml
jamii has quit [Client Quit]
jamii has joined #ocaml
mindbender1 has joined #ocaml
Anarchos has joined #ocaml
<wieczyk> How to deploy a library?
<wieczyk> I see that already installed libraries have both version, native and byte.
<wieczyk> How to prepare a package with ocamlbuild which will compile and install both versions.
<wieczyk> I see that when I type "ocamlbuild .... src/Lib.cma" and then "ocamlbuild ... src/Lib.cmxa" then files from first build are removed.
<wieczyk> Is there some convience how to do this in proper way?
<lambdas> On the few projects I've got, I put archive(byte) and archive(native) fields in my META file.
<wieczyk> META file is recognized by ocamlbuild?
<lambdas> Yes.
<wieczyk> Nice.
<adrien> wieczyk: when you build cma then cmxa with ocamlbuild, it doesn't remove data but only symlinks
<adrien> but you can simply "ocamlbuild foo.cma foo.cmxa"
<wieczyk> lambdas:
<wieczyk> There is no word about META, are you sure that it is for ocamlbuild?
<lambdas> I'm not sure, no :P
<wieczyk> :D
<wieczyk> Ok, could you tell me how to proper install my library?
<adrien> ocamlbuild doesn't know about META files but it now has built-in ability to query ocamlfind
<lambdas> I'm just looking back at stuff that I've already got working.
<wieczyk> There is some switch for some tool to install proper files in proper place?
<wieczyk> lambdas: ok, thanks.
<lambdas> I'm using ocamlfind.
Cyanure has joined #ocaml
<adrien> wieczyk: install using ocamlfind
<adrien> not doing so will make me hunt you, find you, kill you
<adrien> :-)
<wieczyk> sounds like challenge ;p
<wieczyk> pippijn: Did tweaking ,,level'' in camlp4 solve a problem for your?
<adrien> wieczyk: could be, but I'm going to poland next summer
<wieczyk> I will wait....
<wieczyk> adrien: lambdas: Have you some public available example of library without OASIS?
<adrien> wieczyk: with what instead?
<wieczyk> Standard tools.
<wieczyk> Minimalistic library which can be installed as a package for... as I understand for the ocamlfind.
<lambdas> wieczyk: I don't. But thanks for the mention of OASIS. I wasn't even using that! :)
__lrk__ has quit [Quit: __lrk__]
<lambdas> I didn't realise it existed.
<wieczyk> ;]
<adrien> wieczyk: what are standard tools?
<adrien> for you*
<wieczyk> Those from ocaml distribution + ocamlfind.
<adrien> install
<adrien> sorry
<adrien> install:
<adrien> \tocamlfind install your-library-name META your_other_files.cma your_other_files.cm{xa,x,i}
<adrien> done \o/
<wieczyk> COOL
<wieczyk> Thanks.
<wieczyk> Where is a description of META file?
<wieczyk> I cannot find ;/
<wieczyk> man META lol
<adrien> yes!
<adrien> man ocamlfind.conf
<adrien> is a good one too
__lrk__ has joined #ocaml
<wieczyk> Thanks, all works.
<wieczyk> cool
<wieczyk> but modules from library are not visible :D
<wieczyk> but i will solve it by my self
Yoric has joined #ocaml
ng__ has joined #ocaml
<wieczyk> OK, I dont know why
<adrien> ocamlfind install only copies files
<ng__> Is it possible use "n--" in ocaml?
<wieczyk> ng__: decr
<wieczyk> ng__: well, if you are asking about syntax then no
<ng__> for example , while n--
<_habnabit> ng__, that's not typically how one loops in ocaml
<wieczyk> adrien: i have src/StringPainter.mlpack which contains "Basic", the src/Basic.ml exists
<wieczyk> adrien: I builded StringPainter.cma and .cmxa without problems, installed by ocamlfind without problem
<wieczyk> adrien: #require "stringpainter" works, but no module is visible, why?
<pippijn> 19:49 < adrien> ocamlbuild doesn't know about META files but it now has built-in ability to query ocamlfind
<pippijn> ocamlbuild has too many built-in abilities
<pippijn> wieczyk: I didn't try tweaking level, yet
<pippijn> I was busy with my build system
<pippijn> and then I had dinner
<wieczyk> ;]
<pippijn> and now I'm back to build system
<pippijn> and I still don't know the solution to my problem with it
<wieczyk> ;]
<wieczyk> Well, It is frustrating when I do not know what I did wrong, and there is no good example.
<adrien> pippijn: that a build system understand the standard way to query packages is too much?
<pippijn> adrien: if it's built-in in a way that can't be done in user extensions, it's bad
<pippijn> oasis has similar "built-in knowledge" issues
<pippijn> it has a hard-coded list of file extensions that may produce .cmi files
<pippijn> which is: .ml .mli .mly .mll .mlp (I'm not sure about the last one)
<pippijn> let me check
<pippijn> without .mlp
<pippijn> [".ml"; ".mli"; ".mll"; ".mly"]
<pippijn> so if you have anything else, such as .mlp (preprocessed with cpp), .ml.nw (noweb), .atd (for atdgen) or anything else that generates ml files, you lose
<pippijn> you get warnings you can't turn off and you need to manually provide for the things oasis does automatically for .ml files (such as -for-pack)
<adrien> pippijn: user extension for what _everything_ should use?
<adrien> that's utterly useless
<pippijn> adrien: no
<pippijn> adrien: it should be implemented as built-in user extension
sgnb` has quit [Read error: Connection reset by peer]
<pippijn> not as deeply buried knowledge in ocamlbuild
<adrien> wieczyk: what does ocaml output when you "#require "stringpainter""
sgnb` has joined #ocaml
<pippijn> so that users can override or re-implement it
<adrien> pippijn: what makes you believe it's buried deeply?
<pippijn> I don't know about ocamlfind support
<adrien> are you aware that the ocamlfind support has been added quite late
<adrien> ?
<pippijn> no
<pippijn> now I am
<wieczyk> 20:39 < adrien> wieczyk: what does ocaml output when you "#require "stringpainter""
<pippijn> maybe it's good
<wieczyk> see my second pastebin
<adrien> it can't be _that_ deep when it was added years in
<adrien> and iirc it isn't deep
<adrien> wieczyk: ok, saw it now
<adrien> wieczyk: tip
<adrien> module X = StringPainter;;
<pippijn> one very simple thing that you can apparently not do yourself is output custom messages when generating code
<wieczyk> adrien: ?
<pippijn> instead of writing the entire command line, only writing the generated file name
<adrien> wieczyk: run that after requiring the module
<adrien> wieczyk: you can also run "ocamlobjinfo your.cma"
<wieczyk> # open StringPainter.Basic;;
<wieczyk> Error: Unbound module StringPainter
<wieczyk> at my second pastebin
<wieczyk> Why 'module X = StringPainter' is a tip when the StringPainter is unbound?
<pippijn> a build system shouldn't be much more than a graph and functions to operate on it
<pippijn> it can have any number of built-ins that provide standard functionality, but it should be possible for a user to recreate the exact same thing
<adrien> wieczyk: ah, sorry, hadn't seen it was StringPainter that was unbound (packing my stuff for a flight tomorrow)
<pippijn> adrien: where are you going?
<adrien> wieczyk: run ocamlobjinfo your.cma
<adrien> pippijn: AMS
<pippijn> nice
<adrien> as in Amsterdam's airport
<pippijn> my birth town
<adrien> not really
<adrien> I'm going to the airport
<pippijn> what are you doing at the airport?
<adrien> then hotel, then airport, then hotel, then airport
<pippijn> oh
<pippijn> In 1985 the first personal audio player was offered to passengers, along with noise cancelling headphones in 1989
<pippijn> I want those headphones back
<pippijn> now you get shitty headphones that hurt your ears after 2-3 hours
<pippijn> I guess first class gets them
<adrien> wieczyk: can you access ANSI_Colors directly?
<adrien> pippijn: carry your own noise-cancelling headphones
<wieczyk> adrien: No, any module from implementation is not visible
<adrien> pippijn: and/or get these: http://www.audilo.com/bouchons-ER20-standard.html
<pippijn> I have those
<pippijn> similar ones
<pippijn> but they are not useful when you want to listen to music or watch a film
<adrien> wieczyk: make clean, pipe your build-command to | tee foo.log, try again
jamii has quit [Quit: Leaving]
<adrien> wieczyk: sorry, no time to try to build
<wieczyk> 'make'
<adrien> but if you can pastebin the build log, that's much better for me
<wieczyk> ok
<wieczyk> | tee ?
<pippijn> make 2>&1 | tee build.log
<pippijn> adrien: what are you doing with in-flight entertainment?
<adrien> pippijn: too many different things
<adrien> wieczyk: and now when you install, it doesn't work?
<wieczyk> As you could see.
<adrien> I'm wondering if there was some leftover stuff that didn't get properly recompiled and afaik your current build log looks good
<adrien> wieczyk: I mean, if you try again _now_
<adrien> but first:
<adrien> ocamlfind remove stringpainter
<wieczyk> no ;]
<adrien> hmm, btw, how did you install ocaml?
<wieczyk> apt-get install ocaml
<wieczyk> It is a bit frustraing. Why findlib does not give any basic example of library whch works.
<wieczyk> I could compare where is a difference.
<adrien> hmmm, no
<adrien> /usr/local/lib/ocaml/3.12.1/stringpainter: added to search path
<adrien> /usr/local/lib/ocaml/3.12.1 isn't a path for something installed through apt-get
<adrien> you can emulate "ocamlfind install" with mkdir and cp -r, nothing more needed
<wieczyk> Things installed by user are always going to /usr/local/lib, it is NOT a problem with paths.
__lrk__ has quit [Quit: __lrk__]
<wieczyk> It is why manually installed library by ocamlfind goes to /usr/local. Other libraries are here and it works.
<adrien> well, you said you had used apt-get
<wieczyk> For ocaml yes.
<adrien> but not for ocamlfind?
<wieczyk> As you cn see in logs ocaml is installed in /usr
<wieczyk> ocamlfind is also from apt
<wieczyk> but it seems that it is configured to install libraries to /usr/local (it is proper)
<adrien> blah
<wieczyk> ocaml libraries from apt go to /usr/lib
<adrien> stoopid configuration
<wieczyk> ocaml libraries compiled by user go to /usr/local/lib
<wieczyk> IMHO it is not stupid, but it does not matter.
<adrien> I hate that it has to be different again and maybe it does not matter but it can
<wieczyk> Other libraries are also compiled by my self
<wieczyk> and they works.
<adrien> wieczyk: ocamlbrowser -I $(ocamlfind query stringpainter)
<wieczyk> modules are not visible here ;/
<wieczyk> % ls
<wieczyk> cil/ lambda-term/ pa_where/ stringpainter/ stublibs/ utop/ zed/
<wieczyk> % ocamlbrowser -I $(ocamlfind query zed)
<wieczyk> modules from Zed are visible
<wieczyk> ;/
<wieczyk> Hm
<wieczyk> I think that I should provide also .mli or .cmi files in library
<wieczyk> lTerm provides .cma .cmx many .cmi and .mli files
<adrien> oh
<adrien> right, you forgot the .cmi probably
<wieczyk> But why they are not in .cma?
<adrien> yup
<wieczyk> It is a bit weird archive.
<adrien> install: .cma, .cmxa, .cmi, .cmx
<wieczyk> .cmx also?
<adrien> when packing, you won't need all the .cmi
<adrien> .cmx are optional but allow inlining
<wieczyk> mhmh
<wieczyk> ok
<adrien> open a .cmx in a text editor
<wieczyk> Thanks for your time.
<pippijn> how does native code linking work?
<pippijn> if you have a stubs lib
<yezariaely> is there any useable Qt binding available? lablqt is just a proof of concept with some basic widgets
<adrien> np, missing .cmi is a quite common thing to forget, I should have seen it earlier
<pippijn> yezariaely: no
<adrien> wieczyk: actually I wonder if you don't need .o too
<adrien> erf, hold on
<wieczyk> adrien: if yes, then for what is .cmxa?
<pippijn> yezariaely: I was working on one, but didn't get very far
<pippijn> maybe later
<wieczyk> adrien: but ok, I will check it by the empirical way
<adrien> .a
<yezariaely> pippijn: so what GUI do you use? Gtk?
<pippijn> yes
<adrien> wieczyk: look at the size of files and look at them in a text editor
<pippijn> lablgtk is very good
<pippijn> but I don't make ocaml guis
<adrien> .a for native code
<yezariaely> pippijn: is there any component similar to QGraphicsView?
<wieczyk> adrien: why some libraries gives .mli and .cmi, not only .cmi?
<adrien> .so are for C bindings and bytecode
<adrien> wieczyk: so you can read the .mli files
<adrien> it's a good practice
<wieczyk> ok
<wieczyk> no required, only good habbits
<adrien> and .o can be needed in some circumstances
<pippijn> so, e.g. I have ncurses.ml and ml_ncurses.c
<adrien> (when you build a module as .cmx iirc)
<pippijn> I build a libncurses_stubs.a out of the .c file and an ncurses.cmxa out of the .ml file
<pippijn> anything else? should I link them together somehow?
mye has quit [Ping timeout: 246 seconds]
mye_ has joined #ocaml
mye_ is now known as mye
<adrien> cmi
<wieczyk> adrien: works
<wieczyk> adrien: thanks
<adrien> =)
<pippijn> ah, ocamlmklib
<wieczyk> It seems to be very hardly to use findlib directly in some big projects.
<wieczyk> I will check how OASIS works.
<wieczyk> many libraries use it, probably useful.
<adrien> pippijn: first time you build C bindings yourself?
<pippijn> yes
<adrien> pippijn: http://yaxm.org/!fmonnier+ocaml+wrap
<pippijn> am I supposed to get a search engine?
ocp has joined #ocaml
<pippijn> ok, first entry I guess
<adrien> =)
<gustav__> Why can I do this?: let a x n = if n > 0 then x x n-1;;
<Qrntz> gustav__, can you? that doesn't compile.
<gustav__> I haven't tried compiling it.
<pippijn> it won't compile, because (x x n) - 1 is int
<Qrntz> then I don't see how you «can»
<pippijn> so you need to provide an else branch
<gustav__> Code in the interpreter is ok when the same code is ok in the compiler, correct?
<gustav__> And vice versa.
ontologiae has joined #ocaml
<gustav__> pippijn: Nope.
<pippijn> yep.
<gustav__> Same error.
andreypopp has quit [Quit: sleep]
<gustav__> Before any else.
<pippijn> in addition to that, x x n doesn't work
rhodesd has joined #ocaml
<gustav__> That's #1 problem. But why?
<pippijn> well
<pippijn> f x
<pippijn> what type is f?
<gustav__> "Compile" is really the wrong verb. I'm not trying to compile it. It's in the interpreter.
<gustav__> fun?
<pippijn> fun is not a type, it's a keyword
<pippijn> try again
<gustav__> ('a -> 'a) ?
<pippijn> almost
<Qrntz> gustav__, it does not interpret either
<gustav__> 'a -> unit ?
<gustav__> Qrntz: True.
<pippijn> let a f x = f x
<pippijn> what is the type of f?
<gustav__> 'a -> 'b.
<pippijn> yes
<pippijn> so what is the type of x?
<gustav__> 'a.
<gustav__> Hmm.
<pippijn> right
<pippijn> so what happens if you write
<pippijn> let a f = f f
<pippijn> what is the type of f?
<gustav__> 'a. Oh.
<pippijn> it needs to be both 'a and 'a -> 'b
<gustav__> But I want f to be type 'a -> 'b.
eikke has joined #ocaml
<gustav__> Eh. This can't be done...
<gustav__> Type system is fucked.
<Qrntz> lol
<pippijn> how would you do that in another type system?
<gustav__> So that it works.
<gustav__> Fight the power. Duuude.
<pippijn> well how do you imagine that works?
<pippijn> so let's consider you can do that
<pippijn> what would f do with f?
<gustav__> It would apply f.
<Qrntz> not sure if trolling…
<gustav__> Well thanks.
<pippijn> gustav__: so what would the result of that application be?
<gustav__> pippijn: f code with f as first argument, whatever that argument is called.
<pippijn> okay, you know what
<pippijn> show me what you want to do
<pippijn> this abstract talking isn't leading anywhere
<gustav__> Can't. There's a constraint for ya.
<gustav__> Can't look inside the box.
<pippijn> why can't?
<gustav__> Haven't thought of a problem yet.
<gustav__> I made QA program for my desktop. It's quite nice. Don't know what do or make of the data though.
<pippijn> so you call the type system fucked because it can't do something that structurally makes no sense and that has no actual application in real code
<gustav__> I'm always dissatisfied with everything so I thought it would be best if I record it.
<pippijn> then I think Qrntz can now be sure
<Qrntz> yeah, it's pretty clear now
<gustav__> A server, then.
<gustav__> It's a loop construct.
<gustav__> Event loop.
<pippijn> okay, how about you write some pseudo code
<pippijn> for that event loop
<gustav__> let waitloop d = if not d then waitloop (process) else printf "We're done!";;
<pippijn> yes
<pippijn> that makes sense
<gustav__> Well. That's not the same problem but anyway.
<pippijn> somewhat
<pippijn> at least from a type system's point of view, that code is fine
<gustav__> Same problem not same construct.
<gustav__> Sure. But the body or what you call it, isn't defined. So it doesn't like it.
<gustav__> Can't reference itself.
<pippijn> ah
<pippijn> that problem is solved by adding "rec" after "let"
<pippijn> so it can be recursive
<gustav__> Hmm.
<gustav__> Why do I have to be explicit?
<adrien> to avoid mistakes
<pippijn> that, and so you can do this:
<pippijn> let f x = x + 1
<pippijn> let f x = f x * 2
<pippijn> in the second f, f refers to the first f
ulfdoz has quit [Ping timeout: 260 seconds]
<gustav__> True. I can't refer out of my let then? That could be added?
<gustav__> I know you don't want to, but anyway.
<pippijn> you can refer to anything that is in your lexical scope
<gustav__> Recursions are so nice. If not optimized a disaster of course.
<pippijn> tail recursion in ocaml is optimised very well
<gustav__> let f = 1 in let f = 2 in echo f'1;; <-- Would print first f defined.
<gustav__> f'1 or f/1 or something or whatever.
<gustav__> prev f1;;
<gustav__> Something.
<gustav__> Can I work with the scope?
<gustav__> Like in an assoc list?
<pippijn> no
<pippijn> that would be extremely fragile
<gustav__> Maybe.
ng__ has quit [Quit: Leaving]
<gustav__> I really, really wonder how OCaml can help me solve problems. Real, problems.
<gustav__> There aren't really any great tools for dealing with lots of strange data... like some from Facebook, some from PGSQL, and so on...
<gustav__> I should try the other PGSQL lib for OCaml. The one I'm using now isn't that great.
<gustav__> The other, I think, promises to integrate types from PGSQL in OCaml and vice versa. I think.
<gustav__> Would be nice if standard OCaml could be parallellized, instead of inventing special syntax. I think the syntax of match ... has some promise. Internally you could have multiple listeners for the ("match x") x parameter.
<gustav__> So that I can read many arguments at the same time and run the |Some |None whatever in different threads.
<gustav__> Like how i7 processors read instructions from memory.
<gustav__> Preempt.
<gustav__> Haven't coded enough OCaml to say if that happens a lot though.
<gustav__> Probably needs a bigger context.
<gustav__> That's not really a real problem but it could speed up real code, today, if it could be implemented.
<gustav__> I'm not happy with "adapting" code for multiproc env for instance. Would you rewrite Shakespeare for 2012? Some do that, sure. But the original is still there.
<gustav__> Just not the same thing.
<gustav__> Everything that works a list could probably be mangled enough to be parallellized.
<gustav__> Theoretically.
Snark has quit [Quit: Quitte]
mindbender2 has joined #ocaml
<gustav__> Comment if you want.
<gustav__> Is the OCaml source easy to understand/well written? (For a reference I don't think GLIBC is well written.)
sgnb`` has joined #ocaml
sgnb` has quit [Read error: Connection reset by peer]
mindbender1 has quit [Ping timeout: 252 seconds]
<adrien> yes
<adrien> but
<adrien> ocaml = compiler + standard library + tools
<adrien> expect variations
<gustav__> Sure.
<gustav__> Gonna have a look... is it big? o_O
<gustav__> My head already hurts.
<adrien> ocaml = compiler + standard library + tools
<adrien> many architectures
<adrien> so it has to be not that small
<adrien> but I doubt you'll want to read everything at once
<gustav__> What's the chain from ocaml my.ml to "Hello world" on the terminal?
Yoric has quit [Ping timeout: 252 seconds]
andreypopp has joined #ocaml
<wieczyk> Why ocamlbuild documentation is so not complete?
<wieczyk> What the hell is a .odoc target and how it is connected to ocamlbuilds .odocl
<wieczyk> Ok, I understand.
Cyanure has quit [Remote host closed the connection]
<wieczyk> pippijn: it is possible to provide own Lib.mli, so the ,,protected'' trick should be possible
<pippijn> nice
<wieczyk> But I dont know how to provide correct Lib.mli
<wieczyk> so it is very early and eager news ;]
mindbender1 has joined #ocaml
mindbender2 has quit [Ping timeout: 240 seconds]
mindbender1 has quit [Ping timeout: 252 seconds]
<pippijn> what should I use for utf8 encoding and decoding?
Ptival has quit [Ping timeout: 276 seconds]
mfp has quit [Ping timeout: 252 seconds]
SanderM has joined #ocaml
milosn has quit [Ping timeout: 246 seconds]
mfp has joined #ocaml
sepp2k1 has quit [Remote host closed the connection]
ocp has quit [Read error: Operation timed out]
tane has quit [Quit: Verlassend]
mindbender1 has joined #ocaml
chambart has joined #ocaml
Ptival has joined #ocaml
chambart has quit [Ping timeout: 246 seconds]
eikke has quit [Ping timeout: 255 seconds]
fraggle_ has joined #ocaml
lolcathost has joined #ocaml
xavierm02 has quit [Quit: Leaving]
eikke has joined #ocaml
lolcathost has quit [Ping timeout: 265 seconds]
SanderM has quit [Remote host closed the connection]
lolcathost has joined #ocaml
mye has quit [Quit: mye]
andreypopp has quit [Quit: sleep]
ontologiae has quit [Ping timeout: 260 seconds]
as has joined #ocaml
<pippijn> what's this: Error: Forward reference to Factory in file ccActions.cmx
<pippijn> I can't find anything on google
lolcathost has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
emmanuelux has quit [Ping timeout: 246 seconds]