<rgrinberg>
MarcWeber: i believe it's the revised syntax for pattern matching
<MarcWeber>
So it means: new function which does not expect anything and does not return anything?
<MarcWeber>
About [] for revised syntax you're right, but its also used for empty array AFAIK.
<MarcWeber>
and .val is also a revised syntax to access refs !?
<rgrinberg>
i think it's a function that raises matche failure for any paramater
<rgrinberg>
don't trust me though
<MarcWeber>
If there is no rule I'd expect such, too.
<MarcWeber>
:)
pootler_ has quit [Ping timeout: 264 seconds]
pootler__ has quit [Ping timeout: 276 seconds]
BlueProtoman has joined #ocaml
BlueProtoman has left #ocaml []
<Drup>
Is there a way to generate a common documentation for two library in oasis ?
darkf has joined #ocaml
JcGood has quit [Ping timeout: 248 seconds]
breakds has quit [Quit: Konversation terminated!]
Watcher7 is now known as Watcher7|off
talzeus has joined #ocaml
<Drup>
(nvm, I found out)
chrisdotcode__ has joined #ocaml
chrisdotcode has quit [Ping timeout: 246 seconds]
weie_ has joined #ocaml
introom has joined #ocaml
jtbt has quit [Ping timeout: 252 seconds]
Watcher7|off is now known as Watcher7
weie has quit [Ping timeout: 264 seconds]
Yoric has quit [Ping timeout: 264 seconds]
TaXules has quit [Ping timeout: 248 seconds]
TaXules has joined #ocaml
<MarcWeber>
Drup: You told me about -bin-annot. Is it possible to compile ocaml with this option, so that those libraries also get .cmt files?
<Drup>
yes, but you will have to modify the build system of the library >_>
<Drup>
for some, it's easy, for other, not so
zRecursive has left #ocaml []
<MarcWeber>
Drup: Maybe its easier to patch the compiler to accept BIN_ANNOT env var then ..
<MarcWeber>
Or I'll just make it always write those files ..
<Drup>
the guy who did ocamlspot wrote a patch to do that
<MarcWeber>
Drup: Why isn't it enabled by default? Isn't it very useful to devs?
<Drup>
.annot are also disbabled by default, I have no idea why. Also the -bin-annot option is very young (and tools that use it still lack a bit of polish)
davekong has joined #ocaml
<davekong>
Can anyone tell me what the syntax error is in this code entered in a REPL? http://pastie.org/8089963
<Drup>
davekong: change fun to function
<Drup>
function is for a function declaration with pattern matching but with only one argument. fun can take multiple arguments but can't do patern matching.
breakds has joined #ocaml
<davekong>
Drup: thanks!
breakds has quit [Remote host closed the connection]
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
JcGood has joined #ocaml
JcGood has quit [Ping timeout: 240 seconds]
pootler_ has joined #ocaml
pootler__ has joined #ocaml
jcao219 has quit [Ping timeout: 276 seconds]
chrisdotcode__ has quit [Remote host closed the connection]
chrisdotcode has joined #ocaml
pootler_1 has joined #ocaml
pootler_2 has joined #ocaml
pootler__ has quit [Ping timeout: 264 seconds]
pootler_ has quit [Ping timeout: 264 seconds]
pootler_2 has quit [Remote host closed the connection]
pootler_1 has quit [Remote host closed the connection]
pootler has joined #ocaml
ggole has joined #ocaml
ttamttam has joined #ocaml
yacks has quit [Quit: Leaving]
ttamttam has left #ocaml []
darkf has quit [Read error: Connection reset by peer]
darkf has joined #ocaml
introom has quit [Remote host closed the connection]
<adrien_oww>
mathieui: which search engine are you using?
<mathieui>
DDG
<mathieui>
the url gets mentionnent in the summary for the gentoo ebuild, though
<adrien_oww>
ok, same here and I don't have it either in the results
<adrien_oww>
on yahoo and bing, the first result is the old page
<adrien_oww>
which means there are more (or roughly as many) pages pointing to the old one
<adrien_oww>
which is pretty bad
<vpm>
afaik, ddg results are the same for everyone
<adrien_oww>
not necessarily
<adrien_oww>
I purposefuly make ddg tailor its results to my searches because I tend to look up specific things :-)
<adrien_oww>
but it's been a looooong time I last looked up lablgtk stuff
<gasche>
thomasga: if you participate to setting up OUPS, and/or Fabrice is around, could you mention to the next talkers the fact that it would be better if their slides were in english?
<gasche>
while I don't think that should be a requirement, it would make the content much easier to diffuse to the wider OCaml community
csakatoku has joined #ocaml
<gasche>
(I think that would be a good "soft policy" to mention on the website (if it exists))
<adrien_oww>
(slides, but not necessarily speaking in english)
<gasche>
of course
<gasche>
I think speaking in French makes much more sense
<gasche>
and if the occasional non-francophone comes to attend, he/she can read the slides
dsheets has joined #ocaml
<gasche>
in computer science research, doing english slides (and then speaking in whichever language a large majority understands) is the norm
<thomasga>
gasche: I'm don't participate to settings up OUPS, I'm in Nice :p
<thomasga>
(so I should create OUNS I guess)
mathieui is now known as MATHIEUI
<Kakadu>
I forget again: if I add some ocaml function to yacc file is it possible to see their signatures automatically in mli file?
<gasche>
Kakadu: apparently not
<gasche>
that's one of the conclusion of the discussion with pippijn yesterday
<gasche>
you should put those in a separate module
<Kakadu>
TT
ygrek has quit [Ping timeout: 248 seconds]
MATHIEUI is now known as mathieui
<Kakadu>
gasche: Very sad that it is available with custom Makefile but not with ocamlbuild
mcclurmc has joined #ocaml
ollehar has quit [Read error: Operation timed out]
dsheets has quit [Ping timeout: 256 seconds]
<Kakadu>
Can somebody remember me why ocamllex raises exception when Eof?
<Kakadu>
And why it sometimes catched by ocamlyacc and sometimes not?
<Simn>
You can define a token rule for eof, no?
<Kakadu>
yeah but in examples they raise exception and everything workd
<Kakadu>
works*
<Kakadu>
anyway. with token EOF it works
<Kakadu>
I'm sure that parser-combinators if they are slow they aren't so mistical
dsheets has joined #ocaml
<gasche>
Kakadu: what do you mean "available with custom Makefile but not with ocamlbuild"?
<gasche>
ocamlbuild has a -use-menhir option
<Kakadu>
gasche: ocamlyacc generates two files: .ml and .mli
<Kakadu>
in my Makefile I do ocamlc -i file.ml>file.mli
<Kakadu>
that's why I see my definitions in mli
<Kakadu>
ocamlbuild doesn't overwrite .mli
tane has joined #ocaml
ollehar has joined #ocaml
csakatoku has quit [Remote host closed the connection]
ttamttam1 has quit [Quit: ttamttam1]
justdit has joined #ocaml
<gasche>
Kakadu: I see; you should be able to pull that off by having some more code in your myocamlbuild.ml
<Kakadu>
ah, I forget about it
<gasche>
to be fair, I don't know what this mini-plugin would look like
gautamc has quit [Read error: Connection reset by peer]
gautamc has joined #ocaml
ollehar has quit [Read error: Operation timed out]
Yoric has joined #ocaml
_andre has joined #ocaml
ollehar has joined #ocaml
ttamttam has joined #ocaml
Drup has joined #ocaml
mort___ has joined #ocaml
ocp has joined #ocaml
tane has quit [Quit: Verlassend]
osa1 has joined #ocaml
Yoric has quit [Ping timeout: 264 seconds]
tianon has quit [Ping timeout: 260 seconds]
mort___ has left #ocaml []
<pippijn>
gasche: did you see the short document?
bastian__ has joined #ocaml
<bastian__>
hi. is there any guide available on how to setup a project to get started? already installed opam and i'd like to use it
<bastian__>
orbitz: i understand how to use opam, i'm trying to figure out how to create the infrastructure for a simple project
<bastian__>
e.g., howto specify dependencies, use them in code, compile the code, and run it
beckerb has joined #ocaml
<orbitz>
bastian__: dependencies are sepcific in opam packages which are distinct from your project
<bastian__>
orbitz: sure, each libraries specifies other dependencies. just want to write a simple program using libraries I installed using opam
<orbitz>
bastian__: setup a OcamlMakefiel project or oasis or build your own, whichever
<orbitz>
Use ocamlfind during compilation though
dezzy has quit [Quit: leaving]
<gasche>
pippijn: looking at it, thanks
<pippijn>
it's a little rough, I was very tired yesterday
<whitequark>
hmm, is Core expected to work with js_of_ocaml?
<adrien_oww>
I don't think so
<adrien_oww>
it relies on C libraries
<whitequark>
I only have -package core, and open Core.Std; js_of_ocaml reports a slew of unknown identifiers and dies with "unix_inet_addr_of_string is not defined"
<whitequark>
I see.
<thomasga>
whitequark: that's the purpose of core_kernel
<orbitz>
There was a thread about this this month or last
<thomasga>
but I think that is not fully working yet
<orbitz>
I think sebastian did some tricks to get subsets of it working
tianon has joined #ocaml
<pippijn>
gasche: actually the program itself is also quite rough, I made it for a very specific use case, and it is part of my first ocaml project
<gasche>
so pippijn if I understand correctly
<orbitz>
thomasga: A CUFP talk proposal doesn't require an abstract?
dezzy_ has joined #ocaml
<gasche>
you (1) did some work to automatically tell the user would allow to go further in the parse (instead of the last wrong token given) (2) provide a framework for overriding that with hand-crafted error messages for some specific (error state, erroneous token read) pairs?
dezzy_ is now known as dezzy
<pippijn>
yeah
<pippijn>
I think you're missing a word in that sentence, but yes
<pippijn>
and the token match is optional
<gasche>
I don't really like the fact that you're changing the existing syntaxes for fairly minor reasons
<pippijn>
you can have a specific message for each token at a state
<pippijn>
gasche: you mean the nested function?
<gasche>
hm
<gasche>
I hadn't noticed that, do you rely on indentation for bracketing? urgh
<pippijn>
no
<gasche>
you present "%s" as syntactic sugar
<pippijn>
it's unambiguous
<gasche>
because of _ ? urgh
<pippijn>
well
<pippijn>
like I said
<pippijn>
I started ocaml a year ago
<pippijn>
and this is about the second thing I did
<pippijn>
after (during) the C parser
<pippijn>
so it's far from perfect, but demonstrates the ideas
<pippijn>
looking at the code and behaviour while writing this readme, I noticed many things I would have done differently now
<gasche>
I think it would be better if you didn't make any change to the syntax
<gasche>
I mean you could probably compile the error-overriding file as a regular OCaml file, with only minor change to what you write right now
<gasche>
and give it the right semantics
<pippijn>
I had a specific use case for which I wanted the easiest and shortest way
<bastian__>
orbitz: is oasis what most projects use?
<pippijn>
so, you would be less unhappy if the syntax didn't look like ocaml, at all?
Simn is now known as Simn|gone
<gasche>
I don't think there are benefits to using a specific parser and processor for sample files
<gasche>
while the OCaml semantics already allows to express all that just fine
<pippijn>
ok
<gasche>
if I understand correctly the semantics
<gasche>
you could use
<pippijn>
you could write it as data structure
<pippijn>
because that's what this is, of course
<pippijn>
it's no code, it's a nested data structure
<gasche>
[ "open", (fun tok -> function EOF -> "..." | tkIDENT -> sprintf "expected ident %s" tok | ...); "open Foo ..", (fun tok -> function ...)]
<pippijn>
and then you could compile the data structure as code and somehow load it into the message generator
<pippijn>
the main point of the merr program is to translate "open Foo let message" to 10
<gasche>
could you use abstract symbols instead of integers, eg. define a (type message = OpenFoo | TypeConstructor | ...)?
<gasche>
which just the code you give (thanks, it's clearer indeed) I don't understand how Libmerr.Make can actually *produce* one of those 'state' values
<pippijn>
and who would translate the state number from the parser to those symbols?
<gasche>
oh
<gasche>
I thought those were just consecutive integers
<pippijn>
there is no 16
<gasche>
but they're not, they correspond to parser-generator-generated state numbers, ok
<pippijn>
besides that, I did, in merr, try to be exhaustive
<pippijn>
which is simple, because the grammar is very simple
<gasche>
but why do you have to specify that (state = int) then?
<gasche>
ah
<pippijn>
hmm
<pippijn>
I don't remember :) let me check
<gasche>
I think I remember reading in somewhere that "state" is an abstract datatype from the generated parser point of view
<gasche>
that's probably related
<pippijn>
yes
<gasche>
(yeah, when looking at menhir-generated code yesterday to investigate someone's feature request)
<pippijn>
I tried to make most of the code agnostic to what the actual type of state is
<pippijn>
but here, I need to match it
wmeyer` has joined #ocaml
<pippijn>
so I need to use the fact that it is in fact int
<pippijn>
but I didn't want libmerr (which is 40 loc, btw) to know that
<pippijn>
I can still do that, but not in this part of the parser
<gasche>
indeed
<pippijn>
the parser doesn't know the a concept of "identifiers"
<gasche>
I think it's better after-parsing anyway
<pippijn>
it just knows tokens
<gasche>
in OCaml it's done in the type-checker
<pippijn>
right
<gasche>
which is helpful to get the 'identifier classes' that are more precise that just lexical classes
<pippijn>
in C, I would still be doing it inside the parser
<gasche>
(eg. it will only suggest class names where a class name is expected)
<orbitz>
bastian__: I don't know, I've never used it. For a simple thing I'd suggest just starting with OcamlMakefile
<pippijn>
while building the symbol table
<pippijn>
actually, that could indeed be done in the type check
<gasche>
orbitz: for simple things I use ocamlbuild and it's perfect
introom has quit [Remote host closed the connection]
<gasche>
pippijn: looking at your handwritten error messages
<gasche>
where there is an EOF, you say what should be written
<gasche>
and where there is a token, you say that the token is wrong
<gasche>
isn't the EOF information actually more useful?
<gasche>
ah sometimes you say both
<pippijn>
:)
<pippijn>
room for improvements
<pippijn>
I didn't think anybody would be interested in it last year
<pippijn>
and indeed nobody was
<pippijn>
I tried to promote it here
<gasche>
I had the luck of not being on IRC last year
<gasche>
I don't like IRC.
<gasche>
regarding "not quite the OCaml syntax"
<gasche>
in retrospect I think it's not bad that your tool uses a dedicated parser, because it makes it self-describing in a sense
<gasche>
you are your own use-case
<gasche>
so in that persective, indeed I would recommend to use a dedicated syntax that looks like a structured markup for data, and *not* nearly-but-not-quite OCaml source
<pippijn>
ok
<pippijn>
I thought it was a good idea, because it can be seen as a source to source translation
<gasche>
(though I do think that just writing plain OCaml syntax, that would be slightly less convenient but not by much, would actually be a better engineering choice in an absolute sense for users; but eating your own dogfood is a good maintainer-side methodology)
<pippijn>
the only thing the program does is replace sample text with state numbers
<pippijn>
I didn't know of camlp4 at that time
<pippijn>
besides that it could give me sexplib
<pippijn>
maybe I can use camlp4 or compiler libs and have actual ocaml syntax with just a source filter
introom has joined #ocaml
<pippijn>
but then merr would no longer be its own use case :)
<gasche>
yes
<pippijn>
I still have 2 others, though
<gasche>
camlp4 quotations, or the current experiments in the extension_points branch, would both be suitable
<pippijn>
quotations are not necessary
<pippijn>
just a source filter is enough
<gasche>
I don't like source filters when their input source is a valid OCaml program
<gasche>
I think that having code that looks like valid OCaml code but actually has a different semantics is a terrible idea
<pippijn>
ok
<gasche>
the very point of quotation is that the foreign parts in the semantics are also foreign in the syntax
<pippijn>
that's ok, it can just be <:code<open Foo let message = function>> instead of ""
<gasche>
in that case you would eg. use <<type constructor>> instead of "type constructor"
<gasche>
and the user would know that something weirds happen here that requires him/her to read the documentation
jbrown__ has quit [Read error: Operation timed out]
<pippijn>
right
<pippijn>
that's better
jbrown__ has joined #ocaml
talzeus has quit [Remote host closed the connection]
<pippijn>
actually it wouldn't be so bad to let merr not be its own use case
<gasche>
(I'm not quite sure what's the best way to make sure that making a typo inside the quotation results in the appropriate error message at preprocessing time)
<pippijn>
for me :)
<pippijn>
a typo?
<gasche>
if you write <<type constructo>> instead
<gasche>
well I guess you check with the .mly on the other hand
<pippijn>
uhm
osa1 has joined #ocaml
<gasche>
to find the right state number anyway
<MarcWeber>
Is anybody in here knowing camlp4 and filters well I could pay for getting a small task done? The task would be about "write a tracing line for each ocaml command which gets executed, like what ocamldebug writes to stdout pressing step only"
<pippijn>
but that's the point of code samples
<pippijn>
have erroneous code
<pippijn>
which may involve typoes
<pippijn>
also, I don't read the mly
thomasga1 has joined #ocaml
thomasga has quit [Read error: Connection reset by peer]
<gasche>
yeah your mly-esque token description file
<pippijn>
ah
<pippijn>
that still doesn't know what the actual tokens look like
<gasche>
MarcWeber: what's an "ocaml command"?
<pippijn>
you can write anything for TkPIPE for instance
<MarcWeber>
(a; b; c) or if true then a else b
<gasche>
in the syntax you've shown me
<pippijn>
%token TkPIPE "a pipe/or sign"
<MarcWeber>
in this case I mean a,b,c
<gasche>
hm
<gasche>
branching to MarcWeber's question
<gasche>
MarcWeber: I thought you were happing with Camlp4SomethingSomething of the official distribution
<gasche>
specifically, instrumentCamlp4 and instrumentState
<MarcWeber>
gasche: I've already done so. Even though I'm an ocaml noob I'm not new to programming.
<gasche>
of course
Yoric has joined #ocaml
<gasche>
instrumentState keeps an ordered collection of points, and allows you to get them back : exactly what you need
<gasche>
but then instrumentCamlp4 has some logic to not re-record already-visited points
<gasche>
which needs to be disabled for your use-case
<MarcWeber>
gasche: Why keep a list? print_string is enough.
<gasche>
well it's more flexible in the long run
<gasche>
you are fine with diffing a text output, but having a list opens the door to all sort of automated treatment that doesn't have to re-parse the output
<gasche>
my advice would be to do whatever ugly hack you need to make bisect do what you personally do
<gasche>
and then send the patch to Xavier Clerc, in case it inspires him to re-implement that properly
<gasche>
(Xavier Clerc does very nice things, but he is also extremely busy and chances are he will never do anything.)
pootler has quit [Ping timeout: 268 seconds]
ygrek has joined #ocaml
raichoo has joined #ocaml
justdit has quit [Ping timeout: 264 seconds]
pootler has joined #ocaml
ollehar has joined #ocaml
bholst_ is now known as bholst
<pippijn>
gasche: I implemented a compression like you suggested.. and it's 50% increase :\
<pippijn>
but I know why
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
<pippijn>
it's terrible
<pippijn>
gasche: the dictionary takes so much space that it doesn't help
<pippijn>
better use huffman
<pippijn>
gasche: I split up the words in the character names, hashconsed them, and replaced them with their id
dsheets has quit [Ping timeout: 246 seconds]
<pippijn>
gasche: then, I serialised a string array * Codepoint.t array
<pippijn>
gasche: and in the codepoints, the "character name" part got an indirection: Name of string | Compressed of int list
osa1_ has joined #ocaml
<pippijn>
gasche: then, I guessed that of course, compressing every single word in e.g. CAPITAL LATIN LETTER A (note the "A")
osa1 has quit [Ping timeout: 264 seconds]
<pippijn>
gasche: is not going to help, so I added another indirection: Compressed of compressed_part list where type compressed_part = CompressedPart of int | UncompressedPart of string
<pippijn>
gasche: even worse :)
<pippijn>
gasche: I added a threshold for part length to be compressed, and I found that the best compression rate was if I don't compress at all
ygrek has quit [Remote host closed the connection]
hkBst has quit [Quit: Konversation terminated!]
ygrek has joined #ocaml
osa1_ has quit [Read error: Operation timed out]
osa1_ has joined #ocaml
jcao219 has joined #ocaml
breakds has quit [Quit: Konversation terminated!]
<ggole>
Hmm
<ggole>
There must be a german word for the mixture of frustration and delight when you finally find the cause of a problem and it is quite trivial
<pippijn>
what about the feeling you get when you think a problem has a simple solution, and you only found a hard solution, then spend a day researching the topic to find a better solution, and in the end you find that your solution was the best already?
cago has left #ocaml []
<ggole>
Dunno. German has words for lots of things.
<ggole>
English is terrible for describing thought.
mika1 has quit [Quit: Leaving.]
<MarcWeber>
pippijn You never know that your solution was best - because you never know what you've missed.
<pippijn>
MarcWeber: except when the solution is mathematically proven or at least widely believed to be the best
pootler has quit [Ping timeout: 240 seconds]
<ggole>
There's no general method for knowing something is optimal though
<pippijn>
not in general, no
justdit has joined #ocaml
ocp has quit [Read error: Operation timed out]
gasche has quit [Read error: Connection reset by peer]
bkpt has joined #ocaml
djcoin has quit [Quit: WeeChat 0.4.0]
raichoo has quit [Quit: leaving]
<hcarty>
Does someone have easy access to a recent 4.01.0 OCaml install with findlib? I think I found a bug in 4.00.1's ocamlbuild + ocamlfind and I'd like to check if it's fixed in 4.01.0 before reporting.
<ygrek>
you mean trunk? 4.01 is not released, isn't it?
<ygrek>
* is it?
<hcarty>
On 4.00.1 this gives "ocamlfind: Error from package `threads': Missing -thread or -vmthread switch"
<hcarty>
ygrek: Not released but it's been branched from trunk
ttamttam has joined #ocaml
<ygrek>
nice to hear
redfire has joined #ocaml
ttamttam has left #ocaml []
<adrien_oww>
wmeyer`: hi, heard anything from the CI? is it publicly readable?
mort___ has joined #ocaml
Watcher7|off is now known as Watcher7
justdit has quit [Ping timeout: 264 seconds]
justdit has joined #ocaml
Simn|gone is now known as Simn
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
gasche has joined #ocaml
<hcarty>
The threads bug still exists in 4.01.0+dev. Bug report filed. With luck (where luck = someone who knows what they're doing has time to fix it) a fix will make it into 4.01.0.
zpe has joined #ocaml
dsheets has joined #ocaml
darkf has quit [Quit: Leaving]
zpe has quit [Remote host closed the connection]
ollehar has quit [Ping timeout: 256 seconds]
mort___ has left #ocaml []
chrisdotcode has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
dsheets has quit [Ping timeout: 246 seconds]
raichoo has joined #ocaml
introom has quit [Remote host closed the connection]
<pippijn>
18:20 < teotwaki_> Also, Qt is off topic.
<pippijn>
in ##c++
* pippijn
wanders off back into #ocaml
<adrien>
well, Qt is not C++ :P
<adrien>
different matter and using the Qt library makes some things very Qtish
Kakadu has quit [Quit: Konversation terminated!]
<pippijn>
it's also not ocaml, but it is still being discussed here
<whitequark>
there's also ##c
ollehar has joined #ocaml
<adrien>
pippijn: as a library, not as a framework
<pippijn>
it was about QList
<adrien>
well, it's difficult to handle the questions about all the reimplementations
<pippijn>
*shrug*
<adrien>
a Qt question is probably better suited at #qt where people will actually know Qt (and not only some of them)
<pippijn>
if two people in #ocaml discuss implementations of dynamic arrays in whatever language, I don't care
<pippijn>
I'll probably read it and maybe join in
<pippijn>
it wasn't a question
<pippijn>
people were discussing it
<adrien>
yeah, no reason to be an ass but it's also a matter of scale
<pippijn>
and other people telling them to stop it
<pippijn>
I think it's just some kind of allergy
pootler has joined #ocaml
<pippijn>
when Qt is mentioned, people go all "omg don't want"
<pippijn>
they were comparing std::vector and QList
<pippijn>
I think that's a valid topic in a C++ channel
<adrien>
yeah, I definitely agree on that
<adrien>
my point was that some questions, while possibly appropriate, were better suited for another channel
<adrien>
but people on some channels are really pissy
<pippijn>
it's also an excuse not to need to answer when they don't know the answer
<companion_cube>
iirc ##c++ is full of pedantic people, discussions about anything but the standard are on ##c++-general
<companion_cube>
or something like this
<whitequark>
they were invoked with -pedantic -Wall -Werror
pootler_ has joined #ocaml
pootler has quit [Ping timeout: 252 seconds]
justdit has quit [Ping timeout: 276 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 248 seconds]
redfire has quit [Quit: WeeChat 0.4.0]
breakds has joined #ocaml
ontologiae_ has quit [Ping timeout: 264 seconds]
<pippijn>
I wonder what is more efficient in java: a branch or a virtual method lookup
<pippijn>
I'm going for the virtual method, because it's cleaner in this case, but I'm still wondering
<pippijn>
in my application, it's never going to be noticable, anyway
<whitequark>
pippijn: I'd say about same, if on JRE7
<whitequark>
(I'm assuming that your virtual method lookup can be transformed to a branch.)
ulfdoz has joined #ocaml
tianon has quit [Quit: "I'm a very important man. I've got a tower!"]
Simn is now known as Simn|gone
<whitequark>
menhir's conflict explanations are completely awesome.
<pippijn>
whitequark: it's probably going to be a vtable lookup
<pippijn>
whitequark: and it won't be statically bound
<whitequark>
pippijn: remember: JIT.
<whitequark>
if it's bimorphic in practice, it will be optimized to a branch
<whitequark>
over, I guess, vtable pointer.
<pippijn>
ok, it's unlikely to be statically bound
<whitequark>
what do you mean by "statically"?
<pippijn>
devirtualising
<whitequark>
ok
<pippijn>
but yeah, it's bimorphic
<pippijn>
so I guess that will be a branch
<pippijn>
doesn't matter anyway
<pippijn>
it's not being called often
<whitequark>
you'd need to have a method called 10k-20k times (depending on flags) for it to be optimized
<pippijn>
in what timeframe?
<adrien>
two fortnights
<pippijn>
heh
<whitequark>
lol. I think JVM doesn't restrict timeframe
<pippijn>
because it's a potentially long-running server
<pippijn>
so eventually, things get optimised
<whitequark>
that'd need syscalls and so on. it just counts method calls.
<whitequark>
yes
<whitequark>
JVM is tailored for long-running servers.
<whitequark>
in theory it has a -client mode, but since most desktops these days are x86_64 and have tons of RAM... JVM switches itself to -server anyway.
<pippijn>
on my old laptop, eclipse was very slow one day (something to do with the graphics driver, I think), but I have enough ram, so I set the compiler threshold to 50 calls
<pippijn>
eclipse took 5 minutes to boot, but after that it was on fire
<whitequark>
graphics driver?
<whitequark>
it's unlikely that forcing JVM to optimize code would fix *that*.
<pippijn>
nvidia sometimes suddenly makes gtk slow
<whitequark>
ugh. don't wanna know.
<whitequark>
:D
<pippijn>
after some week/months, it's back to normal
<pippijn>
Qt is never affected
jsvgoncalves has joined #ocaml
yacks has joined #ocaml
thomasga1 has quit [Quit: Leaving.]
beckerb has quit [Ping timeout: 245 seconds]
jsvgoncalves has quit [Read error: Operation timed out]
<Drup>
(that's the precise reason why I don't use it)
<whitequark>
well, it's Digia now
ygrek has joined #ocaml
<pippijn>
Drup: my link describes the licencing conditions
<pippijn>
licensing*
<Drup>
pippijn: yes but the LGPL text is linked
tane has joined #ocaml
<Drup>
I'm quite surprised, I was expecting the svg to be an horrible mess but it seems quite doable.
Kakadu has joined #ocaml
Simn|gone is now known as Simn
ollehar has joined #ocaml
ggole has quit []
osnr has quit [Quit: Leaving.]
ttamttam has joined #ocaml
emmanuelux has joined #ocaml
ttamttam has left #ocaml []
wmeyer has joined #ocaml
<wmeyer>
hello
<Kakadu>
hey
<wmeyer>
hey Kakadu!
<adrien>
o/
<wmeyer>
\o
<Kakadu>
Have you ever seen parser generating combinators? (i.e. parser combinators return description (ast-like) of parser, after some transformation this description is compiled (in runtime) into parser-functions which are executed
<pippijn>
hi wmeyer
<wmeyer>
hi pippijn
<pippijn>
parser combinators are not AST
<pippijn>
they are functions that do actual parsing
<wmeyer>
Kakadu: your description made my brain burn :-)
osa1_ has quit [Remote host closed the connection]
<wmeyer>
after pippijn it's a start "closure compilation scheme"
<wmeyer>
s/start/standard/
osa1_ has joined #ocaml
<wmeyer>
you can of course build AST and then build an evalutor
<Kakadu>
wmeyer: yeah, I already thought about evaluator
<wmeyer>
but it will be even slower
ontologiae_ has joined #ocaml
<wmeyer>
it has some advantages, first of all you can perform deconstruction and matching
<Kakadu>
what about factorization using this AST and detecting left recursion in simple cases?
<wmeyer>
you can do it, usually that's what standard packrat generators do on the level of AST
<Kakadu>
wmeyer: have u seen something like this? (in Haskell maybe?)
<pippijn>
in C++, with its massive inlining (or even better, haskell), parser combinators make sense
ygrek has quit [Ping timeout: 256 seconds]
* wmeyer
will have an apple
osa1_ has quit [Remote host closed the connection]
osa1_ has joined #ocaml
* wmeyer
is impressed by Idris
<adrien>
what is it?
<wmeyer>
it's a dependently typed language
<wmeyer>
the good thing about it is that, gives a really good and clean syntax for dependently typed programming, but performance of the EDSLs is really good, due to partial evaulation
ontologiae_ has quit [Ping timeout: 276 seconds]
<pippijn>
and nat is a linked list
<wmeyer>
pippijn: please :-)
<wmeyer>
it compiles to C though
<wmeyer>
you don't need number in the compiler don't you?
<wmeyer>
most often only for the optimisations of the target language
<pippijn>
hm?
<wmeyer>
how often you add and multiply big numbers in your code
<wmeyer>
in numerical, yes, but then don't use nat! use z or positive
<wmeyer>
or floats
<pippijn>
yeah
<pippijn>
not often, I think
<wmeyer>
nats are only useful for dependently typed data types, for indexing something
<wmeyer>
not for generic calculations :-)
<pippijn>
so it's written in haskell
<wmeyer>
pippijn: yes, it's haskell
* wmeyer
++ shower
<pippijn>
interesting
<pippijn>
javascript?
<pippijn>
compileEpic f t = fail "Epic backend disabled"
<pippijn>
haha
mlh has quit [Read error: Connection reset by peer]
<adrien>
wmeyer: enjoy :D
<adrien>
wmeyer: I'm a bit tired so I hope I haven't forgotten or messed up something
mlh has joined #ocaml
* whitequark
almost done with source parser
<whitequark>
then, it's IR parser and dumper... hrmpf
<whitequark>
pippijn: how would you model typical SSA IR in ocaml? mainly use lists
<MarcWeber>
And that does no longer compile (giving the error above)
<MarcWeber>
ignore the type annotation, it was an attempt by me to make it compile.
<MarcWeber>
Adding parameters fixes it ..
<Drup>
I was going to propose just that :)
<MarcWeber>
but that does not work in the empty case.
<MarcWeber>
In that case adding the type helped.
<MarcWeber>
I just don't understand why.
<Drup>
what is the error with empty ?
<MarcWeber>
I can no longer reproduce it?
<Drup>
MarcWeber: about the find_all/filter problem, this is because of a limitation in caml (and in the ML family in general, I think) : For a type variable to be generalized, it must appears in a binding, so the type checker can not generalized type variables in an expression like "let f = g"
<Drup>
This is called the value restriction, the reason are quite technical and I'm not the best person to explain you that, so I will let you ask more competent people if you want details
<MarcWeber>
A workaround is good eonugh .. :)
<Drup>
the workaround is basically "add all the arguments", it's often enough.