kinners has quit [Read error: 110 (Connection timed out)]
GreyLensman has joined #ocaml
Riastradh has quit ["moving machine"]
hangman4 has quit ["Leaving"]
tautologico has joined #ocaml
Lemmih has quit [Read error: 60 (Operation timed out)]
Lemmih has joined #ocaml
Riastradh has joined #ocaml
monochrom has joined #ocaml
gim_ has joined #ocaml
gim has quit [Read error: 110 (Connection timed out)]
hangman4 has joined #ocaml
noj has quit [tolkien.freenode.net irc.freenode.net]
Demitar has quit [tolkien.freenode.net irc.freenode.net]
dd__ has quit [tolkien.freenode.net irc.freenode.net]
taras has quit [tolkien.freenode.net irc.freenode.net]
noj has joined #ocaml
Demitar has joined #ocaml
dd__ has joined #ocaml
taras has joined #ocaml
tautologico has quit []
gim__ has joined #ocaml
gim_ has quit [Read error: 110 (Connection timed out)]
gim_ has joined #ocaml
gim__ has quit [Read error: 110 (Connection timed out)]
mlh has joined #ocaml
monochrom has quit ["hello"]
GreyLensman has quit [Remote closed the connection]
jeff2 has quit []
Submarine has joined #ocaml
mlh has quit ["who are you people and what are you doing in my computer!?"]
mlh has joined #ocaml
mrvn has joined #ocaml
mrvn_ has quit [Read error: 110 (Connection timed out)]
gim_ has quit [Read error: 113 (No route to host)]
gim_ has joined #ocaml
Oejet has joined #ocaml
Oejet has quit [Remote closed the connection]
pango has quit ["Client exiting"]
pango has joined #ocaml
eugos has joined #ocaml
_fab has quit []
eugos has quit ["Leaving"]
srv has quit [Read error: 104 (Connection reset by peer)]
srv has joined #ocaml
eugos has joined #ocaml
smimou has joined #ocaml
Submarine has quit ["Leaving"]
_fab has joined #ocaml
vezenchio has joined #ocaml
gim_ has quit [Read error: 110 (Connection timed out)]
gim_ has joined #ocaml
fab__ has joined #ocaml
_fab has quit [Read error: 60 (Operation timed out)]
fab__ has quit [Remote closed the connection]
Herrchen has joined #ocaml
smimou has quit ["?"]
malc_ has joined #ocaml
cmeme has quit ["Client terminated by server"]
cmeme has joined #ocaml
det has quit ["Lost terminal"]
malc_ has quit ["leaving"]
det has joined #ocaml
mlh has quit [Client Quit]
<vincenz>
Anyone know a good IDE for ocaml?
<vincenz>
should I go for kdevelop or eclipse?
<Demitar>
Many use (x)emacs.
<vincenz>
Well I use vim
<vincenz>
But I'd like something so I have a listing of my files (hence I have somewhat of an overview)
<avlondono>
you'd like something?
* avlondono
uses vim too
<vincenz>
Well the thing with vim is, you don't have a nice overview of the different files
_fab has joined #ocaml
<avlondono>
there was a tag plugin, I used is for some time for c, but I got annoyed (I don't like those featuers). It works with th tags file, so maybe you can use otags for that.
<vincenz>
I know I know
<vincenz>
but I think an IDE might be nice
<avlondono>
I always get annoyed by IDE, that's my problem. I'm never happy with them, to many useless space fill features that I won't be able to use over ssh later. but of course, that's a matter of taste.
<vincenz>
no I know, I typically use vim
<vincenz>
but I'm starting with smoething and would like an overview
<avlondono>
let me know if you write a plugin for vim :-)
<vincenz>
There should be something like emacs but in ocaml
<vincenz>
with the new mzscheme interface for vim, emacs becomes ... obsolete :P
<vincenz>
pango: seems outof date tho
<pango>
I'm not an IDE addict, so I have no personal experience with it
<vincenz>
well last update was last year, and it doesn't support 3.08
<vincenz>
Small design question
<Demitar>
IIRC cameleon2 is under way.
<vincenz>
I have a class server
<vincenz>
which of course has a list of connections
<vincenz>
whenever the listen tells it to spawn a new connection, a callback is called which will actually instantiate this connection
<vincenz>
each connection has a handler
<vincenz>
however I would like the handler to be able to close a connection, or send stuff to a connection
<vincenz>
so it's recursive :/
<Demitar>
Trivial way would be to pass it a callback object or something similiar.
<vincenz>
I know
<vincenz>
but then the handler won't know bout it's connection and thus be unable to close that connection
<Demitar>
Err?
<Demitar>
That would be a callback, no?
<vincenz>
hmm
<vincenz>
I'll figure something out :)
<vincenz>
Demitar: not quite sure what you mean by callback
<Demitar>
vincenz, a function passed to another function/object/... which can be called to perform some operation undefined (as far as the called function is concerned) at the point of definition.
<vincenz>
ah
<vincenz>
well hmm
<vincenz>
I'll just make a definition for handler and connection with "abd"
<vincenz>
"and"
<vincenz>
cause when a connection closes, it should notify it's handler, but a handler should also be able to close a connectin
<vincenz>
actually
<vincenz>
no you're right, a notify is better
<vincenz>
I mean callback
<mrvn>
let type connection { callback : connection -> (); }
<mrvn>
and then "callback conn"
_fab has quit [Remote closed the connection]
<vincenz>
I know
Submarine has joined #ocaml
jason_ has joined #ocaml
jason_ is now known as TheDracle
pango has quit ["Leaving"]
smimou has joined #ocaml
pango has joined #ocaml
<vincenz>
Hmm
<vincenz>
It's a shame you can't pass a type to a class
<vincenz>
I mean a class to a class
<vincenz>
something like
<vincenz>
method x c = new c;;
<Submarine>
hey, OCaml does not have reflexivity
<monochrom>
What does it mean to pass a class to a class? What type system supports that? How complicated is such a type system?
<Submarine>
the CoC supports this :-)
<malc_>
class c = object method x new_c : <a:unit> = new_c end;;
gim has quit [Read error: 113 (No route to host)]
<mflux>
monochrom, c++ supports it ;)
<mrvn>
vincenz: method x c = c (); x (fun () -> new c)
<mrvn>
ocaml supports it through functors.
<mrvn>
mflux: how does C++ support it (other than templates)?
<mflux>
mrvn, mmm... tough one... you sure templates isn't a proper answer?-)
<mrvn>
templates would do the trick.
<mflux>
infact I would expect it to be a common pattern, for instance in c++ containers
<mrvn>
mflux: They don't get the class passed as argument to a method but to their own creation.
<mrvn>
That would be a simple "class 'a foobar = object method x = new 'a"
<vincenz>
hmm
<vincenz>
I think ruby and such could do it, cause there classes are first class objects
<mflux>
that's a good point
<mflux>
I wonder if that is actually a common pattern in any c++ programs, hmm..
<mrvn>
template<T> T x() { return new T; } would be his example.
<mflux>
and it would also be a method
<mrvn>
callable as x<c>()
<vincenz>
I got it
<vincenz>
I'll make a factory
<vincenz>
seems the suited idea for this
<mrvn>
vincenz: a factory sounds much nicer than a functor.
<vincenz>
class virtual factory = object method create_connection : connection end
<vincenz>
add a virtual in there
<mrvn>
vincenz: problem is that methods aren't like normal functions. saves you the extra () but prevents passing them as agruments.
<mrvn>
vincenz: why not a simple "conn -> ()" which gets the listening connection as argument?
* vincenz
shrugs
<vincenz>
a factory will do
<vincenz>
the server will have a factory as parameter
<mrvn>
vincenz: For my socket module I use the read callback just as linux/unix makes a socket readable when a new connection shows up.
<mrvn>
That way you can have the listening connect in your normal select loop too.
<vincenz>
I do that oo
<vincenz>
too
<mrvn>
Then why a factory class?
<vincenz>
because the code that is the server shoul dnot be aware of the protocol
<mrvn>
sounds overkill for one simple function.
<mrvn>
the server just needs a callback
<vincenz>
callback, factory, the same no?
<mrvn>
A class is way more overhead than a closure.
<vincenz>
every server has a collection of connections
<vincenz>
you kill it, it kills it's connections
<vincenz>
plus it uses this in the select loop
<mrvn>
Why would that intrest create?
<vincenz>
just a wrapper for a list
<vincenz>
because the connection needs a reference to this
<mrvn>
What if you want to kill the server?
<vincenz>
cause when the connection is closed from elsewhere
<vincenz>
it should remove itself from the list
<mrvn>
If you have a server class it should capsulate the implementation of the collection. For poll you might want to make it an array instead.
<vincenz>
yes, but if somewhere else
<vincenz>
someone does
<mrvn>
method virtual create : Unix.file_descr -> server -> connection is what I would use.
<vincenz>
connection#close
<mrvn>
and "server#close this_connection" later
<vincenz>
no can't do
<mrvn>
You are exposing the internas of select and your server implementation. Your choise.
<mrvn>
choice
<vincenz>
cause higher up I'll have a world, this might have entities, some with their connections, they can't know which server to go to to close that connection, they shouldn't care, they should just close a conection, and the connection should tell the server to no longer select on it
<mflux>
btw, it would be real nice if there was an interface like Event for unix file descriptors too
<mrvn>
I found that I needed the server anyway, to ask it for bandwith limits, virtual hostname, ip, ...
<mflux>
because they are quite elegant
<mrvn>
mflux: select?
<vincenz>
mrvn: I'm trying to create a virtual world, such things are not necessary
<vincenz>
mflux: there's a library out there, also called Event which has that
<mrvn>
vincenz: You don't need the number of connections or do you count the collection each time?
<mflux>
mrvn, the Event interface has select and other stuff
<vincenz>
mrvn: No I don't, but even then, that could be done
<mflux>
it's cloned from concurrent ml but isn't quite as complete
<mflux>
it doesn't have timer for instance which I find is a miss too
<vincenz>
mrvn: but I want the ability to close aconnection, without going to look which server ti is
<mflux>
vincenz, any pointers for the library?
<vincenz>
mflux: afraid not, I had this peice of code that used ti, but don't have it anymore
<mflux>
but it also allows you to select on selects
<mrvn>
shared memory or sysv ipc?
<mflux>
I don't know about the implementation details but I would assume posix mutexes and shared memory
<vincenz>
mrvn: though you're right
<vincenz>
mrvn: I don't need a collection, I could just use the server directly as the collection
<vincenz>
removes one layer of classes
<mrvn>
vincenz: That is what I found more practical here.
<mrvn>
vincenz: do you have some file transfere protocol for the mud?
<mrvn>
vincenz: for uploading scripts to be run inside the mud
<mflux>
vincenz, it doesn't seem to be anything like ocaml's Event-module?
<vincenz>
mrvn: it's not hing yet
<vincenz>
mflux: no
<vincenz>
nothing.
<mrvn>
vincenz: for ftp I needed the server to open new connections and tell me its port. The server would know if it should use ipv4, ipv6, tls, ... and the client could ignore it.
<vincenz>
hmm
<vincenz>
ugh
<vincenz>
I wish there was some sort of plugin for vim, so that when editing code, and you want to test something, you don't have to first copy all the otherm oudles to a toplevel
<vincenz>
and put them in module Nameoffile = struct ...end;;
<mrvn>
(x)emacs has that
<vincenz>
yeah but I'm not a great fan of emacs personally
<mrvn>
doesn't vim has a "compile" shortcut that calls make?
<vincenz>
does the toplevel use Unix by default?
<mrvn>
no
<vincenz>
hmm
<vincenz>
So how would I launch it with that?
<mrvn>
I usualy just call make and if it compiles its time to get out of the editor.
* vincenz
nods
<mrvn>
mflux: if you need events for fds why not just fork threads per fd and do a blocking read/write?
<mrvn>
mflux: or one thread doing select and creating events for it?
<vincenz>
anyone a makefile expert?
<mflux>
mrvn, well obviously that's not a problem but that doesn't strike me as a very efficient or elegant
<mflux>
well, that latter would propably be efficient
<vincenz>
is it possible to generate a rule
<vincenz>
xxx/xxx.cma:
<mrvn>
mflux: java has no non-blocking IO so you have to fork there. :)
<mflux>
atleast somewhat
<vincenz>
cd xxx; make; cd..
<vincenz>
automatically?
<vincenz>
or rather
<vincenz>
xxx/yyy.cma:
<vincenz>
cd xxx; make yyy.cma; cd..
<mflux>
mrvn, infact I hear it nowadays does have some sort of non-blocking IO but I don't think what kind..
<mrvn>
Or make a common Makefile.options and include that in all makefiles. Easier to change it if need be.
<vincenz>
ok
<vincenz>
thnx
<mrvn>
If you change to "make -C" your makefile even becomes usable :)
<mrvn>
I don't know how you can work without that. If one of the subfiles fail I want make to fail, otherwise "make && ./testrun" wouldn't work.
<mrvn>
Another thing: 'cd system; make system.cmxa; cd ..', the cd .. is unneeded. make forks a subshell for the line and at the end of it it gets closed and any cd gets lost.
<mrvn>
But that is just for info.
<mflux>
in any case: cd system && make system.cmxa
<mflux>
is better than using ;
<mrvn>
mflux: -C
<mflux>
I do use -C
<mflux>
but && should be the obvious fix
<mrvn>
$(MAKE) -C dir target actually.
<vincenz>
how do you select the aaa in aaa/bbb.cma
<mrvn>
$(LIBS_CMA): and then pattern substitution on $@
<vincenz>
how do you check the actual makefile after all the foreach and such have been expanded?
<mrvn>
:) 'make'
<vincenz>
ugh
<vincenz>
fug t
<mrvn>
vincenz: another idea:
gim has quit [Read error: 110 (Connection timed out)]
<vincenz>
Can private methods be accessed by chlid-classes?
mlh has quit [Client Quit]
<monochrom>
No.
<vincenz>
apparently they can
<vincenz>
they're object-private, not type-private
<vincenz>
aka vertical instead of horizontal
* vincenz
is getting somewhere :)
<kinners>
search the mailing list
<vincenz>
?
<kinners>
that question has been talked about on the mailing list, if you want more info
<vincenz>
oh :
<vincenz>
:)
<mrvn>
In c++ you have private, protected and public and friends.
<vincenz>
yeah I know
<vincenz>
but in C++ private is a horizontal feature
<vincenz>
in ocaml it's a vertical feature
<mrvn>
In C++ only friends may touch your private parts.
<vincenz>
yeah
<malc_>
mrvn: nonsense
<vincenz>
kinky bastards
<vincenz>
anyways, any object of class C may access another object Class-C's private parts
<vincenz>
but if D is a a subclass of C, then D may not access those
<vincenz>
so it's horizontal
<vincenz>
in ocaml, the private-ness is for an object, not for a class (so vertical)
<vincenz>
dumteedum
<TheDracle>
... This sounds a bit dirty.
<vincenz>
yeah
<vincenz>
c++ people sharing their private parts with ALL their friends
<TheDracle>
Right..
<vincenz>
and anyone in their class
<TheDracle>
I never liked the concept of 'friend'.
<vincenz>
I prefer the ocaml version
<TheDracle>
C++ programmers are fat pimpled up sluts.
<vincenz>
only the object itself can touch it's private parts
<malc_>
morons
malc_ has left #ocaml []
<TheDracle>
Lol.
<vincenz>
hehe
<TheDracle>
I think he took personal offense to that comment.
<vincenz>
Dumteedum
<mrvn>
I think he didn't get the humor in the word play.
<TheDracle>
noj, I don't think so.
<TheDracle>
Ack, No.
<TheDracle>
mrvn: Yeah, you should see me try to use humor or word play on #C++ or #squeak.
<vincenz>
Squeak is still used?
<TheDracle>
Heck yeah.
<vincenz>
man, it looks babyish
<TheDracle>
It's really actually pretty neat :p
<vincenz>
and it's DAMNED slow
<TheDracle>
Yeah, it does, but it's still cool as hell.
<TheDracle>
Not really, it's gotten a lot faster.
<vincenz>
it's so fricking slow
<TheDracle>
I can run it on my PocketPC even.
<vincenz>
ever tried the 3d tihng for collaborative stuff
<TheDracle>
They've done a lot to speed it up.
<TheDracle>
Lol, no.
<vincenz>
it's a 3d world instead of a 2d world
<vincenz>
WAAAAAAAAY slow
<TheDracle>
Besides, for anything programatically intensive I'll use Ocaml or C.
<vincenz>
so what do you use squeak for?
<TheDracle>
But interactive, and fun.
<vincenz>
get scheme, with drscheme
<TheDracle>
vincenz: I tried using it kind of like an alternative to labview.
<TheDracle>
O.o, yeah, I was just looking at scheme.
<vincenz>
drscheme has an insane amount of libraries
<TheDracle>
I've just had a renewed spark of interest in it because somebody said it emulates Objects via closures.
<vincenz>
plus this really clean gui oo-system
<vincenz>
heh, I remember ICFP 2003
<TheDracle>
Which was a 20 years late idea I had :p
<vincenz>
at 3am, until 6 am
<vincenz>
never touched gui in scheme in my whole life
<TheDracle>
Hm.
<vincenz>
and I wrote a whole gui with many neato feautres
<TheDracle>
Very cool, I'll be sure to look at it.
<TheDracle>
I really like the interactive nature of Squeak.
<TheDracle>
I think programming tools in the future will be more like that.
<vincenz>
not really
<TheDracle>
Why not?
<TheDracle>
:p
<vincenz>
it actually kinda sucks
<TheDracle>
Blah.
<vincenz>
why? Cause you have to share a whole image
<TheDracle>
I'm not saying everything that goes along with it.
<vincenz>
anyone can fuck with any code anywhere, meaning that you can't just distribute YOUr code, you've always have to distribute an entire system
<TheDracle>
Not a single image or anything.
<TheDracle>
But maybe an interactive live development environment.
<TheDracle>
Where you can hook modules and pieces together and watch them run as you do so.
<vincenz>
oh!
<TheDracle>
The rest of the stuff can obviously be very much improved on.
<vincenz>
should be easily done in any language that allows dynamic linking
<TheDracle>
Right.
<TheDracle>
So, scheme is just basically Lisp right?
<vincenz>
yes
<vincenz>
but imho cleaner
<Riastradh>
vincenz, DrScheme doesn't come anywhere _near_ Squeak.
<TheDracle>
Okay, so I kinda already know it :p
<vincenz>
Riastradh: Never said any such thing
<vincenz>
Riastradh: Just saying it has a very nice guilib
<TheDracle>
Riastradh: What is Dr. Scheme?
<Riastradh>
And its GUI library is a horrible combination of an old version of wxWindows and a Simula-style object system.
<vincenz>
TheDracle: free scheme implementation
<TheDracle>
Hm.
<Riastradh>
You implied it, vincenz, by context.
<vincenz>
Riastradh: heh, I used it for our ICFP competition
<vincenz>
Riastradh: that's your interpretation
<TheDracle>
Squeak is, in my humble opinion, amazingly simple, and amazingly powerful.
mlh has joined #ocaml
<TheDracle>
And--- not entirely slow either.
<vincenz>
I happen to like the scheme guilib, it's clean
<vincenz>
I mean drscheme
<TheDracle>
Yeah, I really want to look at that.
<TheDracle>
I've actually 'never' used a clean guilib before.
<TheDracle>
They've always been borderline crap.
<Riastradh>
DrScheme would, however, be comparable to old versions of Squeak in terms of speed & resource hogging.
<TheDracle>
Heh.
<vincenz>
I honestly have my doubts
<TheDracle>
Do either of you know about objects via closures?
<vincenz>
TheDracle: what's so hard about that?
<Riastradh>
Define 'objects.'
<TheDracle>
Polymorphic modular collections of functions to operate on specific data?
<vincenz>
I had that in one of my very first cs courses with scheme
<TheDracle>
I dunno.
<Riastradh>
So you'd consider CLOS instances to not be 'objects?'
vezenchio has quit ["smile, Rakka ..."]
<vincenz>
Riastradh: stop being picky
<Riastradh>
vincenz, I'm not being 'picky.' I'm trying to get an idea of what TheDracle is talking about.
<TheDracle>
Um..
<TheDracle>
Heh.
<TheDracle>
I dunno, lemme think a second.
<mrvn>
let object super = function 'M1 -> 0 | 'M2 -> super 'M2;;
<mrvn>
kind of like that.
<Riastradh>
If he used the meaning of 'object' that I and a lot of other Lisp programmers use, closures would already be considered objects, along with simple data such as pairs, integers, etc.
<TheDracle>
I guess they kind of are objects.
<Riastradh>
Obviously, he's not using that meaning, but I don't know what meaning he is using; therefore, I ask to clarify.
* vincenz
finds that msot CS people tend to be nitpicky just for the heck of it
<mrvn>
Riastradh: classes
<TheDracle>
Riastradh: Can they be effectively used for a message passing type paradigm?
<Riastradh>
vincenz, I'm _not_ being 'picky' here! I'm asking only to clarify his communication!
<vincenz>
Riastradh: most people haev a common idea of objects
<Riastradh>
TheDracle, so you are using a meaning of 'object' that would be the target of Actors-style messages or what Simula-style methods operate on?
<Riastradh>
vincenz, most people's ideas of 'object' differ. A Lisp or Dylan programmer would have a different definition of 'object' from a C++ or Java programmer; all of these people would have different definitions from a MUDder.
GreyLensman has joined #ocaml
<TheDracle>
Hm.
<mellum>
An object is something you can hit monsters with.
<vincenz>
the general populace usually refers to objects in the c++ or java sense, unless otherwise speicfied I think you can assume such style
<TheDracle>
I've never used Simula.
<mrvn>
Objects are things that aren't NPCs.
<vincenz>
TheDracle: c++ and java are simula based
<mrvn>
If it talks it isn't an object. :)
<mrvn>
vincenz: c++ is c based
<vincenz>
it's got objects
<TheDracle>
Hm.
* vincenz
shrugs
<vincenz>
back to coding
<Riastradh>
The term 'object' poses a large problem of communication today amidst people anywhere outside of the C++ & Java drone world, simply because there are many definitions to choose from and people very infrequently specify what they mean.
* Riastradh
will return in a minute.
<mrvn>
(new Sword)->hit(new Monster);
<mrvn>
Riastradh: like "let foo = _object_ ..."?
<vincenz>
Riastradh: yes but I think that the people outisde that "drone" world know the mor specific stuff they mean, which means that unless otherwise specified, you can assume the "drone world"
<vincenz>
anywho
<TheDracle>
Lol.
<Riastradh>
I'm not going to assume the 'drone world' here (or most of the channels I'm in), vincenz.
<Riastradh>
And outside of that world, most people typically have their own such specific definitions -- which is why they talk through each other! One person has one definition and another person has another, so when they communicate, they're talking about orthogonal things and not really communicating successfully.
CosmicRay has quit ["Client exiting"]
<Riastradh>
This is why I asked TheDracle for clarification of what he meant by 'object.' When I say 'object,' I usually mean just some first-class object/value. But a lot of other people have different definitions, and in the context of what TheDracle said, the definition I most frequently use made little sense.
<Riastradh>
So, now that I know that what TheDracle was talking about -- where 'object' means roughly 'actor,' ignoring the concurrency aspect of Hewitt's actors --, may we continue?
<TheDracle>
What is the concurrency aspect?
<TheDracle>
They all operate in indepedent threads?
<Riastradh>
Hewitt's actors all operated concurrently, and the only method of control flow was sending messages to other actors.
<Riastradh>
s/method/construct/1
<TheDracle>
Alright, yes, I don't mean that.
<Riastradh>
But ignoring concurrency, by 'object' you mean roughly 'actor,' correct?
<TheDracle>
Right.
<TheDracle>
Let's think of a smalltalk object.
<Riastradh>
Have you read the original lambda papers?
<TheDracle>
The only functional languages I've really worked with are Ocaml and Lisp.
<Riastradh>
I suspect that you would find them interesting, particularly the parts in the original one about how Hewitt's actors influenced the design of Scheme.
<TheDracle>
Yes.. Scheme sounds neater and neater the more I hear about it.