justinfront has quit [Quit: ChatZilla 0.9.90.1 [Firefox 29.0/20140403132807]]
venk has joined #ocaml
tidren has quit [Remote host closed the connection]
tidren has joined #ocaml
teiresias has quit [Ping timeout: 246 seconds]
teiresias has joined #ocaml
tidren has quit [Ping timeout: 276 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 258 seconds]
tidren has joined #ocaml
lostcuaz has joined #ocaml
divyanshu has joined #ocaml
studybot has joined #ocaml
<bernardofpc>
tautologi> the notion of "variable" in mathematics is the same as variables in pure FP -> I don't know what a "variable" means in FP, but I can think of at least two different meanings of "variable" in math, so you can be at most half-right :p
<bernardofpc>
(variable as in "free variable / bound variable" in logic is clearly not the same intuitive idea as "f(x,y,z) is C^2 w.r.t. variable x")
studybot_ has joined #ocaml
studybot has quit [Ping timeout: 240 seconds]
<tautologico>
this was a simplification
<tautologico>
the term is overloaded
<tautologico>
"dummy" variables like in integration and summation (bound vars) vs. other kinds of variables in equations and formulas, etc
studybot has joined #ocaml
studybot_ has quit [Ping timeout: 252 seconds]
ebzzry has joined #ocaml
<bernardofpc>
what exactly does "variable" mean in FP ? just a "value
<bernardofpc>
" like OCaml ?
<tautologico>
yes
<tautologico>
it's just a name for a value
<tautologico>
in lambda calculus for instance
watermind has quit [Ping timeout: 276 seconds]
<bernardofpc>
ok, thks
<bernardofpc>
and good night
nikki93 has joined #ocaml
groovy2shoes has quit [Read error: Connection reset by peer]
ygrek has joined #ocaml
studybot has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
tidren has quit [Remote host closed the connection]
zpe has quit [Ping timeout: 258 seconds]
studybot has joined #ocaml
jonludlam has joined #ocaml
tidren has joined #ocaml
tlockney_away is now known as tlockney
iorivur has quit [Ping timeout: 245 seconds]
tidren has quit [Remote host closed the connection]
iorivur has joined #ocaml
zpe has joined #ocaml
iorivur has quit [Ping timeout: 240 seconds]
claudiuc_ has quit [Ping timeout: 258 seconds]
zpe has quit [Ping timeout: 245 seconds]
nikki93 has quit [Remote host closed the connection]
<whitequark>
how do I add custom myocamlbuild rules, given oasis?
iorivur has joined #ocaml
jonludlam has quit [Quit: Leaving]
nikki93 has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
nikki93 has quit [Ping timeout: 258 seconds]
nikki93 has joined #ocaml
<whitequark>
nevermind, I can just append them to the end and use combine_dispatch
passiveobserver has quit [Quit: EliteBNC free bnc service - http://elitebnc.org - be a part of the Elite!]
passiveobserver has joined #ocaml
tidren has joined #ocaml
studybot has quit [Read error: Connection reset by peer]
divyanshu has joined #ocaml
iorivur has quit [Ping timeout: 245 seconds]
zpe has joined #ocaml
axiles has joined #ocaml
michel_mno_afk is now known as michel_mno
iorivur has joined #ocaml
zpe has quit [Ping timeout: 276 seconds]
siddharthv_away is now known as siddharthv
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tlockney is now known as tlockney_away
ggole has joined #ocaml
tidren has quit [Remote host closed the connection]
tidren has quit [Read error: Connection reset by peer]
tidren_ has joined #ocaml
siddharthv_away is now known as siddharthv
tidren_ has quit [Remote host closed the connection]
tidren has joined #ocaml
michael_lee has quit [Remote host closed the connection]
studybot has joined #ocaml
tidren has quit [Remote host closed the connection]
studybot has quit [Remote host closed the connection]
tidren has joined #ocaml
studybot has joined #ocaml
tidren has quit [Remote host closed the connection]
tidren has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
iorivur has quit [Ping timeout: 276 seconds]
tidren has quit [Remote host closed the connection]
tidren has joined #ocaml
tidren has quit [Remote host closed the connection]
tidren has joined #ocaml
studybot has quit [Read error: Connection reset by peer]
studybot has joined #ocaml
studybot_ has joined #ocaml
tidren has quit [Remote host closed the connection]
andreypopp_ has quit [Ping timeout: 246 seconds]
lopex has quit [Ping timeout: 246 seconds]
studybot has quit [Ping timeout: 240 seconds]
tidren has joined #ocaml
lopex has joined #ocaml
andreypopp_ has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
Simn has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 252 seconds]
iorivur has joined #ocaml
<whitequark>
so, suppose I want to write a syntax extension for generating serializers (protobuf)
<whitequark>
what should I use? ppx?
zpe has joined #ocaml
AltGr has joined #ocaml
<adrien_oww>
from type definitions? type_conv then
<whitequark>
oh, right.
<whitequark>
type_conv horrifies me.
Kakadu has joined #ocaml
tidren has quit [Remote host closed the connection]
ygrek has joined #ocaml
<companion_cube>
whitequark: use ppx, it's the future!
<companion_cube>
and then write a blog post to explain how to do it step by step, and send the link to me so I can do the same ;)
<adrien_oww>
or migrate type_conv to ppx?
<companion_cube>
oh dear.
<adrien_oww>
sounds better to me to use an intermediate layer for that task
<adrien_oww>
well, or write a new one
<adrien_oww>
but I think it makes sense to have a layer there
<companion_cube>
I never knew exactly what did type_conv provide exactly
<adrien_oww>
and then it can be migrated to ocaml-ty
<companion_cube>
^^
<companion_cube>
in 5 years
<adrien_oww>
future!
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
<companion_cube>
Drup: the discussion about lambdas was on #rust, with C++ users ;)
Arsenik has joined #ocaml
avsm has joined #ocaml
tidren has joined #ocaml
iorivur has quit [Ping timeout: 252 seconds]
Submarine has joined #ocaml
tautologico has quit [Quit: Connection closed for inactivity]
tidren has quit [Remote host closed the connection]
tidren has joined #ocaml
keen_ has joined #ocaml
ikaros has joined #ocaml
iorivur has joined #ocaml
claudiuc has joined #ocaml
keen_ has left #ocaml []
claudiuc has quit [Remote host closed the connection]
ebzzry has quit [Ping timeout: 258 seconds]
nikki93 has quit [Remote host closed the connection]
avsm has quit [Quit: Leaving.]
tidren has quit [Remote host closed the connection]
claudiuc_ has joined #ocaml
keen_ has joined #ocaml
lordkryss has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
divyanshu has joined #ocaml
keen_ has left #ocaml []
claudiuc_ has quit [Remote host closed the connection]
claudiuc_ has joined #ocaml
studybot_ has quit [Read error: Connection reset by peer]
keen_ has joined #ocaml
studybot has joined #ocaml
nikki93 has joined #ocaml
studybot_ has joined #ocaml
avsm has joined #ocaml
ocp has joined #ocaml
studybot has quit [Ping timeout: 250 seconds]
studybot_ has quit [Read error: Connection reset by peer]
avsm has quit [Quit: Leaving.]
nikki93 has quit [Remote host closed the connection]
tane has joined #ocaml
rand000 has joined #ocaml
keen_ has left #ocaml []
bjorkintosh has joined #ocaml
clan_ has joined #ocaml
studybot has joined #ocaml
nikki93 has joined #ocaml
avsm has joined #ocaml
darkf_ has joined #ocaml
darkf_ has quit [Changing host]
darkf_ has joined #ocaml
ollehar has joined #ocaml
Submarine has quit [Ping timeout: 250 seconds]
darkf has quit [Ping timeout: 258 seconds]
mort___ has joined #ocaml
keen_ has joined #ocaml
_andre has joined #ocaml
<hcarty>
Rota: OCaml 4.01.0 and newer allow you to have the same constructor name (and record field name) defined in multiple types in a single module. You can let the compiler try to infer the type the constructor belongs to or tell the compiler explicitly with type annotations.
<hcarty>
Rota: So for the earlier example from mrvn, you can have - type a = Foo of int type b = Foo of float let make_int x : a = Foo x let make_float x : b = Foo x
<mrvn>
hcarty: that is missing type annotations
<mrvn>
or... nvm.
<mrvn>
I thought you needed "Foo (x:int)"
keen_ has quit [Quit: Tiarra 0.1+svn-39209: SIGTERM received; exit]
keen_ has quit [Quit: Tiarra 0.1+svn-39209: SIGTERM received; exit]
keen_ has joined #ocaml
keen_ has quit [Client Quit]
<gasche>
hcarty: constructor+field selection is always driven by the constructor/field type, not the argument type; this makes behavior more robust to change in the code
<gasche>
the reason why it's more robust is that there are two states: (1) there is enough type information, and the selection is unambigous (2) there is no type information and we fallback on the last-defined mechanism
<gasche>
if we used argument types, we could have enough type information to make a choice, but then, when the code changes (a second constructor of the same name with same arguments, for another type, is introduced somewhere), we are ambiguous again
thomasga has joined #ocaml
keen_ has joined #ocaml
tane has quit [Remote host closed the connection]
NoNNaN has quit [Ping timeout: 272 seconds]
keen_ has quit [Client Quit]
keen_ has joined #ocaml
ocp has quit [Ping timeout: 240 seconds]
jonludlam has joined #ocaml
jonludlam has quit [Client Quit]
thomasga has quit [Quit: Leaving.]
NoNNaN has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
claudiuc_ has quit [Remote host closed the connection]
Snark has quit [Read error: Operation timed out]
siddharthv has quit [Quit: Lost terminal]
ygrek has quit [Ping timeout: 240 seconds]
darkf_ is now known as darkf
thomasga has joined #ocaml
<Kakadu>
I'm curious, is OCaml compiler smart enough to use SSE and AVX if they are available?
<ggole>
It uses xmm instructions for floats, but the vector instructions afaik
<ggole>
*not the
freling has joined #ocaml
<ggole>
And I suspect there's no way to tell ocamlopt that you are on a recent machine and have it emit, say, roundsd instead of a call to the corresponding routine
<mrvn>
just build for 64bit
<ggole>
It's conservative 64-bit though, right?
<adrien_oww>
on 64b it _will_ use sse2
<ggole>
Right, but (say) roundsd is sse4.1 (or so)
<ggole>
And there's no way to use that stuff.
<mrvn>
ggole: too bad
<ggole>
Sure: I use C if I want that junk.
* ggole
leaks the contents of everybody's memory
<adrien_oww>
actually you almost could
jonludlam has quit [Ping timeout: 276 seconds]
jonludlam has joined #ocaml
<adrien_oww>
some of these things can be easy to use
<hcarty>
gasche: Thank you for the explanation. That makes sense.
ddosia has quit [Quit: Leaving.]
Simn has quit [Ping timeout: 246 seconds]
michel_mno is now known as michel_mno_afk
<gasche>
ggole: feel free to send a patch to the backend if you find a realistic use-case where using unsupported instructions makes a difference
studybot has quit [Remote host closed the connection]
shinnya has joined #ocaml
zpe has joined #ocaml
<ggole>
gasche: that would produce compatibility problems unless the new instructions were guarded by an architecture flag :(
<ggole>
Not all 64-bit machines have SSE4.1, after all.
Axman6 has joined #ocaml
avsm has quit [Quit: Leaving.]
<Axman6>
Good evening all, would someone be able to recommend an OCaml tutorial that would be suitable for someone fluent in Haskell?
zpe has quit [Ping timeout: 252 seconds]
<gasche>
ggole: the backend already has architecture flags to guard instructions
<gasche>
Axman6: you can read the OCaml manual directly
<ggole>
Or you could have a look through real world ocaml
<ggole>
gasche: hmm, ok
<Axman6>
excellent, I'll take a look at all of those
<Axman6>
oh, ha, missed that that was Edward Yang's blog
michel_mno_afk is now known as michel_mno
<ggole>
gasche: so what would be required? A convincing benchmark and a patch to the x86-64 backend?
<gasche>
ggole: yes
<gasche>
note that "benchmark" means "realistic program" in this context, not "micro-benchmark"
jonludlam has quit [Ping timeout: 240 seconds]
<gasche>
the x86-64 backend doesn't have much flags right now, but Sparc has some and ARM is full of it
<ggole>
It's a build-time thing?
<adrien_oww>
ggole: you can see them in "man ocamlopt"
<adrien_oww>
hmm, at least I thought so
<ggole>
I was just looking at that... maybe I missed it.
<adrien_oww>
right: OPTIONS FOR THE SPARC ARCHITECTURE
<ggole>
Ah
<ggole>
Right
<adrien_oww>
there's only for SPARC, not ARM though
<gasche>
someone forgot to put them in the manual
<gasche>
they're available from "ocamlopt --help" if you have an ocamlopt built for ARM ^^
tane has joined #ocaml
ddosia has joined #ocaml
avsm has quit [Quit: Leaving.]
Thooms has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
<ggole>
What's the mlp stuff? A syntax extension?
<Kakadu>
Well
<Kakadu>
My instruction set interest have appeared after watching some C++ video
<Kakadu>
Herb Sutter had two examples about data locality
<Kakadu>
The amazing result is if one algorithm takes mathematically O(1) time and another takesO(n) the second one still can be faster
<ggole>
Hmm, looks like cmm lowers some float ops too early for the machine specific part of the backend to see them :/
<Kakadu>
(inserting element into array vs linked list)
<ggole>
Or rather, they are lowered away by the time the code flows through there
<ggole>
Kakadu: yeah, and OCaml isn't terribly great about locality :/
<adrien_oww>
ggole: mlp is data which is meant to be pre-processed
<Kakadu>
ggole: Can some runtime with automatic memoty management can be great about data locality?
<Kakadu>
memory*
<gasche>
mlp are a home-made syntax extension used just in the backend
<ggole>
Kakadu: you *could* implement an ML with more compact data structures, but OCaml uses a simple immediate-or-pointer representation that doesn't play nice with that
<ggole>
I think MLton does some of that kind of specialisation
<ggole>
But it requires whole-program compilation.
<ggole>
You can do some hand-specialisation in OCaml but it is swimming upstream a bit.
<ggole>
It all has costs though, you need the GC to know all about your object layouts and stack frames and etc etc
<Kakadu>
Yeah, it's not obvious how to implement it right
<ggole>
There are some obstacles as well, for example OCaml says that == behaves a certain way on things like options
<ggole>
So you can't pack an option into a single word even if the thing inside it will fit :(
<ggole>
Same with variants in general: constructors with args can't be packed because the semantics are different
<ggole>
Blurgh.
<smondet>
ggole: where does it "say" that?
<Kakadu>
Why I can't pack options?
<ggole>
smondet: different behaviour of == is different behaviour: just because it doesn't lay it out in the manual doesn't mean it wouldn't break existing code.
<flux>
it was fragile code to begin with ;)
<ggole>
And you can find, eg, blog posts that explain that allocation denotes identity, and how to rely on that (blurgh).
<ggole>
If you were willing to risk that, and to adopt a more whole-programmy compilation model, I think you could do well
<ggole>
There are some nice list compaction tricks you can pull if the GC is permitted to know pointer types precisely, for instance
<Kakadu>
Where can I read more about it?
Simn has joined #ocaml
<ggole>
Oh blurgh, floor and ceil are in C. Bah, forget it.
divyanshu has quit [Quit: Computer has gone to sleep.]
<ggole>
Kakadu: hmm, let me find the paper I'm thinking of
<ggole>
And some old Lisp papers about CDR-coding, although you have to squint a bit hard to see the relevance.
<ggole>
(CDR-coding suffers from having to admit mutation of the list structure, which an ML can dispense with.)
lordkryss has quit [Quit: Connection closed for inactivity]
mort___ has joined #ocaml
<ggole>
And maybe the MLton papers, if you're keen
<gasche>
ggole: were you considering adding SSE support for floor and ceil?
<gasche>
also, does the SSE instructions conform to the IEEE specification
<gasche>
?
<gasche>
*do
<ggole>
roundsd does, yeah
<ggole>
But I'd have to change quite a bit more than the backend, unfortuantely :/
<ggole>
The existing "built-in" float ops are represented explicitly in, for instance, clambda and cmm
<ggole>
floor/ceil/whatever would have to be added
<Kakadu>
Btw, should vector opeartion should be supported?
* Kakadu
have never done scalar multiplication of vectors
jonludlam has joined #ocaml
avsm has joined #ocaml
<Kakadu>
And I don't even know how to do it if int array is array of boxed ints
<Kakadu>
Althought I ahve seen some instructions special for boxed values
<gasche>
ggole: adding primitives is easy
<gasche>
I could help you with that
mort___ has quit [Ping timeout: 245 seconds]
<gasche>
ggole: for an example of new primitives, have a look at trunk@13106 , that is 89bdc103505183125f7bf759c27302a34757af9b on github/ocaml/ocaml
studybot has joined #ocaml
<ggole>
My concern is that the other architectures should (probably?) still call the C function.
<NoNNaN>
Kakadu: what kind of problems would you like to solve with sse/avx ?
<gasche>
(not that this patch is a great example of proper separation of concepts)
<gasche>
ggole: that's not a problem
studybot has quit [Remote host closed the connection]
<gasche>
the patch I'm pointing at does have this fallback logic
studybot has joined #ocaml
<ggole>
Hmm, let me just figure out Github's interface
<ggole>
Ah, there we go
<Kakadu>
NoNNaN: Nothing practical. I'm just trying to understand can OCaml be as fast as C
darkf has quit [Quit: Leaving]
<Kakadu>
NoNNaN: or as Fortran
<gasche>
the way it is done in this patch is to turn the intrusction in an Iextcall, but catch it back in some backends
<NoNNaN>
Kakadu: you mean tight numeric loops ?
<gasche>
not necessarily the most conceptually elegant, but works
<Kakadu>
NoNNaN: for example
<ggole>
gasche: makes sense
<Kakadu>
NoNNaN: at the moment I don't understand where vector addition is useful if we don't use numeric loops
<Kakadu>
NoNNaN: I mean where else this operations can be generated
<flux>
everyone should just refactor their numeric codes to OpenCL!
<gasche>
SSE is occasionally useful when working on strings
<gasche>
eg. to detect \0
<companion_cube>
or to implement String.blit, I guess
<Kakadu>
In theory List.map2 looks like vector operation but I'm not sure how to generate code forit
<gasche>
at the same time, OCaml strings are not \0-terminated and most tricks are not unicode-safe anyway (not that OCaml itself is)
<companion_cube>
(or Array.blit?)
<ggole>
You can actually detect arbitrary characters that way: gcc uses this to scan for newlines in its lexer in 128-bit chunks
<ggole>
Pretty hairy stuff.
<NoNNaN>
flux:unfortunately not every code maps well to opencl
<gasche>
but in any case (newlines or blit etc.), that's runtime support for a few specific functions
<Kakadu>
btw
<ggole>
I don't think that would work for OCaml strings though, because you would easily run off the end.
<gasche>
it's probably worth optimizing the one function written in C that could take advantage
<Kakadu>
A guy in my university was generating OpenCL from F# for small numeric F# functions
<gasche>
but probably not investing tons of time in the code generator to get that
<flux>
nonnan, well, a lot many problems do map if you allow for CPU implementations
<Kakadu>
It even have worked for small examples
shinnya has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
<ggole>
It'd be nice to be able to say "simd_array" instead of "array" and see some speedups.
<ggole>
But that would require some pretty serious compiler magic.
<companion_cube>
I think there are other arenas where the need for compiler magic is higher
<companion_cube>
for instance, inlining
lostcuaz has joined #ocaml
<companion_cube>
cross-module inlining, functor parameters, etc.
<flux>
frankly, I would easily choose a brainded-easy way to do efficient multicore data processing in OCaml in place of simd_arrays
<ggole>
Yeah, you wouldn't pick simd first
<companion_cube>
(did I mention more unboxing?)
<gasche>
feel free to submit patches in any case :-'
<gasche>
or help review Pierre's branch
<companion_cube>
gasche: well there's a team, I heard, devoted to improve OCaml :D
<flux>
it's not that straight-forward to use multi-processing to speed up this app of mine that uses cairo for most of its work, and then uses Gtk to draw the scene
<flux>
(at least jpeg decoding should go into its own thread easily, being C code)
<gasche>
companion_cube: Gallium people improve OCaml on their spare time
<gasche>
you could do that as well
<gasche>
(but it's of course fine not to)
<ggole>
What's Pierre's branch, the ocamlpro work?
<gasche>
some of it
<ggole>
I poked around their github, but I wasn't clear on what was what
<companion_cube>
gasche: it's sad that no one is full-time on OCaml then :/
<flux>
I now noticed that in fact I don't release the caml lock during JPEG decoding nor the YUV decoding, maybe there's some boosts right there!
<companion_cube>
(ocamllabs people are, though, aren't they?)
<companion_cube>
I don't feel I'm ready to dive into the compiler :s
<ggole>
I'm going to need a bit more time with the codebase before diving into that, I think
<ggole>
Thanks for the pointers.
<gasche>
I've reviewed 1- and 2- already
<flux>
the commit messages are quite brief :)
<NoNNaN>
it is possible to create extremly specialized monomorphic functions (for each type/type combination) in ocaml? (code size is not a problem)
<flux>
nonnan, not really
<flux>
well, you can write them down, each with different name
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<gasche>
(but of course more eyeballs cannot hurt)
divyanshu has joined #ocaml
<NoNNaN>
flux: I have seen a ocaml compiler monomorphic patch somewhere, otherwise a bit metaprogramming would help for type specialization
<ggole>
"The main difference is that exceptions are compiled to constants, hence not allocated when raised." from Chambart's post on the change
<ggole>
Doesn't this change the semantics in the same way I was complaining about above (with ==)?
<companion_cube>
NoNNaN: that's a bit what the patch we discuss does
<companion_cube>
it does some inlining where it specializes types
<companion_cube>
ggole: well don't rely on == on exceptions :p
<companion_cube>
it's an implementation detail, isn't it?
<ggole>
I don't, I'm just wondering whether it is considered sound
<ggole>
Or whether it is considered sound to eliminate the allocation in, say, match foo with A x -> A x | ...
<ggole>
The difference is observable, after all.
<companion_cube>
I'm not sure physical equality is really specified for every case
<companion_cube>
it should be like evaluation order
<companion_cube>
don't rely on it ;)
<companion_cube>
(for immutables values of course)
<ggole>
It *does* feel like you should be able to do that (and with those words, a red flashing warning light goes on).
<ggole>
Right.
<companion_cube>
if it's pure values, why not? :)
<companion_cube>
if it's strings or arrays, of course prudence is needed
tobiasBora_ has joined #ocaml
<ggole>
Some people say that there should be no difference in behaviour between optimised and unoptimised code at all.
<ggole>
They would presumably object to such a transformation.
<ggole>
(Or to the semantics of ==. :) )
tobiasBora has quit [Ping timeout: 245 seconds]
<gasche>
sharing more exception values is already done in trunk, incidentally
<gasche>
(it will change between 4.01 and the next release, independently of Pierre's patches)
<ggole>
For things like Failure "constant string"?
<gasche>
even (raise Not_found) would allocate a bit previously
tobiasBora_ is now known as tobiasBora
<companion_cube>
:/
<ggole>
Hmm, that is a bit... profligate
bjorkintosh has quit [Ping timeout: 245 seconds]
* ggole
idly wonders how much of this would have been approached earlier if allocation were not so fast
<NoNNaN>
Kakadu: take a look at LinearML ( https://github.com/pikatchu/LinearML ), this compiler generate really fast / compact code, implemented in ocaml+llvm, the bintree benchmark is faster (with jemalloc) than the optimized C version
avsm has quit [Quit: Leaving.]
<ggole>
gasche: interesting, it's not raising but just creating the constructors that allocates
<ggole>
ie Not_found == Not_found => false
bjorkintosh has joined #ocaml
<gasche>
some people sometime write (let not_found = Not_found in .... -> raise not_found)
<gasche>
but if you didn't know about that, it means that you don't need to care about it
<gasche>
otherwise you'd have seen it in a profile, and learned about that
<ggole>
Nope, time to patch all this software with micro optimisations (just as the compiler begins to do them for me).
<ggole>
gasche: I've actually done that for constructors with constant args :/
<mrvn>
why would one even want to compare exceptions with ==?
mort___ has joined #ocaml
<gasche>
constructors with constant args will also be optimized in the next release
<gasche>
this broke a few hacks among Obj.magic-happy people
<gasche>
(but not Batteries!)
<gasche>
if you convert immutable into mutable, you're in trouble
<ggole>
Ooh, I guess that answers my prior questions about ==
<def-lkb>
I suspect that the physiqual identity of exceptions plays some role when attaching a backtrace?
* ggole
approves intensely
<gasche>
physical identity of exceptions is also disturbed by marshalling
<gasche>
I don't remember the detail but we improved the documentation on that a few months ago
smondet has quit [Ping timeout: 240 seconds]
smondet has joined #ocaml
<def-lkb>
As they are generative, it's not possible to marshal exceptions
<gasche>
thomasga: I don't understand your reply on the ocamlyacc patch
<gasche>
what we need is a *good reason for changing stuff*
<gasche>
having a migration plan is only pertinent once we have a reason
zpe has quit [Remote host closed the connection]
<gasche>
as I explained, I think the good reason is better error messages
<thomasga>
gasche: well the reason is that is it a pain to maintain for menhir devs
zpe has joined #ocaml
<gasche>
an interesting argument that, to my knowledge, was never raised
<thomasga>
and it's the biggest C bindings in the standard lib
<thomasga>
which makes it's not very portable
<gasche>
I suppose you meant "merlin devs"?
<thomasga>
ha yes, sorry, merlin devs
<companion_cube>
it would be so nice to have better error messages...
<adrien_oww>
thes ones with the mighty sword
* companion_cube
already waiting for christmas
<gasche>
I haven't seen any of those arguments raised in a discussion about switching to menhir
<gasche>
I actually haven't seen any such discussion
<thomasga>
really ???
<thomasga>
ha
<thomasga>
that's maybe why
<thomasga>
:p
<thomasga>
it was few years ago
<gasche>
I remember an oral discussion during a dev meeting
ollehar has joined #ocaml
<gasche>
but in any case, if you are convinced we should switch to menhir, why not propose a pull request to do just that?
<thomasga>
because that's too risky to do that in one go.
zpe has quit [Ping timeout: 240 seconds]
<thomasga>
and because I don't have time to look at that at all :-)
<gasche>
well
<def-lkb>
+1, gasche, I have the impression that you don't want to read my argument: I found that it was not that easy to switch the grammar to menhir style
<gasche>
reviewing and integrating the ocamlyacc changes *and* switching to menhir later would require *more work* in total than just switching to menhir
<gasche>
if we're sure we want to switch to menhir, we don't need to review the changes; possibly use it in a separate branch to work on the transition, that's all
<gasche>
being careful about the change only makes sense if we think we'll get stuck with ocamlyacc for a while
<gasche>
which doesn't solve the problem of the C bindings in the standard lib
<adrien_oww>
you both sound too optimistic :P
<gasche>
but maybe does make merlin's life easier (... than doing nothing)
<def-lkb>
You're scared being stuck with ocamlyacc for a longer time. But I keep note, better submit one big pull request than provide incremental changes.
<gasche>
even better, actually communicate about what you want to do before sending a pull request
<def-lkb>
This is turning crazy =]
<adrien_oww>
gasche: that doesn't fit well with the "I'll just code it and see how it goes" approach which is definitely something we do often
<def-lkb>
Let's get back to the "would require *more work* in total" argument. It took me more work to discuss and try integrating things than to do the actual work.
<gasche>
are you talking about the ocamlyacc patch specifically?
<thomasga>
gasche: that's dumb. pull-requests are the place to discuss changes with actual code.
<def-lkb>
I repeat, this patch is small and useful for me in itself. I just submitted a pull request because it might be interesting to others (and now you know the patch exists)
<gasche>
I understand a pull request as a request for review for upstream integration
<def-lkb>
Especially considering the "switch to menhir" ghost sometime haunting compiler-related discussions
<gasche>
I'm a bit confused
passiveobserver has quit [Ping timeout: 250 seconds]
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
<gasche>
def-lkb: do you think that we should eventually do the work of reviewing the patch and integrating it upstream?
<gasche>
if it's just to let us know about the patch (which would indeed be useful as a temporary step when working on a migration to menhir, but doesn't need a review for that purpose), well I'm happy to know it exists and impressed you'd do the work of working on the ocamlyacc codebase
<gasche>
but then it should be said much more clearly
<def-lkb>
gasche: This is up to you. If you really think it's not worthwhile, you can and should reject it -- c'est toi le gradé.
<def-lkb>
I share something… It's bad, I don't share something it's bad… I don't share I am considering to do something… Not good either.
mort___ has quit [Ping timeout: 240 seconds]
<gasche>
rather than "le gradé", I'm one of the few persons that are (1) not you (2) interested enough to get your work upstream to actually work on doing reviews
passiveobserver has joined #ocaml
<def-lkb>
This is a matter of making this work available, take it if you want, reject it if you don't. That's ok. If someone else wants to contribute, she might be happy to find the tool. Maybe a "ocaml-playground" repository would be more appropriate.
<gasche>
I won't need to do anything if plenty of volunteers come by to say that they checked the patch and are convinced it won't blow up in users' hands in a released versions
<gasche>
-s
<gasche>
def-lkb: or you could have a webpage with information on patches in progress, and announce on the caml-list
<def-lkb>
Otherwise collaborative work will be bound to big monolithic changes. That's fine too, just a different granularity.
<gasche>
I don't think changes need to be big and monolithic
<gasche>
I think they should *not* be
tlockney_away is now known as tlockney
<gasche>
but there should be a need for (reviewing) them
<def-lkb>
gasche: I was considering something like that, although I wasn't sure what could be the appropriate medium. I will consider a webpage
<gasche>
re "reject it", I can't make the decision to close the pull request
<gasche>
I'll leave it open, only I don't plan to work on it personally
<gasche>
fine if someone else does
<gasche>
I'm sorry if you find it taxing to get your work upstream
<gasche>
(unrelated: I sent Benedikt a patch to document the arm-specific options)
<def-lkb>
That's ok and I prefer a project that doesn't integrate each and every feature one writes.
<def-lkb>
What worries me is the feeling that there is a denying of the amount of work needed to properly integrate menhir.
<gasche>
It's rather than you know much more about that than I do
<gasche>
I can only guess
<gasche>
def-lkb: something we could try
<def-lkb>
And that's why I proposed a non-intrusive change that ease the rest of the process. But yes, this change alone has to be reviewed.
<gasche>
once we have a menhir grammar
<gasche>
is to instrument the compiler to parse with both grammars, and fail spectacularly if they return different locations
<gasche>
bootstrap and run the testsuite (which is supposed to have examples of all syntactic constructions by now; otherwise it's a defect we should fix)
<gasche>
if it doesn't fail, my gut feeling is that the menhir grammar is good to go
<gasche>
of course we need a menhir grammar to do this (my understanding is that Merlin's grammar is slightly different and would have to be de-specialized, but I haven't looked at this part in months)
<gasche>
I recently did this instrumentation work to test Pprintast and I indeed found a bug in it ^^
<def-lkb>
this amounts to doing my three steps work in a separate branch… Why not.
<gasche>
minus the "trying to understand legacy C code" part
<gasche>
if you give me a working Menhir grammar, I can give it a go this week-end
maufred has quit [Ping timeout: 264 seconds]
<def-lkb>
My working grammar as merlin peculiarities, I need at least half a day to clean things.
maufred has joined #ocaml
<gasche>
what do you mean "merlin pecularities"?
<gasche>
if it's just different error-checking, that's not necessarily a problem
Thooms has quit [Quit: WeeChat 0.3.8]
<def-lkb>
That's it. It's not a problem, it's just not directly pluggable in place of existing grammar. (well, with -my yacc− I was able to switch between generator at build-time and have only one grammar, see the point?)
lostcuaz has joined #ocaml
NoNNaN has quit [Ping timeout: 272 seconds]
<gasche>
I'm not sure I understand what the changes are
<gasche>
where is your merlin parser? is it ocaml_401/chunk_parser.mly?
martintrojer has quit [Remote host closed the connection]
martintrojer has joined #ocaml
shinnya has joined #ocaml
martintrojer has quit [Remote host closed the connection]
martintrojer has joined #ocaml
Submarine has quit [Remote host closed the connection]
saml has quit [Quit: Leaving]
arjunguha has joined #ocaml
<johnelse>
Anyone know of an idiomatic way of distinguishing OSX and linux at runtime?
<whitequark>
um, I don't think you can run same binary over OSX and Linux?
<johnelse>
true...I'd just like to avoid dealing with it via a configure script or such
<johnelse>
although that might be the better way of doing things, come to think of it
<johnelse>
ah, calling uname with no args works nicely
clan has quit [Quit: clan]
<penryu>
`uname -s` works well IME
clan has joined #ocaml
tidren has joined #ocaml
<johnelse>
penryu: thanks, looks like `uname -s` is usually the same as `uname`
<johnelse>
but I'll add the -s to be safe
clan has quit [Quit: clan]
clan has joined #ocaml
tidren has quit [Remote host closed the connection]
Simn has quit [Quit: Leaving]
<penryu>
yeah, darwin, bsd, and linux vary slightly in their uname(1) manpages. default seems to be identical to -s, and is documented as such all systems I run except FreeBSD. so I retain -s for explicitness.
steshaw has joined #ocaml
Topher has joined #ocaml
tidren has joined #ocaml
nikki93 has joined #ocaml
rand000 has quit [Quit: leaving]
clan has quit [Quit: clan]
claudiuc has joined #ocaml
nikki93 has quit [Remote host closed the connection]
clan has joined #ocaml
claudiuc_ has quit [Ping timeout: 240 seconds]
nikki93 has joined #ocaml
<whitequark>
can anyone help me refactor some functors?