kaustuv has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<thelema>
robthebob: is there a string extension you really want?
<thelema>
s/string/camlp4/
bzzbzz has quit [Quit: leaving]
ccasin has joined #ocaml
bzzbzz has joined #ocaml
Edward__ has joined #ocaml
Edward_ has quit [Ping timeout: 265 seconds]
<robthebob>
thelema, i was interested in a few different extensions: pa_where (as opposed to 'let'), pa_batteries (auto-open Batteries), and mikmatch
<robthebob>
they aren't something that i think has to be in batteries (apart from pa_batteries), but i noticed they are still mentioned in the documentation so was wondering what the plan was for them
<thelema>
I'm against pa_batteries - hiding that you're using batteries through non-standard build-time action is no good.
<thelema>
pa_where seems mostly superceded by the new 3.12 first class modules
<thelema>
err, the old batteries open...
<thelema>
pa_where seems a bow to haskell syntax. I don't find it useful - the case might be made, as it's quite obvious what's going on from just the syntax
<thelema>
and mikmatch exists externally - I don't see the benefit of integrating it vs. the cost of maintaining it
<thelema>
the main reason I worry about camlp4 is composability issues
joewilliams_away is now known as joewilliams
rjsimmon has quit [Quit: Leaving.]
Yoric has joined #ocaml
spearalot has quit [Quit: -arividerchi]
<robthebob>
yeah i see what you mean
<robthebob>
pa_where is indeed a bow to haskell syntax, i think it is clearer in this instance
<thelema>
(not that pa_comprehension doesn't have composability issues)
<robthebob>
are there any particular clashes that you are aware of, or is it a stance of general caution?
<thelema>
Many instances of pa_where being clearer are helped by named parameters
<thelema>
general caution.
<robthebob>
is the concern that applying extensions in different orders could have different behaviour or even not work at all?
<thelema>
more or less, yes
<thelema>
I also really dislike how camlp4 is a compile time action that has no mandatory "comment" in the source code that it's needed
<thelema>
I would be much happier if there were pragmas at the top of a source file indicating what pre-processors needed to be run and in what order
<thelema>
as opposed to hidden in a makefile
<robthebob>
yes, that's a valid point, similar to how GHC handles it
<robthebob>
well, you can enable language extensions either way with GHC
<thelema>
I didn't know that.
<robthebob>
mm, well it doesnt really affect batteries, but for generalised algebraic datatypes for example you can have the cmd line switch -XGADTS or include {-#LANGUAGE GADTs #-} in your source file
<thelema>
I approve. I also kinda wish that such a feature could be implemented in camlp4, but I suspect it can't
ttamttam has quit [Quit: Leaving.]
<robthebob>
i can't think how. the only thing I can see right now is to introduce some syntax error that is removed only by the extension required
<robthebob>
which is no feature at all
rjsimmon has joined #ocaml
<thelema>
yup, a poor circumstance
<palomer>
what does ocamlc -I +camlp4 mean?
<palomer>
I always thought -I took a directory name
<thelema>
it does - the + means prepend the ocaml std install dir
<thelema>
so +camlp4 = /usr/lib/ocaml/camlp4 (or /usr/local, depending on install)
<palomer>
ahhhhh
<murphe>
So i've been learning OCaml for a week or two now. Other than class (which is good), the internet has kiiinda failed me on useful intro-to-ocaml-and-functional-programming material. Do you guys have any reccomendations?
<thelema>
the ocaml reference manual part 1 taught me most things
<thelema>
but ocaml-tutorial.org might be better now
<thelema>
worst case, there's links to other resources
<murphe>
mmkay
<murphe>
i've been using ocaml-tutorial as reference, but perhaps i should just sit down and work through it instead :)
fabjan has quit [Ping timeout: 260 seconds]
Submarine has quit [Quit: Leaving]
mbishop_ has joined #ocaml
mbishop has quit [Ping timeout: 245 seconds]
ikaros has quit [Quit: Leave the magic to Houdini]
mbishop__ has joined #ocaml
mbishop_ has quit [Ping timeout: 258 seconds]
fabjan has joined #ocaml
oriba has quit [Quit: Verlassend]
ikaros has joined #ocaml
kaustuv has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
kaustuv has quit [Ping timeout: 265 seconds]
travisbrady has joined #ocaml
<palomer>
camlp4o -I `ocamlfind query type-conv` pa_type_conv.cmo pa_tui.cmo test_pa.ml <--this outputs what I expect
<palomer>
but if I try and redirect the output to a file, I get giberrish
ulfdoz has quit [Ping timeout: 240 seconds]
<adrien>
which kind of giberrish?
jonafan_ is now known as jonafan
<palomer>
Caml1999M012¦¾
<adrien>
palomer: use -o in your call to camlp4o
<palomer>
etc...
<palomer>
ok, it works
ulfdoz has joined #ocaml
<palomer>
but why did redirecting cause the giberish?
mbishop_ has joined #ocaml
<adrien>
no idea =)
<mfp>
palomer: camlp4o detects if stdout is a tty and will output the serialized form if not
<mfp>
palomer: this way, the code is not parsed twice when you use ocamlc/ocamlopt with -pp camlp4o
mbishop__ has quit [Ping timeout: 265 seconds]
<palomer>
ahh
<palomer>
I didn't know you could detect such a thing
<mfp>
palomer: isatty(3) available as Unix.isatty
Yoric has quit [Quit: Yoric]
<adrien>
used by most "polite" programs not to output binary data to terminals (gzip and xz for instance)
ikaros has quit [Quit: Leave the magic to Houdini]
<flux>
pretty nifty trick (reading ocaml ml a bit late..): type 'annot tree = | Leaf of 'leaf_annot * string | Node of 'node_annot * 'annot tree list constraint 'annot = < leaf : 'leaf_annot; node : 'node_annot >
<flux>
would it allow a nicer way of extending the type 'a in the future?
<palomer>
where's this from?
ikaros has joined #ocaml
<robthebob>
does anybody here use Kaputt?
<robthebob>
i'm trying to get started with it using the example given in kaputt.pdf:
<robthebob>
Test 'untitled no 2' ... 100/100 cases passed
<robthebob>
- : unit = ()
<mfp>
flux: yes, the first thing I tried was constraint 'annot = < leaf : 'leaf_annot; node : 'node_annot; .. > and it did work, but I can't see where/how the row variable would be useful
<mfp>
robthebob: are you on x86-64? maybe it's doing Random.int max_int
<robthebob>
Test 'untitled no 9' ... 100/100 cases passed
<robthebob>
- : unit = ()
avsm has joined #ocaml
ftrvxmtrx has joined #ocaml
mbishop__ has joined #ocaml
mbishop_ has quit [Ping timeout: 265 seconds]
<flux>
palomer, caml mailing list, bluestorm
<flux>
mfp, I was simply thinking having an interface that says < leaf : 'bar > at one time and < leaf : 'bar; node : 'baz > the next
<flux>
mfp, and it wouldn't break the existing, dependant, code if it has used the .. in type definitions?
<mfp>
well, 'baz is bound in the type def so you cannot do w/o it
<mfp>
the only use I can see of the row variable is to reuse the 'a in 'a tree in other contexts that share some type parameters and maybe introduce some others
<mfp>
avsm: I read lwIP is a light-weight TCP/IP stack... in which contexts would it make sense to use it from a relatively memory-intensive environment like OCaml's runtime?
<avsm>
we're building a Xen OS using it; it's not generally useful
<avsm>
compile up OCaml apps into tiny runtime kernels, with no other dependencies
<avsm>
got a full OCaml TCP/IP stuck under development using an LLVM parsing backend, but LWIP is an excellent shim until that's finished
<mfp>
ic, thanks
<avsm>
btw, excellent timing with your message queuing implementation; I was just wondering what a good benchmark would be :)
<mfp>
heh
avsm has quit [Quit: Leaving.]
ygrek has joined #ocaml
<palomer>
| Prompt of string -> (t * string option) list <--why would ocaml have problems parsing this?
jeddhaberstro has joined #ocaml
<mfp>
palomer: what's that, pattern matching or a type declaration?
<mfp>
Foo of x belongs to the latter, Foo x -> y to the formmer
<mfp>
and you're doing both :)
<mfp>
ignore me, misread
<palomer>
type declaration
<mfp>
what about Prompt of (string -> (t * string option) list) ?
<palomer>
it works
<palomer>
but I'm wondering why ocaml is having problems parsing the other one
ygrek has quit [Ping timeout: 245 seconds]
mehdid has quit [Quit: leaving]
mehdid has joined #ocaml
mehdid has left #ocaml []
rjsimmon has quit [Quit: Leaving.]
middayc has joined #ocaml
middayc has quit [Client Quit]
ttamttam has quit [Quit: Leaving.]
gildor has quit [Quit: leaving]
oriba has joined #ocaml
oriba has quit [Client Quit]
gildor has joined #ocaml
_andre has quit [Quit: Lost terminal]
<travisbrady>
mfp: ocamlmq looks cool, just curious, do you have performance benchmarks anywhere?
<derdon>
palomer: why don't you use C for curses stuff?
<palomer>
because I don't need to?
<palomer>
:P
<derdon>
appearently, you do
<palomer>
I can build it with omake
<palomer>
fine, ill see what omake is doing...
mbishop__ has joined #ocaml
<mfp>
travisbrady: I've indeed bm'ed and compared it to ActiveMQ and RabbitMQ a few times, but didn't have it all written down neatly and didn't want to delay the release
<palomer>
I think i need the -linkpkg flag
<palomer>
yeah, that's it
mbishop_ has quit [Ping timeout: 265 seconds]
<travisbrady>
mfp: cool, what's the memory profile like versus others? Is there an easy way to figure memory requirements given an expected number of items?
<mfp>
travisbrady: some ballpark figures: on my 3GHz AMD64 box, ocamlmq delivers ~15000 to 20000 topic messages, and can save up to a few thousand persistent messages / second (accepts ~50K/s message bursts in async mode)
<mfp>
memory usage relative to which ops?
<mfp>
in general, it uses much less memory than ActiveMQ or RabbitMQ
<mfp>
mem usage is independent of the num of queues (because it never keeps the list of queues in mem)
derdon has quit [Ping timeout: 248 seconds]
<mfp>
it grows with the number of subscriptions (around ~150 bytes / subscription); it takes less than 10s IIRC for 1 client to subscribe to 1 million queues and that will take around ~160 MB or so
<mfp>
also, mem usage is essentially flat vs. number of messages in the queue(s)