<revence>
Must confess it is envy for the #haskell bot, which is such a utility over there.
revence has quit [""Okay. let rec usual_routine x = usual_routine x;; usual_routine 1000;;""]
<flux>
hmm.. a similar one might be possible in ocaml too, but it would require a camlp4 module to forbid certain structures, such as references to external symbols ("extern") and using certain modules ("Unix") and even certain functions from certain modules ("Pervasives.open_out")
<flux>
I suppose doing the last one would be a blanket block on using symbol name "open_out"?
<flux>
actually, a better solution would be to compile an ocaml with a new pervasives library, that excluded all kinds of stuff
<flux>
but the "extern"-block would still need to be implemented.
<flux>
actually that sounds like a fun project ;)
<flux>
I doubt you would be able to dynamically link code compiled in such fashion to an existing program, though, as the module interfaces would differ
<flux>
but you could run the compiled code as an external process, with certain limits (cpu-time, memory, etc)
vital303 has quit [Read error: 145 (Connection timed out)]
jlouis_ has quit [Remote closed the connection]
skal has joined #ocaml
joshcryer has quit [Client Quit]
<pedro_>
hi, Im trying to use GLDraw in the interactive interpreter, How can i bound to this library?
<pedro_>
the error : Unbound value GlDraw.viewport.
<flux>
I haven't used opengl for quite a while from ocaml, but maybe something like #use "topfind";; #require "lablgl";; would suffice?
<flux>
(I don't know how GlDraw relates to lablgl, if it even does ;-))
slipstream has joined #ocaml
slipstream-- has quit [Read error: 60 (Operation timed out)]
benny_ has joined #ocaml
benny has quit [Read error: 60 (Operation timed out)]
<pedro_>
umm i must install the lablgl package on my linux :)
<pedro_>
and then i can comile the code.
<flux>
yeah, I think that's a good start..
<flux>
hmm.. is 'assert (print_string "foo"; true)' something the compiler is allowed to optimize away when you compile with -noassert?
<flux>
evaluation order would say "no"
Celos has joined #ocaml
<Celos>
hi, i've installed ocaml on my linux distrib, it works fine in my terminal, but i would like to know, how can i open ml file, or save, i don't find any doc about ocaml un shell
<Celos>
hmm, i've just find the answer for loading file :D still looking for saving
<flux>
you cannot edit and save files in ocaml
<flux>
you'll use an external editor for that
<Celos>
ok
<Celos>
hmm, it's not possible to see the last function written when i press the up arrow key ?
<flux>
celos, use rlwrap or ledit
<Celos>
ok
<Celos>
thx :)
mikeX has joined #ocaml
Submarine has quit [Remote closed the connection]
Celos has quit ["Quitte"]
romanoffi has quit ["Leaving."]
postalchris has joined #ocaml
postalchris has left #ocaml []
bohanlon has quit [Remote closed the connection]
postalchris has joined #ocaml
benny99 has joined #ocaml
postalchris has quit [Read error: 145 (Connection timed out)]
bluestorm_ has joined #ocaml
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
benny99 has left #ocaml []
Riesz has quit ["Leaving.."]
postalchris has joined #ocaml
benny99 has joined #ocaml
<benny99>
it's me bothering again
<benny99>
What were your very first "OCAML-Beginner-Tasks" ?
<lucca>
implement a mandelbrot set drawing program
<lucca>
(very easy, actually!)
Smerdyakov has joined #ocaml
<benny99>
lucca: something even more easy maybe ?
<benny99>
lucca: I guess you didn't start with that huh ?
<lucca>
well, hello world?
<benny99>
lucca: something less easy :p
<benny99>
lucca: hm, I'll read that book till I think that I'm able to do something, maybe that helps the most :|
<benny99>
thanks
benny99 has left #ocaml []
<mrvn>
lucca: I did that in ocaml with both text mode output and graphics module. But ocaml is really slow in both floats and gfx.
<mrvn>
And I implemented the M-Set a 3rd time when I looked at interfacing with C. Move the main loop into C code. :)
<lucca>
heh
<lucca>
mrvn: even slower if you use the Complex type
<Smerdyakov>
You wouldn't need to do that if you were using MLton. ;)
<lucca>
but it makes a very pretty hello world
<lucca>
which was all I needed
<mrvn>
lucca: My code is optimized for the M-Set. With complex you have operations that are not neccessary.
<mrvn>
Smerdyakov: You wouldn't need it if the ocaml compiler would unbox floats. I tried it on alpha where it seemed to never unbox them.
<lucca>
if you want a good fast program, you're right
<lucca>
if you want a learning tool with maximal clarity and ease of learning, no
Sparkles has joined #ocaml
<lucca>
someday it'd be nice if the compiler could trace out the flow of the complexes and simplify it to exactly what is needed by the code And unbox floats... but in the meantime it's fine if it just works
<Smerdyakov>
lucca, just use SML & MLton... ;D
<mrvn>
let rec loop n z = if (n >= nmax) then n else if Complex.abs z > 4. then n else loop (n+1) (Complex.add (Complex.mul z z) z0)
<lucca>
Smerdyakov: nah, already moving on to haskell :p
<Smerdyakov>
lucca, why?
<mrvn>
The thing is that you can use parts of the Complex.abs in the Complex.mul and you can use Complex.abs ^ 2 so you don't have to use sqrt()
<mrvn>
And even better if you transform the formula and don't check for bailout every iteration.