<pippijn>
I can get jenga to work perfectly with only building bytecode or only building native code
<pippijn>
but not both
<pippijn>
because both ocamlc and ocamlopt write .cmi files
pyon has quit [Ping timeout: 246 seconds]
<pippijn>
and jenga notices this and says "oh noes, my dependency changed"
<pippijn>
if I make ocamlc and ocamlopt both output .cmi, jenga complains "two rules for .cmi"
<pippijn>
if I make .cmx depend on .cmi and .cmo, then jenga complains that .cmi changed while executing ocamlopt (true, because ocamlopt did that)
<pippijn>
I could probably make it work by compiling byte and native in separate directries
<pippijn>
directories
<pippijn>
jenga doesn't like that: "non-local rule-targets generated"
lu324_ has quit [Remote host closed the connection]
lu324_ has joined #ocaml
lu324_ has quit [Max SendQ exceeded]
lu324_ has joined #ocaml
eikke has joined #ocaml
rand000_ has quit [Quit: leaving]
Kakadu has quit [Remote host closed the connection]
pyon has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
swgillespie has quit [Ping timeout: 264 seconds]
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
swgillespie has joined #ocaml
rgrinberg has joined #ocaml
RossJH has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hhugo has quit [Quit: Leaving.]
ygrek has joined #ocaml
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kmicinski has quit [Quit: leaving]
pyon has quit [Quit: stupid emacs]
pyon has joined #ocaml
cdidd has quit [Ping timeout: 244 seconds]
cdidd has joined #ocaml
Thooms has quit [Quit: WeeChat 1.0.1]
lu324_ is now known as lu324
swgilles_ has joined #ocaml
swgillespie has quit [Ping timeout: 252 seconds]
rock_neurotiko has quit [Ping timeout: 264 seconds]
Thooms has joined #ocaml
Thooms has quit [Client Quit]
swgilles_ has quit [Ping timeout: 264 seconds]
struktured has quit [Ping timeout: 245 seconds]
lambdahands has joined #ocaml
kmicinski has joined #ocaml
<kmicinski>
Drup: ah yeah, I just saw your z3 bindings and remembered I'd looked at them before
cmtptr has left #ocaml [#ocaml]
<kmicinski>
they're quite nice and after I finish my work on this project using my older bindings, I'll switch to using them, but I wasn't aware of the ml-ng branch for z3 until you pointed me at it
<Drup>
my thing is an overlay for ml-ng
<Drup>
but ml-ng by itself is already much nicer than the old bindings
<kmicinski>
right
swgillespie has joined #ocaml
swgillespie has quit [Client Quit]
struk|dtut has joined #ocaml
rock_neurotiko has joined #ocaml
joness has joined #ocaml
<joness>
I have just noticed that ocaml does not give a warning if you have incomplete pattern matches in a lambda. why is that? and is there a way to get a warning?
rock_neurotiko has quit [Ping timeout: 240 seconds]
kmicinski has quit [Quit: Lost terminal]
enitiz has quit [Ping timeout: 240 seconds]
lambdahands has quit [Ping timeout: 245 seconds]
lambdahands has joined #ocaml
lambdahands has quit [Ping timeout: 272 seconds]
cdidd_ has joined #ocaml
cdidd has quit [Ping timeout: 245 seconds]
enitiz has joined #ocaml
lambdahands has joined #ocaml
struk|dtut has quit [Ping timeout: 246 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
ygrek has quit [Ping timeout: 276 seconds]
darkf has joined #ocaml
chinglish has joined #ocaml
hhugo has quit [Quit: Leaving.]
martintrojer has quit [Ping timeout: 240 seconds]
igitoor has quit [Ping timeout: 244 seconds]
martintrojer has joined #ocaml
igitoor has joined #ocaml
igitoor has joined #ocaml
igitoor has quit [Changing host]
lambdahands has quit [Ping timeout: 256 seconds]
rgrinberg has quit [Quit: Leaving.]
joness has quit [Quit: IRCGate CGI:IRC User]
nonuby has joined #ocaml
<nonuby>
RWO, records chapter, where it says "The hook that the compiler uses in this case to figure out the type is the record field name." doees it mean the first field name?
lambdahands has joined #ocaml
huza has joined #ocaml
<whitequark>
yes
<nonuby>
whitequark, but a few lines down where it infers timestamped from the fn passed to list.reduce it will search through if first one doesnt match, i.e. time is 2nd field of timestamped?
<nonuby>
nvm, i think this is covered by heartbeat example later on, cheers
<nonuby>
okay, just another example if you have two record types, person and address, person has 1 address, and these are simply dumb, you would name the field address so access could be person_1.address.zipcode, but if Address is module with various funcctions and the address record is defined by Address.t, you would call the field Address in the person record definition, this is just naming conventions?
<whitequark>
you can't call the field "Address", it has to start with a lowercase letter
<nonuby>
hmm yeah, it does that say that near start of chapter, but then I see hb.Heartbeat.time, okay so this is where modules are first class, so that instance of hb has its own module of Heartbeat? if Im completely out, these questions usually resolve themselves a few more pages in..
<whitequark>
no, "Heartbeat.time" is just a qualified field name
<whitequark>
the dot after hb and the dot after Heartbeat mean different things.
<nonuby>
okay, thanks, noted
lordkryss has quit [Quit: Connection closed for inactivity]
chinglish has quit [Ping timeout: 276 seconds]
swgillespie has joined #ocaml
vanila has joined #ocaml
struktured has joined #ocaml
q66 has quit [Quit: Leaving]
chinglish has joined #ocaml
BitPuffin has quit [Ping timeout: 240 seconds]
pyon is now known as inf-groupoid
nonuby has quit [Ping timeout: 272 seconds]
rgrinberg has joined #ocaml
badkins has quit [Remote host closed the connection]
rgrinberg has quit [Client Quit]
nullcat has joined #ocaml
enitiz has quit [Ping timeout: 264 seconds]
rgrinberg has joined #ocaml
huza has quit [Ping timeout: 245 seconds]
nonuby has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
tcpc has joined #ocaml
<tcpc>
hi
<tcpc>
why [\+\-\*/] does match +, *, / but not - ?
<whitequark>
try matching \
<tcpc>
like \\- ?
<tcpc>
doesn't work neither
<struktured>
tcpc: really? seems to work for me...
<tcpc>
hm, are you using utop ?
<tcpc>
(coz i am and it doesn't work ya)
<tcpc>
well, \(+\|-\|*\|/\) seems to be working
<struktured>
tcpc: let r= Str.regexp "[-\\+\\*/]" ;; matches on - + * and /
<tcpc>
oh, you put the backslashs *after* the special characters
<tcpc>
ok, thanks
<struktured>
tcpc: you could put the "-" at the end, wouldn't matter. it doesn't need to be escaped, evidently
<struktured>
tcpc: although perhaps an expression like "[0-9]" would require escaping...
<whitequark>
also, use re instead of str
<tcpc>
exactly, i had "[0-9]" expressions in mind so i thought "-" would need to be escaped
<tcpc>
my bad, thx
<struktured>
whitequark is right, btw. although I have zero experience with regex in ocaml, re is what I'd start using
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
<Drup>
depends, which way are you surprised ?
lambdahands has quit [Ping timeout: 256 seconds]
mfp_ is now known as mfp
booly-yam-4366 has quit [Ping timeout: 246 seconds]
swgillespie has joined #ocaml
lambdahands has joined #ocaml
_5kg has quit [Ping timeout: 245 seconds]
Thooms has quit [Quit: WeeChat 1.0.1]
S11001001 has joined #ocaml
swgillespie has quit [Client Quit]
nullcat has joined #ocaml
booly-yam-4366 has joined #ocaml
lambdaha1ds has joined #ocaml
lambdahands has quit [Ping timeout: 256 seconds]
swgillespie has joined #ocaml
mxv has joined #ocaml
leowzukw has quit [Ping timeout: 246 seconds]
leowzukw has joined #ocaml
bytbox has joined #ocaml
yminsky has joined #ocaml
<yminsky>
Anyone feel competent to answer a GADT question?
<Drup>
worst case, we'll tell you we don't know :)
<ggole>
Nope, but let's hear it anyway
<yminsky>
I’m trying to figure out why (and when) locally abstract types are required to make inference go through properly.
<Drup>
ah, that's a bit more "details of the typechecker" than just gadts
<yminsky>
For example, consider this type for representing an array type that might be a compact byte array, and might be a general purpose ocaml array: type ‘a t = Array : ‘a array -> ‘a t | Bytes : bytes -> char t
<companion_cube>
I think if your GADT hides an existential type (is that it?) inference is mostly going not to work
<yminsky>
(No existentials here.)
<yminsky>
If I try to write the length function, I get an overly specific type:
<yminsky>
let length t =
<yminsky>
match t with
<yminsky>
| Bytes b -> Bytes.length b
<yminsky>
| Array a -> Array.length a
<yminsky>
;;
<yminsky>
val length : char t -> int = <fun>
<yminsky>
But with a locally abstract type, I get what I want:
<yminsky>
let length (type el) (t:el t) =
<yminsky>
match t with
<yminsky>
| Bytes b -> Bytes.length b
<yminsky>
| Array a -> Array.length a
<yminsky>
;;
<yminsky>
val length : 'a t -> int = <fun>
<yminsky>
The question is: why?
<rom1504>
what are you trying to get the length of ?
<ggole>
Hmm, when you need the type variable to be polymorphic I think
<Drup>
what ggole said, as soon as you need polymorphism across several cases, you need to annotate
<yminsky>
Indeed, a truly polymorphic type variable is what’s required. And I guess that’s the right explanation.
<yminsky>
In the absence of tying a type variable to a locally abstract one, you’ll get an ordinary variable which is tied to a single type for all uses.
<Drup>
basically, inference of forall is impossible.
<Drup>
(or rather, OCaml doesn't do it)
<yminsky>
Yeah, that all fits. I knew this was a limitation of inference, but that helps me nail it down a bit further.
<yminsky>
Thanks all!
<companion_cube>
yminsky: if you replace 'a array with, say, int array, the function won't type
<companion_cube>
it's not even polymorphism, it's simply inference with GADT
<companion_cube>
type _ foo = | Int : int list -> int foo | Float : float list -> float foo;;
<companion_cube>
let length = function Int l -> List.length l | Float l -> List.length l;;
<companion_cube>
your example did type only because the 'a t could unify with char t
Haudegen has quit [Ping timeout: 264 seconds]
<yminsky>
It is polymorphism, I believe. If you use an ordinary type variable for the ‘a in ‘a foo, you’ll get the kind that can only have one value.
<yminsky>
Thus, your example won’t typecheck, but with the locally abstract variable, it will.
n1ftyn8 has quit [Ping timeout: 245 seconds]
Haudegen has joined #ocaml
<Drup>
yminsky: things become weird when you compose gadt-function and pattern match ocasionally
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<yminsky>
Example?
<Drup>
sometimes you will need to annotate, sometimes not, it's very dependent of the order of the traversal the typer is doing
<ggole>
GADTs have that effect, yeah
<ggole>
Losing or-patterns is particularly annoying
<Drup>
that too
<Drup>
yminsky: I don't have a nice example right now, but I encountered the issue several time.
<Drup>
expecting not to have to annotate and being wrong.
<yminsky>
I’ve definitely seen it too. The rules for when you need to help the inference engine along aren’t simple.
<companion_cube>
with merlin, you know quickly you have to annotate
<ggole>
And "natural" structures sometimes simply cease to work
<companion_cube>
in practice I didn't find it too annoying to have to annotate GADT code
<ggole>
You had an array or record but now you need existentials, time for a fiddly encoding
NoNNaN has quit [Ping timeout: 250 seconds]
<Drup>
(well, there is polymorphic recursion too that you need to annotate ...)
rock_neurotiko has quit [Quit: No Ping reply in 180 seconds.]
booly-yam-4366 has quit [Ping timeout: 245 seconds]
<ggole>
I wonder whether there is language design work that could make using them less troublesome
<Drup>
ggole: fully dependently typed language ? :D
<ggole>
*Less* troublesome :)
<companion_cube>
TYPED HOLES IN MERLIN
<ggole>
I dunno, maybe that's the path to go down if you want that stuff.
<Drup>
companion_cube: wouldn't help for the boxing issue
<Drup>
ggole: in my experience, using a fully dependently type language is actually less annoying than using gadts
<Drup>
because the language is actually design to embed proof and type-level programming
<ggole>
Like ATS, Idris, etc?
<Drup>
ATS is a different can of worm by itself, because low level + linear types + ...
<companion_cube>
boxed issue? how is that related?
<Drup>
companion_cube: you have to box things in existential to hide the type and be able to fit everything in the same container
<Drup>
it's a common and very annoying pattern with gadts
<Drup>
ggole: I mostly tried Agda, never did big things though.
* ggole
reimplemented the stdlib to avoid that
<ggole>
(Just as an exercise.)
booly-yam-4366 has joined #ocaml
<ggole>
Only half worked, since I ended up needing the wrapper elsewhere anyway.
<Drup>
ggole: well, you also did the boxing thing, for basic blocks
<ggole>
Right.
_5kg has joined #ocaml
<ggole>
I have a tentative design that sort-of avoids that, but it involves pretty heavy changes to the form of the IR
<Drup>
like ?
<ggole>
Putting only "scheduled" instructions (stores, calls, etc) in basic blocks and everything else floating free as in a graph IR
<ggole>
The scheduled_insn type gives an opportunity to introduce the necessary existentials.
<ggole>
I doubt it's worth it.
hhugo has quit [Quit: Leaving.]
<Drup>
that would be awkward to write transformation.
<ggole>
It introduces simplicities in some parts, complexity in others
<ggole>
Eg to introduce a value instruction you don't need to fiddle around with placing it in a block
<ggole>
(But you need a scheduling pass later.)
rock_neurotiko has joined #ocaml
mxv has quit [Ping timeout: 264 seconds]
booly-yam-4366 has quit [Ping timeout: 264 seconds]
booly-yam-4366 has joined #ocaml
hekmek has quit [Quit: Verlassend]
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
n1ftyn8 has joined #ocaml
arj has joined #ocaml
_5kg has quit [Ping timeout: 245 seconds]
_5kg has joined #ocaml
mxv has joined #ocaml
<pippijn>
which mailing list should I direct questions about jenga at?
Nahra``` has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
Nahra``` has joined #ocaml
enitiz has quit [Ping timeout: 252 seconds]
leowzukw has quit [Ping timeout: 245 seconds]
enitiz has joined #ocaml
badkins has joined #ocaml
MC__ has joined #ocaml
manud has joined #ocaml
<pippijn>
is caml-list@inria.fr appropriate?
<MC__>
Hi, I have added a dependency to _oasis of a library. When reinstalling, it doesn't build the dependency automatically and exists with an error
hhugo has joined #ocaml
<MC__>
is there any way to configure the library to automatically install dependenceis?
<pippijn>
MC__: not with oasis, but with opam yes
<MC__>
how I can do it?
<pippijn>
the library's opam package also needs the dependency added
<MC__>
awesome! Thanks
anemator has joined #ocaml
struktured has joined #ocaml
wwilly has joined #ocaml
anemator has quit [Client Quit]
<yminsky>
jenga questions should go to the core list I would think
<yminsky>
ocaml-core@googlegroups.com
<pippijn>
alright
ygrek has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
ane has left #ocaml [#ocaml]
MercurialAlchemi has quit [Ping timeout: 246 seconds]
MercurialAlchemi has joined #ocaml
pyon has quit [Read error: Connection reset by peer]