gusta911 has quit [Remote host closed the connection]
gustav__ has joined #ocaml
emmanuel__ has joined #ocaml
emmanuelux has quit [Ping timeout: 244 seconds]
emmanuel__ has quit [Read error: Connection reset by peer]
gnuvince has joined #ocaml
eikke has quit [Ping timeout: 245 seconds]
eikke has joined #ocaml
jamii has joined #ocaml
kennyd has joined #ocaml
fayden has quit [Ping timeout: 265 seconds]
eikke has quit [Ping timeout: 252 seconds]
madroach has quit [Ping timeout: 244 seconds]
madroach has joined #ocaml
fayden has joined #ocaml
milosn has quit [Ping timeout: 246 seconds]
emmanuelux has joined #ocaml
emmanuelux has quit [Read error: Operation timed out]
tac has joined #ocaml
BiDOrD has joined #ocaml
BiDOrD_ has quit [Ping timeout: 265 seconds]
dmj111 has joined #ocaml
parlancho has quit [Ping timeout: 252 seconds]
kennyd has quit [Ping timeout: 276 seconds]
monadicity has quit [Quit: Leaving]
kennyd has joined #ocaml
weie has joined #ocaml
hongboz has joined #ocaml
gnuvince has quit [Quit: Remember when men were men and regular expressions recognized regular languages?]
gustav__ has quit [Ping timeout: 248 seconds]
gnuvince has joined #ocaml
Yoric has joined #ocaml
Yoric has quit [Remote host closed the connection]
olasd has quit [Read error: Operation timed out]
gnuvince has quit [Read error: Connection reset by peer]
gnuvince has joined #ocaml
teamon has quit [Ping timeout: 250 seconds]
dmilith has quit [Ping timeout: 248 seconds]
everyonemines has joined #ocaml
Leonidas has quit [Ping timeout: 244 seconds]
teamon has joined #ocaml
dmilith has joined #ocaml
vpm has quit [Ping timeout: 255 seconds]
Leonidas has joined #ocaml
olasd has joined #ocaml
olasd has quit [Changing host]
olasd has joined #ocaml
lopex_ has joined #ocaml
vpm has joined #ocaml
bobry_ has joined #ocaml
fantasticsid has joined #ocaml
dmj111 has quit [Ping timeout: 252 seconds]
cdidd has quit [Remote host closed the connection]
hongboz has left #ocaml []
jamii has quit [Ping timeout: 265 seconds]
tac has quit [Quit: Page closed]
tac has joined #ocaml
tac has quit [Client Quit]
tac has joined #ocaml
mattrepl has quit [Quit: mattrepl]
myx has joined #ocaml
jewel has quit [Ping timeout: 252 seconds]
sampego has joined #ocaml
ocp has joined #ocaml
tac has quit [Quit: Page closed]
everyonemines has quit [Quit: Leaving.]
ttamttam has joined #ocaml
ontologiae has joined #ocaml
fusillia has joined #ocaml
Snark has joined #ocaml
ontologiae has quit [Ping timeout: 265 seconds]
mika1 has joined #ocaml
cago has joined #ocaml
troydm has quit [*.net *.split]
dezzy has quit [*.net *.split]
testcocoon has quit [*.net *.split]
wagle has quit [*.net *.split]
sivoais has quit [*.net *.split]
NaCl has quit [*.net *.split]
patronus1 has quit [*.net *.split]
Derander has quit [*.net *.split]
dezzy has joined #ocaml
troydm has joined #ocaml
testcocoon has joined #ocaml
wagle has joined #ocaml
sivoais has joined #ocaml
NaCl has joined #ocaml
patronus1 has joined #ocaml
Derander has joined #ocaml
thomasga has joined #ocaml
ontologiae has joined #ocaml
Kakadu has joined #ocaml
lolcathost has quit [Ping timeout: 255 seconds]
Siphonblast has joined #ocaml
lolcathost has joined #ocaml
mika1 has quit [Quit: Leaving.]
lolcathost has quit [Ping timeout: 260 seconds]
mika1 has joined #ocaml
lolcathost has joined #ocaml
larhat has joined #ocaml
tane has joined #ocaml
larhat1 has joined #ocaml
larhat has quit [Read error: Connection reset by peer]
ttamttam1 has joined #ocaml
ttamttam1 has quit [Client Quit]
tane has quit [Quit: Verlassend]
lopex has quit [Remote host closed the connection]
bobry has quit [Write error: Broken pipe]
bobry_ has quit [Remote host closed the connection]
lopex_ has quit [Write error: Broken pipe]
_andre has joined #ocaml
lopex_ has joined #ocaml
bobry_ has joined #ocaml
Yoric1 has joined #ocaml
fantasticsid has quit [Ping timeout: 252 seconds]
tane has joined #ocaml
ikaros has joined #ocaml
mika1 has quit [Quit: Leaving.]
ftrvxmtrx has joined #ocaml
lolcathost has quit [Quit: leaving]
tane has quit [Quit: Verlassend]
nimred_ has quit [Ping timeout: 264 seconds]
nimred has joined #ocaml
nimred has quit [Changing host]
nimred has joined #ocaml
logicgeezer_ has quit [Remote host closed the connection]
Yoric1 has quit [Ping timeout: 246 seconds]
troydm has quit [Read error: Operation timed out]
lolcathost has joined #ocaml
<fasta_>
The problem with emacswiki is that there is no janitor for user-contributed comments that have no information content.
<fasta_>
They all want to live peace fully with eachother, but it's simply not true that every comment is as useful. Some comments are mathematically dominating others.
lolcathost has quit [Quit: leaving]
mika1 has joined #ocaml
fantasticsid has joined #ocaml
mika1 has quit [Client Quit]
xavierm02 has joined #ocaml
<xavierm02>
hey
<xavierm02>
Is it a good or a bad idea to define helper functions inside the function needing them?
<xavierm02>
File "booleanExpression.ml", line 110, characters 10-11:
<xavierm02>
which is line 9 in the file i posted
<xavierm02>
Error: Syntax error
parlancho has quit []
<xavierm02>
Is there some way to get "hints" abotu what the syntax error is?
<xavierm02>
like "missing ***"
<xavierm02>
"unexpected ***"
<xavierm02>
?
<flux>
well, you can run the preprocessor somehow to extract those parser-keywords for you
<flux>
not exactly sure how :)
<xavierm02>
:/
timeless has joined #ocaml
timeless is now known as tripleffect
<tripleffect>
Hey! I have a problem downloading OCaml installer for Windows. It always stops when ~1MB is left no matter what version I try to download and no matter the source. What's wrong?
<flux>
tripleffect, that's like really weird
<flux>
tripleffect, I would immediately blame your firewall or antivirus for detecting a pattern it blocks
<adrien>
tripleffect: avast?
<tripleffect>
Well, yes.
<adrien>
had a similar issue
<adrien>
had to disable the AV (had no time to complain to avast)
<tripleffect>
thanks, I will try disabling it then.
tane has quit [Quit: Verlassend]
<tripleffect>
got it, thanks a lot, I thought I would have to download it at the university on some linux build.
<Qrntz>
xavierm02, you should probably have a space between «[<» and «'»
myx has quit [Ping timeout: 260 seconds]
jewel has joined #ocaml
lihaitao has joined #ocaml
<tripleffect>
I have to switch to something else, avast sees a trojan. Who would put a trojan in the package letting people program in their language... Unreasonable.
<adrien_oww>
you can send a notice to the avast people; they should be fairly reactive
<Qrntz>
I hope you meant switching to something else from Avast, not OCaml :-p
<tripleffect>
Yes, I meant the AV of course. ;)
<adrien>
hmm, btw, actually avast spots the ocaml bytecode as a virus
<adrien>
which is not that surprising
<tripleffect>
Well, I need to learn to code in OCaml for dissertation purposes, so I will have to do something about this whatever it's going to be. It's hard to talk about functional programming noting just Microsoft's language.
eikke has joined #ocaml
<flux>
tripleffect, what's your thesis going to be about?
larhat has joined #ocaml
<tripleffect>
it's very general right now, modern use of functional programming in business.
<tripleffect>
but I guess it's better when it's general at this point as it's for the engineering degree. this way it may be expanded later focusing on something in particular.
<tripleffect>
ok, I sent a notice to Avast.
larhat has quit [Ping timeout: 256 seconds]
larhat has joined #ocaml
<tripleffect>
A lot of programming languages need a bytecode for the compiler. Why would it spot the OCaml's as a virus? Because it's not mainstream like C/C++?
<tripleffect>
f# takes a lot from OCaml and I've got no problem with it using Avast at the same time... :/
tane has joined #ocaml
<thizanne>
tripleffect: Avira also blocks OCaml, fyi
<adrien>
tripleffect: "in doubt, delete" maybe
<tripleffect>
I should get a small notebook with some Unix based OS for programming purposes. I'm angry I bought a 15.6'' screen laptop which is still too big to take it every day with you.
<tripleffect>
But I had no plans of studying IT then. :P
<Kakadu>
15.6 is cool
<Kakadu>
AFAIR in 19th century many people was using very heavy walking sticks
<Kakadu>
They used them to have strong arms for guns
<Kakadu>
They wanted to increase their chances to win in a duel
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<Kakadu>
So, heavy laptop may be a plus
<tripleffect>
it's cool when you want a portable pc to play games and run all mainstream applications. it gets more complicated when you want to put it into your backpack and go to your university jumping for example. ;)
<tripleffect>
I have to drive to my uni, so taking it is not a problem. Pre-installed OS is a problem because it complicates adding another system.
<Kakadu>
What is preinstalled?
lihaitao has quit [Quit: Ex-Chat]
Kakadu has quit []
ftrvxmtrx has quit [Quit: Leaving]
<mk270>
tripleffect: you could also stick linux/bsd in a virtualbox on your existing hardware?
<tripleffect>
I've got windows 7 pre-installed with some embedded components from my laptop producer. if I need a fresh installation, I have to boot 4 DVDs.
<mk270>
well, get cygwin if you don't have it already, and get virtualbox and install linux in it
fraggle_laptop has joined #ocaml
<tripleffect>
mk270: sure but still it would present problems such as speed.
<mk270>
what, ocaml on cygwin?
<tripleffect>
no... all other applications running.
<adrien>
tripleffect: not for CPU-bound tasks
<mk270>
tripleffect: i'm obviously a bit unfamiliar with your performance requirements?
<adrien>
and for I/O you can get pretty good speeds too
<mk270>
there are probably quite a few xensource etc folks in here who know more about performance under virtualisation than i do, but you'll often find it's surprisingly acceptable
<tripleffect>
it all should run smoothly with 8GB of RAM and Core i5 at 2.4 GHz, it's definitely enough. I just have too much applications installed as my laptop is used for a lot of purposes. ;)
<mk270>
ok, so, you may be better off running windows in virtualbox on linux
<mk270>
as then your base case won't have all these crazy apps running, as linux does measurably less of that kind of thing without being told to
<mk270>
i think i'm starting to get facetious. excuse me :)
cdidd has joined #ocaml
<tripleffect>
I know my skills are still definitely low here, lower than average for sure. I moved from a hobbyist to a student quite fast and unexpectedly.
<xavierm02>
Qrntz: I added the space and renamed parser to parse but it still give the same error :/ http://pastebin.com/6c0sKFeh
<tripleffect>
Thanks for all the advice, I will seek some solution as time goes by fast and I will need a better environment for programming purposes.
<tripleffect>
And again thanks a lot for solving this downloading problem. ;)
<tripleffect>
I've got to go. Cheers!
tripleffect has quit [Quit: ChatZilla 0.9.89 [Firefox 17.0.1/20121128204232]]
mika1 has quit [Quit: Leaving.]
fusillia has quit [Remote host closed the connection]
rossberg has quit [Quit: Leaving]
mika1 has joined #ocaml
mattrepl has joined #ocaml
larhat has quit [Ping timeout: 252 seconds]
mika1 has quit [Quit: Leaving.]
andreypopp has joined #ocaml
andreypopp has quit [Excess Flood]
andreypopp has joined #ocaml
andreypopp has quit [Excess Flood]
mika1 has joined #ocaml
andreypopp has joined #ocaml
andreypopp has quit [Excess Flood]
andreypopp has joined #ocaml
andreypopp has quit [Excess Flood]
kennyd has quit [Read error: Connection reset by peer]
andreypopp has joined #ocaml
andreypopp has quit [Excess Flood]
andreypopp has joined #ocaml
andreypopp has quit [Excess Flood]
larhat has joined #ocaml
thomasga has quit [Quit: Leaving.]
sampego has quit [Quit: Page closed]
fraggle_laptop has quit [Remote host closed the connection]
beckerb_ has quit [Quit: Konversation terminated!]
tane has quit [Quit: Verlassend]
mika1 has quit [Quit: Leaving.]
tane has joined #ocaml
cago has left #ocaml []
mika1 has joined #ocaml
mika1 has quit [Client Quit]
<thelema>
stock ocamlbuild doesn't seem to have a tag to enable -bin-annot, does it? I can find the -annot flag with "ocamlbuild -documentation | grep annot", but no bin-annot
maufred has quit [Remote host closed the connection]
<thelema>
fixed bin-annot problem with a line in myocamlbuild.ml (shouldn't be ncecessary to do, but easy enough to add for one project): flag ["ocaml"; "compile"; "bin_annot"] (S[A "-bin-annot"]);
<thelema>
now on to next problem: typerex2 doesn't look in _build directory for .cmt files
<pippijn>
what's bin-annot for?
<thelema>
pippijn: to produce .cmt files, which have more information than .annot files
<pippijn>
ah
Yoric has joined #ocaml
<mk270>
thelema: how easy would it be to make myocamlbuild.ml support syntax extensions (eg for lwt)?
<thelema>
mk270: I don't think you need to touch myocamlbuild.ml to use sytnax extensions installed using findlib like lwt
<mk270>
thelema: i'm trying to drive this from oasis...?
<thelema>
just add tags to depend on the lwt package and enable syntax extensions
smondet has joined #ocaml
<mk270>
thelema: no, oasis doesn't add those tags; that's the problem
<thelema>
yes, just add them yourself; it'll work fine.
<thelema>
better to put them in _tags than in myocamlbuild
<mk270>
thelema: i know. i want oasis to do it, though
<thelema>
mk270: oasis doesn't currently suport syntax extensions automatically
<mk270>
yes. my question is how hard is it to change that?
<thelema>
you can put a dependency on lwt.syntax in the _oasis file
<mk270>
but is that going to work?
<pippijn>
yes, I think that works
Yoric has quit [Ping timeout: 265 seconds]
<thelema>
but because of the revised syntax, ocamlfind requires being told whether to use camlp4o or camlp4r, so you need to put syntax(camlp4o) in your _tags file
<mk270>
is there an example somewhere on the web?
<mk270>
yeees
<thelema>
outside what oasis does.
<mk270>
how hard is it to patch oasis to do that for me?
metadave has joined #ocaml
<thelema>
you'd have to patch the oasis distribution for others to be able to use your _oasis file and get the same result, not just a local change, right?
<mk270>
yes
<thelema>
I don't know how hard oasis is to hack on; I've tried to figure out its internals once upon a time, and gave up; maybe with something smaller like this, I'd be able to find the right place.
<mk270>
which involves not breaking existing _oasis files
<thelema>
that's not too bad; it'd probably involve modifying just one plugin, which would bump its rev, and since plugins are versioned, I think the existing _oasis files would work.
<thelema>
I'm surprised that sylvain hasn't done what looks like the simplest thing that could work: adding a tag to tell oasis whether to use camlp4o or camlp4r for syntax extensions
<thelema>
s/tag/oasis field/
<mk270>
well, i emailed him, and he's understandably busy with more important things :)
<mk270>
but for me this is on the critical path to documenting "i know ocaml, but i dont know the current build system, and i want to use lwt"
<thelema>
having this done for you automatically shouldn't be a blocker, but ok, I guess it's good that you want to help remove this clumsiness for future users
<mk270>
well, i intend on being a net consumer of the work of future ocaml users :)
<thelema>
me too.
<thelema>
that dir is where I'm starting to look for how to modify the plugin to support a new field
<mk270>
yes, i'd found that file already
<mk270>
but oasis seems modular but complicated
<thelema>
I agree.
<thelema>
There's a ton of plugin-ability everywhere, which means code is a bit spread out
<thelema>
hmm, I wonder if it'd be possible for the myocamlbuild to detect syntax extension modules and automatically add `-syntax camlp4o` to syntax-extension packages
ontologiae has quit [Ping timeout: 252 seconds]
<thelema>
I guess it could do a simple guess, and do this for packages ending in .syntax
<mk270>
myocamlbuild is a script generated by oasis, yes?
<thelema>
oasis generates a myocamlbuild.ml file, yes
<mk270>
i couldn't find the defining occurrence of "flag"
<thelema>
the flag function is part of ocamlbuild
<mk270>
ah ok
<mk270>
what does it do?
<mk270>
does it build the parser for the commandline?
<thelema>
the short version is that it takes two arguments: 1) a list of flags and 2) a list of command-line arguments (kind of)
ontologiae has joined #ocaml
<thelema>
and when all those flags are active for the compilation of a file, it adds those arguments
<thelema>
s/compilation/building/
<mk270>
so these arguments are presumably passed to subprocesses like ocamlc?
<thelema>
exactly
<mk270>
where do the flags come from? what are they read from?
<thelema>
the _tags file has some flags, ocamlbuild applies other flags depending on what it's doing (such as link, compile, doc, infer_interface, etc.)
<mk270>
ah right
<mk270>
are flags tags?
<mk270>
_tags is a mapping from regular expresisons to a list of flags?
<thelema>
not quite regexes, but a particular kind of shell globbing
<thelema>
but yes
<mk270>
i meant regexp in the sense of grammar rather than syntax
<mk270>
but yeah
<thelema>
patterns, yes.
<mk270>
ok so "flags" are involved in reading the _tags file
<mk270>
but i think i want the bit that writes the _tags file? or does your .syntax suggestion work around that?
<mk270>
because it can see what "pkg"s are being used?
<thelema>
If we modify there to check whether the package name ends in .syntax, we can put -syntax camlp4o onto that line
<thelema>
onto the arguments that are added
<mk270>
ok
<thelema>
It's not quite the right fix...
<mk270>
so we're enforcing two conventions here
<thelema>
because it makes camlp4r not easy to use
<mk270>
one to do with camlp4o vs the other other one (which i dont understand)
<mk270>
and also that it only works for pkgs named *.syntax (which we can also live with)
<thelema>
camlp4o vs. calmp4r?
<mk270>
yes
<mk270>
i dont know what the revised syntax is
<mk270>
but i dont like it :)
<mk270>
not liking it saves time
<thelema>
yes, this modification will assume that any packages that end in .syntax need `-syntax camlp4o` as part of their command line
<thelema>
it's not worth liking; I've tried it and gone back.
<mk270>
ahhh
<mk270>
(see, it DOES save time)
<mk270>
ok so people who need the revised syntax can hack in a switch for it into the _oasis file
<thelema>
but because of its existence, findlib needs to be told whether to use camlp4o or camlp4r every time you use a syntax extension
<mk270>
but they don't care, because they're not using oasis for this, because it doesn't work
<thelema>
Actually, I'm not sure what people that need the revised syntax could do, other than not use oasis
<mk270>
well, they'r eNOT using oasis for this precise function yet, because it doesn't work, hence the conversation :)
<mk270>
so i need to slip in an A"-syntax"; A "camlp4o"?
<thelema>
yes
Neros has quit [Ping timeout: 248 seconds]
<mk270>
and cocamlc and ocamldep also need the list of packages, but they're *already* getting that, right?
<mk270>
i dont know what infer_interface is
<thelema>
yes, -package pkg does that
<thelema>
`ocamlc -i` will print an .mli for a .ml file; infer_interface is the ocamlbuild name for that
<mk270>
oh right thanks
<mk270>
that guy needs to know about syntax extensions too, then?
<thelema>
yes
<thelema>
everybody but link
<mk270>
right
Neros has joined #ocaml
<mk270>
now there is a section for dealing with syntaxes
<thelema>
can be removed completely
<mk270>
hmm
<thelema>
can be left; but camlp4r users will have to .. hmmm, not sure what they'll have to do.
<mk270>
that's going to break at least something, right? :)
tac has joined #ocaml
<mk270>
can they be doing anything at all, at the moment?
<mk270>
ah
<mk270>
this stuff all works when the syntax module is separate, somehow, right?
<mk270>
i cant remember the details
<thelema>
if people have put 'syntax_camlp4o' in their tags files, we've got them covered
<mk270>
let's get it working for my use case, then worry about preserving existing behaviour
<mk270>
gotcha
<mk270>
and they probably have that
<thelema>
and if people have syntax_camlp4r, we're breaking them anyway
<thelema>
unknown tags are silently ignored, so removing the syntaxes won't break them
<mk270>
can you link modules using two difrent syntaxes?
<thelema>
yes
<thelema>
the syntax is only at compile time
<thelema>
it's a pre-process step
<gasche`>
"unknown tags are silently ignored, so removing the syntaxes won't break them"; meh, I'd like to have warnings in ocamlbuild so you shouldn't rely on their absence
<gasche`>
(hi)
<thelema>
gasche`: I completely agree, but it'd take a bunch of work to decide if a particular tag has *no* rule to match it, vs. just not being used during the current execution of ocamlbuild
<thelema>
and even that would be tricky, as whether a tag is useless depends on the myocamlbuild.ml file, which probably makes doing a complete job of this impossible.
<gasche`>
I expect _tags to be parsed *after* myocamlbuild.ml is built
<gasche`>
(in think I believe myocamlbuild.ml drives the interpretation of _tags)
<gasche`>
so that should be possible
<gasche`>
too much on the TODO-list, though
<thelema>
the simple heuristic of whether a tag has absolutely no ocamlbuild rule or flag matching it is good for finding typos in the _tags file
<thelema>
but being able to detect whether or not the tag has any effect (i.e. it's actually possible for it to affect compilation) can't be done correctly
<thelema>
i.e. maybe you put a tag that only affects ocaml compilation on a .c file. This shouldn't generate a warning.
<mk270>
so, if yo ucan have two syntaxes, then we can't have a global syntax setting
<gasche`>
I agree
<thelema>
mk270: yes, then we're back to needing input from the user...
<gasche`>
I think "the simple heuristic" is what I want
<mk270>
it needs to be don e on a per-package basis?
<gasche`>
per-file, ideally
<thelema>
gasche`: that's doable, yes.
<mk270>
per-file?
<thelema>
mk270: the setting of which syntax to use should be per-file
<mk270>
as in, two .ml files in the same dir should be able to use the same syntax module, the one for camlp4o and the other for camlp4r
<mk270>
?
<thelema>
exactly because the "linking modules using two different syntaxes"
<thelema>
if we were to do this properly, yes.
<thelema>
I'm fine with giving camlp4r the boot in oasis
<gasche`>
you could request revised syntax files to use .mlr rather than .ml; some people use ".ml4" in the general case of files needed preprocessing
<gasche`>
but that's invasive
<thelema>
maybe this should be proposed on the list.
<thelema>
I would be very happy with .mlr for revised syntax
<mk270>
all we're discussing here
<mk270>
is a pull request offered to sylvain
<mk270>
which he could completely ignore
<mk270>
or reject
<mk270>
what is "the list"?
<gasche`>
what about having camlp4o by default, but a way to set camlp4r per file? giving the option doesn't mean asking the same effort in both cases
<thelema>
gasche`: I'm not sure what ocamlfind will do - you need to enable a predicate in it to trigger it using syntax extensions, which is the fundamental cause of this problem
<mk270>
v2 : allow .mlr to specify this other syntax
<thelema>
hmm, maybe we can just enable that predicate directly...
<mk270>
v3 : have some means in _tags for setting camlp4o (don't we already have this?)
<thelema>
yes, need the syntax predicate...
<thelema>
in ocamlfind
<mk270>
so let's not zap that from myocamlfbuild then :)
<mk270>
not that i'd ever propose doing that
<mk270>
to give you a hint: my x window manager is olvwm, which has been unmaintained since the 1990s. why change when y oucan not change? :)
<thelema>
I wonder what happens if both camlp4o and camlp4r predicates are set for preprocessing
eikke has quit [Ping timeout: 246 seconds]
<thelema>
nope, need -syntax <something> to enable pre-processing
larhat has quit [Quit: Leaving.]
<thelema>
and need either camlp4o or camlp4r in order for syntax extensions to work right (get a wonderfully useless error message with `-syntax camlp4`)
<thelema>
so it looks like what we're doing is the best without digging into oasis sourcecode
<fasta_>
adrien: a generative approach would be fine too.
<fasta_>
adrien: and that only requires source code.
<thelema>
fasta_: only to an extent; deriving adds printers based on type declarations
<thelema>
this doesn't help for, for example, the builtin Set.t
<thelema>
nor for float/int
<thelema>
fasta_: one example where pretty printing is hard is to try to add debugging printing to List.rev; since it's polymorphic, you'd need runtime information to print the values.
yroeht has quit [Ping timeout: 264 seconds]
<fasta_>
Or a dependent type-system.
<thelema>
fasta_: my solution to this problem is to use batteries' printer combinators to compose a printing function of the type I want to use
<fasta_>
Hmm, the type of those printers is also rather I/O.
<fasta_>
In Haskell, the model is really simple.
<fasta_>
I wish one wouldn't have to specify deriving(Show), though.
<thelema>
haskell has type classes to make this happen; OCaml doesn't have compiler support for the equivalent; one must spell it out
<fasta_>
If I write print value, of course I want the compiler to create the required instance.
<thelema>
which means either pre-processing or doing it by hand
<fasta_>
I don't quite understand what problem compiler writers have with creating useful languages.
<fasta_>
But perhaps it's just that they don't want to make the compiler slow.
<fasta_>
I don't know. What is the reason? Would it really matter so much?
<fasta_>
Of course, the same thing would have to be done for serialization, and other data structure independent problems.
<mk270>
fasta_: my theory was that this sort of stuff wasn't recognised as useful when the language was designed, and now people make do without it and there's little demand for it
<mk270>
it's not a biggie for me
<thelema>
don't forget that Caml is a product of the early 80's
<fasta_>
When I 'drop down to C++' these things annoy me too.
jamii has quit [Quit: Leaving]
<mk270>
anwyay, i am more focused on little changes that can make what we have right now a bit better
<adrien>
mk270: a big issue with runtime type info is that it takes quite a lot of space afaiu
<mk270>
if i need a system like yours i'd just use python :)
<companion_cube>
especially for unboxed data types
<adrien>
which is why I like the current proposal to only add it where requested with a function-granularity
<mk270>
adrien: cheers
<fasta_>
Is there a product made after 2010 which can call OCaml libraries and C libraries that has such pragmatism built in?
<mk270>
now that i think about it, it would probably take a lot of space
<mk270>
fasta_: we don't have to agree with your identification of your preferences with "pragmatism"
<mk270>
"how long have you been beating your wife"
<fasta_>
mk270: the information content of a pretty printer is zero.
<fasta_>
This is why compilers exist.
<mk270>
look, i'd really like a pretty printer
<mk270>
or at least, some kind of way of automaticlaly jsonising *everything*
<mk270>
but i can get most of that with dyntype and other tools
<mk270>
or use python
<mk270>
whereas i've implemented a few trivial language runtimes, i don't have any theoretical background in computer science, so i can't engage with this "information content" etc -> why compilers exist kind of argument
<fasta_>
mk270: what are the limitations of dyntype? I.e. for what does it not work?
<thelema>
fasta_: dyntype cannot autogenerate anything if it doesn't have the type declaration
<eikke>
it's not runtime type inspection or something, but does allow to write 'generic' functions over values of some type for which some information about the type is available as well (be it implicit or, most likely in ocaml, explicit)
Snark has quit [Quit: Quitte]
lolcathost has joined #ocaml
eikke has quit [Ping timeout: 255 seconds]
lolcathost has quit [Quit: leaving]
eikke has joined #ocaml
mye has joined #ocaml
metadave has quit [Remote host closed the connection]
<eikke>
is there any way to write something like "type ('a, 'b) foo = F of ('a 'b)"?
<wmeyer>
eikke: yes: with first class modules
<wmeyer>
it's called higher rank polymorphism
<mk270>
wmeyer: what's all this about a wiki?
<eikke>
wmeyer: I know what it is, just not sure how to encode it :)
Siphonblast has quit [Read error: Connection reset by peer]
<wmeyer>
mk270: I will have a go with writing up some articles for a wiki in a markup
<eikke>
wmeyer: I know, looking into reworking something from Haskell into OCaml (I'm mostly into the former nowadays)
<wmeyer>
eikke: I know :-) (was not sure about it)
<wmeyer>
sorry not being helpful and rather confusing
<eikke>
np, thanks for the link
<wmeyer>
eikke: I wish we got it, and type level computation
<mk270>
wmeyer: what relation has this wiki to ocaml.org?
<wmeyer>
I played with heterogenous lists
<wmeyer>
mk270: it will have, if anybody wants it, for time being articles will be on github with intention to put it to ocaml.org
<mk270>
ah ok
<wmeyer>
but I will try to experiment also with my server
<mk270>
wmeyer: can't you send a pull request to ocaml.org?
<wmeyer>
mk270: will do, let's see how it goes!
<eikke>
wmeyer: that article you linked to is pretty interesting, actually. never knew that encoding before.
<mk270>
where is this wiki?
<wmeyer>
my intention was to improve the situation
<wmeyer>
it's not yet there, I will have a go maybe over the next week
<wmeyer>
eikke: it is, I was amazed :-)
<wmeyer>
mk270: if you are interested, you can just drop an email what would you like to see there.
<wmeyer>
the wiki, was about getting ocamlbuild and camlp4 wikis together for instance
<wmeyer>
currently there are fragmented right?
<wmeyer>
why not to have one, with full integration
<wmeyer>
eikke: I played with heteregonous list, it turns that they are only slight improvement of tuples
<wmeyer>
eikke: 1) you can cons element 2) you can get length 3) and hd and tl are available, although of course not in recursive setting
<wmeyer>
eikke: all just GADTs
<eikke>
wmeyer: hmh... disagree: there's a relation between a [int, int, char] list and an [int, char] list, but not between (int, int, char) and (int, char)
<wmeyer>
eikke: hm interesting I didn't check when the list is wrapped into type
<wmeyer>
but nevertheless it shows some current limitations.
<eikke>
I just used some made-up notation in the above ;)
<wmeyer>
your code would allow to map over it
<wmeyer>
but again, without pattern matchers on data types, like type classes in Haskell it's not possible
<wmeyer>
the higher order polymorphism
<wmeyer>
eikke: yes, camlp4 would be useful :D
Yoric1 has quit [Ping timeout: 252 seconds]
<wmeyer>
for constructing hlists too
<wmeyer>
eikke: what are you porting from Haskell?