<pippijn>
but in a function_definition (the production above), "main" is derived as part of decl_specifier_seq, so it produces a syntax error later on
Yoric has joined #ocaml
<pippijn>
if decl_specifier_seq (which is now "decl_specifier (attribute_specifier | decl_specifier)*") is a single decl_specifier, the production is matched
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
thebifnif has joined #ocaml
thebifnif has left #ocaml []
madroach has quit [Ping timeout: 265 seconds]
lggr has quit [Ping timeout: 240 seconds]
madroach has joined #ocaml
Drakken has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
Drakken has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
err404 has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
jamii has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
astertronistic has joined #ocaml
diego_diego has joined #ocaml
diego_diego has quit [Client Quit]
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
jamii has quit [Ping timeout: 246 seconds]
Yoric has quit [Ping timeout: 255 seconds]
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
BiDOrD_ has joined #ocaml
lggr has joined #ocaml
BiDOrD has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
astertronistic has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
<pippijn>
thelema: I have a suggestion for BitSet: test_and_set
<pippijn>
thelema: like the bts instruction (bit test and set)
lggr has quit [Ping timeout: 260 seconds]
<pippijn>
thelema: set a bit and return the previous value
lggr has joined #ocaml
smondet has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
Yoric has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
astertronistic has joined #ocaml
ankit9 has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
ankit9 has quit [Client Quit]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
tufisi has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
astertronistic has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
pango is now known as pangoafk
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
ftrvxmtrx has quit [Quit: Leaving]
lggr has joined #ocaml
<pippijn>
what would be the best way to find out whether a BatBitSet.unite changed something in the target bitset?
djcoin has joined #ocaml
thomasga has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
ankit9 has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
Snark has joined #ocaml
lggr has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
lggr has quit [Ping timeout: 256 seconds]
testcocoon has joined #ocaml
lggr has joined #ocaml
chambart has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
ocp has joined #ocaml
ftrvxmtrx has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
ggole has joined #ocaml
cago has joined #ocaml
<ggole>
Hello, I'm trying to get typerex working and I'm running into some difficulties. Building and installation works, but it seems that no (non-local) identifiers can be found in any project that builds under ocamlbuild.
<ggole>
Reading the docs, I seem to need to indicate that .cmt files can be found under _build by adding a line to .typerex, but I've done that to no effect. Any ideas?
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
<thomasga>
ggole: do you have any cmt files in _build ?
<ggole>
Yeah
<ggole>
A bunch of .cmt and .cmti
Yoric has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
chambart has quit [Read error: Connection reset by peer]
lggr has joined #ocaml
<thomasga>
have you restarted typerex after adding the right line ?
<thomasga>
(and which version of ocaml are you using ?)
lggr has quit [Ping timeout: 260 seconds]
<ggole>
The docs indicate I don't need to restart: in any case, doing so doesn't help. OCaml version is 3.11.2, which seems to be (the minimum version) supported.
<ggole>
Maybe I should try an upgrade.
lggr has joined #ocaml
chambart has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
<thomasga>
ggole: 3.11.2 should be supported, and 4.00.0 is not
Kakadu has joined #ocaml
lggr has joined #ocaml
<thomasga>
I guess you've added 'CMT _build` to the .typerex at the root of your project
<thomasga>
(ie. .typerex should be at the same level as your _build directory)
<ggole>
Yes, that's what the docs suggested.
<ggole>
And if I deliberately introduce a mistake into the file typerex will complain, so it seems to be observing the file is there.
lggr has quit [Ping timeout: 260 seconds]
ocp has left #ocaml []
lggr has joined #ocaml
<thomasga>
ggole: well in that case I don't know sorry … maybe some emacs buffers got some clearer error message
<ggole>
Not that I can find... thanks anyway. :)
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
sepp2k has joined #ocaml
lggr has joined #ocaml
trotro has joined #ocaml
cago has quit [Quit: Leaving.]
cago has joined #ocaml
xrchz has joined #ocaml
<xrchz>
is it normal to get segmentation faults when building camlp5 with ocaml 4 ?
<xrchz>
very frustrating
<xrchz>
it seems to be getting further with each attempt though, before segfaulting again
<Kakadu>
I don't think so
<Kakadu>
Daniel de Rauglaudre has mentioned in caml-list that `Camlp5 6.06, compatible with OCaml 4.00.0 has been released.`
<Kakadu>
xrchz: ^^
<xrchz>
is he here? where can I get some help debugging this?
<xrchz>
Kakadu: thanks..
<xrchz>
I am using OCaml 4.00.0 and trying to build Camlp5 6.06...
lggr has quit [Ping timeout: 240 seconds]
<Kakadu>
xrchz: You can find this email in caml-list archive. And his email too
lggr has joined #ocaml
<xrchz>
do you know roughly when that email was? i can't find it
<Kakadu>
Jun 4
<fx_>
segafulting compiler?
<xrchz>
fx_: yep,
<xrchz>
../tools/ocamlopt.sh: line 5: 9072 Segmentation fault $COMM $*
<xrchz>
the line number changes every time I try building camlp5
lggr has quit [Ping timeout: 245 seconds]
<xrchz>
i thought this language was supposed to be safe :(
<xrchz>
oh wait maybe the line number is not changing
<xrchz>
just the number before the error
rixed has joined #ocaml
<fx_>
where is that file from? ocamlopt.sh
<fx_>
can you show it's content
<xrchz>
fx_: camlp5
lggr has joined #ocaml
<xrchz>
#!/bin/sh -e
<xrchz>
COMM=${OCAMLN}opt$OPT
<xrchz>
echo $COMM $*
<xrchz>
$COMM $*
<xrchz>
sorry, there is a blank line in there too
<xrchz>
so line 5 is $COMM $*
<fx_>
ok, then it looks like ocaml bug
<fx_>
enable core dumps and post to ocaml mantis please
<xrchz>
how do I enable core dumps?
<fx_>
on linux : ulimit -c unlimited
<fx_>
then run
<fx_>
after segfault you will have file 'core'
<fx_>
look at it with gdb
<xrchz>
do I need to register for mantis?
<fx_>
gdb path_to_ocamlopt path_to_core_file
<fx_>
I guess so
<xrchz>
ugh
<fx_>
or post to mailing lit
<fx_>
* list
<xrchz>
that requires registration too
<fx_>
ok, post it here, you lazy! :)
<xrchz>
it's not laziness - i am trying to cut down on my passwords and emails :p
<fx_>
I will proxy it to mantis
<xrchz>
thanks
<fx_>
(hint: just use some password manager like pwsafe or keepass)
<fx_>
a
<Kakadu>
fx_: +1
<xrchz>
I do use a password manager
<xrchz>
sorry - I meant I just don't want to register for any ocaml stuff at the moment - I think you should allow anonymous bug reports. but anyway... I don't want to argue.
lggr has quit [Ping timeout: 240 seconds]
<xrchz>
ok I am looking at it with gdb
<xrchz>
but I'm not sure what to look for... would you rather just have the core file, or something in particular?
err404 has joined #ocaml
<xrchz>
fx_: I have the core file now
<xrchz>
gdb did say "/usr/bin/ocamlopt": not in executable format: File format not recognized
<xrchz>
though
lggr has joined #ocaml
<fx_>
hm!
<fx_>
ah
<xrchz>
file /usr/bin/ocamlopt says "data"
<fx_>
it is bytecode
<fx_>
use ocamlopt.opt
<fx_>
I guess it was used for compilation
<xrchz>
ok
<xrchz>
yes that worked for gdb
<xrchz>
now... what shoudl I look for?
<fx_>
thread apply all bt full
<xrchz>
another potential problem is warning: Could not load shared library symbols for linux-vdso.so.1.
<fx_>
not a problem
<fx_>
also tell what exact versions of ocaml and camlp5 you are using
<xrchz>
camlp5 version (you can see in the path of the core file) is 6.06
lggr has quit [Ping timeout: 256 seconds]
<fx_>
hm.. usually there is much more info in such cases
<fx_>
install please libc6-dbg package
<fx_>
or whatever to get libc debug symbols
<xrchz>
uh
lggr has joined #ocaml
<xrchz>
is this going to mean compiling my own glibc?
<fx_>
uh, gentoo??
<xrchz>
let me see if anyone has already packaged a glibc with debugging symbols
<xrchz>
i am using archlinux
<fx_>
in sane distros usually debug symbols are in separate package
<xrchz>
nobody has packaged it with debugging symbols yet
<xrchz>
bah this is eating too much time. i will come back to it later. thanks very much for your help so far fx_
<fx_>
ok, I will try to reproduce it here
<fx_>
but seeing no ocaml symbols in trace it makes me think that it may be not ocaml's fault
<fx_>
cannot say for sure
<xrchz>
fx_: if I can do anything else helpful just say so; I'll check irc every so often today.
<fx_>
xrchz, you compiled strict or transitional mode?
lggr has quit [Ping timeout: 248 seconds]
<xrchz>
fx_: strict
<xrchz>
./configure \
<xrchz>
-prefix '/usr' \
<xrchz>
-mandir '/usr/share/man' \
<xrchz>
-strict
<xrchz>
make world.opt
ankit9 has quit [Quit: Leaving]
<fx_>
it builds fine here :(
<fx_>
no ideas then..
lggr has joined #ocaml
<xrchz>
64-bit?
<fx_>
yes
chambart has quit [Ping timeout: 244 seconds]
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
antegallya has joined #ocaml
mcclurmc_away is now known as mcclurmc
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
ulfdoz has quit [Quit: deprecated]
lggr has quit [Ping timeout: 240 seconds]
mnabil has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
antegallya has quit [Quit: Leaving.]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
<mcclurmc>
thomasga: i have an opam feature i wanted to run by you
<mcclurmc>
thomasga: the jocaml.4.00.0 target i wrote only installs the jocaml compiler, and not the corresponding ocaml compiler
<mcclurmc>
thomasga: i think it might be useful for a compiler target to have a depends flag (or parent, or companion, not sure what it should be called) that will allow you to say that this compiler should be installed with this other compiler
<mcclurmc>
thomasga: could be useful for things like jocaml, as well as typerex ocp-wrapper, perhaps
lggr has quit [Ping timeout: 252 seconds]
zbroyar has left #ocaml []
lggr has joined #ocaml
cago has quit [Quit: Leaving.]
cago has joined #ocaml
<thomasga>
mcclurmc: jocaml needs ocaml ?
<thomasga>
if yes, it's maybe better to add jocaml as a package
<thomasga>
I though it was a compiler variant
lggr has quit [Ping timeout: 252 seconds]
_andre has joined #ocaml
cago has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
<mcclurmc>
thomasga: jocaml installs just the jocaml* tools, but not the corresponding ocaml* tools
cago has joined #ocaml
<mcclurmc>
thomasga: so when you switch to jocaml.4.00.0 , you get jocaml 4, but you're left with system ocamlc
<mcclurmc>
i'll see about creating a package for it, maybe that will be the best way to do it
<mcclurmc>
can a package specify that it only works with a certain version of the compiler?
lggr has quit [Ping timeout: 255 seconds]
iZsh has quit [Quit: Coyote finally caught me]
<thomasga>
yup
<thomasga>
there is an 'ocaml-version' field
lggr has joined #ocaml
iZsh has joined #ocaml
<djcoin>
Does anyone checked out TypeScript (typed superset of javascript by microsoft), it seems good. Wonder if there will be ways to integrate this language with Ocaml or JavaScript generated by Ocaml
<Kakadu>
djcoin: Why its better than OCaml+js_of_ocaml?
<djcoin>
Kakadu: I did not say it was better. But there might be typed javascript lib coming. And it will be great to interact with those.
<djcoin>
+ this language seems to be compiled in quite efficient/not bloatted vanilla javascript
lggr has joined #ocaml
<Kakadu>
Maybe I'll enrage somebody but I think that something related to Microsoft can't be a good think. But when I see how slow KDE loads and how fast just installed Win7 loads I'm getting in bate :D
trotro has quit [Quit: Leaving]
lggr has quit [Ping timeout: 240 seconds]
<Kakadu>
s/good think/good thing/
trotro has joined #ocaml
lggr has joined #ocaml
<djcoin>
Your example does not match your first statement no ?
<Kakadu>
djcoin: Yeah, that's why I added `I'm getting in bate` and smile
<djcoin>
I don't like microsoft much for its OS and politics. However C# (that i don't use), microsoft research, they are also behind haskell too iirc, softwares, are pretty great.
<djcoin>
(microsoft research -> i was told so, never actually read a paper)
lggr has quit [Ping timeout: 255 seconds]
<Kakadu>
I thought that F# is cool but after using it a bit I have understand that far from OCaml
<djcoin>
Whatever, TypeScript seems to be 'ok'. Comparing to coffeescript or dart
<Kakadu>
I don't like this broken type inference in F#
<djcoin>
or other stuff. It's just a thin layer adding types it seems.
<djcoin>
Which is the essential.
<Kakadu>
Maybe I'll also try to write something in F#
<Kakadu>
fail
<Kakadu>
s/F#/TypeScript/
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
mcclurmc is now known as mcclurmc_away
ocp has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
lggr has quit [Ping timeout: 240 seconds]
testcocoon has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
err404 has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 244 seconds]
mcclurmc_away is now known as mcclurmc
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
CoverSlide has quit [Ping timeout: 245 seconds]
gnuvince has quit [Ping timeout: 240 seconds]
lggr has quit [Ping timeout: 252 seconds]
CoverSlide has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
<Kakadu>
guys
<Kakadu>
is it possible to compile myocamlbuild with debug info?
<Kakadu>
this myocamlbuild raise File_no_found and we are thinking where is can be
lggr has joined #ocaml
tufisi has quit [Read error: Operation timed out]
cixaxa has joined #ocaml
<pippijn>
Kakadu: maybe you can wrap the dispatch thing in a Printexc
cixaxa is now known as tufisi
<Kakadu>
pippijn: I've thinked about it
<pippijn>
Kakadu: do you know about grammar analysis?
lggr has quit [Ping timeout: 260 seconds]
<pippijn>
like reachability, derivability, first/follow sets?
<thomasga>
Kakadu: Not_found in myocamlbuild.ml is almost certainly a missing ocamlfind package (if you are using oasis)
<pippijn>
and it takes 0.08 seconds
<pippijn>
I feel like that is a long time
<pippijn>
it does around 20 iterations over all productions just for first sets
<pippijn>
ah, 12 iterations
mrm has joined #ocaml
<pippijn>
and 16 for the follow sets
<pippijn>
Kakadu: so how did you learn to compute first sets?
<Kakadu>
I'm googling this book
<pippijn>
the dragon book?
<Kakadu>
no
lggr has quit [Ping timeout: 260 seconds]
Yoric has joined #ocaml
<Kakadu>
so
<Kakadu>
FIRST evals a set of production for a nonterminal?
lggr has joined #ocaml
<Kakadu>
thomasga: We with mrm a trying to build ocamlpcre on windows and we still get stupid exception
<pippijn>
Kakadu: no, a set of terminals
<Kakadu>
so
<Kakadu>
FIRST(k,\alpha)
<Kakadu>
pippijn: what k do u have?
<pippijn>
I'm not sure1
<pippijn>
let's say 1
<Kakadu>
no left recursion in grammar?
lggr has quit [Ping timeout: 260 seconds]
<mrm>
Hello. Does anyone here use the official cygwin-based windows installer? I struggle hard with trying to build pcre-ocaml. There seem to be some OASIS-specific path handling problems.
<pippijn>
okay..
<pippijn>
yes, any kind of recursion
<pippijn>
but if it makes it easier for you, let's say no left recursion
<Kakadu>
pippijn: OK
<Kakadu>
we have \alpha
<Kakadu>
apply all rules with \alpha on the left
<mrm>
I get some "The system cannot find the path specified" errors, some of which I could fix by changing paths in setup.data by hand
<Kakadu>
if production starts from non-terminal --- take it and put to answer
<pippijn>
and alpha is a sequence?
<Kakadu>
wait
<Kakadu>
terminal*
<Kakadu>
alpha is argument of FIRST function
<pippijn>
yes, what type does it have?
lggr has joined #ocaml
<Kakadu>
I think is is a sentence of grammr
<pippijn>
right
<Kakadu>
so if you have list of productions
<Kakadu>
all of them starts from neterminal
<Kakadu>
you can apply many rules to this nonterminal
<Kakadu>
and get more productions
<Kakadu>
some of them can start from terminal
<Kakadu>
you will put this terminals to answer
<Kakadu>
and filter this list of productions
<Kakadu>
there will not be a eternal recursion because grammar is nonrecursive
<pippijn>
right
<Kakadu>
It's your algorithm>
<Kakadu>
?
<pippijn>
yes
<pippijn>
well, I don't know what you mean by filter
<pippijn>
because I iterate over the entire list of productions several times
lggr has quit [Ping timeout: 260 seconds]
<Kakadu>
Set.filter (fun x -> if start_with_terminal x then (put_to_answer (head x); false) else true) production_set
<Kakadu>
pippijn: You can dance!
<pippijn>
(if you wanna)
<Kakadu>
My friend says that most common practice is to eval FOLLOW set incrementally
<pippijn>
yes, I do that
<Kakadu>
not whole set at the same time
<pippijn>
for both first and follow
<Kakadu>
and still slow?
<pippijn>
0.08 seconds
<pippijn>
fast enough for now
<pippijn>
I have slower parts..
lggr has joined #ocaml
<pippijn>
like the CFG inclusion thing
<Kakadu>
btw
<Kakadu>
Is it possible to define C++ language in LL(k) grammar?
<flux>
I don't think so, because on templates
<flux>
(maybe there are other scenarios that don't involve templates)
<pippijn>
oh, the inclusion thing is actually pretty fast
<Kakadu>
pippijn: My friend says that your timing is OK
<Kakadu>
FIRST&FOLLOW are very heavy operations
<pippijn>
Kakadu: I'm unhappy
<pippijn>
bison/yacc seem a lot faster
<pippijn>
wait, let me check, I have the same grammar as yacc grammar
lggr has joined #ocaml
<pippijn>
bison yyparse.yy 0.32s user 0.01s system 102% cpu 0.320 total
<pippijn>
that's *everything*
<pippijn>
including LR sets, parse tables, code generation
<pippijn>
ok, codegen is cheap
<mrm>
pippijn: Why to spend shitloads of effort to build yet another C++ parser? Why not to leverage clang or improve Elkhound instead? Is your interest academic in nature or is it a just for fun hobby project? :-)
<pippijn>
mrm: I spent weeks working on elsa
<pippijn>
and clang is cool, but not very easy to extend (grammar-wise)
<pippijn>
PEGs are naturally composable
<flux>
you want to extend c++??
<mrm>
pippijn: So you want a tool that would allow you to extend the C++ grammar? (for example, to embed some DSLs)
<pippijn>
mrm: potentially any, but I didn't implement that, because I didn't need it
lggr has quit [Ping timeout: 252 seconds]
<mrm>
pippijn: At day job I have to work with Borland Delphi 7 (which is almost as bad as working with plain C). My hobby project is a simple language, which is compiled to Delphi
<mrm>
For example, it adds global polymorphic type inference
<mrm>
Type declarations are sometimes mandatory (in order to be compatible with the Delphi object system)
<pippijn>
delphi is so amazingly ugly
<pippijn>
mrm: ah, similar to ocaml, then
<pippijn>
if you use objects
<mrm>
Next I am going to implement ADTs and proper pattern matching
<pippijn>
nice
<mrm>
pippijn: YES, I HATE DELPHI
<pippijn>
I use java at my day job
<pippijn>
I'm hated for my metaprogramming
<pippijn>
(using reflection)
<mrm>
It takes literally 10x as much time to rewrite stuff from ocaml to delphi than it takes to implement it in ocaml initially
<mrm>
Yep, Java is almost as ugly and tasteless as Delphi :-(
<mrm>
I would choose it anyday over Delphi though :-(
lggr has joined #ocaml
<pippijn>
me too
<pippijn>
java is okay
<pippijn>
java7 is okayer than java6
<mrm>
I plan to solve the "problem of day-job tool" by implementing a program transformation system :-)
<pippijn>
java8 potentially gives me function pointers
<pippijn>
which would be very okay
<ousado>
mrm: are you aware of haxe?
<ousado>
mrm: are you aware of haxe?
<mrm>
ousado: Yes. I didn't find it interesting
<ousado>
oops
<ousado>
haxe.org
<mrm>
ousado: It has a C++ backend, but the code prodeced is hardly readable
<ousado>
mrm: it's what you're talking about :)
<mrm>
And my idea is to produce somewhat readable code
<ousado>
a program transformation system
<ousado>
yes, the c++ target is not really good
<mrm>
Also, the Haxe compiler is ugly as fuck internally. I didn't want to mess with it
<ousado>
mrm: I don't agree
<mrm>
the Haxe language itself is very baroque. I don't need most of its features
<ousado>
the core is very well written and fast
<mrm>
And the main feature I need is a macro system
jamii has joined #ocaml
<mrm>
A beauty is in the eye of the beholder
<ousado>
it has a great macro system
<pippijn>
hm
<pippijn>
ousado: macros from one translation unit can't be used in that same translation unit, can they?
<ousado>
pippijn: depends
<mrm>
ousado: Haxe macro system wouldn't allow me to build free-syntax DSLs with their own parsers, right?
<mrm>
*free-form
lggr has quit [Ping timeout: 256 seconds]
<ousado>
pippijn: they can, but it's better to keep them separate, since you can use platform specific APIs in macros you don't have for the target you're compiling to
<mrm>
It doesn't allow macros to modify or access the environment (unlike Racket macros)
<ousado>
define "the environment"
<pippijn>
I like racket, maybe I'll use that as my initial meta language
cago has quit [Quit: Leaving.]
<mrm>
ousado: Lexical context, for example. Is it possible to write a macro that would introduce a binding? (an anaphoric macro)
<ousado>
and of course you can write parsers in haxe macros
<mrm>
ousado: Would those DSLs be expanded on runtime or on compile-time?
<ousado>
compile-time
<ousado>
well, as you like, really
<mrm>
So I can use those DSLs to compile code dynamically?
<mrm>
Well, thats a good feature. Didn't know that Haxe was capable of that
<ousado>
since you can write anything you want in haxe, and haxe macros are just haxe, yes - it's not a good idea for most tasks though
<mrm>
It's something I miss in OCaml (and look jealously at MetaOCaml)
<ousado>
haxe syntax is flexible enough for almost everything
lggr has joined #ocaml
<vbmithr>
Hi
<mrm>
ousado: I'm not a big fan of the idea of general purpose languages :-) But if a language has decent metaprogramming capabilities, then I would probably find it interesting and useful :-)
<ousado>
mrm: the main reasons I started using haxe for were ADTs, static typing, and the JS target. now that it has very powerful macros and an ever-improving type system I use it for almost everything
<flux>
I wonder if there will be a day when Haxe will be written in Haxe
<ousado>
the quality of the std lib and some of the targets are not as good, though
<mrm>
ousado: Lack of an easy to use macro system is why I'm starting to use Racket for hobby projects instead of OCaml, which is my previous love :-)
<ousado>
sounds like I should take a look
<ousado>
flux: I hope not too soon, tbh
<ousado>
haxe has some rough edges still
<mrm>
I suddenly came to conclusion that no general purpose language can ever be as productive and efficient as a domain-specific one.
lggr has quit [Ping timeout: 246 seconds]
<mrm>
ousado: By the way, why Haxe and not OCaml?
<ousado>
I didn't know of js_of_ocaml, and wasn't aware of ocaml that much
<ousado>
haxe brought me here, more or less
<mrm>
Apart from the macro system, I don't see any interesting features in Haxe (support for some target platforms maybe)
<ousado>
the type system is very cool
<mrm>
And OCaml has obviously a much richer ecosystem with lost of commercial users (relative to Haxe)
<mrm>
ousado: Does it feature polymorphic variants? SML-like module system? GADTs?
lggr has joined #ocaml
<mrm>
ousado: Structural objects, like in OCaml? :-)
<mrm>
Talking of type systems, OCaml surely has a lot of neat and useful stuff
<ousado>
yes, structural typing
<ousado>
no GADTs
<casion>
how would ocaml have a richer ecosystem than haxe?
<mrm>
My favourite feature is the module system
<casion>
can't haxe target a wide range of VMs with full interop?
<mrm>
casion: Well, it's an old and estabilished language. Just take a look at the number of libraries
tufisi has quit [Ping timeout: 246 seconds]
<ousado>
plymorphic variants are not built-in but macros to the rescue
<mrm>
OCaml has much better documentation than Haxe
<mrm>
Agree?
<casion>
mrm: I just started looking at ocaml yesterday, and I wouldn't say the documentation is very good
nass1 has joined #ocaml
<ousado>
well, haxe is a young thing, I favor many ocaml features over those of haxe
<ousado>
that doesn't mean that haxe is not a very productive language, though
<mrm>
There are some successful open-source projects written in OCaml (unison, mldonkey, frama-c, opa, pfff)
<djcoin>
Ocaml documentation is itself not really good :|
<djcoin>
imho
<ousado>
I e.g. do a lot of code generation - haxe is almost second to none in that regard
<mrm>
djcoin: Yeah, some parts of it are poorly written and/or outdated (camlp4, ocamlbuild)
<casion>
mrm: I was curious why you said ocaml had a richer ecosystem when haxe can leverage nearly everything of the target
<arsatiki>
is ocamlbuild outdated?
<casion>
you can use the full java ecosystem with haxe, or nearly any c++ lib, or .net or.. etc..
<mrm>
arsatiki: I think it is extremely confusing. I spend _a lot_ of time fighting with ocamlbuild (because it is often not obvious how to do some simple stuff)
<mrm>
*spent
lggr has quit [Ping timeout: 252 seconds]
<arsatiki>
mrm: oh right. so it's poorly written then?
trotro has quit [Quit: Leaving]
<mrm>
casion: By "poorly written" I meant confusing and uncomprehensive
<casion>
mrm: maybe if you can find the correct doc to look at it's OK
<casion>
knowing what to look for, where to find it, and if it's current… that's been confusing so far
<mrm>
casion: It's often _hard_ to find information about some use cases of ocamlbuild on the internet
<mrm>
casion: And believe me, I'm good at searching
<thelema>
mrm: we admit that ocamlbuild is poorly documented
<djcoin>
Too bad yeah :(
<casion>
mrm: I'm not, and I'm very new to the language
<casion>
:(
Kakadu has joined #ocaml
<casion>
I've been doing most of my side-work in clojure lately, and at least ocaml is a bit less fractured than clojure's docus
<casion>
I mean a lot, not a bit :)
lggr has joined #ocaml
<mrm>
casion: Richer ecosystem also includes suck tools as editor modes and IDEs
<djcoin>
s/suck/such
<djcoin>
=)
<ousado>
heh
<mrm>
casion: There are static analysis tools for OCaml, and a decent IDE (Typerex)
<mrm>
*such, yeah :-)
<mrm>
Funny typo
<casion>
mrm: I can see that
<ousado>
freudian
trotro has joined #ocaml
<casion>
but ocaml is not exactly very high on the list if you're considering editor support or IDE availability anyway
<casion>
I've been getting along fine in emacs with it though, besides figuring out how to build and package things
<mrm>
Yeah. Relative to Java, C++ and such OCaml is as bad as Haxe in this aspect :-)
<mrm>
casion: Also, speaking of "richer ecosystem": some libraries are language-specific
<mrm>
For example, take a look at Mikmatch (regexps integrated into OCaml)
<mrm>
PG'OCaml, an interesting kind of a database interface
<mrm>
Bitstring, Erlang-style bitstrings, which are neatly integrated into language
lggr has quit [Ping timeout: 256 seconds]
<flux>
pg'ocaml is quite great, but it has some downsides
<ousado>
mrm: to me there's no doubt that ocaml is the superior language in many, many ways - also the ocaml community plays in a completely different league
<flux>
particularly doing queries involving arrays doesn't work
<flux>
well, work great at least
<flux>
it might be a more recent postgresql has mechanisms for dealing with some of the problems
<pippijn>
oh
<casion>
how is concurrency handled usually in ocaml?
<pippijn>
LR item sets seem a little complex
<mrm>
ousado: Well, OCaml has to simple to use macro system (unless MetaOCaml catches up and we get some kind of a Camlp4/MetaOCaml hybrid). And that might make me reconsider Haxe for a while :-)
<mrm>
*has no
<ousado>
yes
<Qrntz>
everyone, are there any bioinformatics libraries different from BioCaml?
<thelema>
casion: threading is built into the language, with standard library support, but it's single-core
<ousado>
that's the main reason I use it
<ousado>
.. but haxe is a very open project with an extremely flexible and fast compiler that's evolving quickly
<Qrntz>
I find its dependency list a bit too impressive, including both Core and Batteries
<pippijn>
yeah, ocaml is not very open
<mrm>
ousado: How many people actually use Haxe to make job done?
<mrm>
ousado: The web site looks like a cheap advertisement
<thelema>
pippijn: ocaml is opening up more.
<pippijn>
thelema: that's good to know :)
<pippijn>
mrm: it really does..
<ousado>
mrm: my guess is that it's mostly used by indie game devs
<ousado>
but e.g. prezi.com is using it for their product now
<mrm>
OCaml's license makes me feel uncomfortable :-( I recently had to embed SML/NJ into my application instead of OCaml
<mrm>
Because of the scary compiler license :-(
<pippijn>
SML/NJ is cool
lggr has joined #ocaml
<pippijn>
very nice internals
<mrm>
pippijn: It's tiny and well-documented :-)
<thelema>
mrm: granted; ocaml's license is weird. I don't know anyone in the ocaml community with the appetite to change it
<pippijn>
yes
<pippijn>
mrm: do you know mythryl?
<mrm>
If it weren't for the riches of the OCaml ecosystem, I would gladly switch to SML
<pippijn>
it's a pragmatisised SML/NJ
<mrm>
pippijn: Yeah. I didn't find it particularly interesting
<thelema>
mrm: the big players all have paid for their own special license that lets them do what they want.
<mrm>
seemed like a yet another ml dialect
<pippijn>
yes
<pippijn>
more like ocaml
<pippijn>
but built from SML/NJ
<mrm>
Oh. I didn't know it's built on SML/NJ
<pippijn>
and cynbe really loves writing
<mrm>
:-)
<pippijn>
so the documentation is very good
<mrm>
But whyyy. Why yet another boring ml-like language?
<mrm>
Why not reimplement ocaml, for example?
<mrm>
That would be truly useful
<pippijn>
actually I'm a fan of that idea
<pippijn>
reimplementing ocaml
<pippijn>
I got to go
<pippijn>
someone here is getting impatient
<mrm>
Cya. Thanks for talking
<Kakadu>
mrm: What about embedding haskell?
<mrm>
Kakadu: I needed a simple, predictable, strict dialect of ML
<Kakadu>
okay
<ousado>
mrm: it's ATS then :P
<casion>
embedding haskell is not exactly easy
<casion>
if even possible for most platforms
<mrm>
If i didn't suddenly get the bright idea of using some lightweight SML imlementation, then I would stupidly implement a simple ML dialect myself :-)
<casion>
I've banged my head against that wall for w hile
lggr has quit [Ping timeout: 256 seconds]
<mrm>
casion: Well, that is if you try to embed GHC (both compiler and the hairy runtime system)
<mrm>
casion: But there are much simpler haskell implementations out there
<casion>
and clojure is only useful for hobby stuff (for me)
<casion>
mrm: I've seen cyclone
<mrm>
casion: And what do you think about it? Isn't it a huge improvement over C in many ways? (from the language design point)
<mrm>
I'm not sure how usable cyclone in practice is, though :-)
<casion>
mrm: I didn't use it, I looked at the docs and backed away slowly
<mrm>
Yeah, the docs are surely not "enterprise-ready" :-)
<casion>
seems like an attempt at objective-C without any of the smalltalky-ness
<mrm>
casion: Cyclone is by design as static as possible
<casion>
hmm, it appears they've added a good bit since I looked last
<mrm>
and that may be a good thing given that it is positioned as a tool for system programming and embedded development
<casion>
ATS looks quite neat
<mrm>
ATS looks complex and difficult to use :-) It doesn't seem to pretend being the next "language for the masses"
<ousado>
mrm: but the masses are not who will write the next OS :)
lggr has quit [Ping timeout: 260 seconds]
<ousado>
(.. for the masses)
<casion>
mrm: I'd complain, but I already spend enough time writing asm for niche chipsets
<mrm>
ousado: Yeah. But I still think that languages can be both very powerful and simple to use. And the kind of languages that are both powerful and simple and domain-specific languages
<casion>
currently my goal is to become at least marginally proficient at GUI application development
<djcoin>
amazing how many languages exists. Hard to tell which will be uses in the next decades. All are differents, which deserve to be moved forward or not, in which invest times ?
<djcoin>
s/uses/used
<casion>
and switch over to a client-based control rather than onboard
<djcoin>
s/invest/should time be invested
<mrm>
ousado: ATS is a pack of complex features with no way to build new features upon then. Such kind of design reminds me of Perl and C++ :-(
<casion>
so I can just write UI and do most crunching in a sane environment
lggr has joined #ocaml
<ousado>
mrm: I don't think that writing verified software will ever be "simple"
<mrm>
ousado: Simple languages can make it simple to verify programs (by using domain-specific verifiers)
<ousado>
and the author is very responsive to ideas for improvement
<ousado>
mrm: so you first write a DSL for writing a verified GC, and then implement your GC?
<ousado>
or networking stack?
<ousado>
or a generic DSL for writing drivers?
<mrm>
ousado: DSLs should be as specific as possible. General often equals complex
<ousado>
the problems and errors in those fields are well-known, and ATS addresses them - it's a domain specific language for systems-programming, if you will
<mrm>
ousado: For example, a DSL for defining (and solving) systems of linear equations can check that the system is solvable
eni has joined #ocaml
<mrm>
It's a simple kind of check, which is simple to implement
<casion>
if you have a generic DSL, you're kind of doing it wrong
<casion>
very wrong
<mrm>
Well, we haven't even defined "verification', which is a complex matter
<ousado>
while I agree that often DSLs are great to work with, I don't see how you'd build an OS out of hundreds of DSLs
lggr has quit [Ping timeout: 240 seconds]
<mrm>
Tools like Coq allow us to perform some kind of static verification (in regards to some complex invariants). But how well does it work in practice? Does it really matter to "verify" all the things that Coq forces us to? It is a complex matter
<mrm>
But I have a belief that simple languages would often allow to make simple verifications and it is those simple verifications that would work best in practice
<mrm>
Practice will show if I my point (guess?) is somewhat meaningful :-)
ontologiae has joined #ocaml
<ousado>
mrm: yes, it's a complex matter, and ATS is an approach to give you fine-grained control ver that
<ousado>
that is, you can cheat, if you absolutely want
lggr has joined #ocaml
<mrm>
ousado: I will surely take a closer look at ATS. Thanks for mentioning it. Any language that has unique features is most certainly worth my investigation :-)
<ousado>
and you can rewrite existing C code incementally
<ousado>
incrementally
<ousado>
yeah
<ousado>
ok.. gotta work now.. always nice in #ocaml
<mrm>
ousado: cya
<ousado>
cya, and if you have further comments on haxe, I'd be very interested
jamii has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 255 seconds]
jamii has joined #ocaml
lggr has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
UncleVasya has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
ulfdoz has joined #ocaml
lggr has joined #ocaml
tufisi has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
ontologiae has quit [Ping timeout: 246 seconds]
mcclurmc is now known as mcclurmc_away
err404 has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
avsm has joined #ocaml
lggr has joined #ocaml
sivoais has quit [Quit: Lost terminal]
djcoin has quit [Quit: WeeChat 0.3.7]
ggole has quit [Quit: Ex-Chat]
eni has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
mnabil has quit [Ping timeout: 252 seconds]
sivoais has joined #ocaml
zbroyar has joined #ocaml
brendan has quit [Quit: leaving]
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
sepp2k1 has joined #ocaml
sepp2k has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
pangoafk is now known as pango
zbroyar1 has joined #ocaml
<wmeyer>
pippijn: OK will do the spec for lousy parser. The time difference is bad but dealt with that somewhat for few years
<wmeyer>
pippijn: the PEG parser can be greedy or not. It has a special operator "match everything that is not"
<wmeyer>
I agree it will take some time to convert from CFG because PEG is a different beast (rewrite I am afraid)
zbroyar has quit [Ping timeout: 246 seconds]
<wmeyer>
In particular the order of the choice operator matters - it's not longer non-deterministic
lggr has quit [Ping timeout: 240 seconds]
<wmeyer>
pippijn: if you need help just shout
<adrien>
HELP! I NEED SOMEBODY! HELP!
<adrien>
(sorry :-) )
gnuvince has joined #ocaml
<wmeyer>
adrien: Is it because you had a british breakfast, or?
<adrien>
hmmm, maybe because of the glass of whisky ;-)
<wmeyer>
that's actually nice
<wmeyer>
just on saturday we had a chat about polymorphic recursion
lggr has joined #ocaml
<wmeyer>
and also some bigger quantities of alokohol were involved ;-)
<wmeyer>
don't flood the list because of the buggy emacs!
lggr has quit [Ping timeout: 248 seconds]
Cyanure has joined #ocaml
lggr has joined #ocaml
xrchz has joined #ocaml
<xrchz>
why was toploop.cmi moved??
lggr has quit [Ping timeout: 246 seconds]
<thelema>
xrchz: so that all compiler libs would live together. Yes, it broke a lot of projects.
ftrvxmtrx has joined #ocaml
<xrchz>
thelema: so what is the correct way to use it now?
<xrchz>
You should see the README for HOL Light: it suggests making a symbolic link to recreate the old location of toploop.cmi
<xrchz>
which is so ugly
<thelema>
agreed.
<xrchz>
but what else can we do?
<thelema>
the correct way to use it now is to -I +compiler_libs
<xrchz>
as an argument to ocaml?
<thelema>
err, compiler-libs
lggr has joined #ocaml
<thelema>
yes
<xrchz>
ok i wll try that - and tell teh HOL Light devs if it works - thanks
<xrchz>
thelema: it works :) thanks
ontologiae has joined #ocaml
<thelema>
xrchz: n/p
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
brendan has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
zbroyar has joined #ocaml
zbroyar1 has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
gnuvince has quit [Ping timeout: 240 seconds]
lggr has quit [Ping timeout: 246 seconds]
YawningAngel has joined #ocaml
<YawningAngel>
Is it possible to pass arguments from one function to another in OCaml?
<_habnabit>
let f x = g x
lggr has joined #ocaml
<YawningAngel>
g here being?
<thelema>
YawningAngel: the other function
<YawningAngel>
So yes, but only in line?
<thelema>
do you want to pass an unknown number of arguments?
<YawningAngel>
Ideally. I'm working with a fixed number now because I don't know the language and it's simpler
<thelema>
is this related to printf?
lggr has quit [Ping timeout: 256 seconds]
<YawningAngel>
Nope, I just want to take the inputs to one function and then compute on them with other functions for the sake of neatness
<thelema>
you can use partial application to get something like that in some cases - say that function g has 5 arguments, then `let f = g 1 2` will give you a function with 3 arguments
<_habnabit>
YawningAngel, ocaml doesn't have a way of accepting and passing an arbitrary number of arguments
<thelema>
but in general, the type of f will have to know how many arguments it takes.
<thelema>
so you're back to the case of a fixed number of arguments
<thelema>
and then `let f x y z = g 1 2 x y z` is the solution
<YawningAngel>
Aight, thanks guys
lggr has joined #ocaml
trotro has joined #ocaml
xrchz has left #ocaml []
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
UncleVasya has quit [Quit: UncleVasya]
gnuvince has joined #ocaml
trotro has quit [Ping timeout: 256 seconds]
lggr has quit [Ping timeout: 256 seconds]
nass1 has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
YawningAngel has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 256 seconds]
gnuvince has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 256 seconds]
lggr has quit [Ping timeout: 245 seconds]
hongboz has joined #ocaml
lggr has joined #ocaml
<hongboz>
can anyone explain a bit to me about how toplevel was flushed?
ftrvxmtrx has joined #ocaml
chambart has joined #ocaml
<hongboz>
which key triggers the toplevel flush the channel?
<wmeyer>
hongboz: probably not a key, toplevel should just flush after each phrase, if you call API then try to do flush on the channel
lggr has quit [Ping timeout: 245 seconds]
<hongboz>
can you be more precise? I changed Toploop.parse_toplevel to my parser
<hongboz>
it almost wokrs, but you have to tell when to flush the channel
<hongboz>
Did I miss something? how to reconigze a phrase?
<thelema>
hongboz: ;;
<hongboz>
thelema: yes, but suppose my parser is different from ocaml's, still ";;" ?
<thelema>
probably, but not sure.
lggr has joined #ocaml
<hongboz>
this behavior was hard coded in the toplevel?