<jonludlam>
let me tell you a story about that file, and how frustrating it was to have to put that in there
<jonludlam>
xapi had its own http library, which was mostly OK, but it didn't encode cookies correctly
<jonludlam>
then we replaced that with cohttp, which did encode cookies correctly
<jonludlam>
and had to make compat code, which undid the damage our library did, and then split them up correctly
<jonludlam>
we copied the code from cohttp to split them correctly
<jonludlam>
(introducing re_str at that point)
<jonludlam>
then when cohttp switched to stringext, rgringberg noticed that cohttp wasn't quite correct
sagotch has joined #ocaml
<jonludlam>
and allowed spaces in cookie values
<jonludlam>
which xapi had depended on!
<jonludlam>
so we couldn't inherit the fix, as that broke our workaround to our broken library
<jonludlam>
so I had to go back to cohttp's previous solution, but use a fixed re_str.bounded_split_delim
cago has joined #ocaml
* avsm
reads his scrollback with wide eyes
avsm1 has joined #ocaml
thomasga has quit [Quit: Leaving.]
dsheets has quit [Ping timeout: 240 seconds]
avsm has quit [Ping timeout: 260 seconds]
<Drup>
whitequark: weirdly, I remember asking you a question following our metadata discussion, but can't find it in the backlog
<whitequark>
which q?
<Drup>
I read the link you gave me, I got most of it, except the main point : how do I get the metadata attached to an instruction (in "%indvar.next = add i64 %indvar, 1, !dbg !21" for example)
<whitequark>
oh
<whitequark>
...
<Drup>
don't tell me it's not implemented in the ocaml api, please x)
<whitequark>
it is
<whitequark>
but you'd wish it wouldn't
<whitequark>
basically, you have to use val metadata : llvalue -> int -> llvalue option
<Drup>
and which int should I gave ?
<whitequark>
the `int' in question is the LLVM-internal encoding, unique for !dbg and other possible names there
<Drup>
and how do I figure this int out ?
<whitequark>
why, by reading LLVM sources, of course
* whitequark
giggles
<whitequark>
(I'll do it for you)
<Drup>
and what about the metadata is not added by llvm itself ?
<Drup>
what if*
<whitequark>
that would depend on what the int represents, exactly
<Drup>
is the number guaranteed to be the same ?
<whitequark>
oh
<whitequark>
actually, it's not *that* horrible
<Drup>
" %.0 = phi i32 [ %x, %0 ], [ %.1, %9 ], !pagai.var !2" <-- here is my real example. If it's define in the tool in question, I can just ask the guy who did it (he's at shouting distance :D)
<whitequark>
you make it from a string using Llvm.mdkind_id llctx "pagai.var"
<whitequark>
why the hell it doesn't use an abstract type there, I do not know
sagotch has quit [Remote host closed the connection]
<Drup>
ok ...
<Drup>
that's actually usable.
<whitequark>
(a patch would be very welcome)
<Drup>
yeah, I can do that.
<whitequark>
great!
<whitequark>
call it `type llmdkind`, I think
<Drup>
I would like to finish my termination checker before starting to divert my attention again
<whitequark>
*nod*
divyanshu has quit [Quit: Computer has gone to sleep.]
<Drup>
flux : I can't really evaluate it, nor compare to other tools, as I don't really know them
<flux>
drup, well, does it have lots of bugs?-)
<Drup>
does seem so :)
<Drup>
doesn't*
<jonludlam>
Drup, to be clear, that commit removes the conditional dependency, right? but shows how it could be done?
<Drup>
jonludlam: no, this commit actually had the conditional dependency
<Drup>
add*
<Drup>
bll
<flux>
drup, is there lots of improvements to be had?
agarwal1975 has quit [Quit: agarwal1975]
<Drup>
flux: it's state of the art research, there is always lot's of improvements possibles
<Drup>
jonludlam: so, previously, I had a weird solution that didn't work, with two executable sections for the same executable
<Drup>
it didn't actually work, one was overwritten by the other
<flux>
drup, so it works in llvm level, does it work for languages other than C?
<jonludlam>
Drup, ok right. lemme look more
<flux>
drup, also, how do you put the annotations back to the source code?
<Drup>
what I did is that I removed the extra executable section and added special ocamlbuild rules that look into the setup.data information if a flag is enabled or not and add the appropriate dependency if it is
<jonludlam>
ooooh
<jonludlam>
right
<jonludlam>
cppo
<mk270>
ok - thanks for the discussion re regexps - the answer seems to be everything is terrible?
<Drup>
jonludlam: I also use cppo, yeah
<jonludlam>
no wait
<jonludlam>
hm
<mk270>
i'm reading "Str, and anything which pretends to be Str, is broken"
<jonludlam>
mk270, no, re_str in ocaml-re is terrible
<Drup>
but cppo alone is not enough, you need to do the ocamlbuild thingy
<mk270>
but the pcre thing is Ok
<jonludlam>
oh, so the ocamlbuild.ml isn't autogenerated by oasis?
<Drup>
flux: I'm not the author at all !
<flux>
drup, oh
<Drup>
jonludlam: this part, no
<mk270>
basically, there's this "regexp -> string -> bool" function which saves some magic internal state, which you retrieve some other way
<jonludlam>
I see
<mk270>
and i don't trust that to play niceley with Lwt
<jonludlam>
with lwt you're probably fine
<mk270>
ah ok
<jonludlam>
there's no yielding anywhere
<jonludlam>
but for pthreads, you're not OK
<Drup>
(jonludlam: there is no generated code in the myocamlbuild.ml, since it's using the dynamic setup)
<mk270>
well, it still sucks and i still want to work around it - i can use Pcre?
<Drup>
mk270: or you can use normals Re :p
<jonludlam>
Drup, gotcha. Drat, that means trying to figure out ocamlbuild...!
<mk270>
drup: i thought normal Re had the same interface problem? not so?
<Drup>
jonludlam: I did most of the work :p
<jonludlam>
mk270, no, just the Re_str module
* jonludlam
coughs
<jonludlam>
:-)
<mk270>
is the documentation secret?
seanmcl has joined #ocaml
<Drup>
jonludlam: I was working on something a bit more "generic" that what I'm using, let me push it
yacks has quit [Ping timeout: 260 seconds]
<jonludlam>
Drup, cool
<Drup>
actually, I'm not sure the "more generic" thingy is better for you x)
<Drup>
flux: I can still answer a little bit, since I'm using it
<Drup>
flux: it's taking llvm's bitcode as input, it should accept any language
<kaustuv>
Are there any LLVM-based compilers that have a precise incremental GC?
<Drup>
I don't know about annotations in the source code, but it can output an annotated bitcode, with invariants in the metadata
<Drup>
(which is what I'm using)
<whitequark>
kaustuv: not that I'm aware of...
<whitequark>
oh, hm, the WebKit FTL JIT may count as one
<whitequark>
but the problem is that the LLVM GC layer currently makes it impossible to have roots in registers
<jpdeplaix>
I think the rust guys are working on that
<kaustuv>
I'm not clued in on these things, but doesn't having a shadow stack solve this?
<whitequark>
they have attempted it once and gave up, and now Rust has moved from GC paradigm by large
<whitequark>
kaustuv: it's very expensive
<whitequark>
you have to reload values *all the time*, or in best cases just around every single call
<whitequark>
jpdeplaix: I think the current work with Rust and GC is more or less integrating Boehm nicely
<whitequark>
Rust never had a working GC, you see
<whitequark>
and there's not really much desire for it
<jpdeplaix>
:/
<jpdeplaix>
why « nicely » ?
<jpdeplaix>
I've recently started using Boehm for cervoise
cago has quit [Quit: Leaving.]
<whitequark>
I think Boehm wants to keep some thread-local data itseld
<whitequark>
itself*
<jpdeplaix>
mmmh ok
<whitequark>
and it plays well neither with green threads (ugh) nor with pthreads, because it doesn't really *have* to care, when your type system guarantees the GC values are task-local
<whitequark>
I think the trouble is mostly about green threads
<kaustuv>
I'm reading the Swift programming manual, and it seems that they have made a ridiculous mess of closures because of their commitment to reference counting
<whitequark>
it's not as much committment to refcounting as a commitment to full interop with ObjC, I believe
<kaustuv>
Ah, that may be it. Does ObjC have concepts like "unowned references"?
<whitequark>
malloc() ? :)
dsheets has joined #ocaml
johnelse has quit [Ping timeout: 252 seconds]
<whitequark>
how'd you collect it?
<kaustuv>
Well, in the Swift argot, an "unowned" reference is a reference managed elsewhere.
<kaustuv>
Kind of like a weak reference
<whitequark>
I don't know really
<def`>
kaustuv: yes there is this concept
<ousado>
kaustuv: what's special about closures there?
<ousado>
or messy, rather
<ousado>
?
<def`>
kaustuv: this essentially means not generating refcount manipularion instructions
<kaustuv>
ousado: they add something called "capture list" to the type of functions that basically tell the system what kind of reference to hold to captured variables in the context
<kaustuv>
Search for "Resolving Strong Reference Cycles for Closures"
thomasga has joined #ocaml
thomasga has quit [Client Quit]
<ousado>
"The appropriate choice of weak or unowned depends on the relationships between the different parts of your code."
<ousado>
very precise
ygrek has quit [Ping timeout: 260 seconds]
<kaustuv>
I'm ready to predict that memory analysis tools to remove reference cycles will becom de rigueur in iOS/OS X
agarwal1975 has joined #ocaml
dsheets has quit [Ping timeout: 260 seconds]
huza has quit [Quit: WeeChat 0.3.8]
<ousado>
wow, that chapter really is covers the sick part of swift
<kaustuv>
It can basically serve as a definition for "runtime-guided language design"
<ousado>
yeah
<ousado>
"The compiler is optimized for performance, and the language is optimized for development, without compromising on either"
<ousado>
could hardly be more wrong after reading that
agarwal1975 has quit [Quit: agarwal1975]
agarwal1975 has joined #ocaml
<ousado>
I skipped the chapter initially, and apart from switches and if-else not being expressions I first thought apple did a better job than google with dart, MS with typescript and FB with hack
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
<kaustuv>
well, *anything* would be better than Dart. I mean, their response to people pointing out that their type system is unsound (for covariant subtyping in arrays) was, "yes, but, it's more intuitive!"
<whitequark>
... WHAT
sagotch has joined #ocaml
<jpdeplaix>
:DD
<Armael>
kaustuv: and they add runtime checks to patch up the thing ?
<companion_cube>
< whitequark> oh, hm, the WebKit FTL JIT may count as one <--- oh dear, a Faster Than Light jit compiler?
kaustuv has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"]
ygrek has joined #ocaml
<sagotch>
hi
<sagotch>
I am looking for a way to disable the quotes highlighting in tuareg-mode (<< ... >>), any idea?
Nahra has quit [Remote host closed the connection]
willb1 has quit [Ping timeout: 252 seconds]
willb1 has joined #ocaml
<reynir>
Armael: AFAIK the static types in dart don't mean a thing at run time
<Armael>
wow
<Armael>
so hum
<Armael>
ok
<reynir>
and type checking is optional anyway
rgrinberg has joined #ocaml
Nahra has joined #ocaml
<ousado>
they have a checked mode
<ousado>
where they give different runtime errors than you get in release mode
<ousado>
or something
rz has quit [Quit: Ex-Chat]
nikki93 has joined #ocaml
BrainPirate_ has joined #ocaml
BrainPirate has quit [Ping timeout: 240 seconds]
BrainPirate_ is now known as BrainPirate
nikki93 has quit [Ping timeout: 240 seconds]
Hannibal_Smith has joined #ocaml
Gertm has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest47051
jwatzman|work has joined #ocaml
johnelse has joined #ocaml
Guest47051 has quit [Ping timeout: 264 seconds]
yacks has quit [Ping timeout: 264 seconds]
avsm1 has quit [Quit: Leaving.]
olauzon has joined #ocaml
avsm has joined #ocaml
eikke__ has quit [Ping timeout: 255 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
sagotch has quit [Remote host closed the connection]
maattdd has joined #ocaml
yacks has joined #ocaml
racycle has joined #ocaml
nispaur_ is now known as nispaur
martintrojer has quit [Ping timeout: 255 seconds]
martintrojer has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
Submarine has joined #ocaml
BitPuffin has quit [Ping timeout: 255 seconds]
slash^ has joined #ocaml
tlockney_away is now known as tlockney
ontologiae has quit [Ping timeout: 260 seconds]
boogie has joined #ocaml
arjunguh_ has joined #ocaml
arjunguha has quit [Ping timeout: 276 seconds]
arjunguh_ has quit [Client Quit]
tobiasBora has joined #ocaml
eikke__ has joined #ocaml
Submarine_ has joined #ocaml
Submarine_ has quit [Changing host]
Submarine_ has joined #ocaml
arjunguha has joined #ocaml
Submarine has quit [Ping timeout: 276 seconds]
arjunguha has quit [Client Quit]
<tobiasBora>
Does anyone manage to make ocaml-gettext work ?
arjunguha has joined #ocaml
<tobiasBora>
Oh c'est bon :)
Thooms has quit [Quit: WeeChat 0.3.8]
arjunguha has quit [Client Quit]
<adrien>
:)
jwatzman|work has quit [Quit: jwatzman|work]
manizzle has joined #ocaml
Kakadu has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
<tobiasBora>
There is something I don't understand : what is the difference between the "library" module and the "program" module ?
eikke__ has quit [Ping timeout: 265 seconds]
arjunguha has joined #ocaml
q66 has joined #ocaml
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tobiasBora has quit [Ping timeout: 265 seconds]
<adrien>
have you looked inside gnu gettext's doc?
manizzle has quit [Ping timeout: 260 seconds]
tane has joined #ocaml
maattdd has quit [Ping timeout: 240 seconds]
tnguyen has joined #ocaml
jao has quit [Ping timeout: 276 seconds]
mort___ has quit [Ping timeout: 265 seconds]
seanmcl has quit [Read error: Connection reset by peer]
cesar_ has joined #ocaml
cesar_ is now known as Guest57976
Guest57976 has quit [Ping timeout: 260 seconds]
arj has quit [Quit: Leaving.]
arj has joined #ocaml
arj has quit [Quit: Leaving.]
AltGr has left #ocaml [#ocaml]
tnguyen1 has joined #ocaml
tnguyen has quit [Read error: Connection reset by peer]
arjunguha has joined #ocaml
nikki93 has joined #ocaml
manizzle has joined #ocaml
nikki93 has quit [Ping timeout: 276 seconds]
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
BitPuffin has joined #ocaml
alpounet has quit [Remote host closed the connection]
jsvgoncalves has joined #ocaml
yacks has quit [Ping timeout: 255 seconds]
tnguyen1 has quit [Quit: tnguyen1]
yacks has joined #ocaml
maattdd has joined #ocaml
tane has quit [Quit: Verlassend]
hhugo has quit [Quit: Leaving.]
avsm has quit [Quit: Leaving.]
rgrinberg has quit [Quit: Leaving.]
maattdd has quit [Ping timeout: 252 seconds]
keen________ has joined #ocaml
keen_______ has quit [Ping timeout: 264 seconds]
Thooms has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest38116
hhugo has joined #ocaml
Guest38116 has quit [Ping timeout: 255 seconds]
rz has joined #ocaml
shinnya has joined #ocaml
maattdd has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
Moataz-E has joined #ocaml
typedlambda has quit [Ping timeout: 252 seconds]
tobiasBora has joined #ocaml
maattdd has quit [Ping timeout: 264 seconds]
typedlambda has joined #ocaml
jsvgoncalves has quit [Remote host closed the connection]
Nahra has quit [Remote host closed the connection]
Nahra has joined #ocaml
eikke__ has joined #ocaml
wwilly has joined #ocaml
_andre has quit [Quit: leaving]
Submarine_ has quit [Remote host closed the connection]
Submarine has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Anarchos has joined #ocaml
hhugo has quit [Quit: Leaving.]
claudiuc has joined #ocaml
maattdd has joined #ocaml
Nahra has quit [Remote host closed the connection]
hhugo has joined #ocaml
Nahra has joined #ocaml
maattdd has quit [Ping timeout: 276 seconds]
yacks has quit [Ping timeout: 252 seconds]
rand000 has quit [Quit: leaving]
deavid has quit [Ping timeout: 255 seconds]
thomasga has joined #ocaml
philtor_ has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
Submarine has quit [Quit: Leaving]
<ousado>
I'm looking for a refactoring tool for changing ADT constructors and their uses in a relatively large code-base, anyone aware of such a thing?
maattdd has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest78907
<Drup>
no, but maybe you can cheat
<Drup>
1) design a ppx to do it
<Drup>
2) use -dsource
<ousado>
what's -dsource?
<Drup>
undocumented compiler flag that make the parser output the program after all pp/ppx
thomasga has quit [Quit: Leaving.]
<ousado>
sounds not too bad
wwilly has quit [Remote host closed the connection]
Guest78907 has quit [Ping timeout: 260 seconds]
<Drup>
you could do something slightly nicer (and less hacky) by using the compiler libs directly
<thomasga>
but the problem is about creating top-level modules from module packs apparently
<thomasga>
(seems to be a syntactic restriction)
emmanueloga has joined #ocaml
johnelse has quit [Ping timeout: 265 seconds]
johnelse has joined #ocaml
johnelse is now known as Guest80775
<Drup>
introduced*
<Drup>
thomasga: wasn't generative functor untroduced in 4.02 to allow this kind of construction ?
agarwal1975 has quit [Quit: agarwal1975]
emmanueloga has joined #ocaml
emmanueloga has quit [Changing host]
cross has quit [Ping timeout: 265 seconds]
<Drup>
yeah
<Drup>
it's working in 4.02
<Drup>
just tried
<Drup>
only work inside a generative functor
cross has joined #ocaml
<Drup>
replace (X : sig end) by ()
<Drup>
if you try with (X : sig end) it gives you an almost clear error message : "This expression creates fresh types. It is not allowed inside applicative functors."
chris2 has quit [Ping timeout: 245 seconds]
BrainPirate has quit [Quit: BrainPirate]
<thomasga>
hum
<thomasga>
but I don't create fresh type
<thomasga>
(I'm installing 4.02 to see the difference)
<Drup>
but you may easily, using first class modules
Thooms has quit [Quit: WeeChat 0.3.8]
<Drup>
(also, technically, you are, but they might be alias to other type that are not knew)
<Drup>
new*
<thomasga>
I see
<thomasga>
hum
<thomasga>
it works with 4.02 when you don't use generative functor
<thomasga>
actually it works with generative as well
<thomasga>
seems that the compiler is clever enough to see that I only create aliases
<Drup>
that's normal, everything that works without generative will work with it :)
<Drup>
ok, indeed, I tried with a module with an abstract type
<Drup>
if your types are not abstract, you don't need the generativeness
NoNNaN has quit [Ping timeout: 272 seconds]
<Drup>
(although, the fonctor as you defined it with this X is actually fake-generative, so you might as well make it really generative :p)
<thomasga>
well, in my example X contains more stuff
<thomasga>
in my use-case I mean
S1100100` has joined #ocaml
S11001001 has quit [Disconnected by services]
<Drup>
yeah
S1100100` is now known as S11001001
S11001001 has quit [Changing host]
S11001001 has joined #ocaml
nikki93 has joined #ocaml
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tristero has joined #ocaml
NoNNaN has joined #ocaml
eikke__ has quit [Ping timeout: 240 seconds]
eikke__ has joined #ocaml
tobiasBora has quit [Quit: Konversation terminated!]
cesar_ has joined #ocaml
cesar_ is now known as Guest36274
rgrinberg has quit [Quit: Leaving.]
Guest36274 has quit [Ping timeout: 240 seconds]
chris2 has quit [Ping timeout: 245 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
rgrinberg has joined #ocaml
olauzon has quit [Ping timeout: 265 seconds]
chris2 has joined #ocaml
jsvgoncalves has joined #ocaml
alpounet has joined #ocaml
WraithM has quit [Ping timeout: 260 seconds]
madroach has quit [Ping timeout: 252 seconds]
thomasga has quit [Quit: Leaving.]
madroach has joined #ocaml
thomasga has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
thomasga has quit [Client Quit]
NoNNaN has quit [Remote host closed the connection]
BrainPirate has joined #ocaml
BrainPirate has quit [Client Quit]
NoNNaN has joined #ocaml
alpounet has quit [Remote host closed the connection]
<eikke__>
anyone ever defined a module which is a functor over 2 other modules, where the signature of the second depends on some type defined in the first?