<companion_cube>
gasche: I don't really see the point of OASIS for simple stuff
<gasche>
my view of OASIS is that it should be the tool that codifies the best practices of the OCaml community
<gasche>
if you do something not too exotic, you fit a use case that has been considered by OASIS
<adrien_oww>
with oasis (or at least ocamlfind), I have cross-compilation support
<gasche>
so you write some metadata to make it happy, and it takes care of "all the rest"
<companion_cube>
gasche: but what does it bring here?
<companion_cube>
I can use ocamlfind with ocamlbuild and a Makefile
<gasche>
well for example, it brings .cmxs support
<gasche>
did you think of the .cmxs in your META file and install target?
<companion_cube>
.cmxs isn't a basic use case
<companion_cube>
ah, you mean deploying the lib as a .cmxs?
<gasche>
yes
<companion_cube>
how would it be loaded? I'm curious
<gasche>
companion_cube: my point is that you don't have to understand how .cmxs work, OASIS will do the right thing regarding them
<companion_cube>
gasche: I don't know how to use .cmxs apart from Dynlink...
<gasche>
(and possibly other aspects of the lifetime of an OCaml piece of code, such as generation of a GODI package)
<gasche>
well they're intended for dynlinking, indeed
<adrien_oww>
gasche: I found a very good reason to not have ocamlfind support in ocamlbuild! pester companion_cube :P
<adrien_oww>
companion_cube: ever seen mfp's ld.so for ocaml?
<companion_cube>
no
<companion_cube>
I don't understand why there are .cmxs in libraries... Dynlink doesn't allow to load something that doesn't register somewhere explicitely
<adrien_oww>
in a few words: dynamic linking for ocaml
<companion_cube>
ah
<companion_cube>
sounds nice
<adrien_oww>
it is
<adrien_oww>
there's a performance penalty at startup but it's not huge (and probably because we have so much useless stuff loaded and done at startup and because it's a very young project)
thomasga has joined #ocaml
<adrien_oww>
with oasis you could tell your software to either link static or shared libraries
<companion_cube>
gasche: I'll honestly think about OASIS if I write a big program with dynamic libs
<companion_cube>
meanwhile, I don't think so
<gasche>
but the point of distributing libraries is to let *others* use it
<gasche>
you don't know what their use case will be
<gasche>
supporting OASIS helps with their use cases, that you don't have to know about and practice yourself
<gasche>
furthermore, if the community-codified practices change in the future, OASIS can start supporting more things without you changing a line of your metadata
<companion_cube>
but I have to learn oasis and list my modules and blablabla
<gasche>
companion_cube: note that you can add arbitrary stuff in your Makefile on top of what oasis generates
<gasche>
# OASIS_START, nothing, # OASIS_STOP, your stuff
<companion_cube>
ah
<gasche>
at "oasis setup" time, oasis will fill the 'nothing' part with its boilerplate
<gasche>
(I personally prefer not to check the boilerplate in the DCVS repository, so I generally keep it out until releases; Daniel Bünzli has a neat script for that)
<gasche>
hm, note that Makefile support is provided by the DevFiles (0.3) plugin
<gasche>
(same thing for _tags and myocamlbuild.ml, of course, if your build system is ocamlbuild)
UncleVasya has joined #ocaml
mattrepl has quit [Ping timeout: 256 seconds]
mcclurmc has quit [Ping timeout: 268 seconds]
zpe has joined #ocaml
spanish has joined #ocaml
<Kakadu>
is it possible to express -rectypes -pp "camlp5o pa_checked.cmo pa_ostap.cmo pa_log.cmo" in _tags file?
<gasche>
note that you can also access your syntax extensions through ocamlfind (which is necessary if they're distributed as third-party libraries), for example "rectypes, syntax(camlp5o), ostap.syntax" (assuming there is an ostap.syntax findlib package)
<gasche>
(but you have to invoke ocamlbuild with -use-ocamlfind then)
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
<gasche>
I understand the semantics of nsplit!
* Kakadu
is studying why this options are not passed to ocamldep
mcclurmc has joined #ocaml
<adrien_oww>
Kakadu: mantis!
<Kakadu>
adrien_oww: It looks more like pebcac
mika1 has quit [Quit: Leaving.]
mika1 has joined #ocaml
Neros has joined #ocaml
<adrien_oww>
Kakadu: could be both :P
beckerb has joined #ocaml
dsheets has joined #ocaml
chambart has quit [Ping timeout: 256 seconds]
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
osnr has quit [Ping timeout: 246 seconds]
speredenn has joined #ocaml
ttamttam has quit [Quit: ttamttam]
skchrko has quit [Quit: Leaving]
_andre has joined #ocaml
ttamttam has joined #ocaml
troydm has quit [Ping timeout: 256 seconds]
ttamttam has quit [Quit: ttamttam]
Tamae has quit [Ping timeout: 268 seconds]
<f[x]>
> with oasis you could tell your software to either link static or shared libraries
<f[x]>
adrien_oww, can you elaborate on that?
<f[x]>
you mean C static libs or what?
<adrien_oww>
no, .cmxa vs. .cmxs
f[x] has quit [Ping timeout: 264 seconds]
Tamae has joined #ocaml
breakds has joined #ocaml
talzeus has quit [Remote host closed the connection]
skchrko has joined #ocaml
speredenn has quit [Quit: Leaving]
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
<gasche>
Kakadu: if you find an issue with OCamlbuild that is not yet reported in mantis, and not unreasonably hard to fix, now is the right time to report it
<gasche>
I fixed a couple issues in preparation of the next release, and I don't mind tackling a couple more
osnr has quit [Client Quit]
<gasche>
(of course other people on the chan are encouraged to come with patches as well)
csakatoku has joined #ocaml
<Kakadu>
gasche: I was busied by mine parser-combinators and I didn't feel enough mind power to go deep to ocamlbuild. But I think I can make test file to reproduce problem
* Kakadu
isvery sad taht ocamlbuild is so unobvious
csakatok_ has quit [Ping timeout: 256 seconds]
weie has quit [Read error: Connection reset by peer]
<gasche>
my absolutely secret plan
<gasche>
is to work through enough issues to get a better mental picture of the tool
<gasche>
and then help with the document
<gasche>
ation
weie has joined #ocaml
<gasche>
(writing in two lines so that people with a highlight on that cursed word don't start harrassing me)
<gasche>
if anyone here is interested in helping with ocamlbuild, wmeyer has developped a very nice library for writing (regression) tests
<gasche>
just contributing a test for a known bug is easy, and already helpful
<gasche>
(it's in ocamlbuild/testsuite in the OCaml distribution sources)
csakatoku has quit [Remote host closed the connection]
<gasche>
Kakadu: the problem is with your _tags file
<gasche>
I think "*.ml" will only match phases where the target is the .ml
<Kakadu>
ah, with 'true' it workd
<Kakadu>
works*
<Kakadu>
BUt what should I write to enable this extensions only for a couple of files?
<gasche>
oh
<gasche>
I see
<gasche>
you used "*.ml" instead of <*.ml>
<gasche>
the former looks for an exact match, the latter is the glob pattern
<gasche>
forget my previous tentative explanation of the problem
<Kakadu>
gasche: Do you know a link to read about prefixes like use_,package_,pkg_ ?
raichoo_ has joined #ocaml
<gasche>
I consider them deprecated since -use-ocamlfind exists
raichoo has quit [Disconnected by services]
raichoo_ is now known as raichoo
<gasche>
before paramtrized tags were added, primitive ocamlfind plugins used to traverse the list of all ocamlfind packages, and add a new tag package_<foo> for each package <foo>
<gasche>
nowadays you can simply use package(foo)
<gasche>
(if -use-ocamlfind is passed, it will simply call "ocamlfind ocamlc" instead of "ocamlc" (same for other commands), and pass the "-package foo" option to ocamlfind)
<gasche>
(if -use-ocamlfind is *not* passed, ocamlbuild will try to emulate ocamlfind's work by calling "ocamlfind query ..." to get the information)
<gasche>
the compiler is not mistaken here, you are
<gasche>
hum
<gasche>
let me cancel what I just said, I did not read the code correctly
<gasche>
still my gut feeling is that you should be worried not about how to silence the warning, but why it happened (probably there is something wrong)
<gasche>
how is 'error' defined?
<MarcWeber>
raise Something
<gasche>
can you show the entire code of its declaration?
<gasche>
if it's "let error = raise Something", you're in trouble
pootler__ has joined #ocaml
<gasche>
(is the line of the error really the "error ()" part of the code you quoted?)
<MarcWeber>
let error() = raise Builtin_error - its used multiple times in that file
pootler_ has quit [Ping timeout: 264 seconds]
ttamttam has joined #ocaml
<flux>
marcweber, (error () : unit)
<flux>
or let error () = (raise Builtin_error : unit)
<flux>
but that's worse probably
<flux>
marcweber, the thing is that you have code that, should it return, would have an indeterminate type.. if you know what you're doing you can just tell it the type and the warning goes away.
<flux>
ah
<gasche>
I think the reason for the warning is the following
<flux>
maybe the problem is thay you have failwith "Argh"; more_code_here ();
<gasche>
if BACKEND_FLASH is not defined
<flux>
more_code_here () is never reached..
<gasche>
your code has the structure
<gasche>
(if .. then fail else fail); more_code
<gasche>
as flux says
<gasche>
not that in the other case, there is a chance for the left of the sequence to not fail horribly
<gasche>
you could rewrite that code to avoid the warning, as such:
<gasche>
(match platform with -> IFDEF FLASH THEN (gen... ; VNull) ELSE raise ... | _ -> failwith ...)
<gasche>
that is, pushing the sequence inside the match, to the only case that does not fail
<Cypi>
(Just adding the type annotation ": unit" at the end of the match seems to work, too.)
<gasche>
of course
<gasche>
I'm not sure which is the best way to fix the warning
<gasche>
if this code is never going to not-fail, I think pushing the sequence inside the match is better
pootler__ has quit [Ping timeout: 246 seconds]
<gasche>
if in the future one of the branches may not-fail, it's better to use an annotation
<MarcWeber>
(raise (FeatureDependsOnDisabledPlatform "add_native_lib") : unit) seems to work
f[x] has joined #ocaml
chambart has joined #ocaml
<ggole_>
Speaking of not returning
<ggole_>
I always thought it would be nice if "impossible" return types were annotated specially
<ggole_>
Say if they were printed 'never
<ggole_>
Instead of the usual 'b or whatever
<orbitz>
ggole_: i think jane st does type never = 'b or somethign
<orbitz>
# Scheduler.go;;
<orbitz>
- : ?raise_unhandled_exn:bool -> unit -> Core.Std.never_returns = <fun>
<ggole_>
Ah, that's doing the same thing manually
pootler_ has joined #ocaml
<gasche>
I would be surprised if it was exactly the same thing
<gasche>
I suspect they have rather defined type never_returns = { absurd : 'a. 'a }
<gasche>
(which is an entirely reasonable way to handle that)
<ggole_>
I think I see: the named type is used because a type ariable will be printed as just 'b if the value is bound elsewhere
<ggole_>
(And that type foo = 'a doesn't type check)
<orbitz>
ah ok
<orbitz>
I should learn ocaml's type system better
chambart has quit [Ping timeout: 260 seconds]
<orbitz>
although i'm fearful of getting too godo in it, i like how much i can accomplish knowing so little :)
travisbrady has joined #ocaml
ttamttam has quit [Quit: ttamttam]
gal_bolle has joined #ocaml
raichoo has quit [Quit: leaving]
osnr has quit [Quit: Leaving.]
smondet has joined #ocaml
pootler_ has quit [Ping timeout: 260 seconds]
osa1 has joined #ocaml
hkBst has quit [Quit: Konversation terminated!]
csakatoku has joined #ocaml
darkf has quit [Quit: Leaving]
mika1 has quit [Quit: Leaving.]
Yoric has quit [Ping timeout: 264 seconds]
wwilly has quit [Remote host closed the connection]
UncleVasya has quit [Remote host closed the connection]
ollehar has quit [Ping timeout: 256 seconds]
UncleVasya has joined #ocaml
gal_bolle has quit [Quit: Page closed]
pootler_ has joined #ocaml
UncleVasya has quit [Remote host closed the connection]
UncleVasya has joined #ocaml
UncleVasya has quit [Remote host closed the connection]
ontologiae has quit [Read error: Connection reset by peer]
raichoo has joined #ocaml
UncleVasya has joined #ocaml
UncleVasya has quit [Remote host closed the connection]
gautamc has quit [Read error: Connection reset by peer]
Kakadu has quit [Quit: Konversation terminated!]
gautamc has joined #ocaml
ontologiae has joined #ocaml
jknick has quit [Ping timeout: 256 seconds]
csakatoku has quit [Remote host closed the connection]
<MarcWeber>
Which is the correct way to run deriving preprocessor?
<MarcWeber>
-pp deriving fails on my source file - I remember having used camlp4o pa_deriving or such in the past? Did I use an alternative implementation?
Patchou has joined #ocaml
Zeev has joined #ocaml
Tamae has quit [Ping timeout: 248 seconds]
Zeev has quit [Client Quit]
<orbitz>
MarcWeber: is it a camlp4o thing?
<orbitz>
in which case you can do -pp 'camlp4o pa_deriving' i believe
<MarcWeber>
After running make I do no longer find the pa_* - there is a syntax/deriving executable which also works on simple examples
<MarcWeber>
I don't depend on it ..
Kakadu has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
Patchou has quit [Ping timeout: 256 seconds]
ttamttam has left #ocaml []
<hcarty>
gasche: Is it possible to define custom parameterized tags with ocamlbuild?
_andre has quit [Quit: leaving]
csakatoku has joined #ocaml
<hcarty>
gasche: I have a simple rpath plugin here - https://gist.github.com/hcarty/5198467 - and it would be nice/cool to be able to extend it to support something like '<**.*>: rpath(/some/path)' in _tags.
csakatoku has quit [Ping timeout: 252 seconds]
eikke has joined #ocaml
eikke has quit [Read error: Connection reset by peer]
ollehar1 has quit [Ping timeout: 248 seconds]
ollehar has joined #ocaml
ggole_ has quit []
Neros has quit [Remote host closed the connection]
<gasche>
but I can look for that (preferably tomorrow)
eikke has joined #ocaml
testcocoon has joined #ocaml
ollehar has quit [Ping timeout: 246 seconds]
eikke has quit [Read error: Connection reset by peer]
Zeev has quit [Ping timeout: 248 seconds]
<gasche>
hcarty: it's the "pflag" function in the PLUGIN module type (ocamlbuild/signatures.mli)
<gasche>
and it is well-documented :]
ollehar has joined #ocaml
ollehar has quit [Ping timeout: 246 seconds]
ollehar has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
skchrko has joined #ocaml
UncleVasya has quit [Quit: UncleVasya]
ollehar1 has joined #ocaml
tani has quit [Quit: Verlassend]
ollehar has quit [Ping timeout: 256 seconds]
ollehar1 has quit [Ping timeout: 264 seconds]
tane has joined #ocaml
ttamttam has joined #ocaml
Tobu has quit [Ping timeout: 256 seconds]
ttamttam has quit [Client Quit]
<hcarty>
gasche: Thank you! That's exactly what I'm looking for. When I wrote that snippet I ended up trying to implement pflag by hand. I need to dig more deeply into the sources next time.
<hcarty>
And in some magical future we'll be able to have a myocamlbuild.ml that looks like: "let () = Rpath.dispatch (); Static_link.dispatch (); Other_custom_plugin.dispatch ()"
<hcarty>
Then everyone will be happy and peaceful bliss will settle over the multitude of OCaml build tools.
Tobu has joined #ocaml
ollehar has joined #ocaml
<hcarty>
Then again, oasis makes all of this a bit redundant. I should find the time to submit all of this as a proper oasis patch to add support for these features.
<hcarty>
oasis could be a nice way to circumvent ocamlbuild's lack of support for external modules in a myocamlbuild.ml. I wonder if it it would be too ugly to have oasis inline external files into its generated myocamlbuild.ml. That could simplify the maintenance and composition process when several extensions are involved.
eni has quit [Ping timeout: 256 seconds]
oriba has joined #ocaml
Snark has quit [Quit: leaving]
raichoo has quit [Quit: leaving]
bernardofpc has quit [Read error: Connection reset by peer]
smondet has quit [Quit: leaving]
travisbrady has quit [Quit: travisbrady]
Tamae has joined #ocaml
tane has quit [Quit: Verlassend]
csakatoku has joined #ocaml
Zeev has joined #ocaml
csakatoku has quit [Ping timeout: 248 seconds]
Drup has quit [Quit: Leaving.]
testcocoon has joined #ocaml
testcocoon has quit [Client Quit]
testcocoon has joined #ocaml
testcocoon has quit [Client Quit]
ohama has quit [Quit: leaving]
ohama has joined #ocaml
ohama has quit [Disconnected by services]
Drup has joined #ocaml
testcocoon has joined #ocaml
ohama has joined #ocaml
testcocoon has quit [Client Quit]
testcocoon has joined #ocaml
ulfdoz has quit [Ping timeout: 264 seconds]
alxbl has quit [Remote host closed the connection]
alxbl has joined #ocaml
testcocoon has quit [Client Quit]
testcocoon has joined #ocaml
venk has joined #ocaml
<ollehar>
If we in Java have an object which we change through state, and in OCaml instead have a record where we produce a new record each time we change something, will the Java version be more efficient?
testcocoon has quit [Quit: Coyote finally caught me]
testcocoon has joined #ocaml
testcocoon has quit [Client Quit]
testcocoon has joined #ocaml
testcocoon has quit [Client Quit]
testcocoon has joined #ocaml
testcocoon has quit [Client Quit]
testcocoon has joined #ocaml
ohama has quit [Disconnected by services]
Yoric has quit [Ping timeout: 256 seconds]
ohama has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
testcocoon has joined #ocaml
testcocoon has quit [Client Quit]
testcocoon has joined #ocaml
testcocoon has quit [Client Quit]
testcocoon has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
testcocoon has joined #ocaml
testcocoon has quit [Client Quit]
testcocoon has joined #ocaml
testcocoon has quit [Client Quit]
testcocoon has joined #ocaml
testcocoon has quit [Client Quit]
testcocoon has joined #ocaml
testcocoon has quit [Client Quit]
testcocoon has joined #ocaml
csakatoku has joined #ocaml
eikke has joined #ocaml
csakatoku has quit [Ping timeout: 256 seconds]
Drup has quit [Quit: Leaving.]
Drup has joined #ocaml
bernardo1pc has joined #ocaml
bernardo1pc is now known as bernardofpc
dsheets has joined #ocaml
Zeev has quit [Ping timeout: 248 seconds]
ontologiae has joined #ocaml
<hcarty>
ollehar: That likely depends on the specifics of the object/record and the type of update being performed.
venk` has joined #ocaml
<ollehar>
No compiler magic being performed?
<hcarty>
ollehar: If you do a functional update on the OCaml record (let new_record = { old_record with field = modified_field_value }) then the 'cost' of the update is low.
<ollehar>
Why so?
ontologiae has quit [Ping timeout: 264 seconds]
<hcarty>
Because everything other than 'field' is shared between old_record and new_record. new_record has the same contents (physically the same) as old_record aside from field.
<hcarty>
But, again, the contents of 'field' and how it is being updated may affect the relative cost of a functional update vs mutation.
venk has quit [Ping timeout: 264 seconds]
<hcarty>
If 'field' is a giant array of data which needs to be copied to avoid mutation then mutation will be faster.
<ollehar>
ok
Netfeed has quit [Ping timeout: 260 seconds]
<ollehar>
You know of a link about this (could be good for my blog)?
<ollehar>
(or I might just include this chat, if you don't mind)
Netfeed has joined #ocaml
<hcarty>
ollehar: Go for it. It's not the most eloquent description but if it's helpful you're welcome to use it.
<ollehar>
Good, thanks :)
eikke has quit [Ping timeout: 264 seconds]
Drup has quit [Read error: Connection timed out]
csakatoku has joined #ocaml
<pippijn>
(Program not linked with -g, cannot print stack backtrace)