<flux>
I guess some parts of C could handle deprecation better..
<companion_cube>
but how was uint32 defined?
<flux>
ie. I think gcc aswell supports deprecation attributes
<Leonidas>
companion_cube: ok, not really, it was changed in 2014, but for some reason opam picked zarith 1.2
Reshi has quit [Ping timeout: 246 seconds]
<Leonidas>
my (?) bad
malc_ has joined #ocaml
srcerer has quit [Ping timeout: 244 seconds]
sepp2k has quit [Ping timeout: 246 seconds]
jwatzman|work has joined #ocaml
<Leonidas>
I have a code that does a lookup (as a Lwt.t) and it might return that no data was found. Wondering whether to Lwt.return an error variant or use Lwt.fail?
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
<companion_cube>
Leonidas: 'a option Lwt.t ?
<Leonidas>
companion_cube: yes, either this or 'a Lwt.t with Lwt.fail Not_found. Not sure what the downsides of the latter are
<companion_cube>
it's less explicit
<companion_cube>
same as in blocking code actually
<companion_cube>
so I'd do the same: lookup : foo -> 'a option Lwt.t ; lookup_exn : foo -> 'a Lwt.t (** @raise Not_found blabla *)
<Leonidas>
you are right, it's better to return option. Thanks companion_cube :)
<companion_cube>
well it depends on whether you are sure you will find the value, or whether not finding the value is to be expected
yegods has joined #ocaml
<Leonidas>
it is entirely possible to not find the value
yegods has quit [Remote host closed the connection]
<companion_cube>
then option is probably better, yeah
toolslive has quit [Ping timeout: 250 seconds]
sepp2k has joined #ocaml
toolslive has joined #ocaml
malc_` has joined #ocaml
malc_ has quit [Ping timeout: 250 seconds]
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
silver has joined #ocaml
yegods has joined #ocaml
<flux>
well, nowadays it's nice that you can do match with exception, does the lwt extension have that?
<flux>
I'm not saying returning an option isn't better, though, you can always convert it into an exception with Option :)
yegods has quit [Remote host closed the connection]
aantron has quit [Read error: Connection reset by peer]
dsheets has quit [Remote host closed the connection]
aantron has joined #ocaml
yegods has joined #ocaml
sepp2k has quit [Ping timeout: 268 seconds]
mettekou has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
yegods has quit [Remote host closed the connection]
nicholasf has quit [Remote host closed the connection]
kakadu has joined #ocaml
nicholasf has joined #ocaml
dsheets has joined #ocaml
Reshi has joined #ocaml
<Simn>
What's the best way to deal with OCaml 4's "Warning 3: deprecated: String.create Use Bytes.create instead." so that the code can still be compiled using OCaml 3?
noddy has quit [Ping timeout: 252 seconds]
<ggole>
You could just muffle the warning.
<johnelse>
Simn: add a dependency on 'bytes' - newer versions of ocamlfind know what to do with it, even on OCaml 3.*
<ggole>
Or just String.make instead
<ggole>
*just use
dsheets has quit [Ping timeout: 268 seconds]
FreeBird_ has quit [Remote host closed the connection]
Reshi has quit [Ping timeout: 250 seconds]
<Simn>
Thanks, I'll try that.
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
<Simn>
Hmm, that works for create but now I have the same problem with set.
kushal has quit [Quit: Leaving]
<ggole>
If you mutate strings, you should really change the code to use Bytes.
<ggole>
OCaml is slowly making a breaking change to strings to make them immutable.
<ggole>
The use case of strings as mutable buffers will be covered by Bytes.
<Simn>
Yes I understand that and it makes sense, I just don't want to give up on OCaml 3 yet because we have people using it still.
<ggole>
Then you have two choices: mute the warning and put off the changes, or use the 'bytes' compatibility library as johnelse suggested
<ggole>
The second method is by far the cleaner, but of course will be a bit of work.
<Simn>
We don't use ocamlfind anyway, so I guess I'll go for the warning muting even though I don't really like doing that.
<ggole>
Do you not use third-party code?
AlexRussia has joined #ocaml
<Simn>
We do but in a... different way. They are added to a distinct repository which is a git submodule of the application.
<Simn>
That probably sounds totally horrible to you, but it's how I found it!
<ggole>
Yeah, that style of building is somewhat common in some circles.
<Simn>
I'm not opposed to moving it to a more modern way, but several of us have a disability called "Windows" which tends to not make things easier in the OCaml world.
<ggole>
Mmm.
dsheets has joined #ocaml
sepp2k has joined #ocaml
sepp2k has quit [Ping timeout: 260 seconds]
Reshi has joined #ocaml
dsheets_ has joined #ocaml
dsheets has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
noddy has joined #ocaml
<companion_cube>
Simn: just curious, how come you still use OCaml 3? it's really old, all the OSes I know have at least 4.00
nicholasf has quit [Remote host closed the connection]
<Drup>
"I just don't want to give up on OCaml 3 yet because we have people using it still." <- who ?!
<Simn>
companion_cube, I had quite a bit of trouble getting OCaml 4 to work on Windows originally, whereas the 3.11 MSVC version would more or less work out of the box.
<companion_cube>
oh! didn't know that
<companion_cube>
I'm not sure many people still support 3.12, let alone 3.11, though
<Simn>
I'll push for the move to OCaml 4. I'm still trying to get opam to work through cygwin though.
sz0 has joined #ocaml
noddy has quit [Ping timeout: 276 seconds]
<Simn>
The other thing is that we have a camlp4o parser and I think if we move to OCaml 4 properly it might be a good time to modernize that as well.
<companion_cube>
oh, that should work, I have such a cygwin install somewhere
<companion_cube>
what's the parser used for?
<Simn>
Well, parsing... not sure what to reply to that. :D
yegods has quit [Remote host closed the connection]
mettekou has quit [Client Quit]
hcarty has joined #ocaml
nicholasf has quit [Remote host closed the connection]
noddy has joined #ocaml
BitPuffin has joined #ocaml
<_y>
oh Simn, are you working at the Motion Twin?
<Simn>
No, Haxe it not developed by Motion Twin (anymore).
jwatzman|work has quit [Quit: jwatzman|work]
<theblatte>
camlidl doesn't compile with 4.03.0 because of warning 31 now being fatal (camlidl has an array.ml...). Should I report a bug to camlidl or just fix the opam file to add "-w -31" to the ocamlc command?
<_y>
hm right, seems it has grown strong and well :-)
sepp2k has quit [Quit: Leaving.]
ryanartecona has joined #ocaml
sepp2k has joined #ocaml
<adrien>
iii13:22 companion_cu : Simn: just curious, how come you still use OCaml 3? it's really old, all the OSes I know have at least 4.00
<adrien>
s/iii//
<adrien>
and I was about to ask a question related to 3.12.1!
<companion_cube>
:D
<adrien>
# cat /etc/debian_version
<adrien>
7.8
<adrien>
I'm using the toplevel for a script and I can't get a backtrace
<companion_cube>
wow, I have a 7.9 and it's already far too old
<adrien>
(Program not linked with -g, cannot print stack backtrace)
<adrien>
companion_cube: production server
<adrien>
Simn: 4.03 has almost OOTB cross-compilation support to Windows and it should be easy to use that to cross-compile the compiler itself
<adrien>
needs a bit of love but I really believe it's not that much work
<Simn>
I don't know, usually when I try something like that it ends in an afternoon of frustration.
<adrien>
getting the cross-compiler should be 15 minutes of work
<adrien>
cross-compiling the compiler should be some work but not frustrating work
<companion_cube>
adrien: well, me too (personal server with mails, etc.)
dsheets has joined #ocaml
Algebr has joined #ocaml
<adrien>
I've been writing a script to extract some infos that I can later analyze
<adrien>
started as a small awk script, now 400 lines of ocaml
<hcarty>
adrien: The toplevel didn't get backtrace support until some 4.x version. A recent one IIRC
<adrien>
hmm, ok, thanks
<adrien>
well, there's a migration to a jessie-based system planned so I'll wait until then
<toolslive>
yes. that's typically how it goes. 10 lines of bash/sed/awk => 200 lines of python => 400 lines of ocaml
Algebr has quit [Ping timeout: 252 seconds]
<adrien>
I pushed the code on a test machine, installed ocamlc (and its deps) there and got a nice trace :)
<adrien>
toolslive: I'm glad I jumped to ocaml directly :)
AlbertusMinus has joined #ocaml
<toolslive>
yes, I tend to be an optimist.
<adrien>
:)
<hcarty>
adrien: That cross-compilation news is good to hear
<adrien>
yup! :)
<hcarty>
adrien: Is there documentation available? I've been using whitequark's opam repository for my limited Windows-targeting needs so far.
<AlbertusMinus>
hi all, anyone from the Batteries team here?
<adrien>
I only use a few patches on top of 4.03 now; I need to make a bit of doc but the approach I use now relies on what has been done for targetting other platforms
<adrien>
basically it is that you can have an ocamlc that outputs bytecode that works on both platforms
hcarty has quit [Ping timeout: 260 seconds]
yegods has joined #ocaml
<Leonidas>
flux: not that I know of but it'd be really cool
noddy has quit [Ping timeout: 252 seconds]
<Leonidas>
Simn: we used our own build of OCaml 4.02 on Windows
kushal has joined #ocaml
<Leonidas>
but then I moved jobs not to have to deal with Windows
<Simn>
That's one way to do it!
<Leonidas>
adrien: what? OCaml can now cross compile? That'd be fantastic
<Leonidas>
we also couldn't use OPAM b/c of windows.
<Leonidas>
and ctypes.
<adrien>
to unix platforms since 34.02
kushal has quit [Client Quit]
<adrien>
s/34/4/
<Leonidas>
that's a few decades in the future still
<adrien>
(lossy wifi)
<Leonidas>
;)
<adrien>
:)
<companion_cube>
AlbertusMinus: not really, but a release for 4.03 is planned soon, if that's what you're wondering about
<AlbertusMinus>
absolutely ;-) I was eager to make comparisons between 4.02.3, 4.03 and4.03+flambda
<thizanne>
theblatte: what did you do in the end ?
<adrien>
I rotated the laptop 75 degress left and wifi is better now
<theblatte>
thizanne: nothing yet :)
<companion_cube>
AlbertusMinus: I think you can already `opam pin` the master branch
<theblatte>
but I created an account on the ocaml forge to report the bug...
<theblatte>
(hoping that's the right place)
<AlbertusMinus>
companion_cube: I guess I'll wait, I'm not fond of toying around with opam settings. Though, I wonder if there'd be a way to improve the workflow here, between a compiler stable release and a matching release of opam packages
<AlbertusMinus>
here many people must have opam-switched to realize they can't do much as of now with existing projects
ocaml117 has joined #ocaml
<Drup>
a lot of things are already there
<Drup>
missing is mainly batteries and oasis
<thizanne>
theblatte: did you report it ?
<thizanne>
(else I am currently on the page with a working -maybe- patch)
<theblatte>
thizanne: not reported, go for it
hcarty has joined #ocaml
<ocaml117>
Is it impossible to extend a module using an include--or in any way at all--if the module you wish to extend has an opaque type t? I fear it is impossible. Correct?
<Drup>
ocaml117: it's possible, what you give details ?
<Drup>
can*
FreeBird_ has joined #ocaml
<ocaml117>
I wanted some additional functions on an existing library and other than modifying the library just so I can use it elsewhere, I was trying to extend it, but I realize now I cannot.
<ocaml117>
So I guess I'll just hack my own changes and opam pin into the library.
<hcarty>
ocaml117: You can extend the module but you may not be able to do what you want with values of type t. That depends on what functionality is already exposed.
<AlbertusMinus>
Drup: well these are basic libraries and tools so this is heavy... I appreciate the amount of effort so this is by no means a criticism. I know this is not people's main work
<adrien>
you cannot modify an existing module; you can however create a new one which includes the other one and expose it in a similar way
<ocaml117>
The functionality already exposed is insufficient to accomplish the manipulations on type t that I desire.
<Drup>
ocaml117: ah, you want to look inside an abstract type, but outside the abstraction boundary ?
<Drup>
No, you can't, that's by design
FreeBirdLjj has quit [Ping timeout: 260 seconds]
FreeBird_ has quit [Ping timeout: 240 seconds]
djellemah_ is now known as djellemah
rgrinberg has joined #ocaml
Denommus has joined #ocaml
ocaml117 has quit []
hcarty has quit [Quit: WeeChat 1.4]
FreeBirdLjj has joined #ocaml
yegods has quit [Remote host closed the connection]
AlbertusMinus has quit [Quit: Page closed]
ryanartecona has quit [Ping timeout: 250 seconds]
douglascorrea has joined #ocaml
noddy has joined #ocaml
njrt has quit [Quit: Page closed]
sh0t has joined #ocaml
toolslive has quit [Ping timeout: 250 seconds]
groovy2shoes has quit [Ping timeout: 268 seconds]
toolslive has joined #ocaml
<theblatte>
thizanne: thanks for the report :)
kushal has joined #ocaml
<theblatte>
now to investigate the new segfault in biniou...
<thizanne>
I'm not sure my patch is really clean, but I just hope it will motivate xleroy to write a correct one :)
MercurialAlchemi has quit [Ping timeout: 244 seconds]
<companion_cube>
theblatte: does biniou use Obj?
<theblatte>
companion_cube: ah, yes
<companion_cube>
you had me worried for a sec
<theblatte>
:D
<theblatte>
including 5 occurrences of Obj.magic
<def`>
that's why it's better to directly use external "%identity"
<def`>
people look for Obj first :P
mettekou has joined #ocaml
<theblatte>
there's an Obj.set_field in there too
<companion_cube>
oh my.
<theblatte>
anyway, not sure what to report as a bug...
<Drup>
"halp, flambda broke my incorrect code"
<companion_cube>
ẘ^
<companion_cube>
oops
<companion_cube>
^
<Drup>
"Working as intended, closing."
<Drup>
:D
<def`>
Drup: why incorrect?
<theblatte>
Drup: I meant to biniou :)
<Drup>
def`: well, if it suddenly segfault with flambda because it contains Obj.set_field, chances are ...
<def`>
This Obj code could be perfectly valid against the previous model.
<theblatte>
(also, I don't think this is with flambda enabled, I used the 4.03.0 opam switch)
kakadu has quit [Ping timeout: 250 seconds]
<gasche>
def`: are you planning on pushing for TRMC again, or where the performance numbers too inconclusive in the end?
<def`>
gasche: problem is not performance numbers
<def`>
but how to behave with non-linear continuations
<def`>
gasche: I would like to push for exceptions first (this one is useful for existing code), but as we say in this country "j'en ai un peu plein le cul"
kushal has quit [Ping timeout: 260 seconds]
<gasche>
I have plenty of Racketeers around, I'll ask what the Lisp family thinks of the non-linear case
<def`>
thanks
<gasche>
are you speaking of turning non-escaping exceptions into local control?
<gasche>
hm
hxegon has joined #ocaml
<gasche>
or rather, your stack trace work?
<def`>
gasche: also, making the use explicit (putting [@trmc]) seemed to satisfy both uses
Reshi has quit [Quit: WeeChat 1.4]
<def`>
having inlined callsites appear in backtraces
<gasche>
yep
<gasche>
I would also like to push for François' work in 4.04
<gasche>
I mean, his stack-trace-friendly "finally"
<gasche>
if you want to have your work in 4.04, you should hurry :-)
<def`>
"LOL"
<def`>
what's the deadline?
<def`>
please give me feedback about TRMC, I will fix the stack traces.
<toolslive>
@hannes: that pull would be an improvement. janestreet have something similar in core (bigstring) the ideal solution would be some kind of automatic resource management that actually does not create a space leak.
deavid has quit [Ping timeout: 260 seconds]
deavid has joined #ocaml
<toolslive>
something like c++'s unique_ptr would do wonders here.
<ggole>
I don't see how that could be sound
<ggole>
Without adding some kind of lifetime stuff
<pippijn>
with_bigarray (fun arr -> ...)
<ggole>
And then you return arr or stash a reference to it in the heap
<pippijn>
ok
<pippijn>
make it a monad
<pippijn>
with_bigarray state_like_monad_value
nicholasf has quit [Remote host closed the connection]
<def`>
ggole: releasing a bigarray in use could be a runtime error
<def`>
or even completely undefined...
<ggole>
How do you tell it is in use?
<def`>
YOu cannot
<ggole>
As for the latter, that seems no different to unsoundness
<toolslive>
with_ does not scale
<ggole>
I mean, you can do it, but it doesn't seem appropriate for a language like OCaml
<def`>
The exception would be raised at use point.
<def`>
ggole: I won't object to putting the release function in Obj :P
<toolslive>
an alternative is to allow values to be pinned so that the gc will not move them. At that point, you no longer need bigarrays and Bytes.t could be used as a buffer for c libraries too
<ggole>
Seems like it would be expensive - you would have to either tag or retain (until collectible) memory
<ggole>
An unsafe operation would work, I suppose.
Simn has quit [Read error: Connection reset by peer]
<def`>
ggole: not expensive no, it could be like resizing the bigarray to 0 size.
<def`>
The point is being able to release the backing memory, not the object itself.
<def`>
The cost would be that some optimizations are now prevented.
<ggole>
Oh, I see
<ggole>
Hmm.
<toolslive>
currently the backing memory lingers and causes no GC pressure
<ggole>
Because the index is no longer invariant after object creation as arrays currently are?
MercurialAlchemi has joined #ocaml
<def`>
Something like that. More index bounds checking would need to be done.
<def`>
(read Damien Doligez answer at the end of the thread)
<def`>
(on the PR)
<ggole>
OK, got it
<def`>
oops, I must have mistaked the PR, no Doligez answers on this one, sorry.
<def`>
Ah it is Demetri Obenour.
mistermetaphor has joined #ocaml
darkf has quit [Quit: Leaving]
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
nicholasf has joined #ocaml
kushal has quit [Ping timeout: 252 seconds]
yegods has joined #ocaml
nicholasf has quit [Remote host closed the connection]
<flux>
I wonder why the command pkg-config gtksourceview-2.0 fails though it does read the existing file /usr/lib/pkgconfig/gtksourceview-2.0.pc ..
rgrinberg has quit [Ping timeout: 244 seconds]
noddy has joined #ocaml
<flux>
I wonder though if this is somehow misusing it?-o
<flux>
the command that is
<flux>
heh, noticed also that apparently pkg-config never reached 1.0..
<flux>
nope, just my debian dependencies seem to have been insufficient, gtksourceview-2.0 required a more recent version of gtk+-2.0
<flux>
after much inspection it turns out I was missing libpng16.pc - hint, pkg-config --print-errors.. :-)
amnn has joined #ocaml
sh0t has quit [Ping timeout: 250 seconds]
sh0t has joined #ocaml
Simn has joined #ocaml
<flux>
cool, yet another package bites the dust because of -Werror: lablgtk-extras
FreeBirdLjj has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 268 seconds]
kyo9142 has joined #ocaml
sepp2k has quit [Quit: Leaving.]
<flux>
(cool2, my project compiles with 4.03.0 and it seems it also saves 10%-units of CPU-time so I guess that might save a few watts overall :).)
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
ollehar has joined #ocaml
ollehar has quit [Client Quit]
kyo9142 has quit [Ping timeout: 246 seconds]
rgrinberg has joined #ocaml
srcerer has joined #ocaml
dsheets has quit [Remote host closed the connection]
kyo9142 has joined #ocaml
dsheets has joined #ocaml
larhat has quit [Quit: Leaving.]
dsheets has quit [Ping timeout: 244 seconds]
<companion_cube>
meanwhile, I realize that i don't install the .cmx in several of my libraries
<companion_cube>
this is going to get ugly
octachron has quit [Quit: Page closed]
<Drup>
companion_cube: but, hum, are you not using oasis ?
<companion_cube>
not for small libraries
<Drup>
That would not happen if you were using oasis :D
<companion_cube>
yeah but oasis is bloat
<flux>
but if he were using oasis he wouldn't be installing those librarise with 4.03.0 ;)
<companion_cube>
I would have more code in the setup.ml and myocamlbuild.ml than in the lib itself
<Drup>
flux: that's wrong.
<companion_cube>
and I find it wrong, sorry
<Drup>
flux: oasis-emited build system is oasis independent, the resulting library can be installed without oasis
<Drup>
(that's the fucking point)
<flux>
a good point, didn't recall that
<companion_cube>
yeah, but it should not be necessary for 1-module projects, ffs
<flux>
actually that's the part I don't quite like in git-repos, it messes up the tree.. ;)
<flux>
but for releases that's perfectly ok.
<Drup>
flux: that's why you generally emit a lighter setup for dev :>
<flux>
well, pgocaml didn't :)
<flux>
and then there are these minimal 'commit only my changes, not what oasis changed', and these other 'commit oasis changes'
<Drup>
(ocamlers complain about redditors who blindly yell "beh no multicore" but they do the same for oasis, it's slightly unnerving)
<companion_cube>
if I had 2 months, I would seriously consider 1/ removing the codegen from oasis 2/ merging oasis into ocamlbuild
<companion_cube>
that would make a better build system, with no additional dependencies
<flux>
I too would like a non-codegen version of oasis I could use for dev
<flux>
and then just use a release script for generating the release package
<Drup>
flux: it exists.
<Drup>
(I use it in 4 projects)
<flux>
oh, I guess I need to look again into it :)
Denommus has quit [Remote host closed the connection]
<Drup>
flux: it has existed since at least 3 years, probably more
<flux>
so changes to ie. myocamlbuild.ml or _tags work how?
<Drup>
Look at tyxml or lwt
Denommus has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
<flux>
hmm, do oasis.dynrun is a package for running oasis without patching files in the repo?
kyo9142 has quit [Ping timeout: 252 seconds]
<Drup>
it patches files, just dynamically during build, and clean up afterwards
<Drup>
companion_cube: btw, when you add a constraint for a recent ocamlbuild in _oasis, it generates less stuff, a good start would be to clean up that even further, by assuming a very recent ocamlbuild
MercurialAlchemi has joined #ocaml
<companion_cube>
no, a good start would be to wipe out setup.ml
<companion_cube>
and all the camlp4, data-notation and ocamlify and ocamlmod
<companion_cube>
then ideally it would be merged into ocamlbuild, so ocamlbuild can read _oasis files
<companion_cube>
and this would be the equivalent of cabal for Ocaml
<Drup>
that's not a start, that's finish :D
<companion_cube>
yep
<Drup>
hence the suggestion to start with something slighly more reachable
<flux>
1. collect socks
<companion_cube>
I don't see the point of generating less stuff
<companion_cube>
I want to generate no stuff
A19774941 has joined #ocaml
mettekou has quit [Ping timeout: 252 seconds]
A1977494 has quit [Ping timeout: 260 seconds]
noddy has quit [Ping timeout: 246 seconds]
<gasche>
flux: 10% perf gain with 4.03 without flambda? did you try with flambda, playing with optimization settings?
<gasche>
(if you're doing floating point, it's probably related to the changes in unboxing strategies)
<flux>
my measurements were completely unscientific :)
<flux>
based on 'top'. perhaps I should redo a proper test.
<flux>
the only ocaml-intensive bit would be a color space conversion of a bitmap
kyo9142 has joined #ocaml
<flux>
oops I was overselling it
<gasche>
(also I was misunderstanding what 10% means)
<companion_cube>
today evening might be "hacking oasis in anger"
<companion_cube>
hey gasche
<flux>
not color space conversion per se, but just reordering gbr32 to rgb24 or something like that
<flux>
and my program is a webcam viewer
<Leonidas>
"program rejected due to nongeneralizable type variable that appears nowhere"
<gasche>
hi
<flux>
so its cpu load seemed to drop from around 190% to 180%
<rgrinberg>
companion_cube: \o/ doing community service I see
<Leonidas>
This is so complicated of a name, I don't even understand it
<gasche>
still sounds like a lot for a webcam
<companion_cube>
rgrinberg: no, just being angry (for other reasons)
<flux>
well, it's 4 webcams, all are jpeg-decoded
<flux>
and then two of them are h264 encoded
<Leonidas>
maybe it is a 24K webcam?
<flux>
as I said, completely unscientific :)
<flux>
but the conversion part did take an appreciateable amount of cpu..
<flux>
(so a proper benchmark would benchmark just that part)
<companion_cube>
anyone knows what tool deals with "IFDEF" statements?
<companion_cube>
(without a leading #, it's not cppo)
<rgrinberg>
optcomp?
<companion_cube>
no, oasis doesn't dpend on optcomp... weird
<rgrinberg>
could also be the preprocessor that comes with camlp4 as well
<companion_cube>
that is probably that
<companion_cube>
gah
<rgrinberg>
camlp4.macro or w/e it's called
<companion_cube>
it's named "remove me"
hcarty has joined #ocaml
<Leonidas>
hmm, how do I specify the type annotation of the return value of a function which is defined using function?
<Leonidas>
let f : int = function x -> x
<ggole>
let f : int -> int = function x -> x
<ggole>
You can omit the argument with _ if you like.
Algebr has joined #ocaml
<ggole>
An alternative is to annotate the body: let f = function x -> (x : int), but this is ugly for large functions
<Leonidas>
ggole: _ -> int works for me, thanks!
ygrek has joined #ocaml
yegods has quit [Remote host closed the connection]
<hcarty>
gasche: Does ocamlbuild, either from a myocamlbuild.ml or its findlib-accessible modules, provide a way to inspect the content of a _tags file?
<hcarty>
gasche: I'd like to have .merlin auto-generate from the package(...) entries in _tags
<companion_cube>
o/ hcarty
TheLemonMan has joined #ocaml
<hcarty>
companion_cube: \o
yegods has joined #ocaml
<companion_cube>
hcarty: p
<companion_cube>
pv
mistermetaphor has quit [Remote host closed the connection]
ggole has quit []
<companion_cube>
wonderful, applying ocp-indent on oasis' source files causes its tests to fail
<Drup>
x)
<Algebr>
wat
<Drup>
I'm on slightly surprised, tbh, it probably tests code emission, which uses it's own codebase
kyo9142 has quit [Ping timeout: 276 seconds]
<Drup>
(oasis' test suite is ... arcane)
<Algebr>
feature wish for opam, a way to see changelog of release, idea came up after seeing lwt updated to 2.5.2
<companion_cube>
I'm surprised, the rest of the code isn't actually that ugly
<companion_cube>
apart from identation itself
<hcarty>
companion_cube: pv?
<Drup>
companion_cube: on the surface, no
<Drup>
it's just very difficult to do anything
<Drup>
Algebr: yes, that's a long standing feature request (I have ticket about it)
<Algebr>
Drup: can you link it, I'd like to add voice to it too
doecnt has joined #ocaml
jonasac has joined #ocaml
jonasac has quit [Client Quit]
dsheets has joined #ocaml
shinnya has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
mistermetaphor has joined #ocaml
scarygelatin has joined #ocaml
pierpa has joined #ocaml
yegods has quit [Remote host closed the connection]
<companion_cube>
Drup: so what's this story about more recent ocamlbuild making oasis files simpler?
BitPuffin has quit [Read error: Connection reset by peer]
<Drup>
just look at the generated myocamlbuild, you'll understand
<Drup>
it's emulating a lot of things that may (or should) be available in ocamlbuild
<companion_cube>
does it include some of MyOcamlbuildBase?
slash^ has quit [Read error: Connection reset by peer]
loli-pyon has quit [Ping timeout: 276 seconds]
rseymour has joined #ocaml
noddy has joined #ocaml
<flux>
gasche, in reality 4.03.3 with flambda (and fp) is actually slower than 4.02.3 :-)
octachron has joined #ocaml
<flux>
I guess I should try without the fp
yegods has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 244 seconds]
mettekou has joined #ocaml
rgrinberg has quit [Ping timeout: 250 seconds]
<malc_`>
flux: 4.03.3 ?
<flux>
.. .0
<malc_`>
phew
<hcarty>
There seems to be a lot of use of nocrypto rather than cryptokit. (a) Is that actually true? (b) If so, why?
<Algebr>
I like its API better
<Algebr>
was easier for me to just jump in and use it
<flux>
the final numbers are in! with the assistance of the benchmark module: plain 4.03.0+flambda with or without -O3 and with or without fp (the options don't really matter in this case) is faster than 4.02.3 for my test case, by 6% in fact :-o
<Algebr>
I wonder how much $$$ savings that translate for users like Jane Street
kakadu has joined #ocaml
infinity0 has quit [Ping timeout: 260 seconds]
<flux>
I guess I should try plain 4.03.0 as well for completeness
<flux>
can the compiler be compiled in parallel? opam doesn't seem to do it.
<Drup>
I was going to say "yes", but I realized I was going to use a opam 2.0 feature
<Drup>
sorry :(
<flux>
:(
infinity0 has joined #ocaml
<hcarty>
Algebr: Makes sense. For my immediate use, calculating the stringified checksum of a blob of bytes, the amount of code for both seems about the same.
hxegon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Algebr>
hmm, maybe another argument for nocrypto is that david spends time on it, it gets improvements.
infinity0 has quit [Ping timeout: 240 seconds]
pyon has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
<Drup>
(cryptokit is very mature and used in a lot of stuff, though, but it relies on C bindings, and yes, nocrypto is nice too)
<Algebr>
ah that's right, nocrypto also has some C but its all compiled in.
bba has quit [Read error: Connection reset by peer]
bba has joined #ocaml
infinity0 has joined #ocaml
hxegon has joined #ocaml
bba has quit [Read error: Connection reset by peer]
bba has joined #ocaml
MercurialAlchemi has joined #ocaml
rgrinberg has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 246 seconds]
hxegon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
doecnt has quit [Ping timeout: 252 seconds]
vishesh has joined #ocaml
hxegon has joined #ocaml
yegods has quit [Remote host closed the connection]
sh0t has quit [Ping timeout: 268 seconds]
giing3r97 has joined #ocaml
<giing3r97>
Hey guys
<giing3r97>
Quick question
<giing3r97>
I am used to CamlLight (not the same syntax as Ocaml unfortunately)
<giing3r97>
But right now, I am on a win x64 machine and I cannot find anything to make my camllight code work properly
<giing3r97>
So, do you know how to translate
<giing3r97>
let rec f = fun ... ;;
<giing3r97>
to Ocaml ?
<giing3r97>
(with ... being stuff)
<gasche>
let rec f = fun ... ;;
<gasche>
but then it depends on the dots
<giing3r97>
Hmm
<gasche>
OCaml supports (fun x y z -> ...), several parameters, but not pattern-matching after "fun"
<gasche>
you can use "function" instead of "fun" which supports pattern-matching, but not taking several arguments at once
<giing3r97>
That's what I have
<giing3r97>
>_<
<gasche>
if you use, say, (fun [] [] -> .... | (x::xs) (y::ys) -> ...), then you need (fun xs ys -> match xs, ys with [], [] -> ... | (x::xs), (y::ys) -> ...)
<giing3r97>
Ok thanks ...
<gasche>
I remember an old developpez.com forum message summarizing all the syntax differences between Caml Light and OCaml
<gasche>
(the software libraries are really the big change)
sh0t has joined #ocaml
<giing3r97>
Thanks that's fine, I managed to quickly adapt a few things (it was not a big chunk of code); Seems to work on the try.ocaml online thingy
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
misterme_ has joined #ocaml
mistermetaphor has quit [Read error: Connection reset by peer]
nicholasf has joined #ocaml
nicholasf has quit [Remote host closed the connection]
giing3r97 has left #ocaml [#ocaml]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
solrize has quit [Ping timeout: 250 seconds]
malc_` has quit [Remote host closed the connection]
gasche has left #ocaml [#ocaml]
nicholasf has joined #ocaml
<_y>
indeed gasche, your message on developpez.com proved quite handy for me :-)
<_y>
(funnily, i used it for the other direction round, downgrading my knowledge of the syntax to the legacy one :p)
nicholasf has quit [Remote host closed the connection]
cojy has joined #ocaml
<cojy>
how does the ocaml compiler bootstrap?
<pierpa>
normally
nicholasf has joined #ocaml
<hcarty>
cojy: A mixture of C and a snapshot of the bytecode-compiled compiler
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
<Drup>
mostly a the snapshot.
<Drup>
the C code is only the runtime, it's always there