gene9 changed the topic of #ocaml to: www.ocaml.org | http://caml.inria.fr/oreilly-book/ | http://www.bagley.org/~doug/shootout/ | http://icfp2002.cs.brown.edu/ | Ocaml kicks ass (c) Dybbuk | please, write Makefile.[am|in]
Demitar has quit []
Yurik has quit [Read error: 104 (Connection reset by peer)]
exarkun has quit ["ircII EPIC4-1.0.1 -- Are we there yet?"]
exarkun has joined #ocaml
Belgarion has quit [vinge.openprojects.net irc.openprojects.net]
smkl has quit [vinge.openprojects.net irc.openprojects.net]
themus has quit [vinge.openprojects.net irc.openprojects.net]
smkl has joined #ocaml
themus has joined #ocaml
Belgarion has joined #ocaml
two-face has joined #ocaml
two-face has quit [Client Quit]
Demitar has joined #ocaml
Demitar has quit []
TimFreeman has joined #ocaml
<TimFreeman> Is there an expression in OCAML that's analogous to __FILE__ in C, which returns the current file name?
<TimFreeman> ...current *source* file name, that is.
TimFreeman has left #ocaml []
Demitar has joined #ocaml
Demitar has quit [Read error: 113 (No route to host)]
exarkun has quit ["Death to all fanatics!"]
exarkun has joined #ocaml
exarkun has quit [Remote closed the connection]
exarkun has joined #ocaml
two-face has joined #ocaml
two-face has left #ocaml []
Yurik has joined #ocaml
<Yurik> re
belman has joined #ocaml
<Yurik> belman: hi
malc has joined #ocaml
<Yurik> malc: hi
<malc> Yurik: lo
malcy has joined #ocaml
malc has quit [Client Quit]
Yurik has quit [Read error: 104 (Connection reset by peer)]
Belgarion has quit [Read error: 110 (Connection timed out)]
Yurik has joined #ocaml
<Yurik> re
Yurik has left #ocaml []
volatile has joined #ocaml
<volatile> anyone awake?
<exarkun> awake, aye
<volatile> I'm thinking about converting my ftp server written in c into ocaml
<exarkun> Cool
<volatile> I'm just learning ocaml, and wanted to know if there is a way to specify variables of a certain size (8 bit, 16 etc)
<exarkun> integer vars?
<volatile> well the character var is by default 8 bits right?
<exarkun> yup
<volatile> is that a standard or just a coincedence?
<volatile> in ocaml i mean
<exarkun> I think it's always 1 byte, but I'm pretty new to ocaml myself :)
* mr_bubbs never concerns himself with such things :)
<exarkun> That's a good point. What in an ftp server needs integers of a particular size?
<volatile> data must be transfered in 1 byte sizes, but actually I don't think there is any need for 16 bit or 32 bit specifically sized integers
<mr_bubbs> the great thing is there are things in OCaml that hide that for you, and they are portable, to boot
<mr_bubbs> and they even do it efficiently!
<volatile> the chief reason I'm thinking about converting it to ocaml is the buffer protection (no buffer exploits are possible) and that the code runs fast. C# and Java were also choices but the mono port doesn't compile code directly to x86 and java is, well... java, not exactly the speed demon
<exarkun> libsafe protects you from buffer overruns
<mr_bubbs> volatile: so you have the whole thing written in C, eh?
<mr_bubbs> exarkun: how's the twisted progress
<mr_bubbs> volatile: I mean.. it's finished and such
<volatile> mr_bubbs: no, actually its only about 50% done
<mr_bubbs> well, guess it's not too bad
<exarkun> mr_bubbs: paused while I consider possible approaches to the Jelly module
<mr_bubbs> I'd say if you already have the thing in another language, it might be kinda costly to rewrite it, depending on its size
<mr_bubbs> exarkun: yeah.. I have an httpd written in Python.. I'm really trying to not just port it to another language... I'm rather rethinking the ideas based on strengths of OCaml that were nonexistent with Python
* exarkun nods.
<volatile> its pretty small, not that many lines at all. However so far its pretty portable between windows and linux
<volatile> how come libsafe is so unused?
<mr_bubbs> good question
<mr_bubbs> I don't use it and I wonder why I'm not, myself
<volatile> I don't see wu-ftpd , apache, etc using it by debian or other distro mainterners. Or freebsd or openbsd
<exarkun> I guess people don't really care about security.
<exarkun> :)
<mr_bubbs> heck, I don't see it in ports unless I'm overlooking
<mr_bubbs> I think there are a few variants on a theme in regards to protecting overflows and such
<mr_bubbs> oh
<mr_bubbs> this doesn't help
<exarkun> blink
<mr_bubbs> Wojciech Purczynski discovered that format string protection in libsafe can be
<mr_bubbs> easily bypassed by using flag characters that are implemented in glibc but are
<mr_bubbs> implemented in libsafe. It was also discovered that *printf function wrappers
<mr_bubbs> incorrectly parse argument indexing in format strings, making some incorrect
<mr_bubbs> assumptions on the number of arguments and conversion specifications.
<mr_bubbs> hehe
<exarkun> heh
<volatile> as far as ocaml goes, there is no way to have a buffer overrun correct?
<mr_bubbs> I know there's a way to turn off bounds-checking with the native compiler
<mr_bubbs> can't think of anything else, off-hand
<mr_bubbs> I haven't been using the language too long, though
<volatile> doesn't seem to be very popular unfortunately
<volatile> seems to be very clean
<exarkun> clean?
<exarkun> I think its syntax is its worst feature :)
<volatile> modify to make it look more C++ maybe? ;)
<exarkun> Have you guys looked at the new syntax specification at all? caml4 or something like that, forget what it was called exactly
* volatile hardley knows the current syntax, whatever version the online orielly book uses
<volatile> *hardly
<smkl> revised syntax
volatile has left #ocaml []
malcy has quit ["no reason"]
<mr_bubbs> hmm, cool
<mr_bubbs> volatile was from my state
<mr_bubbs> not everyday you know someone close to you who likes OCaml :)
<exarkun> heh
<mr_bubbs> for the first week or two using OCaml, I couldn't make a single thing work!
<mr_bubbs> now it seems so easy, heh
<mr_bubbs> I went nuts over the immutable part, heh
<exarkun> hooray for immutability
<mr_bubbs> :P
* mr_bubbs was messing with threads last night
<mr_bubbs> fun stuff
* exarkun flees from threads.
<mr_bubbs> hah
<mr_bubbs> Fatal error: exception Invalid_argument("Thread.kill: not implemented")
<mr_bubbs> neat
<mr_bubbs> [budbud@bb 7:58PM](~/ml)$ ocamlc -o str_array_test str_array_test.ml
<mr_bubbs> [budbud@bb 7:58PM](~/ml)$ ./str_array_test
<mr_bubbs> Fatal error: exception Invalid_argument("Array.get")
<mr_bubbs> [budbud@bb 7:58PM](~/ml)$ ocamlopt -o str_array_test str_array_test.ml
<mr_bubbs> [budbud@bb 7:58PM](~/ml)$ ./str_array_test
<mr_bubbs> Fatal error: exception Invalid_argument("out-of-bound array or string access")
<mr_bubbs> why doth that happen?
<mr_bubbs> now I'll have to match for Invalid_argument _
<mr_bubbs> hehe