polin8 has quit [Read error: 110 (Connection timed out)]
baader has quit ["I'll be back"]
liyang_ has joined #ocaml
liyang has quit [No route to host]
liyang_ has quit [Read error: 110 (Connection timed out)]
foxster has quit [Connection timed out]
Rapiere has joined #ocaml
docelic has joined #ocaml
docelic has quit ["later"]
CybeRDukE has joined #ocaml
liyang has joined #ocaml
docelic has joined #ocaml
docelic has quit ["l8r"]
phubuh has joined #ocaml
CybeRDukE has quit ["Home is where you hang your @"]
polin8 has joined #ocaml
docelic has joined #ocaml
docelic has quit ["later"]
docelic has joined #ocaml
CybeRDukE has joined #ocaml
Rapiere has left #ocaml []
mrvn_ has joined #ocaml
docelic has quit ["l8r"]
mrvn has quit [Read error: 110 (Connection timed out)]
teratorn has quit ["Terminated with extreme prejudice - dircproxy 1.1.0"]
foxster has joined #ocaml
docelic has joined #ocaml
baader has joined #ocaml
docelic has quit ["l8r"]
phubuh has quit [orwell.freenode.net irc.freenode.net]
phubuh has joined #ocaml
mrvn_ is now known as mrvn
Riastradh has quit [Connection timed out]
brwill is now known as brwill|out
foxster has quit [No route to host]
phubuh has quit [orwell.freenode.net irc.freenode.net]
phubuh has joined #ocaml
gilbertdeb has joined #ocaml
<gilbertdeb>
has ocaml been used for any low-level work yet?
CybeRDukE has quit ["God is real... unless declared an integer."]
<taw>
yeah
<taw>
like fftw or ocaml compiler
<taw>
but as meta-low-level
<taw>
how low you want to get ?
<gilbertdeb>
as low as low can be.
<taw>
yeah, but what ?
<taw>
just to be fast ?
<taw>
os kernel ?
<gilbertdeb>
yes.
<gilbertdeb>
not for speed, just to reduce sheer volume of work.
<taw>
you want to make os kernel in ocaml ?
<taw>
hmmm
<gilbertdeb>
is ocaml not up to the task ;)
<gilbertdeb>
speculating now, mostly.
<gilbertdeb>
even if it means it will generate intermediate c-code, I think it is better than typing every single damned thing in c.
<taw>
well
<taw>
ocaml is single-threaded now, with GC etc.
<taw>
it's like writing kernel in java
<taw>
it's all GC problems, and it really suck for kernels
<gilbertdeb>
ack
<taw>
because of gc
<taw>
you can't get 2 threads running at the same time
<taw>
memory alocation requires global lock
<taw>
and almost every operation requires allocating memory
<gilbertdeb>
oh well.
<taw>
so in effect only one ocaml thread can run at the same time (but others can wait at i/o or sth)
<taw>
oh, and try c++ not c ;)
<taw>
these 2 pluses help a lot
<gilbertdeb>
god no!
<taw>
oh yes they do
<taw>
if you don't know why c++ is better than c you shouldn't be using either
<gilbertdeb>
I'm sure they do. amen.
<gilbertdeb>
for me, No.
<gilbertdeb>
honestly, i don't like either.
<taw>
mmm
<taw>
yes
<gilbertdeb>
but i like c++ < c.
<taw>
but c++ fixes worst problems of c
<taw>
really
<taw>
it just needs to be learned
<taw>
for example it has string class, so you won't be getting stack overflows all the time like with c
<taw>
objects are great for security
<gilbertdeb>
yay.
<taw>
"c security" is even worse than "windows security"
<gilbertdeb>
why isn't the linux kernel written in c++ then?
<taw>
historical reasons, obviously
<gilbertdeb>
mmhm.
<taw>
in 1991 there weren't any good c++ compilers
<taw>
yet
<taw>
most new systems are using these 2 pluses
<taw>
of course c++ has so many features you can't use them all
<gilbertdeb>
eg?
<taw>
afair solaris uses c++
<gilbertdeb>
really?
<gilbertdeb>
and which else uses c++?
<taw>
you only want kernels ?
<gilbertdeb>
any others you can think of.
phubuh has quit [orwell.freenode.net irc.freenode.net]
<taw>
let me grep, so i don't make any mistakes
<taw>
damn
<taw>
most packages don't have Build-Depends here
<gilbertdeb>
do you use c++ much?
<taw>
not really
<taw>
i try to avoid it
<gilbertdeb>
so why od you recommend it?
<taw>
because i try to avoid plain c even more
<taw>
;)
<gilbertdeb>
hahah
<taw>
i love it when i can't google any support data quickly
<gilbertdeb>
why not have your favorite language generate the C code for you?
<taw>
huh ?
<gilbertdeb>
n/m
<taw>
c isn't really lowest-common-denominator
<gilbertdeb>
it can be.
<taw>
no
<gilbertdeb>
por que non?
<taw>
it doesn't have very important instructions
<taw>
like bound
<gilbertdeb>
?
<taw>
intels have lot of nice instructions
<taw>
that aren't usable from c
<taw>
so if foo compiler generates c it can't use them
<taw>
but if it generates asm directly it can
<gilbertdeb>
but it will be portable won't it?
<taw>
bound is most obvious
<taw>
well, yeah, you can generate twice slower code on architectures that don't have them :)
<gilbertdeb>
the goal being to avoid using c no?
<gilbertdeb>
it is fulfilled in this case I think.
<taw>
things like gc, bound checking, dynamic growth of datastructures
<gilbertdeb>
s/using/writing/
<taw>
aren't really programable in c
<taw>
you mean to have all languages generate c code instead of asm ?
<gilbertdeb>
not all.
<taw>
what would it change, really ?
<gilbertdeb>
for all those avoiding c when c is unavoidable ;)
<taw>
either way ?
<taw>
oh
<taw>
yeah, mysql is written in c++
<taw>
that's what i was trying to confirm
<gilbertdeb>
what about postgresql?
<taw>
that's plain c
<taw>
postgres started in 1980s
<gilbertdeb>
I know
<taw>
most old software is still using plain c
<taw>
even if you diidn't plan to do anything heavy in c++, having it for ocasional use is still good
<taw>
like vector<>s, class string, a few stl algorithms here and there and some syntactic sugar for objects
<gilbertdeb>
so far you've said nothing about ocaml.
<gilbertdeb>
mellum: 'lets talk about trees' you: 'birds land on trees, and birds etc etc etc' ;)
<taw>
oh
Smerdyakov has quit [orwell.freenode.net irc.freenode.net]
<taw>
hehe
Smerdyakov has joined #ocaml
<taw>
so ocaml is not for kernels
<gilbertdeb>
ack.
<gilbertdeb>
what is ocaml for?
<taw>
kernels require minimal runtime, ocaml has very heavy runtime
<gilbertdeb>
ICFP contests?
<taw>
with gc and threading model that's absolutely horrible
<gilbertdeb>
it seems to have won a lot and been used for little else :D
<taw>
and no easy way to access binary data
<taw>
oh, sure
<taw>
it's fast
<taw>
it won this year too ?
<gilbertdeb>
the winners have not been announced.
<taw>
oh
<taw>
ok
<taw>
and ocaml doesn't compile to c
<taw>
that's also a problem
<taw>
here
<gilbertdeb>
it has a VM doesn't it?
<taw>
mmm
<taw>
no
<taw>
it can compile to binary
<taw>
only gc stuff is included, not any full vm
<taw>
but it's bad enough
<taw>
but yes, it has bytecode version too with full vm
<gilbertdeb>
so what makes it so great?
<gilbertdeb>
well?
<taw>
oh
<taw>
it's great for certain things
<taw>
it's damn fast
<taw>
has higher level functions
<taw>
big standard library
<taw>
has strong polymorphic typing
<taw>
(now, that's surprising but that's the only language left with these features)
<gilbertdeb>
what else had it before?
<taw>
left after crossing out ;)
<taw>
no other language has these
<taw>
c++ has no high order functions, lisp no static typing, haskell is damn slow, and sml's standard lib sucks (and it has no oo)
<taw>
of course ocaml isn't any ideal
<gilbertdeb>
whats missing?
<taw>
threading model sucks most, operating on binary data sucks too, sql and other usual things are not easy to use
<taw>
and debuging facalities aren't as good as they should be
<taw>
in fact they're very bad
<gilbertdeb>
if ocaml is so fantastic, why hasn't anyone written a debugger for ocaml in ocaml?
<taw>
it has a debuger
<taw>
but it's very simple
<taw>
and lacks most features that are needed
<gilbertdeb>
well, is it impossible to write the best one in ocaml for ocaml?
<taw>
debugger is piece of software that needs tight integration with the rest of language, so it's not really easy
<taw>
i suppose someday someone is going to write one
<gilbertdeb>
that does mean that ocaml is the best language to write one in no?
<taw>
but c is even more popular and people are still using gdb ;)
<taw>
well, sure ocaml debugger should be written in ocaml
<taw>
but also some debugging facilities should be build into language
<taw>
like universal printing function
<taw>
i can't just say: print_anything foo;;
<taw>
or even (string_of_anything foo)
<taw>
debugger has such feature (well, not for anything, but for enough things)
<taw>
but it's not accessible on language level
<taw>
if i couldn't use ocaml i would probably use lisp, maybe sml
<gilbertdeb>
ocaml needs a baby sitter to do its real work for it doesn't it?
<taw>
mmm
<taw>
there are still many things about ocaml that could improve it a lot
<taw>
but that's the same with other languages too
<taw>
as if java didn't desperately needed templates and operator overloading
<gilbertdeb>
asm is perfect.
<gilbertdeb>
eg, you can write a debugger for asm *in* asm.
<gilbertdeb>
isn't that a novel concept?
<taw>
well
<taw>
i'm sure they were doing such things in 1960s
<gilbertdeb>
they should be doing so now as well.
<taw>
asm is really not a language for humans
<taw>
not any more than binary opcodes
<gilbertdeb>
great '90s languages like ocaml can't write good debuggers in themselves ;)
<gilbertdeb>
I think it is.
<taw>
mm
<taw>
i don't understand you
<taw>
ocamldebug is written in ocaml
<gilbertdeb>
but you say it is bad.
<taw>
we just need to improve it a lot
<gilbertdeb>
what are 'we' waiting for?
<taw>
that doesn't mean improved ocamldebug should be written in c++
<taw>
stuff like that requires knowing not only language (easy) but also all the internals of vm (hard)
<taw>
not many people with that knowledge
<gilbertdeb>
is this knowledge available on the net?
<gilbertdeb>
or rather info.
<taw>
yea
<taw>
read the source, luke
<gilbertdeb>
har har har har.
<gilbertdeb>
whats the source written in?
<taw>
ocaml
<gilbertdeb>
really?
<gilbertdeb>
for the VM?
<taw>
yes
<gilbertdeb>
interesting!
<taw>
not realy
<gilbertdeb>
why not?
<taw>
almost all compiled languages are written in themselves
<taw>
almost all compiled language compilers are written in themselves
<gilbertdeb>
that makes sense.
<gilbertdeb>
it is the first proof that they _can_ compile at all.
<taw>
gcc in c, freepascal in pascal, gnat in ada, ocaml in ocaml
<taw>
yeah
<gilbertdeb>
if knowing not only language (easy)
<gilbertdeb>
and VM is written in ocaml...
<gilbertdeb>
what is causing: the internals of vm (hard)
<gilbertdeb>
?
<taw>
well
<taw>
you know c, can you fix gcc easily ?
<gilbertdeb>
:)
<taw>
the same problem
baader has quit [orwell.freenode.net irc.freenode.net]
mellum has quit [orwell.freenode.net irc.freenode.net]
<gilbertdeb>
I see i see.
<gilbertdeb>
n e way.
<gilbertdeb>
gtg. food time.
<gilbertdeb>
thanks for the info taw.
<taw>
bye
gilbertdeb has left #ocaml []
polin8 has quit [orwell.freenode.net irc.freenode.net]
skylan has quit [orwell.freenode.net irc.freenode.net]
vect has quit [orwell.freenode.net irc.freenode.net]
wax has quit [orwell.freenode.net irc.freenode.net]
asqui has quit [orwell.freenode.net irc.freenode.net]
rox has quit [orwell.freenode.net irc.freenode.net]
Smerdyakov has quit [orwell.freenode.net irc.freenode.net]
mrvn has quit [orwell.freenode.net irc.freenode.net]
liyang has quit [orwell.freenode.net irc.freenode.net]
palomer has quit [orwell.freenode.net irc.freenode.net]
taw has quit [orwell.freenode.net irc.freenode.net]
clog has joined #ocaml
brwill|out has joined #ocaml
vegai has joined #ocaml
Khortl has joined #ocaml
skylan has joined #ocaml
Smerdyakov has quit [Remote closed the connection]
lam has joined #ocaml
Smerdyakov has joined #ocaml
foxster has joined #ocaml
foxster has quit [Client Quit]
<baader>
type astring = { mutable s : string } ;;
<baader>
does this make sense actually ?
<sam>
looks fine to me
<baader>
hm ok
<baader>
mind if i ask a question about that ?
<sam>
ask or don't ask. don't ask if you can ask
<baader>
ok 1st: aren't strings mutable by default ?
<sam>
yes.. but the above will create a mutable reference to a string
<baader>
i thought that it creates a mutable record of strings, no ?
<sam>
it creates a record, that has a member s, which is a mutable reference to a string
<baader>
hm
<baader>
ah i get it
<sam>
..so if you did "type astring = { s : string }".. the reference would be immutable, but you still could mutate the string itself
<baader>
yes, thx, i understand
<baader>
actually i was looking for this: type astring = string ;; and for some reason i 1st figured it had to look something like this type astring = s : string ;;
<baader>
the latter being not a correct definition
<baader>
so i suppose type name = { x:type } is only valid for records ?!
<sam>
it defines a record type, yes.. if that was what you were asking?