ski has quit [Read error: 110 (Connection timed out)]
ski has joined #ocaml
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
slipstream has joined #ocaml
mauke has quit [Client Quit]
pango__ has joined #ocaml
slipstream-- has quit [Connection timed out]
pango_ has quit [Read error: 145 (Connection timed out)]
neilc has joined #ocaml
<neilc>
hmm, why is there no default action for rules in ocamlyacc?
<neilc>
bison's default action is $$ = $1
<neilc>
which can be convenient syntax sugart
<neilc>
"sugar"
ulfdoz has quit [Read error: 60 (Operation timed out)]
<Smerdyakov>
neilc, does that action use the value of the first symbol in the rule for the value of the rule?
<neilc>
yeah
<Smerdyakov>
neilc, that sounds hideous for rules involving multiple symbols.
<neilc>
hideous how?
<Smerdyakov>
It's arbitrary and it can mask errors.
<Smerdyakov>
(Where you meant to type an action but forgot)
<neilc>
well, if you prefer you could limit it to rules whose rhs is a single symbol
<neilc>
which would make it less arbitrary
<neilc>
and as for masking errors, yeah, that is possible
<Smerdyakov>
I think I prefer to avoid special cases like that.
<neilc>
it hasn't seemed to cause the zillions of people using bison much trouble, fwiw :)
<Smerdyakov>
Using bison is a lot harder than using ml-yacc.
<Smerdyakov>
It's more excusable to take shortcuts when the underlying language has poor support for abstract syntax trees.
<neilc>
yeah, i suppose
<mikeX>
it proved to be a name conflict, the fact that I had both crc32.ml and crc32.o (the later coming from the compilation of crc32.c) messed things up :(
Submarine_ has quit [Remote closed the connection]
<mikeX>
hmm, binary with ocamlopt 3.09.1 segfaults when trying to reference a variable obtained with copy_int32() from a C program :/
<mikeX>
works fine with ocaml 3.08.3 on athlon xp
ski_ has joined #ocaml
ski has quit [Connection timed out]
kryptt has joined #ocaml
translocatedfetu has joined #ocaml
<translocatedfetu>
howdy, can anyone suggest a command line interpreter that is more bash/readline-like?
translocatedfetu is now known as sirreality
<sirreality>
by command line interpreter, I mean, the mode where I simply run "ocaml" with no arguments and then have a simple programming environment
<mikeX>
sirreality: rlwrap
<mikeX>
I think there are some more on the hump
mikeX has quit [""zz""]
<dylan>
sirreality: ledit?
<dylan>
e.g. "ledit ocaml"
<dylan>
gives you a readline-like ocaml toplevel
<sirreality>
ok awesome
<sirreality>
i knew about wrapping it with emacs, but that would require me learning emacs keys :-)
<sirreality>
readline-like is good, specially if it supports vi keys
<Submarine>
ocamllex + ocamlyacc are sufficient to parse all languages I've come across, except perhaps FORTRAN
<zmdkrbou>
nobody uses such complex grammars :)
<Amorphous>
c++
<Submarine>
except that for C you need some dirty hacks
<Submarine>
well, for C/C++ you need to know some dirty tricks
<zmdkrbou>
if you need more, the tool made by francois pottier may do the trick
<Submarine>
because (drum rolls) C/C++ is not LR(n)
<Submarine>
C/C++ has a contextual grammar
<zmdkrbou>
eeer
<zmdkrbou>
about C, are you sure ?
<Submarine>
I am sure.
<zmdkrbou>
i don't believe ansi C is not LR(n)
<Submarine>
It is not.
<Amorphous>
oh and perl is not LR either
<Submarine>
one word: typedef
<zmdkrbou>
oh
<zmdkrbou>
yes
<zmdkrbou>
it's written in the K&R :)
* Submarine
wrote the original frontend for Astree
vodka-goo has joined #ocaml
<vodka-goo>
hi
<vodka-goo>
I was wondering about something, and I thought somebody might have had the same problem already
<vodka-goo>
I have a script language, which is sort of a mini-ocaml, which functions, partial application, labels and optional labels, and uses ocaml-like syntax
__DL__ has quit [Read error: 104 (Connection reset by peer)]
<vodka-goo>
many users won't know ocaml, so I thought it might be nice for them to propose a more conventional syntax, ruby-like for example, at least changing the application (f ~a:va x) into (f(a=va,x))
<vodka-goo>
I won't change the type system, it'd still have partial application, and arbitrary order for labeled args
<vodka-goo>
the only problem is for the unit.. it's ugly to change f () into f(()), and I can't figure out any safe automatic sugar
<vodka-goo>
sorry for the verbosity ;) does anybody has a hint ?
<zmdkrbou>
using something else than () for the unit value :)
<vodka-goo>
but it'll still look very arbitrary to people ignoring functional languages
<flux__>
use void, that ought to be familiar..
<flux__>
or maybe have a separate syntax for partial application :-o
<vodka-goo>
it's familiar as a type, not a value
<flux__>
(it wouldn't resolve all the uses for () though)
<vodka-goo>
flux__: that's a possibility, python has a separate syntax, but it's ugly
<zmdkrbou>
None as in python ? :)
<vodka-goo>
I'm afraid I need to ask the user to put sthg, None or void or whatever..
zigong has joined #ocaml
<TaXules>
:(
<Amorphous>
ah now i see it one rule in the grammar i have written is right regular where the others are left regular.
<Amorphous>
zmdkrbou: any idea how i can write e(cd|a)+ as a left regular CFG? or how i write a*b+e as a right regular?
quamaretto has joined #ocaml
<Amorphous>
forget it. i give up about that for today...
Smerdyakov has joined #ocaml
zigong has quit ["using sirc version 2.211+KSIRC/1.3.12"]
vodka-goo has quit [Remote closed the connection]
mikeX has joined #ocaml
<mikeX>
the thread module states that it doesn't take advantage of multi-processor machines, does this stand for Hyper-Threading/Dual-Core systems as well?
jo_l_apache has joined #ocaml
vodka-goo has joined #ocaml
<Schmurtz>
mikeX, yes
<mikeX>
:(
<Schmurtz>
ocaml use only one cpu
<Schmurtz>
if you need it, you must use different process linked with pipes
<Schmurtz>
(processes)
<Schmurtz>
(several processes)
<mikeX>
i see
<mikeX>
thanks
<Submarine>
mikeX, Essentially the memory management is not threadsafe.
<Submarine>
this precludes everything like hyperthreading, dual core, whatever
<Submarine>
Astree uses multiple processes, pipes and sockets.
<zmdkrbou>
</ad> :p
<mikeX>
heheh
<mikeX>
actually I just finished a nasty hack on the md5 digest module, which adds an optional calculation of a crc32 sum, without having to reread the file, so I thought threading the calculations might be an added bonus for some systems
<mikeX>
but I don't think separate processes is worth the effort
lispy_ has joined #ocaml
<mellum>
wtf would you need crc for if you have md5?
lispy has quit [Read error: 110 (Connection timed out)]
<mikeX>
haha, well it's for anime, most fansub groups append the crc32 sum of the file in their releases
<mellum>
Clever, that saves 12 bytes per file as compared to md5!
<mikeX>
lol
<mellum>
At the expense of being trivially fakeable, but hey.
<mikeX>
well it's just for corrupt download detection :/
<Smerdyakov>
mikeX, are your downloads much smaller than 12 bytes?
<mikeX>
nope
lispy has joined #ocaml
lispy_ has quit [Read error: 104 (Connection reset by peer)]
<mikeX>
i meant on the filename :/, anyway, I have to have the crc32 sum to verify, but I would like to have md5sums for myself
lispy has quit [Read error: 110 (Connection timed out)]
<flux__>
mellum, crc's are perfectly fine for checking if there's been a transmission error
mellum has quit [Read error: 110 (Connection timed out)]
bzzbzz has quit [Read error: 110 (Connection timed out)]
lispy has joined #ocaml
quamaretto has quit ["bye"]
vodka-goo has quit ["Connection reset by by pear"]
jo_l_apache has quit [".ei mi cliva"]
Submarine has quit [Nick collision from services.]
Raziel has joined #ocaml
<pango>
mikeX: mldonkey uses C for the hashing thread, mainly to get around that problem
Raziel has quit ["Yo soy goma. Tú eres cola."]
<mikeX>
but you get more overhead for portability right?
<pango>
Haven't looked in the details how hard it is to implement
Schmurtz has quit ["Dodo !"]
<mikeX>
i see :/
jo_l_apache has joined #ocaml
Raziel has joined #ocaml
vodka-goo has joined #ocaml
kral has joined #ocaml
jo_l_apache has quit [".ei mi cliva .i co'o rodo"]
Raziel has left #ocaml []
__DL__ has joined #ocaml
__DL__ has quit ["Bye Bye"]
kral has quit [""In girum imus nocte et consumimur igni.""]
Skal has quit [Remote closed the connection]
_JusSx_ has quit ["leaving"]
vodka-goo has quit ["Connection reset by by pear"]