<Drup>
there is a really big problem with ocaml that the syntax understood by the interpreter is slightly different than the one you should use when compiling a file
<Drup>
in the intepreter, you have to end *every single sentence* with a ";;", including those "open"
<whitequark>
yeah, I know this
introom has joined #ocaml
<Drup>
when compiling, your better whitout it since it's the source of lot's of silly parsing errors
talzeus_ has quit [Read error: Connection reset by peer]
<whitequark>
ok
<whitequark>
how do I get let..in to work in a compiled toplevel?
<whitequark>
or is there no way?
<Drup>
let .. in is not for top level declaration, no
<Drup>
you can cheat with some code in "let _ = blabla"
<whitequark>
so I can use let..in inside blabla?
<Drup>
yes
<whitequark>
that's... ugly
<whitequark>
but ok
<Drup>
"let <binding> in <expr>" is an <expr>
dsheets has quit [Ping timeout: 246 seconds]
<Drup>
whitequark: technically, you can do a succession of sentence as if you were in the interpreter and compile it, it should work, but it's very painful very quickly
<bernardofpc>
Because of the ;; ?
<bernardofpc>
or the "in" ?
<Drup>
the ;;
<whitequark>
Drup: I see
<whitequark>
is it possible to somehow tell ocamlbuild to always -use-ocamlfind -use-menhir ?
<whitequark>
The boolean ``or''. Evaluation is sequential, left-to-right: in e1 || e2, e1 is evaluated first, and if it returns true, e2 is not evaluated at all.
<whitequark>
how is this implemented? a parser hack?
<pippijn>
why parser hack?
<whitequark>
well, ocaml is strict, isn't it?
<pippijn>
ah
<pippijn>
you mean that :)
<whitequark>
yes
<pippijn>
basically, yes
<pippijn>
except it's not a parser hack
<pippijn>
but a semantics hack
<pippijn>
the compiler special-cases Pervasives.(||)
<whitequark>
# let myor = (||) in myor (printf "1"; true) (printf "2"; true);;
<whitequark>
2121
<whitequark>
er, just 21
<pippijn>
right
<whitequark>
so it is, well, a parser hack: || under any different name isn't ||
<pippijn>
the same with let (||) = (||) in ...
<pippijn>
no, not a parser hack
<pippijn>
the parser doesn't care where an operator comes from
<whitequark>
oh ok, compiler hack :)
<pippijn>
it's the type-checker that looks up names and assigns types etc.
<whitequark>
right
<pippijn>
and when going from ocaml to some intermediate language, Pervasives.(||) is special-cased
<whitequark>
I was thinking about code coverage lately
<whitequark>
any of you seen "transition coverage" tools for validating FSMs?
<whitequark>
seems like something that can be useful.
<pippijn>
you mean to find dead states?
<whitequark>
e.g. that would really help my Ruby parser. I've glued together a homegrown grammar actions coverage tool (there are usually almost none rules without actions, so it's OK)
<whitequark>
pippijn: no, not like that
<whitequark>
to force you write a testcase for every single possible transition in the FSM
<whitequark>
this would uncover 80% of bugs which were found in my parser by trial and error.
<whitequark>
note that action coverage is, by far, not enough, because most of these bugs occured in accidentally present/absent internal transition
<whitequark>
in the _lexer_ FSM.
<whitequark>
but the technique itself doesn't have to be limited to just lexers, ofc.
<pippijn>
you want a sentence generator?
<whitequark>
that would be a complementary task
<whitequark>
however, it'd be useless for me, because I have no authoritative lexer to compare from.
<pippijn>
"what is the shortest token sequence that leads to a certain state"?
<whitequark>
no
<whitequark>
not really.
<whitequark>
I want instrumentation for the lexer which would record when transitions happen, and highlight those (on the transitions graph) which never happened
<whitequark>
basically.
<pippijn>
ah
<pippijn>
I can implement that in re2ml :)
<pippijn>
that's easy
<whitequark>
hm, now that I said it... I can probably screw some bolts together in ragel
<whitequark>
pippijn: hehe, if only I was rewriting ruby/parser in ocaml
<whitequark>
I'm not a fan of complex and nondeterministic lexers, like, AT ALL
<pippijn>
that's a problem, because make will be called too early
<whitequark>
does it not work in practice?
<pippijn>
I don't know, I haven't met this problem yet
<pippijn>
in practice, it won't happen often
<pippijn>
but I know when I have heavy I/O load, it happens to me sometimes
<pippijn>
even with manual make invocation
<whitequark>
guard uses inotify
<pippijn>
I type :w in vim, switch windows, type "make", and it fails because the file is not there yet
<whitequark>
so it won't randomly coalesce two distinct events to one
<whitequark>
it should be deterministic.
<pippijn>
right
<pippijn>
ok, so guard is not better than inotifywait
<whitequark>
pippijn: I said "randomly"
<pippijn>
ah
<whitequark>
from what I see in the issue, it does coalesce them
<whitequark>
always, that is.
<pippijn>
"However, Ruby is not an ordinary language and meanings can change significantly depending on the presence of spaces"
<pippijn>
that is terrible
<whitequark>
that totally is
<pippijn>
This seems to be really disliked by some.
<pippijn>
I'd be one, if I used ruby
<whitequark>
well again, it causes surprisingly little problems in practice.
<whitequark>
*few
<pippijn>
yes
<whitequark>
the parser is really very well-tuned
<pippijn>
I know.. once you are freaked out a couple of times
<pippijn>
just like javascript and its semicolon insertion
<whitequark>
oh, it's much more regular
<whitequark>
in fact, before I started to work on parser, I don't think I triggered an unexpected behavior in the parser even once
<whitequark>
in five or so years writing ruby
<pippijn>
ok, that's good
<pippijn>
perl is weird, too
<pippijn>
and I like perl
<pippijn>
I can get over it
<whitequark>
ruby is orders of magnitude more regular than perl
<pippijn>
perl is probably even weirder
ggole has joined #ocaml
<pippijn>
yes, I guess so
<whitequark>
in fact where it isn't, it often suffers from perl ancestrance :p
<whitequark>
also, awk
<whitequark>
it's being deprecated, but not quickly.
<whitequark>
e.g. ruby has proper scoping, and it has almost zero methods which access environments across scopes
<whitequark>
(binding, block_given?, local_variables and caller)
<whitequark>
and its OO is the most amazing OO system I've ever worked with. it's better by far margin than C++/Java/C#, better than Smalltalk, and better than OCaml's
<whitequark>
better as in more expressive.
<whitequark>
because of two key features: you can conveniently (sic) introspect everything at any moment, and it is very simple and idiomatic to forward (possibly mutate) messages
<whitequark>
the idea of Foundry is to write a static language which retains 80% of this flexibility :)
<whitequark>
is it not possible to add code above menhir's declaration of token type?
mfp has quit [Ping timeout: 240 seconds]
f[x] has joined #ocaml
thomasga1 has joined #ocaml
Guest21170 is now known as sgnb
<gasche>
whitequark: according to the manual, you can put %{ ... %} headers anywhere in the file
<gasche>
hm
<gasche>
more precisely, anywhere before the first %% separator
<gasche>
so you can do %{ ... %} %token ... %{ ... %} %%
thomasga has quit [Ping timeout: 248 seconds]
ontologiae has joined #ocaml
<whitequark>
gasche: doesn't work: it still adds that code after type token = ...
<whitequark>
so I can't use the newly defined type in tokens.
<whitequark>
I had to extract another module, Lang, on which both parser and lexer depend.
mfp has joined #ocaml
stevej has quit [Ping timeout: 268 seconds]
<whitequark>
pippijn: one good thing in ocaml is that an identity function can just return its argument regardless of type
<whitequark>
however that also turns bad when you want to pass around stuff which doesn't fit into a tagged word
<whitequark>
so, it turns out that C++-like approach is more flexible, if results in some bloat.
<pippijn>
whitequark: sure
<pippijn>
so, use ATS
<pippijn>
which has both
ttamttam has joined #ocaml
<whitequark>
heh
<whitequark>
isn't it also a complete PITA to use?
<pippijn>
it's ugly (in my opinion)
<whitequark>
I think that stuffing a lot of invariants to your type system isn't that good of an idea
<whitequark>
you essentially turn it into a collection of whatever ad-hoc constraints you wanted
<pippijn>
I like that :)
<whitequark>
:D
<pippijn>
I like coq
<ousado>
it solves real problems. and the feature-set of ATS is pretty unique
<whitequark>
ousado: not saying it's useless. saying it's... not for everyone. by a far margin.
<pippijn>
t@ype
<whitequark>
and the skillset required to successfully use ATS diverges with the skillset required otherwise in embedded work (perhaps this is bad, but this is how it is).
zpe has joined #ocaml
<ousado>
sure, the skillsets required to use more as opposed to less advanced languages diverge. that's not only true for embedded work.
osa1 has quit [Quit: Konversation terminated!]
thomasga has joined #ocaml
thomasga1 has quit [Read error: Connection reset by peer]
zpe has quit [Ping timeout: 248 seconds]
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
Simn has joined #ocaml
osnr has quit [Ping timeout: 248 seconds]
UncleVasya has joined #ocaml
thomasga has quit [Ping timeout: 248 seconds]
<gasche>
whitequark: I *suppose* this may be a menhir bug
q66 has joined #ocaml
<gasche>
indeed
<gasche>
I have a small repro case
<gasche>
sending this to menhir's dev right now
<whitequark>
gasche: thanks!
thomasga has joined #ocaml
<gasche>
I got quick feedback
zpe has joined #ocaml
Kakadu has joined #ocaml
<gasche>
the maintainer is not conviced it's a bug (of course that's an excuse for not doing anything)
<gasche>
so you should keep your workaround for now (which is probably a better organization in the long-term anyway)
<whitequark>
I see.
<gasche>
but maybe you or I could get motivated enough to submit a patch to fix that
<gasche>
which has good chances of being accepted if it is not ugly
<whitequark>
I'll look into it later.
ttamttam has quit [Read error: Connection reset by peer]
<pippijn>
gasche: what is the case?
ttamttam has joined #ocaml
<gasche>
I need more context to understand your question
<pippijn>
10:45 < gasche> I have a small repro case
<gasche>
the type (t) declared above the token declaration is put below it in the generated source file
<gasche>
that should be *rather* simple to fix (not trivialy as the header-collecting structure is probably unordered right now, so that would require a change of representation)
<gasche>
but I have never played with menhir's source code
<pippijn>
I see
<pippijn>
let me check
<pippijn>
btw
<pippijn>
gasche: I think that is useless
<pippijn>
gasche: type t is not emitted into the .mli
<pippijn>
so the resulting parser function can never be compiled
ttamttam1 has joined #ocaml
weie_ has quit [Read error: Connection reset by peer]
ttamttam has quit [Ping timeout: 246 seconds]
<pippijn>
I don't need to check
<pippijn>
you can't do this..
weie has joined #ocaml
<pippijn>
if you wanted to do this, menhir would need to know what part of the %{ %} is mli and what is ml
<gasche>
hm
<gasche>
isn't the .mli produced by something like (ocamlc -i) ?
<gasche>
that's what I assumed
mort___ has joined #ocaml
<pippijn>
no
<pippijn>
that would be bad
<pippijn>
because the .ml has lots of small functions
<pippijn>
for every state
<gasche>
ah
<gasche>
well, you could probably tune menhir-side code generation to not reveal them at toplevel
mcclurmc has quit [Ping timeout: 240 seconds]
<pippijn>
what do you mean?
<pippijn>
ah
<gasche>
but arguably even the functions people usually put in their %{ ... %} are auxiliary stuff that doesn't belong in the public interface
<pippijn>
then it would be noticably slower
<gasche>
I don't think so if their are still closed
<gasche>
s/their/they/
<pippijn>
sorry
<gasche>
in any case, that is a valid point you make, about .mli subtleties
<pippijn>
let () = let s1 a = ... in let s2 a = ... in ()
<pippijn>
blah
ccasin has quit [Ping timeout: 245 seconds]
<pippijn>
it is slower
<pippijn>
I have tested it
<pippijn>
because I wanted to do something like you suggested
<pippijn>
in a different setting
<pippijn>
and I found, local functions, even if they don't close over anything, are slower
<pippijn>
toplevel functions are the fastest
<gasche>
do you still have your concrete example around? I am fairly surprised that lambda-lifting don't make them equivalent
<gasche>
note that I'm only considering closed subfunctions
<gasche>
not closures
osnr has quit [Ping timeout: 252 seconds]
<ggole>
The second example is closed
<gasche>
does it have a non-neglectible performance disadvantage over the first one?
<gasche>
I'm not talking about producing assembly code that is not as nice
<gasche>
but actual time
<ggole>
Doubtful
<ggole>
The waste of code space is annoying though
<gasche>
(Playing with compiler optimizations taught me that 80% of the simplifications of the assembly code were made irrelevant by processor-level cleverness)
<gasche>
besides
demonimin has quit [Ping timeout: 245 seconds]
<gasche>
It is bad to make style decisions based on optimisations details that may change in the future
<pippijn>
in my case, it was noticably slower
<gasche>
I think that some performance-style decisions are robust to minor optimizer changes/improvements (eg. favoring tail-rec versions when they occur no additional work)
<pippijn>
exactly the same name as I had for my lexer stack
<whitequark>
pippijn: yes. :D
* whitequark
renames it to cage_of_tomatoes
<whitequark>
science is about why not! *ahem*
<pippijn>
personally, I prefer Parser.Id_IVAR (locate lexbuf, i)
<pippijn>
whitequark: good
<whitequark>
oh, right, it's valid
<pippijn>
besides that, I like it
<ggole>
Why the all caps constructors?
<whitequark>
ggole: I'm used to token names from Ruby's lexers
<ggole>
(Not a big deal, just not really idiomatic in OCaml)
<ggole>
Right
<whitequark>
tPERCENT isn't a valid constructor so I made up something
<pippijn>
I also do that
<pippijn>
for token names
<ggole>
I used it do it, coming from C
<pippijn>
but only for token names
<pippijn>
I think that's not bad, then you know it's a token :)
<whitequark>
pippijn: ok. thanks :) now to figure out menhir's new features (parametric actions)
<whitequark>
seems like it can cut the parser's length considerably
<pippijn>
whitequark: those are awesome
<pippijn>
not really a new concept
<pippijn>
but it's nice that they implemented it
<whitequark>
not new?
<whitequark>
huh, it's the first time I see them anywhere
<ggole>
whitequark: pretty readable: I'd consider less List.hd and List.tl and more matching, but a match failure would probably just be a bug there
<whitequark>
anywhere: yacc, bison, antlr, ...
<whitequark>
ggole: yeah, I want the exceptions
Neros has quit [Ping timeout: 264 seconds]
<pippijn>
you get exceptions if you put a refutable pattern there
<pippijn>
but you also get a compiler warning
<gasche>
given that we apparently have a lot of people interesting in yacc-style parsers right now
<ggole>
assert false would be more informative if you are looking for bugs
<ggole>
But it is OK as is
<gasche>
let me note that I would be interested in whether OCaml's ocamlyacc parser could be improved to provide better error messages
<ggole>
(List.hd failure won't give you source locations)
<gasche>
I think there would be room for contribution on this point
<pippijn>
gasche: have you seen my menhir patch?
<whitequark>
ggole: um, what about that command-line key which enables backtraces?
<pippijn>
I'm not very interested in ocamlyacc
<whitequark>
it's pretty futile to debug stuff without backtraces anyway
<gasche>
but the devs are a bit wary of parser changes -- in particular, working with error tokens may change the automaton state and *possibly* introduce conflicts
<gasche>
pippijn: no I have not
<pippijn>
but I'm sure it could be improved just as easily as menhir
<ggole>
whitequark: you can use that, yeah: but often you are in the toplevel or just haven't turned it on
<whitequark>
pippijn: serious question: no parallelism in ocaml code? at all?
<whitequark>
that sounds sad.
<pippijn>
olafurw: yes
<olafurw>
ok, thanks
<pippijn>
whitequark: yes, that is sad
<pippijn>
and it won't change anytime soon
<whitequark>
is there only a single ocaml implementation?
<pippijn>
yes
<ggole>
Multiple implementations of ML family language tend to be their own thing
<ggole>
jocaml, for example
<pippijn>
there is caml light, the predecessor of ocaml
<ggole>
js_of_ocaml might be considered an alternative implementation if you squint enough
<whitequark>
ggole: jocaml seems to be compatible?
<pippijn>
js_of_ocaml
<pippijn>
that's true
<pippijn>
that's a different runtime
<ggole>
Yeah, but it exists as an extension of the language and not an alternative impl
darkf has quit [Quit: Leaving]
<whitequark>
right
<pippijn>
but does js have threads?
<whitequark>
js_of_ocaml doesn't seem to be a serious thing
<pippijn>
whitequark: why not?
<whitequark>
pippijn: no, and will not, likely, ever.
<ggole>
There's "web workers"
<ggole>
But they are not really threads
<whitequark>
ggole: that's multiprocess
<whitequark>
it will be a cold day in hell before js gains shared memory
<whitequark>
and likely that's for better
<whitequark>
concurrency issues are bad enough with the callback spaghetti :]
<whitequark>
pippijn: (js_of_ocaml) library support
<whitequark>
e.g. unicode support, these days, is a key part of a runtime
<ggole>
Clearly the JS VM engineers need to write an autoparallel JIT so it's not an issue
* ggole
coughs
mort___ has joined #ocaml
<whitequark>
ggole: oh, there are
<ggole>
Should be an easy problem, that one.
<ggole>
Actually JIT seems like the way to go for autoparallel
<whitequark>
JIT is the way to go for anything remotely dynamic, if you have gigabytes of RAM :)
<ggole>
Speculative choices instead of conservative ones
<whitequark>
why speculative? JIT has rather precise info
<flux>
of the previous runs
<flux>
not future ones
<pippijn>
jit can speculate
<pippijn>
on the future
<whitequark>
flux: of the current run, for example.
<ggole>
Becuase you really want to back out of parallelizing that call that turns out to be an add instruction
<pippijn>
and revert things if they turn out wrong
<ggole>
So the overhead doesn't kill you
<whitequark>
sure sure :)
<ggole>
You can do that speculatively: can't really do it conservatively without giving up opportunities
<ggole>
I think speculative optimisations are a really interesting idea in general
<whitequark>
oh, it's a pretty powerful concept, especially in jvm
<flux>
let's say you have an operation that takes t1 time units and returns true/false, and depending on that value you do one of two operations that take time t2
<whitequark>
invokedynamic is zero-cost on the fast path
<flux>
you could probably just evaluate all three and discard the one value :)
<whitequark>
flux: that's what superscalar CPUs do
<flux>
whitequark, in a very small scale
<whitequark>
(if they have speculative executions, which they most often have)
<whitequark>
right
<ggole>
You have to be careful with side effects, exceptions, etc
<ggole>
Processors have ROBs and stuff for that
<whitequark>
ggole: (invokedynamic) for example, its usage immediately allows to turn all constant (pseudo-constant) accesses in JRuby to actual constants
<whitequark>
subject to folding
<ggole>
Yes, it's programmable inline caching
<ggole>
Very cool
<whitequark>
yeah.
<ggole>
I suspect static languages can benefit from this too
<ggole>
Although not in the same places
<whitequark>
ggole: they do, for some kind of static
<whitequark>
objc relies on inline caching heavily
<whitequark>
(static in the sense that it doesn't have JIT, yes)
<ggole>
I'd like to play around with a jit to see what kind of speculation you can get away with
<ggole>
One example is data structure rewriting
<ggole>
Replacing indirect members with their contents
<ggole>
In general the semantics are wrong
<ggole>
So you can do it speculatively
<whitequark>
interesting
<ggole>
Fixup might be expensive if you have to crawl the heap... still not sure if that would fly
dsheets has joined #ocaml
<ggole>
But it would give languages like Java (or OCaml!) C-like representations if it works out
<whitequark>
ggole: I think I've seen papers on similar projects
<whitequark>
they had in common the fact that they integrated with GC
<whitequark>
i.e. it did fixups while traversing heap.
<ggole>
I'm so happy that compilers are sexy again
<ggole>
They were boring for twenty years
<whitequark>
were they?
<ggole>
Yeah
<ggole>
You can't really do much with C
<ggole>
"Here's a new, slightly less useless alias analysis" *yawn*
<whitequark>
ah, in this sense. yeah.
<pippijn>
that's a result of better languages becoming more popular
gautamc has quit [Read error: Connection reset by peer]
<whitequark>
better *cough*
<whitequark>
like JS and Java?
<ggole>
Dunno that JS is all that civilised :)
<pippijn>
I'm not sure about java
<ggole>
(At least it is memory safe.)
<whitequark>
ggole: JS is absolutely horrendous
_andre has joined #ocaml
<flux>
and now they are coming up with languages that are resource-safeish
<whitequark>
but to optimize it, you need to try really ahrd
<pippijn>
you need the language to be memory safe if you want to do interesting optimisations
<whitequark>
*hard
<ggole>
whitequark: {} + [] *giggle*
gautamc has joined #ocaml
<whitequark>
pippijn: either that, or allow your compiler to break your programs :p
<ggole>
And the treatment of this. My god, what was Eich thinking?
<whitequark>
ggole: to quote him: "I had to come up with something in two weeks, or something even worse would happen"
<whitequark>
though, it is likely that he was entirely correct.
<pippijn>
whitequark: ah, that's the = operator?
<ggole>
Then he proceeded to heavily market his work once it somehow became entrenched.
<whitequark>
pippijn: ==, yeah
<pippijn>
at least that is symmetrical
<pippijn>
+ is not
<whitequark>
for +, two dimensions is not enough
<whitequark>
let's make a four-dimensional graph of operators in javascript.
<ggole>
At least it isn't Perl.
<whitequark>
it's not a problem that no one could make any sense from it, anyway
<whitequark>
ggole: to be at least a bit fair to him, it's really hard to change anything on the web
<whitequark>
though I'm not exactly impressed with efforts
<whitequark>
ES6 is a typical committee disaster
<ggole>
That's partly because the only programmabiliity we have is Javascript!
<whitequark>
and asm.js is, well, just *why*
bobry has quit []
<whitequark>
it's an unnecessary formalization of emscripten output. why do you market it like a cure for every known bug
bobry has joined #ocaml
ttamttam1 has quit [Quit: ttamttam1]
<Simn>
** Fatal error: In interp.obj, symbol lidate_166 doesn't start with _ or ?
<Simn>
<-- what does that mean?
<pippijn>
looks like an error from your (windows) linker
<gasche>
multi-process parallelism
<gasche>
hm
<gasche>
wrong time
<Simn>
Hmm, fixed after make clean
<gasche>
pippijn: your "each token has an attribute" example could be rather easily added to menhir
<gasche>
that would desugar to an auto-generated attr_of_token function
<pippijn>
yes
<gasche>
I'm not sure the maintainer would want that and see the value over a manual %{ let repr_of_token = function ... %}
<gasche>
but you should suggest anyway, showing your use-case
<pippijn>
I suggested the StateError patch
<pippijn>
twice
<pippijn>
not for me, I don't care what he does with his code
<pippijn>
I have my menhir in github
<gasche>
but that's an orthogonal feature, isn't it?
<gasche>
(and where is your menhir fork? what other things do you do?)
<pippijn>
no other things
<pippijn>
I wanted to be minimally invasive
<pippijn>
so that my changes could be replayed easily on new upstream versions
<gasche>
upstream integration is always better than separately-maintained fork, though
<gasche>
(no reproch here, it seems you're doing the right thing)
<pippijn>
I have suggested it
<pippijn>
once after I finished it, and now again, one year later
<pippijn>
I'm not going to suggest the attr_of_token function before the StateError is accepted
<pippijn>
and I'm not going to implement it
<pippijn>
merr extracts the token names, and sed removes them
<gasche>
menhir is in the "It's not my main job so I'd rather not spend too much time on it"-maintenance mode
<gasche>
so you have to be a bit pushy
<gasche>
whitequark: did you report your UTF8 issue to the js_of_ocaml developers?
<pippijn>
last time, he said I could have read-only access to their repository
<pippijn>
I didn't get it (and I don't really need it)
jcao219 has joined #ocaml
<whitequark>
gasche: I think someone here said that camomile doesn't work on js_of_ocaml
<gasche>
that's a developer of the old days, he's a bit stupid about being afraid of letting the world see badly-written commit messages
<whitequark>
and there's no unicode in ocaml core, so...
<pippijn>
whitequark: yes, because it needs the databases that are not in code
<pippijn>
gasche: I see
<gasche>
whitequark: so you did not consider investigating further and reporting the need to the appropriate people, and yet you say that js_of_ocaml "is not a serious thing" based on that need?
<pippijn>
my commit messages today were often "readme"
<Kakadu>
with signals and slots you can write very simple non-typesafe function connect: qobject -> string -> qobject -> string -> unit
<Kakadu>
s/with/for/
<pippijn>
yeah, that is a problem
<Kakadu>
not really big
<pippijn>
not big, no
<Kakadu>
also some class definitions may be mutal recursive
<Kakadu>
(and should be placed in one file)
<pippijn>
hmm
<pippijn>
well, I'm not doing anything with that right now
<pippijn>
maybe I'll end up putting *everything* in one file
<Kakadu>
oh
<Kakadu>
me remembers how ocaml have taken 1.5Gb to compile one file
<pippijn>
hehe
<pippijn>
that's ok
<Kakadu>
I can recommend youi to write simple example with ListView, ListModel and a button which adds items to model dynamically. Don't forget to make view autoupdateable when model changes
<pippijn>
I'm not going to do that soon
<pippijn>
I'm leaving the code there
<pippijn>
I still compile it every day, but otherwise I don't do things with it
<Kakadu>
Are u against QtQuick?
<pippijn>
no, I like it
<Kakadu>
Why QtWidgets than?
<pippijn>
I'll probably use your thing sooner than I finish my qt binding
<gasche>
but maybe you could also bind to a JS library?
<pippijn>
well, ok, decompression is enough, I think
mort___ has joined #ocaml
<pippijn>
I will make a file with zlib-compressed data in it
<pippijn>
and in js, I decompress it
<gasche>
if you're thinking of those unicode tables, wouldn't a simple run-length encoding do the job?
<gasche>
(I have no idea how those table ares but I assume they have lots of blanks)
f[x] has quit [Ping timeout: 248 seconds]
<pippijn>
I think so
<pippijn>
let me check
<pippijn>
gasche: not that many
<pippijn>
there are separator @@@@@@ things
<pippijn>
but there is a lot of repetition in the character names
<pippijn>
"CAPITAL LETTER " something
<pippijn>
that would benefit from string compression
<pippijn>
lempel-ziv
<pippijn>
with appropriately chosen window
<gasche>
ok
alxbl has quit [Read error: Operation timed out]
<gasche>
pippijn: if you wanted to seriously work on gzip or zip files, camlzip is a library binding but the parsing and writing of gzip/zip files is done in pure OCaml
<gasche>
zlib only does the heavy lifting of actually compressing data
<gasche>
so that would be a good basis to start from
<pippijn>
that's exactly the wrong thing, isn't it?
<pippijn>
I don't want to work with files
<pippijn>
I just want the pure compressed data in a stringised form in an ocaml source file
<gasche>
(I have done related things with my students when I wanted to give them data but their only tool available to import it was a caml light... toplevel)
<gasche>
pippijn: devise a sensible lexing algorithm that splits words
<Kakadu>
I more or less understand what is wrong but I don't guess have to rewrite it
<gasche>
then produce a list of tokens where words are not reapeated
<pippijn>
yeah, I can do that
<pippijn>
just for the strings
<gasche>
(eg. you create (int -> string) map on the fly, and serialize the mapping along with the (int list))
<gasche>
Kakadu: you mean "and g = memoize f"
<gasche>
but yeah, that's difficult
<Kakadu>
gasche: ah, this copy&paste
<gasche>
you can do ugly tricks such as
<gasche>
let f = ref (fun () -> assert false);; let rec h = ... !f ... and g = .... h ...;; f := memoize g;
<gasche>
it should also be possible to make that work without mutation
<gasche>
something like
<gasche>
hm
<gasche>
what I had in mind works only if you can rewrite your mutual definition (let rec f () = ... and g () = ...) as (let rec f () = (let g () = ... f ... in ... g ...))
<gasche>
that is if you don't need to expose g and can keep it internal to f
<Kakadu>
ah, mutation compiles but prolem which I tried to fix not. TT
f[x] has joined #ocaml
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
pootler_ has joined #ocaml
pootler__ has joined #ocaml
<Kakadu>
probably my expression parser-function can't get profit from memoization TT
mfp has quit [Read error: Connection reset by peer]
f[x] has quit [Ping timeout: 256 seconds]
pootler_ has quit [Ping timeout: 248 seconds]
pootler__ has quit [Ping timeout: 256 seconds]
<pippijn>
implementing unicode formats is more useful than compression
<pippijn>
at least someone would potentially use it
<avsm>
you don't type in enough ocamlbuild commands then
<gasche>
at least, I personally don't mind writing longer, but more explicit names
<avsm>
you can keep those too, just not force them on people (i.e. -v —verbose)
<gasche>
I'm open to shortening propositions
<gasche>
hm
Drup has joined #ocaml
<avsm>
just occurred to me that that's why i dont like -use-ocamlfind
<gasche>
(by that I don't mean that I have the authority to make them accepted upstream)
<avsm>
not that it's not the default, just that its a pain to type all the time
<gasche>
avsm: one idea I had was to mark some flags as automatically enabling -use-ocamlfind
<avsm>
its too late for this sort of change for 4.1, i would have thought
<avsm>
agh, no more magic :-( that's even harder to reason about
<gasche>
I am not sure Damien would mind changes on the ocamlbuild front
<flux>
I'll rejoice when it becomes enough to build any properly configured project with plain 'ocamlfind'
<flux>
just how it works with make.
<flux>
+like
<gasche>
flux: could you be a bit more explicit?
<flux>
it never quite works to run ocamlbuild from make in the presense of multiple targets
<gasche>
what gets wrong?
<flux>
gasche, my routine for building a project: ocamlbuild.. hmm, I wonder what do I usually want to build? ok it's foo.byte, it has let main(). now it's doing it.. no, somehow it doesn't find packages, ah yes I need to use -use-ocamlfind..
<flux>
compare to: make
<gasche>
flux: one of the difference is that today's OCaml code does not explicitly list its dependencies
<gasche>
(as opposed to C's #include directives)
<flux>
I don't mind having a _tags-file
<gasche>
I made a suggestion to consider allowing topfind's directive #require "foo" in OCaml source code (headers) on the wg-platform list
<gasche>
but the reception was rather cold
<flux>
I mean that I cannot express those two things in it
jcao219 has joined #ocaml
<gasche>
I do think it's a very good idea, but I'm apparently alone in that
<flux>
I wonder if I can do it in myocamlbuild.ml? but those are not quite composable.
<flux>
personally I wouldn't mind even if external dependencies, as you are suggesting, were expressed in .ml files
<gasche>
flux: which two things? default targets and packages?
<flux>
but it needs some forethought
<gasche>
ah
<flux>
default targets and -use-ocamlfind
<gasche>
so -use-ocamlfind isn't specified in _tags
<ggole>
Aren't there tools to extract dependencies?
<gasche>
ggole: not at the ocamlfind-package level
<gasche>
(and they're broken anyway)
<ggole>
Oh :(
<gasche>
so
<gasche>
would it work to have a use_ocamlfind flag to put in _tags file
<gasche>
?
<flux>
gasche, I would definitely use it if there was one
<avsm>
yeah, but that doesn't work, does it?
<gasche>
in a more general way, it would make sense to have one
<flux>
although I don't quite see the harm in it just being the default
<gasche>
one flag for each command-line option
<gasche>
but as avsm maybe says, I'm not sure that would work
<avsm>
since it changes other rules, so it wouldnt fit in with the semantics of _tags as a filler
<avsm>
it could work with a vpath for ocamlfind
<pippijn>
man
<pippijn>
that took longer than expected
<avsm>
i.e. anything with ocamlfind would build in _build/ocamlfind/<target>
<avsm>
(which we need anyway for %.p.cmx and %.d.cmx to work properly anyway)
Zopieux has joined #ocaml
felix2 has joined #ocaml
tcpc has joined #ocaml
<gasche>
I'll admit I don't know what "vpath" are
<tcpc>
hi
felix2 has left #ocaml []
<gasche>
hm
colbseton has joined #ocaml
<gasche>
other idea: have a ocamlbuidfind command (or alias)
colbseton has left #ocaml []
<gasche>
maybe
<gasche>
if we start having more of those knobs in ocamlbuild, that have global effects like plugins (instead of just translating easily to tags or command-line options), we may need a supplementary semantic concept
<gasche>
I wonder if the recently added -syntax support is also such a special-case
<avsm>
there's precedent with the other compiler bits
<gasche>
I'm still not quite sure that we don't rather want -use-ocamlfind to be the default
<gasche>
I mean, we could have ocamlbuild and ocamlbuildfind, but who would have interest in using ocamlbuild?
kaustuv has joined #ocaml
<gasche>
my understanding of the answer is "mirage, for expert performance reasons" and "oasis, for expert legacy reasons"
<kaustuv>
Is it unreasonable to want the Module.() to not increase the indentation level for the stuff inside the () ?
mort___ has quit [Quit: Leaving.]
<gasche>
making users pay for those two fairly specific use-cases seems weird
<gasche>
kaustuv: doesn't (...) already increase the indentation level?
<kaustuv>
Yes, () does increase it. I want it *not* to.
<kaustuv>
My particular use case is something like Foo.([ ... a whole bunch of stuff ])
<kaustuv>
I don't want the stuff to be indented twice.
<kaustuv>
Basically, I want Module.[ ].
<gasche>
so you request is rather related to ([...]), or M.[..] or M.{...}
<gasche>
(I'm had the need for M.{..} occasionally)
<gasche>
You would have to ask the syntax czar on the bugtracker
Zopieux has left #ocaml []
ocp has quit [Ping timeout: 248 seconds]
ollehar has joined #ocaml
<kaustuv>
I guess I can file a feature wish for M.[] and M.{}.
demonimin has quit [Read error: Connection reset by peer]
ollehar has quit [Ping timeout: 264 seconds]
demonimin has joined #ocaml
niwong has joined #ocaml
<gasche>
avsm, flux: I think we could consider having a "header" in the _tags file that would contain not predicate-filtered tags, but compilation-wide behavioral indications
<gasche>
eg. no-hygiene, use-ocamlfind, etc.
<gasche>
in a world that solved the plugin issue, we could also indicate which plugin to load there
<gasche>
on the other hand, semantically _tags is not really the right place to put this information
<gasche>
myocamlbuild.ml would be more appropriate
<gasche>
but people don't like to change this file
<MarcWeber>
Is there a camlp4 parser which can cope with that line 26 in the paste?
snearch has joined #ocaml
raichoo has quit [Quit: leaving]
Patchou has quit [Read error: Connection reset by peer]
ollehar has joined #ocaml
snearch has quit [Quit: Verlassend]
Tamae has joined #ocaml
pootler_ has joined #ocaml
pootler__ has joined #ocaml
snearch has joined #ocaml
<MarcWeber>
The second -pp is excuted first ? I would not have expected that.
malo has joined #ocaml
<ollehar>
totally off-topic: anyone have experience with SSL together with websockets?
<MarcWeber>
ollehar: Why?
cago has left #ocaml []
<ollehar>
I have problems :(
<MarcWeber>
One IP per domain, unless browser and servers understand a http extension (see wikipedia about how its called)=
<MarcWeber>
Except that there is not much which should go wrong
mika1 has quit [Quit: Leaving.]
<zorun>
MarcWeber: this isn't related to websockets, isn't it?
hkBst has quit [Quit: Konversation terminated!]
<zorun>
and IAFAIK, all recent browsers support this extension
<ollehar>
maybe its Lwt_unix.socket, then. hm.
<MarcWeber>
ollehar: Anyway: Talk about the problem you experience and people may have a chance to help you.
<ollehar>
I use a cgi-script that works as a small websocket server. for each "session", a cgi-script is started and start listen on 8080, then 8081, etc. now I tried switching to SSL in apache, and the websocket won't connect.
dsheets has quit [Read error: Operation timed out]
<ollehar>
so perhaps this won't work with SSL:
<ollehar>
let sock_listen = Lwt_unix.socket Unix.PF_INET Unix.SOCK_STREAM 0 in
<ollehar>
( from start_websocket function)
<MarcWeber>
ollehar: user -> apache -> cgi app ? or in which way does the request get forwarded?
<MarcWeber>
ollehar: Does connecting to apache serving a simple test.txt file work using SSL?
<ollehar>
yeah, ordinary loading from cgi works
<ollehar>
it's just the websocket part
<MarcWeber>
Apache acts as proxy starting many cgi apps in your case? But your cpi (ocaml?) app should not bother with SSL then ?
<MarcWeber>
the cgi app should only know that it has to return links to https:// urls
<ollehar>
(cgi done i OCaml)
<ollehar>
sounds reasonable
tcpc has left #ocaml []
<ollehar>
this is the error in apache2/error.log: Lwt_stream.Empty[Thu Jun 27 12:44:44 2013] [OcamlNet] /cgi-bin/drakskatten_ajax: Netchannels.Closed_channel (Status 500), referer: https://127.0.1.2/cgi-bin/drakskatten
<MarcWeber>
Now CGI is not HTTP(S) protocol usually. Often sockets stdin/out can be used, too - depending on your knowledge (could be wrong this time again ..)
<MarcWeber>
ollehar: And without https everything is fine?
<MarcWeber>
It looks to me that the cgi app does not receive any bytes
<ollehar>
yes, I've been using the websocket cgi for months without ssl
<ollehar>
first I was thinking it's a port problem.
<ollehar>
like, SSL only listens on 443.
<ollehar>
I will ask the programmer of Lwt_websocket, which I use.
thomasga has quit [Quit: Leaving.]
<ollehar>
alternatively, I won't encrypt the websocket information.
<MarcWeber>
ollehar: http://www.yolinux.com/TUTORIALS/LinuxTutorialCgiShellScript.html shows how to write a minimal shell cgi script. Maybe you want to try replacing the ocaml cgi by such a dummy script to understand more about what fails. Eg the bash script will not care about any stdin
cdidd has quit [Read error: Operation timed out]
amiller_ has quit [Read error: Operation timed out]
cdidd has joined #ocaml
dezzy has quit [Ping timeout: 240 seconds]
dezzy has joined #ocaml
kaustuv has left #ocaml []
Guest61774 has joined #ocaml
Guest61774 is now known as amiller_
<ollehar>
MarcWeber: maybe so, thanks for your time!
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
<companion_cube>
is there a complexity bound on Map.split?
volumetone has joined #ocaml
volumetone has quit [Client Quit]
<companion_cube>
I'd like to find for a key k, in a Map, the value whose key is the lowest key >= k
csakatoku has quit [Remote host closed the connection]
<flux>
I would imagine it would be O(lg n)
<flux>
what else would it be?
<companion_cube>
don't know, could be bigger
raichoo has joined #ocaml
JcGood has joined #ocaml
ontologiae_ has joined #ocaml
ontologiae has quit [Ping timeout: 246 seconds]
Kakadu has quit [Quit: Konversation terminated!]
csakatoku has joined #ocaml
JcGood has quit [Ping timeout: 245 seconds]
Yoric has joined #ocaml
ttamttam has quit [Quit: ttamttam]
ontologiae_ has quit [Ping timeout: 248 seconds]
JcGood has joined #ocaml
csakatoku has quit [Ping timeout: 246 seconds]
thomasga has joined #ocaml
JcGood has quit [Ping timeout: 240 seconds]
mcclurmc has quit [Ping timeout: 252 seconds]
q66 has quit [Quit: Quit]
q66 has joined #ocaml
q66 has quit [Remote host closed the connection]
q66 has joined #ocaml
Tekk_ has left #ocaml []
<adrien>
wmeyer: I'll be sending you some work pretty soon
introom has quit [Remote host closed the connection]
q66 has quit [Quit: Leaving]
q66 has joined #ocaml
djcoin has quit [Quit: WeeChat 0.4.0]
ontologiae_ has joined #ocaml
jtbt has joined #ocaml
<wmeyer>
adrien: great! thank you.
<adrien>
it's awful
<adrien>
configure has changed a lot
<adrien>
I'm soooo likely to introduce a regression
<wmeyer>
yes, it's changing, since we have CI now
<wmeyer>
let's see, it's just a build system, the target is trunk at the moment so see no problem
<pippijn>
adrien: build system?
<adrien>
pippijn: ocaml's
dsheets has joined #ocaml
<pippijn>
also, what CI system do you use?
<wmeyer>
gerrit&jenkins
<pippijn>
ah
<wmeyer>
it's not too bad
<adrien>
wmeyer: and there are windows slaves?
<wmeyer>
yes, there are
kanibe has quit [Ping timeout: 252 seconds]
<wmeyer>
dsheets: hi!
<adrien>
mingw and msvc?
<pippijn>
does ocaml use ocamlbuild?
<adrien>
jein
<wmeyer>
pippijn: partially, camlp4 uses
<pippijn>
ok
<dsheets>
wmeyer, hi
<wmeyer>
dsheets: didn't get my head around to come to makespace this weekend
jtbt is now known as kanibe
<adrien>
wmeyer: and do you know if the "official" mingw stuff is mingw-w64 now or is that only for 64b?
<adrien>
(my impression that it was for both bitnesses)
<dsheets>
wmeyer, no worries... i didn't go either
<wmeyer>
adrien: I think both, but I'd need to ask, isn't it just 64bit?
<wmeyer>
i would thought so
<adrien>
wmeyer: no, it handles both despite the name
<adrien>
and it handles 32b better
<adrien>
way better
<adrien>
way way way way way better
<wmeyer>
ok
<adrien>
if mingw.org still has to be supported, it's annoying and I'm going to be unable to test that
<adrien>
(I will _not_ install a mingw.org toolchain if I can avoid it)
<wmeyer>
sorry, I know so little about this adrien
JcGood has quit [Ping timeout: 276 seconds]
<wmeyer>
mingw.org toolchain?
<adrien>
there's GCC, binutils, everything and then there are the bindings to the system libc
<adrien>
or platform api
<adrien>
and groups of people doing the work to support the toolchain on windows
<adrien>
15 years ago there was mingw.org
<adrien>
work is not done upstream
<adrien>
some of the main contributors are everything but nice
<adrien>
API coverage is not that good
<adrien>
and for the past 5 years or so, you have mingw-w64
<adrien>
which started after a company started open-sourcing its work to have GCC on Windows 64 (their software requires a lot of memory and they have C, java and obj-c in their codebase)
<adrien>
but mingw.org refused the contribution
<adrien>
on the one hand you have annoying pedantic people you can't work with
<adrien>
and with old support
<adrien>
on the other hand you have nice people who welcome contribution, work for you and are going forward
csakatoku has joined #ocaml
<adrien>
that said, I'm worried about Git
<adrien>
the borg might already be among us
emmanuelux has joined #ocaml
csakatoku has quit [Ping timeout: 246 seconds]
mcclurmc has joined #ocaml
<adrien>
it feels like git is updating my patch iself =/
ontologiae_ has quit [Ping timeout: 245 seconds]
ontologiae_ has joined #ocaml
<adrien>
wmeyer: I've updated the first batch of patches ; I'm going to test them but maybe you want to start checkign them already?
Guest79149 has quit [Ping timeout: 264 seconds]
ttamttam has joined #ocaml
<wmeyer>
I'm looking at them now adrien
<wmeyer>
ah, yes please attach them to mantis
yacks has quit [Ping timeout: 256 seconds]
<adrien>
well, I haven't time to build with them yet but I thought that you could want to start checking them now
<adrien>
I'll attach them once they're tested
<adrien>
(warning you)
<wmeyer>
no need to worry we do it on trunk at the moment, and CI will (hopefuly) catch the build problems
<wmeyer>
but yes, testing of course is required
snearch has quit [Quit: Verlassend]
<adrien>
wmeyer: enjoy :D
csakatoku has joined #ocaml
ontologiae_ has quit [Ping timeout: 276 seconds]
BiDOrD_ has joined #ocaml
yacks has joined #ocaml
csakatoku has quit [Ping timeout: 264 seconds]
darkf has joined #ocaml
BiDOrD has quit [Ping timeout: 248 seconds]
ttamttam has quit [Remote host closed the connection]
<pippijn>
gasche: I'm tired, I can write more, later
stevej has joined #ocaml
mlh has quit [Read error: Connection reset by peer]
mlh has joined #ocaml
JcGood has joined #ocaml
jcao219 has quit [Ping timeout: 248 seconds]
rgrinberg1 is now known as rgrinberg
Yoric has quit [Ping timeout: 264 seconds]
Armael is now known as Le_Peuple
Le_Peuple is now known as Armael
JcGood has quit [Ping timeout: 246 seconds]
Yoric has joined #ocaml
<whitequark>
pippijn: pong. yes, utf-16
<pippijn>
whitequark: I have everything now
<pippijn>
the code is not so nice in some places
<pippijn>
I'll clean it up later
<pippijn>
(yes, I will, I'm that kind of person who does)
<pippijn>
but it works
<pippijn>
I have do exhaustive tests
<pippijn>
-do
<whitequark>
pippijn: excellent, thanks
<whitequark>
I'll try to integrate it with ulex a bit later
<whitequark>
I really need unicode literals in Foundry.
<whitequark>
(it's unicode-only, duh)
csakatoku has joined #ocaml
<nlucaroni>
Anyone aware of a meta-heuristic / global optimization library for OCaml? (Simulated Annealing, VNS, Tabu, ...).
<pippijn>
whitequark: why can't you use BatUTF8 and/or camomile?
<whitequark>
pippijn: BatUTF8 will pull in the rest of Batteries, right?
<whitequark>
I see it depends on BatIO
<pippijn>
yes
<pippijn>
what is the problem with that?
<whitequark>
don't want to pull in a lot of libraries I am not going to use. already have Core here
<pippijn>
ok
<wmeyer>
adrien: all of them apart one are on trunk now.
<whitequark>
mostly same reasoning for camomile (character tables I don't need), plus it won't work with js_of_ocaml.
csakatoku has quit [Ping timeout: 246 seconds]
<whitequark>
which is a js_of_ocaml issue, as gasche correctly says, but if I can stick to small and portable solution which is sufficient, I'd do just that.
<pippijn>
is that a js_of_ocaml issue?
<pippijn>
camomile wants to open databases
<pippijn>
what can js_of_ocaml do about that?
* whitequark
shrugs
<whitequark>
well, emscripten emulates a filesystem :]
<pippijn>
right
<pippijn>
yes, it can do that
<whitequark>
not sure. maybe at some point I will need to do normal form transformations. then I'd have to switch to camomile
<whitequark>
so far I'm fine with the simplest thing that works
<pippijn>
ok
<pippijn>
if you use it and modify it, I would like to know about your changes
<whitequark>
sure
<whitequark>
likely the first one would be iteration, substring and concatenation functions
<whitequark>
oh, you even have the UDB. nice.
<pippijn>
oh
<pippijn>
whitequark: I don't have iteration, substring and concatenation :)
<whitequark>
pippijn: adding them
<pippijn>
ah
<pippijn>
ok
<pippijn>
whitequark: what licence do you use for that?
<whitequark>
pippijn: if you want, I can contribute my changes back under MIT
_andre has quit [Quit: leaving]
<whitequark>
I generally open-source all (useful) support libraries for products I write under it.
<pippijn>
Hi pippijn! You've successfully authenticated, but GitHub does not provide shell access.
<pippijn>
is there a way to log into ssh but not request a shell?
<pippijn>
I want to stay logged in, so I can use ssh multiplexing
<wmeyer>
ssh <host> read
<wmeyer>
or something similar
<whitequark>
pippijn: -N
<pippijn>
nice
<pippijn>
whitequark: that works, thanks
<pippijn>
it even stays open quite long, nice
<pippijn>
it has been open for 15 minutes
<whitequark>
argh, mehnir can automagically extract location info from the lexer
<pippijn>
yes
<pippijn>
ocamlyacc can, too, I think
* whitequark
goes back to remove all Location.t from tokens
<pippijn>
:)
csakatoku has joined #ocaml
<whitequark>
though it's really ugly
<whitequark>
why isn't there a function to return a tuple of ($startpos,$endpos)?..
<amiller_>
let mk_stream : 'a.(module StreamOps) -> (int -> 'a) -> 'a stream
<amiller_>
from oleg's page on first class modules?
ulfdoz has joined #ocaml
<amiller_>
'a.(module StreamOps) i don't understand that syntax, it's obviously not array indexing but what else is .()?
csakatoku has joined #ocaml
<amiller_>
i haven't found any exlpanation of it in the module syntax docs
<def-lkb>
You can add spaces: 'a . (module StreamOps)
<amiller_>
or for that matter let map : 'a . ('a -> 'b) -> 'a stream -> 'b stream
<def-lkb>
You can read it as "forall 'a . <type>". It just happens that, to make things more confusing, <type> is a package "(module StreamOps)" (that is, the type of a first class module value)
<amiller_>
isn't it implicit
<amiller_>
is that the same as (module StreamOps) -> (int -> 'a) -> 'a stream?
<def-lkb>
Sometime, the quantifier has to be made explicit.
<def-lkb>
With ": (module StreamOps) -> (int -> 'a) -> 'a stream", the typer just check that the type of your value is an instance of this schema.
csakatoku has quit [Ping timeout: 256 seconds]
<def-lkb>
(That is, there is an 'a such that the actual type fits this scheme).
<def-lkb>
For instance, a value of type (module StreamOps) -> (int -> int) -> int stream would be accepted by the typechecker.
<def-lkb>
With an explicit quantifier, the typechecker ensures that 'a is not instanciated in the final type.
<wmeyer2>
adrien: it would be worth to integrate also ocaml-android project with your cross compilation patches
breakds has joined #ocaml
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
osnr has quit [Quit: Leaving.]
<whitequark>
oh right, I'm doing it wrong.
<whitequark>
is it possible to, hmm, apply subtyping to records? say I have several records like this: http://hastebin.com/mamafopiba.hs
<whitequark>
I want to have a function which accepts *any* of the above records and extracts the `expression' field
<whitequark>
nevermind, figured out how to do it better
<Drup>
whitequark: no, but you can use object for that
<whitequark>
Drup: don't actually need it. all of the locations above are embedded in the AST like this: http://hastebin.com/bibucajoni.pas
<Drup>
(and yes, have multiple record type with the same fields is asking for troubles)
<whitequark>
so I can just match the node type
<Drup>
having*
<whitequark>
or, I can just make all Location.* tuples of (t, { lhs=...; rhs=... })
<whitequark>
and this is probably a better idea
Yoric has quit [Ping timeout: 264 seconds]
<whitequark>
hm, don't get it
<whitequark>
type l = t * t with sexp;; is OK
<whitequark>
but type n = t * { foo : t} with sexp;; is Parse error: [type_kind] expected after "=" (in [opt_eq_ctyp])
gautamc has quit [Read error: Connection reset by peer]
<whitequark>
oh, record types have to be named, I guess.
<Drup>
yes
<whitequark>
at least, am I correct that if I have a bunch of types (t * unary_i), (t * binary_i), etc, and a function t * 'a -> t, that function could process them all?
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
gautamc has joined #ocaml
<whitequark>
it seems that it should
osnr1 has joined #ocaml
osnr has quit [Ping timeout: 246 seconds]
osnr1 has quit [Quit: Leaving.]
malo has quit [Quit: Leaving]
q66 has quit [Quit: Leaving]
<whitequark>
hm, why can't a module use type definitions from its own .mli?..