delamarche has quit [Remote closed the connection]
bluestorm has quit [Remote closed the connection]
adu has joined #ocaml
LordMetroid has quit ["Leaving"]
coucou747 has quit ["bye ca veut dire tchao en anglais"]
seafood_ has quit [Read error: 110 (Connection timed out)]
brooksbp has joined #ocaml
brooksbp has quit []
nuncanada has quit ["Leaving"]
seafood_ has joined #ocaml
adu has left #ocaml []
jlouis has quit [Remote closed the connection]
alexyk has joined #ocaml
seafood_ has quit []
darinm has joined #ocaml
rodge has joined #ocaml
brooksbp has joined #ocaml
brooksbp has quit []
Snrrrub has quit []
alexyk_ has joined #ocaml
thelema has joined #ocaml
alexyk has quit [Read error: 110 (Connection timed out)]
<palomer>
hrmph
<palomer>
I remember someone telling me that ocaml has GADTs
netx has joined #ocaml
seafood_ has joined #ocaml
middayc has joined #ocaml
rodge has quit ["Leaving."]
seafood_ has quit []
fuzzdk has joined #ocaml
<alexyk_>
not to start something, but what's the comparison of OCaml to Erlang these days? :)
<alexyk_>
is VM much slower than ocamlopt?
<alexyk_>
and are Erlang strings still abysmal 8 bytes per char beasts?
love-pingoo has joined #ocaml
darinm has left #ocaml []
middayc_ has joined #ocaml
filp has joined #ocaml
middayc has quit [Connection timed out]
fuzzdk has quit [Read error: 110 (Connection timed out)]
ulfdoz has quit ["deprecated"]
seafood_ has joined #ocaml
m3ga has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
l_a_m has joined #ocaml
bluestorm has joined #ocaml
<flux>
I wonder why foo fun () -> 42 is a syntax error
<flux>
hm, I suppose the grammar would tell me :)
<bluestorm>
flux: you're unlucky, it works with camlp4o
<bluestorm>
but (foo fun () -> 42) doesn't :p
<flux>
uh?
<bluestorm>
hmm
ulfdoz has joined #ocaml
<bluestorm>
$ camlp4o -str 'foo fun () -> 42'
<bluestorm>
let _ = foo
<bluestorm>
let _ = fun () -> 42
<flux>
:)
ikaros has joined #ocaml
<flux>
not what I'd expect :)
<flux>
anyway, the issue (of opening parenthesis) is worked around easy with a custom operator
<bluestorm>
(i suggest ^< :)
<flux>
bah, I use @@ :-)
<bluestorm>
i can have >^ while yours is not bidirectional
<bluestorm>
(same with @. )
<flux>
> is on a different level than ^
<flux>
so it's not completely bidirectional either
<bluestorm>
only one level of difference
<bluestorm>
and it's needed for associativity
<bluestorm>
the application operators have to take care of associativity (while i think composition operators don't)
alexyk_ has quit []
<flux>
well, if I ever decided to switch @@ to >|, it would most probably be a search/replace operation
<flux>
perhaps OSR will give me incentive! (does it have that?)
<bluestorm>
not for now afaik
<flux>
ok
<bluestorm>
but i hope it will eventually get a load of useful operators
<bluestorm>
even if, as Smerdyakov said, ocaml non-support for closure-related operations can make those things a bit more costly than the usual style
<flux>
has it been given thought whether they should come in "automatically" (piggypacked with another module) or would they be in their own "Operators" module (or somesuch)?
<flux>
yes, that's too bad
<flux>
hm, although isn't most of the time that just for currying?
<flux>
and currying was handled efficiently?
<bluestorm>
i think currying is
<flux>
also, I wonder if ocaml could be optimized to handle these kind of closures without introducing excessive smartness/complexity
<flux>
(hm, could be optimized -> could be changed to optimize)
<bluestorm>
i guess it could, but you've to find someone willing to do it
<flux>
well, maybe next summer's jane street socp :)
<bluestorm>
anyway, i don't think it's a problem to use those operators, and maybe have a more constrained style in the computation-intensive parts of the program
<bluestorm>
i don't really care if the 90% of my code taking 10% of execution time get 20% slower because of nice operators
<flux>
I think it's possible that certain kinds of server software could have the time spent all over the code, and in the end limiting the number of concurrent clients it can manage
seafood_ has quit [Read error: 110 (Connection timed out)]
<flux>
you know, like ruby.. ;)
|Catch22| has quit ["To the best of my knowledge, I guess that I'm fresh"]
<tsuyoshi>
I've been working on a library to make ocaml more like ruby.. faked overloading, making everything into a class etc.
<tsuyoshi>
I want to see how the performance compares to regular ocaml or ruby
<flux>
tsuyoshi, statically typed ruby to ocaml-compiler? ;-)
<tsuyoshi>
yeah basically
<tsuyoshi>
well.. you don't really need a compiler..
<tsuyoshi>
I think you can do everything just through modules.. except constants need to be like "new int 0" instead of just "0"
<tsuyoshi>
a preprocessor could take care of that
alexyk has joined #ocaml
<tsuyoshi>
although I guess I'm not trying to make the syntax the same as ruby
<tsuyoshi>
I don't like ocaml syntax much, but I like ruby syntax even less
<qwr>
what syntax you like then? haskell? scheme?
<tsuyoshi>
I like scheme
fuzzdk has joined #ocaml
<bluestorm>
tsuyoshi: there is a camlp4-compatible (< 3.10 i'm afraid) scheme syntax for ocaml
<naufraghi>
is it possible to access the toplevel print-whatever-you-get facility from a program?
alexyk has quit []
<flux>
no, but there are modules that can do similar stuff; none as quite capable, though
alexyk has joined #ocaml
hkBst has joined #ocaml
<naufraghi>
flux: ... is there a simple reason of this? the toplevel has some introspection power that a normal program can't have?
<naufraghi>
I can also be ok having a verbose run in the toplevel and a silent run once optimized...
alexyk has quit []
alexyk has joined #ocaml
LordMetroid has joined #ocaml
alexyk has quit [Client Quit]
<flux>
you can detect that with Sys.interactive
<flux>
I think I've read that the magical introspection powers of the toplevel derive from the fact that it has magic hooks to the compilation process
alexyk has joined #ocaml
<naufraghi>
ok, thanks, I'll investigate
alexyk has quit []
vbmithr has joined #ocaml
vbmithr has quit [Client Quit]
<flux>
funny, in natively compiled programs (with threads) one needs to do let _ = Thread.create (fun () -> ()) () in order to guarantee that Thread.self works later
<flux>
(obviously if you don't otherwise use threading)
<flux>
I have a library which doesn't require threading by itself, but I decided to add an assertion that certain objects cannot be accessed from different threads (check for matching Thread.id), and for that reason it calls Thread.id (Thread.self ())
sporkmonger has quit []
seafood_ has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
filp has quit ["Bye"]
Morphous has joined #ocaml
seafood__ has joined #ocaml
seafood___ has joined #ocaml
Morphous_ has quit [Read error: 110 (Connection timed out)]
sporkmonger has joined #ocaml
seafood_ has quit [Read error: 110 (Connection timed out)]
seafood__ has quit [Read error: 110 (Connection timed out)]
middayc_ has quit []
coucou747 has joined #ocaml
Yoric[DT] has joined #ocaml
naufraghi has quit [Read error: 110 (Connection timed out)]
Yoric[DT] has quit ["Ex-Chat"]
seafood___ has quit []
naufraghi has joined #ocaml
middayc has joined #ocaml
<tsuyoshi>
ocaml is not reallly an interpreted language
<tsuyoshi>
the "toplevel" is a hack that can give you that impression...
<bluestorm>
actually, python use a bytecode too
<bluestorm>
i'm not sure what "interpreted" means these days
<tsuyoshi>
python has a runtime type system.. it's a whole other world
<tsuyoshi>
ocaml is more like c++ than python
RobertFischer has joined #ocaml
<struk_atwork>
tsuyoshi, that's a first time comparison if I've ever heard one
Morphous_ has joined #ocaml
Morphous has quit [Read error: 110 (Connection timed out)]
vbmithr has joined #ocaml
vbmithr has quit [Client Quit]
<mattam>
tsuyoshi: The toplevel is not a hack. Ocaml can be both interpreted (REPL) and compiled.
<bluestorm>
hm
<bluestorm>
the toplevel use bytecode compilation under the hood
<tsuyoshi>
people keep coming in here and asking how to get runtime type information
<mattam>
Yes... but that's just implementation, it could be done otherwise.
<tsuyoshi>
they do this because they see the toplevel has runtime type info
<tsuyoshi>
but what the toplevel does is not normal
<mattam>
Allright, I see what you mean. Can you really write toplevel-specific code ?
<hcarty>
mattam: You can write pretty-printers for different data type for the toplevel to use. They may be specific to the toplevel, though I am not certain.
<hcarty>
For example, lacaml provides a toplevel pretty-printer for matrices
ikaros_ has joined #ocaml
<mattam>
I think you can't use that anywhere else (except for other toplevel based programs like ocamldebug).
<bluestorm>
hmm
<bluestorm>
iirc the printers are just format -> your_type -> unit functions
<bluestorm>
wich make them "usable" everywhere, though of course you won't have the ad-hoc polymorphism of the toplevel
<mattam>
I mean you don't get a format -> 'a -> unit function anywhere else.
<bluestorm>
i don't see that as a huge limitation : if your code is polymorphic, how would printing a value of unknown type help debugging anything ?
<bluestorm>
(and if the part of your course you want to inspect through value printing is monomorphic, then you don't need a format -> 'a -> unit function)
<mattam>
I didn't argue that it was a limitation or anything. It's true that it can mislead people though, thinking that type info could be present at runtime. Especially given that the strong typing actually _permits_ not to have it :)
ikaros has quit [Read error: 110 (Connection timed out)]