Defcon7 has quit [Read error: 60 (Operation timed out)]
Defcon7 has joined #ocaml
mimosa has quit [Remote closed the connection]
tyler has joined #ocaml
<tyler>
Are O'caml lists implemented as singly linked lists?
<Smerdyakov>
Yes.
<tyler>
It seems that way, as List.nth l n seems to be proportional to n....
<Riastradh>
It is.
<Smerdyakov>
Lists are not an especially privileged type.
<Smerdyakov>
They are defined with the 'type' keyword like anything else.
<Riastradh>
If you want constant-time indexing, use an array.
skylan has quit ["."]
<Smerdyakov>
So the definition tells you how it works.
<tyler>
ahh...
* tyler
is slowly getting the hang of O'Caml....
<tyler>
sorta ;)
skylan has joined #ocaml
<Smerdyakov>
Goodgood.
<tyler>
I figure the rewards are worth the pain...
<tyler>
In the sense that it's a decent language to work with (no memory managment...) while being high-performance as well
<Smerdyakov>
Certainly. You'll never go back again if you learn the basics.
<Smerdyakov>
I'd go further than "decent language"! :D
<tyler>
My languages of choice currently are python and ruby
<tyler>
Smerdyakov: All languages suck. Some just suck less...
<mattam>
you'll love static typing i can tell you
<tyler>
mattam: heh...
<tyler>
mattam: well, I do C as well when I must...
<tyler>
so I know that road...
<Riastradh>
C's static typing is a joke.
<tyler>
Riastradh: yep...
<mattam>
you'll miss the fun reflection/dynamic stuff a little, but that's not so bad.
<tyler>
mattam: yep.
<tyler>
mattam: But then, I think OOP is overrated ;)
<tyler>
not useless mind you, but overrated...
Nutssh has quit ["Client exiting"]
<mattam>
we couldn't agree more :)
<tyler>
Java gets it worst of all...
* tyler
tries to repress the memories...
<tyler>
ruby does it right...
* tyler
hasn't gotten to O'Camls OO stuff yet
* tyler
is in chapter 6 of the merjis.com tutorial
* Riastradh
coughs 'multiple dispatch' at tyler.
<tyler>
multiple dispatch?
* tyler
never bothered to really dig in to OO theory...
<mattam>
dispatch (select method) based on more than one argument (the object the method is called on usually). Is that right Riastradh ?
<Riastradh>
Yes.
* mattam
has good rests of reading the UW cecil report
mattam has quit [Read error: 60 (Operation timed out)]
mattam has joined #ocaml
Bakka has quit ["changing servers"]
mattam_ has joined #ocaml
mattam has quit [Read error: 60 (Operation timed out)]
<tyler>
is there any sort of 'automake' for ocaml? That is, something that can scan a source file and generate the proper ocamlc / ocamlopt command line to build the binary, together with the right librarys, etc?
<Smerdyakov>
There is a standard Makefile from someone or other affiliated with the OCaml project, where you just need to enter filenames.
<tyler>
I mean, it's not a *huge* deal
<tyler>
as 'open Foo' usually means just add /usr/lib/ocaml/3.07/foo.cmxa to the ocamlopt command.....
<Smerdyakov>
You don't need to use 'open' to use libraries.
<tyler>
right....
<Smerdyakov>
It's entirely a syntactic convenience.
* tyler
thinks it's cool that ocaml includes a drawling library :)
<tyler>
brings back fond memories of hacking graphics in qbasic years ago...
<mattam>
certifying the ocaml compiler is in the works
<Demitar>
indigo, OCaml is already proving difficult stuff. =)
Riastrad1 has joined #ocaml
<indigo>
like what?
<indigo>
you mean in the realm of program verification, or something else?
<Demitar>
Mostly. It was pretty much an "shock-and-awe don't-ask-questions" statement. ;-)
<indigo>
ah
* Demitar
of course is too tired to have any idea what he's talking about.
<indigo>
well, i'm looking at ocaml because i'm looking for a safe language with good performance
<mattam>
indigo: what would you want to compare ocaml programs to ? i mean what sort of programs in C ?
<indigo>
mattam: well, generally, just anything, which makes it kinda hard to test :)
<indigo>
i've implemented some small tests and the results have all been on par with C, but i was looking for something bigger
<Demitar>
indigo, OCaml allows me to write terrible code that still works. That is something which requires strong statical typing. :)
<indigo>
heh
<indigo>
well, i'm still trying to figure out just how safe it really is
<indigo>
the idea is to make a language which can make memory protection unneeded
<mattam>
indigo: ocaml does
<Demitar>
Sound like TUNES?
<indigo>
yes, it does :)
<mattam>
if it hadn't some Obj.magic and the like
<Demitar>
You always have to be wary of exceptions of course.
<indigo>
well, if the program dies gracefully, that's fine
<indigo>
comprimising the system is not acceptable though
<indigo>
can't be worse than a segfault
<Demitar>
Well, you'd have to write a memory manager for OCaml of course. Apart from that it should be safe afaik. But you probably want stronger proof of that if you're aiming to ditch memory protection.
<Demitar>
Anyway, later.
Demitar has quit ["Bubbles everywhere!"]
<indigo>
mmm...bubbles
<indigo>
well, i have a feeling i'll be in the ocaml source soon...
<indigo>
like right now
<indigo>
i think ocaml would be a good language for poetry :)
Riastradh has quit [Success]
malte has quit [Read error: 54 (Connection reset by peer)]
<indigo>
is there any way to take the bytecode produced by ocamlc, and produce native code?
<indigo>
or is there a table of all the filetypes all these tools expect? :P
stupid|me has joined #ocaml
whiskas has quit [Read error: 113 (No route to host)]
Nutssh has joined #ocaml
stupid|me has quit ["Pa / Bye."]
det has quit [Read error: 104 (Connection reset by peer)]
bk_ has quit ["I'll be back"]
tyler has joined #ocaml
<tyler>
Is there a tool to properly indent O'Caml code
<Smerdyakov>
emacs
<tyler>
I've got a series of really nasty nested statements
<tyler>
and something isn't lining up right...
<tyler>
I think anyways...
<tyler>
I'm getting a syntax error on a line that is simply 'done ;'
<Smerdyakov>
I hope you saw my answer to your question, tyler.
<tyler>
yea
<tyler>
what's the proper encantation?
<Smerdyakov>
If you have an OCaml mode installed, nothing. It will automatically be syntax highlighted and indented as you edit it.
<tyler>
Smerdyakov: err... little late for that...
<tyler>
plus emacs isn't my $editor *g*
<Smerdyakov>
You can select it all and indent-region, in that case.
<tyler>
ok
<Smerdyakov>
Also, switch to using emacs, if you want to code in functional languages. Almost all FP hackers use it.
<tyler>
DOH!
<tyler>
it wasn't looping percisley...
<tyler>
but how I was entering
<tyler>
I left the in off a let....
<tyler>
my mandelbrot program is getting pretty neat ;)
<tyler>
I'm implementing progressive rendering
<tyler>
it requires a power of 2 window size
<tyler>
and then continually subdivides until every pixel is rendered
<tyler>
so you get a fast 'preview' and then kinda let the details fill in
<Hipo>
Adaptive rendering isn't that good in mandelbrot...
Jaundice has joined #ocaml
<Hipo>
Hmm, sorry I think I misunderstood.
bk_ has joined #ocaml
<tyler>
Hipo: Still here?
<indigo>
moOOOOooOOo
Defcon7 has quit [Read error: 60 (Operation timed out)]
<tyler>
Anyways, if anyone is interested...
<tyler>
code is at http;//tylere.com/mandel.ml
Defcon7 has joined #ocaml
<tyler>
compile it, and run it with a single integer argument that specifys the size of the window
mimosa has quit ["J'ai fini."]
* indigo
looks
<indigo>
probably the biggest ocaml program i have read :)
<tyler>
hehe
<tyler>
come on now... it's under 100 lines
<tyler>
not very well structured I'll give you...
<tyler>
but it works
<tyler>
it breaks up after you zoom in 20 or 30 times
<tyler>
but that's just due to the limitations of doubles (!!)
<indigo>
no ocaml on this box, so i can't run it :(
<tyler>
a freebsd machine by any chance?
<indigo>
windows :(
<tyler>
ugg
<indigo>
need it for work :((
<tyler>
1 sec
<indigo>
i have linux availible to, but only through ssh
<indigo>
that's where i am now
<indigo>
i'd put ocaml on it, but stupid debian wants to install X also
<tyler>
heh
<Smerdyakov>
Whaaat?
<Smerdyakov>
I install ocaml just fine on a remote Debian machine I run.
<indigo>
does it have X?
<Smerdyakov>
Probably, but who cares? It's just some extra time spent downloading and installing.