det has quit ["ircII EPIC4-1.1.2 -- Are we there yet?"]
brwill_store is now known as brwill
mrvn has joined #ocaml
brwill is now known as brwill_zzz
jdmarshall has joined #ocaml
foxster has quit [Client Quit]
palomer has joined #ocaml
<palomer>
does ocaml have templates?
<Smerdyakov>
See ocamlp4
<Smerdyakov>
:D
<palomer>
I mean macros
<Smerdyakov>
Yup, I know.
<palomer>
isn't ocamlp4 the intermediate language from which assembly code is produced?
<Smerdyakov>
I don't think so.
<Smerdyakov>
p4 is pre processor & pretty printer
<palomer>
why 4?
<jdrake>
maybe there was a p1, p2, p3
<jdrake>
or it could be a copy of 'm4'
<Smerdyakov>
4 words beginning with P in the expansion.
<Smerdyakov>
I just gave them above.
<palomer>
oh, and another thing, I'm interested in doing symbolic manipulations. What ficilities does ocaml have to support this?
<Smerdyakov>
Algebraic data types and pattern matching.
<Smerdyakov>
The best tools possible for symbolic manipulation :P
<palomer>
Algebraic data types?
<Smerdyakov>
Algebraic data types in the core library include lists and options.
<Smerdyakov>
They're disjoint unions of arbitrary types.
<jdrake>
Smerdyakov, a simple question I wanted to ask you about ocaml - do its objects support runtime calling by name, and determining if said name exists in it? (wondering if it would be a suiter for objc binding)
<Smerdyakov>
jdrake, no
<palomer>
ah, erm, runtime calling by name would be fun:o
<palomer>
quite usefull for symbolic manipulations
<Smerdyakov>
palomer, and generally useless..
<Smerdyakov>
palomer, while adding overhead
<jdrake>
Smerdyakov, it proves to be quite useful in objective c
<Smerdyakov>
to everything
<Smerdyakov>
jdrake, Objective C has an impoverished type system.
<jdrake>
cocoa is the best designed ui type library I have ever experienced
<palomer>
how natural is defining a grammar in ocaml?
<Smerdyakov>
palomer, just as natural as using any other language's version of yacc.
<Smerdyakov>
palomer, you should use Haskell if you don't have strict performance constraints.
<palomer>
eh, why?
<palomer>
I'm scared about not being able to do any procedural work
<jdrake>
* monads * ?
<Smerdyakov>
palomer, because Haskell is more elegant and has type classes!
<jdrake>
Smerdyakov, you keep talking about thes type classes, explain them
<Smerdyakov>
jdrake, they're principled operator overloading. Find yourself a pre-written explanation/tutorial on the web for more.
<jdrake>
i hope not like c++'s operator overloading
<Smerdyakov>
I said _principled_. :D
<palomer>
doesn't ocaml have operator overloading?
<jdrake>
no
<Smerdyakov>
palomer, no. Every operator has exactly one type.
<jdrake>
type inference!
<Smerdyakov>
palomer, even addition has different operators for integers and floats: (+) vs. (+.)
<palomer>
can't you define the * operator from a vector, scalar to a vector?
<Smerdyakov>
palomer, no
<palomer>
ohmy, and thats not so in haskell?
<Smerdyakov>
palomer, you can't even use * for floats
<Smerdyakov>
palomer, correct
<Smerdyakov>
I'd say that Caml does it "the right way" in the absence of type classes.
<Smerdyakov>
Haskell needs no special cases to do this.
<Smerdyakov>
And you can write functions that take, for example, any type that has + defined on it.
<jdrake>
smerdy always is pushing haskell, and Riastradh seems to push scheme
<Smerdyakov>
And have only one compiled version of such a function.
<palomer>
ohmy
<Smerdyakov>
Something like this is only possible in C++ with templates and naive text substitution.
<palomer>
haskell does look nice
<palomer>
but, erm, don't monads complicate things often?
<Smerdyakov>
Not if you just write pure functional code
* jdrake
puts up his Holy Cross infront of Smerdy - "Begone Demon!"
<jdrake>
if you are an imperative refuge like me, you should be thinking not of haskell, me thinks
<palomer>
ok, take something very simple in procedural code
<palomer>
breadth first search
<palomer>
how would one do that in haskell? given that you have to check every node too see if you've already seen it
<jdrake>
recursion?
<palomer>
yes, of course recursion
<Smerdyakov>
jdrake, I think another important part of your background is that you have little education above high school level... no offense or anything, but anyone who succeeds in university level math can learn FP easily from an imperative background.
<jdrake>
knowing these functional languages it is probably some elegant solution
<palomer>
but you have to pass the 'seen' list with every call
<palomer>
VERY expensive
<Smerdyakov>
palomer, no, not very expensive!
<palomer>
eh?
<Smerdyakov>
palomer, why is it inherently more expensive than the imperative version?
<palomer>
in the imperative version, i would simply pass a pointer to the seen list
<palomer>
so every time I update the list, I would have to evaluate it
<Smerdyakov>
palomer, you can pass any object of arbitrary size without requiring copying.
<Smerdyakov>
palomer, because the underlying memory is not allowed to modified after the object is created!
<palomer>
ohmy
<palomer>
so, erm, how would I would have to create a new 'seen' everytime a new node pops up?
<Smerdyakov>
Yup
<Smerdyakov>
Usually with most of its memory overlapping with the last "seen list."
<palomer>
thats alot of lists being created and destroyed
<Smerdyakov>
If it's literally a list and not some fancier lookup structure, then it will be a node containing the new item and a pointer to the old seen list.
<palomer>
everytime a new node pops up, a list is created and destroyed
<Smerdyakov>
(That requires an allocation of a single small structure.)
<Smerdyakov>
No.
<Smerdyakov>
The old lists stick around, because they are included in the new ones.
<palomer>
but, erm, that means I have to return the seen list, right?
<jdrake>
one is a copy and the other is a modify version. The copy one is much simpler
<palomer>
the 'seen' list
<Smerdyakov>
jdrake, I think that example is too complicated to be helpful.
<Smerdyakov>
palomer, what do you think you need to return it from?
<palomer>
the function
<Smerdyakov>
palomer, what function?
<palomer>
I have my function, which recursively checks every node
<palomer>
it takes the graph and a list of seen nodes
<jdrake>
oh well, only one i have right now :-) Time for sleep
<palomer>
and the item being searched for
<Smerdyakov>
Are you talking about depth-first or breadth-first search?
<Smerdyakov>
I think you meant depth-first.
<Smerdyakov>
If you are using recursion as your traversal stack.
<palomer>
breadth first
<Smerdyakov>
Breadth-first will require you to maintain an explicit queue.
<Smerdyakov>
So your function description as given doesn't sound adequate.
<palomer>
ok, depth first then:o
<Smerdyakov>
One functional implementation of this returns the 'seen list' from a recursive worker function, yes.
<Smerdyakov>
You can also create a version that maintains an explicit stack and never returns the 'seen list'.
<palomer>
ok, so the seen list gets passed, and a new node is found
<palomer>
what do you do?
<Smerdyakov>
You mean for the 2nd strategy I mentioned? (never return seen lsit)
<palomer>
for any purely functional strategy
<Smerdyakov>
I'll just quickly write an OCaml implementation.
<Smerdyakov>
let dfs pred succ start = let search stack seen = match stack with [] -> None | current::rest -> if inList seen current then search rest seen else if pred current then Some current else search rest (current::seen) in search [start] []
<Smerdyakov>
Which is probably totally incomprehensible to you, but what can I do? :)
<palomer>
lol
<palomer>
yes
<palomer>
especially since im a schemer
<Smerdyakov>
Oh. I think I could write it in Scheme.
<palomer>
the scheme syntax is getting on my nerves
<palomer>
without a set!?
<Smerdyakov>
Yup
<palomer>
I'd like to see that
<Smerdyakov>
How can I define a local recursive function inside a (define)?
<Smerdyakov>
Well, I'll make up my own funny syntax for it until/unless you tell me. :-)
<palomer>
erm
<palomer>
you can have defines
<palomer>
defines aren't against functional programming
<Smerdyakov>
I said *local* defines.
<palomer>
use memq to search a list
<Smerdyakov>
Meaning they are only valid inside another define.
<palomer>
yes, local or non local, doesn't make much of a differenc
<palomer>
I mean, it is simply a letrec in the end
jdrake has quit ["Oops. This machine just fell asleep"]
<palomer`>
hrm, it's funny how the word repaste has changed over the years
<palomer`>
(done (car stack))?
<Smerdyakov>
Is it invalid?
<Smerdyakov>
done is a parmeter to dfs.
<Smerdyakov>
done is a function that takes a state and decides if it is the one we're looking for.
<Smerdyakov>
succ is a function from a node to those connected to it.
<Smerdyakov>
start is the initial node.
<palomer`>
that applies a function
<palomer>
:o
<palomer>
stupid erc
palomer` has left #ocaml []
<Smerdyakov>
Yes, the function done is applied to (car stack).
<palomer>
erm, you'll pass a function to dfs?
<palomer>
why?
<Smerdyakov>
What is the point of it otherwise?
<palomer>
itll finish searching when there are no more nods!
<Smerdyakov>
So? This is pure functional.
<Smerdyakov>
There would be no interesting return value if it always searches all nodes.
<palomer>
search is the else clause?
<Smerdyakov>
You want dfs to look for a particular node, right?
<palomer>
ahh, gotcha
<palomer>
yes, this is a good way to do it
<Smerdyakov>
Of course it is. :P
<Smerdyakov>
So do you understand the code, then?
<palomer>
concatenate will create a new list
<palomer>
quite inefficient
<Smerdyakov>
I doubt it.
<Smerdyakov>
It probably only duplicates the elements of its first parameter.
<Smerdyakov>
Or there is another function that does that.
<palomer>
ah, you're right, but concatenate (which should read append) takes O(n) I believe
<Smerdyakov>
Where n is the length of its first parameter.
<palomer>
and another thing, when it returns, the items will no longer be concatenated
<palomer>
so you lose the information
<Smerdyakov>
What?
<palomer>
if I add a node to seen, when it returns that node will no longer be there
<Smerdyakov>
I'm pretty sure that my implemenation is 100% correct if function names are adjusted to be the desired Scheme functions, etc..
<palomer>
oh my, I think it will work
<Smerdyakov>
So? When it returns, all that matters is its return value.
<palomer>
yes, seems quite efficient
<palomer>
however, append does take O(n) since you need to append to the end of a list
<Smerdyakov>
This code is identical to the OCaml version I gave earlier.
<Smerdyakov>
It takes O(n), where n is the length of the first parameter.
<palomer>
and appending to the end of a list isn't the easiest thing in the world
<Smerdyakov>
I mean for it to return a new list consisting of the elements of the first list followed by the elements of the second list.
<Smerdyakov>
Which takes time proportional to the length of the first list.
<palomer>
yes
<Smerdyakov>
The total time spent in appending is proportional to the number of edges in the graph.
<palomer>
which is quite inefficient
<Smerdyakov>
And you can't avoid traversing all edges in the worst case.
<Smerdyakov>
So you don't lose anything compared to the optimal.
<palomer>
exactly
<palomer>
this implementation runs in O(n^2)
<Smerdyakov>
Which is the best possible asymptotic efficiency.
<palomer>
worst case
<palomer>
nonono
<Smerdyakov>
Yup.
<palomer>
actually, you're right
<Smerdyakov>
I know.
<palomer>
no, you're not actually
<palomer>
nlogn is the best
<Smerdyakov>
Nope.
<palomer>
by using binary tree
<Smerdyakov>
What do you mean by n?
<Smerdyakov>
The number of nodes in the graph?
<palomer>
number of nodes
<palomer>
in a dense graph
<Smerdyakov>
It is impossible to verify that the kind of node you want is not in the tree without traversing all edges, if the graph is connected.
<Smerdyakov>
Do you agree on this?
<palomer>
no
<palomer>
I don't
<palomer>
I could label the nodes numerically, and binary search
<Smerdyakov>
But we are searching for a node that satisfies an arbitrary predicate.
<Smerdyakov>
You can't find such a node with binary search.
<palomer>
oh, you're talking in the tree
<palomer>
yes
<palomer>
in the worst case
<palomer>
I will have to traverse everything
<Smerdyakov>
OK.
<Smerdyakov>
And, in the worst case, the number of edges is Theta(n^2).
<Smerdyakov>
Right?
<palomer>
yes
<Smerdyakov>
So that means the algorithm can't do better than Omega(n^2).
<Smerdyakov>
So the function I gave is asymptotically optimal in the worst case.
<palomer>
but at every iteration, when you concatenate, that adds a complexity of O(n)
<palomer>
Smerdyakov: actually, thats not perfectly true, unfortunetly, you can have much, much faster algorithms
<palomer>
oh wait, this is depth first search
<palomer>
ill have to look that up
<palomer>
but you append does add an order of complexity
<Smerdyakov>
What do you mean by n in "at every iteration that adds a complexity of O(n)"?
<palomer>
concatenation
<palomer>
takes O(n)
<palomer>
where n is the size of seen
<Smerdyakov>
No.
<palomer>
correct?
<palomer>
eh?
<Smerdyakov>
n is the size of the first parameter.
<Smerdyakov>
Which is the neighbor list of a particular node.
<Smerdyakov>
Get it?
<palomer>
but, in a dense graph, each node has n neighbors
<Smerdyakov>
Right.
<Smerdyakov>
That adds up to O(n^2) (with n the vertex count) complexity from the appends.
<palomer>
hrm, oh, so its 2*n which is O(n)
<Smerdyakov>
Which is still the optimal complexity.
<palomer>
hrm
<palomer>
ill masticate it
<Smerdyakov>
.. What is there to masticate?
<palomer>
im pretty sure dfs can be done faster than bfs though
<Smerdyakov>
Nope.
<palomer>
I mean
<Smerdyakov>
It's impossible to do either without scanning all of the input.
<Smerdyakov>
So a lower bound on both is the input size.
<palomer>
ok, take breadth first search
<Smerdyakov>
Which is Theta(n^2)
<palomer>
bfs is NOT O(n^2)
<palomer>
that I can guarentee
<palomer>
well, not if tweaked
<Smerdyakov>
Well, you are wrong.
<palomer>
by using different data structures
<palomer>
here's how
<palomer>
ok
<palomer>
djikstra's algurithm
<Smerdyakov>
"Using different data structures" in a way that lets you do it more efficiently means you are solving a different problem than the generic "breadth-first search problem."
<palomer>
whats the running time?
<palomer>
itll still search each node in a breadth first manner
<palomer>
though it won't be the generic algorithm
<Smerdyakov>
That's fine, as long as it solves the generic problem.
<palomer>
where does one draw the line at generic algorithm and different algorithm?
<palomer>
yes
<palomer>
ok, getting back to djikstra
<Smerdyakov>
I said nothing about "generic algorithms."
<palomer>
djikstra will visit every node in a breadth first manner
<palomer>
and it does it in n*log(n) time
<Smerdyakov>
Nope.
<palomer>
to which claim?
<Smerdyakov>
Hold on
<Smerdyakov>
It's O(|E|log|V|) for edges E and vertices V.
<Smerdyakov>
Considering the worst case, E = Omega(V^2)
<palomer>
But, finally, if we use a Fibonacci heap, the amortized cost of each extractMin() is O(lgv) but the best part is that each call to decreaseKey() (called to readjust weights in the heap) is only O(1). This gives us the best running time of O(VlgV + E)
<palomer>
oh, you win again:/
<Smerdyakov>
So we have Omega(|V^2|log|V|)
<Smerdyakov>
Which is even worse!
<palomer>
ill have to masticate this one, too
<Smerdyakov>
You shouldn't need to.
<palomer>
always masticate what you're tought, a mule once told me
<Smerdyakov>
It's IMPOSSIBLE to solve breadth- or depth-first search with an algorithm that can ignore inputs.
<palomer>
I'm thinking of switching over from scheme to haskell
<Smerdyakov>
Do you agree to that much?
<palomer>
erm
<palomer>
yes
<Smerdyakov>
And the input size is Omega(n^2).
<Smerdyakov>
So no algorithm can beat Omega(n^2) worst case!
<palomer>
ahh, I see you're point
<palomer>
it follows from your first claim
<palomer>
your first claim makes sense
<palomer>
but ill have to masticate it
<palomer>
because in dense graphs you can ignore certain input
<Smerdyakov>
Which do you ignore when the node you're search for isn't present and the graph is fully connected?
<palomer>
or so, my brain is telling me
<palomer>
I see your point
<Smerdyakov>
Well, I mean connected, not fully connected, I think. There is a path from any node to any other.
<palomer>
very good point
<palomer>
well put
<palomer>
bedtime!
<palomer>
night!
<palomer>
and thx
palomer has left #ocaml []
jdmarshall has quit []
systems has joined #ocaml
two-face has joined #ocaml
<two-face>
yo
<systems>
yo
<two-face>
3.07 is still not released
<Maddas>
heh
<Maddas>
why are you waiting for it?
<systems>
i bet he uses gentoo
<systems>
do you run gentoo
<two-face>
of course not :)
<two-face>
they said it would have been released mid-september
<vect>
'lo dudes
<two-face>
hello
det has joined #ocaml
det has quit [Client Quit]
det has joined #ocaml
<two-face>
det: it is not python here :)
<systems>
yea twisted matrix
<systems>
ocaml can use something like twisted
<det>
oh, I forgot they got reverse dns working :)
<systems>
det no shame
<det>
systems: first ocaml needs non-blocking sockets on windows :)
<two-face>
det: do we care for windows?
<systems>
some people would
<det>
yes
<Maddas>
two-face: I think supporting windows is crucial for the popularity of a general-purpose language
<two-face>
Maddas: it is sad, isn't it?
<Maddas>
yes, it is :)
<det>
to be cliche, sad, but true :)
<Maddas>
I don't even like compiling my own stuff for windows, even the thought repels me.
<Maddas>
det: :)
<two-face>
I have no windows box, so I can't even try
<Maddas>
two-face: I refuse to try :)
<two-face>
:)
<det>
it's not hard unless it uses C extensions
<det>
in which case it probally uses ocamlmklib, which doesnt exist for windows
<det>
I mean, to compil eit
<det>
not fun
<two-face>
it is meant to discourage you!
<Maddas>
haha
<det>
:)
<Maddas>
it is meant to convert people to UNIX! *cough*
<two-face>
hmm
<two-face>
not necessarily a good idea, but at least to unconvert people to wincows
systems has quit [Read error: 60 (Operation timed out)]
<Maddas>
;)
<two-face>
:x
<two-face>
notice the smiley, could be a command for some editor
<det>
so, what's better than unix, that is available now?
<two-face>
gnu/linux
<det>
that's unix :)
<two-face>
gnu's not unix!
<two-face>
too bad ther is no free version of VMS
<Maddas>
well, strictly speaking FreeBSD and OS X aren't UNIX either ;)
<Maddas>
but OS X is probably out of question unless you got a Mac (I will have one soon, yay)
<two-face>
I have a mac, but use linux on it
<Maddas>
:)
<Maddas>
the g5s are supposed to be very fast, I wish I were able to test them myself :)
<Maddas>
I'm thinking about using OpenBSD on my PowerBook, even though OS X is probably a better desktop system.
<det>
OS X is unix!
<two-face>
os x is meant to be unix but not really is
<Maddas>
it's based on FreeBSD, so it's pretty close
<Maddas>
but it's not *really* unix :)
<two-face>
it makes use of internal cooking which is not really unixish
<Maddas>
internal cooking?
<Maddas>
(I don't know much about the internals)
<two-face>
yes, every unix apps makes use of /etc for configuration purpose
<two-face>
os x is different
<two-face>
there was an article on freshmeat last year
<Maddas>
I see, I'll search :)
<Maddas>
Are you happy with running linux on a Mac?
<Maddas>
As opposed to running it on x86 hardware
<Maddas>
(Just wondering what the benefits are)
<two-face>
I havea ibook
<two-face>
i'm happy with linux, it works fine
<Maddas>
I see
<Maddas>
I'm using FreeBSD now, I'll see if I can get to like OS X
<Maddas>
although it might be a bit mousy for me, I'm more of a keyboard user
buggs is now known as buggs|afk
<Maddas>
ah,yes the netinfo thing
<Maddas>
That might get annoying, I've read about that
<two-face>
netinfo?
<Maddas>
"Apple's Unix-like operating system uses NetInfo, for a configuration datastore, something more akin to the Windows registry we all know and hate"
<Maddas>
as opposed to using /etc
<two-face>
ah yeah, I didn't recall
<Maddas>
ah, but it looks like you can make it use /etc
<Maddas>
that should be better
<Maddas>
but then, I'll see when I try
<two-face>
os x is not free anyway, should not be used
<Maddas>
haha
<Maddas>
:)
<two-face>
Futhermore, it is slower, not kid
<det>
not kid ?
<two-face>
no kid
<two-face>
not kidding
<two-face>
of course, os x is cute but I'm seeking for simplicity :)
<Maddas>
I just need a good desktop OS :)
<Maddas>
which allows me to fiddle around with the interior if I feel like doing so
<two-face>
gnome 2.4 and kde 3.1 look mature
<Maddas>
I hate those
<two-face>
enough
<Maddas>
too bloated, slow, huge :)
<two-face>
why?
<two-face>
so is os x
<Maddas>
Yes
<Maddas>
OS X isn't just the window manager, I can use X11 too ;)
<Maddas>
You mean Aqua
<two-face>
but it's not free, so evil
<Maddas>
haha
<Maddas>
And I love Cocoa from what I've seen, OS X has a GUI I find nice, it's very consistent throughout applications and all
<Maddas>
err, Aqua I mean
<two-face>
so is windows
<Maddas>
Windows isn't stable, doesn't let me fiddle with the interior
<Maddas>
and the API is horrible compared to Cocoa
<Maddas>
security is, well, non-existent
<Maddas>
and I can't run all the programs I love and need
<two-face>
you have no excuse for using os x
<Maddas>
I don't need an "excuse"
__DL__ has joined #ocaml
<Maddas>
I have no "excuse" for using anything else, I don't need to ecxuse myself
<Maddas>
I gave you the resaons
<Maddas>
a very consistent GUI, a nice API, and reasonable speed thanks to hardware acceleration
<two-face>
Maddas: are you in favor of software patents?
<Maddas>
no, I don't like software patents
<two-face>
__DL__: salut Remi
<Maddas>
I don't like the GPL either
<Maddas>
two-face: I need a good OS, I don't care if some people consider it evil or not
<Maddas>
OS X fits my definition of 'good' very well, so I'll use it
<Maddas>
and if I don't like it, I can still switch
<Maddas>
so nothing lost :)
<__DL__>
two-face: salut
<two-face>
__DL__: tu ne sais pas pourquoi 3.07 n'est pas encore prêt ?
<__DL__>
non, je n'en ai aucune idée.
<two-face>
je ne sais pas s'il sera prêt pour sarge
<__DL__>
la derniere modif du cvs date du 14, ils attendent qqc (peut-être veule t il eviter l'effet ocaml 3.05)
<two-face>
peut-être, cela dit, les versions beta aident bien dans ce sens
<two-face>
bon, miam
Demitar has joined #ocaml
<Maddas>
what's the most common workaround to get tail-recursive calls with exception handling?
<Maddas>
calls surrounded by try ... with, that is
mellum has joined #ocaml
<mellum>
hi
<Demitar>
Hello mellum.
<Demitar>
Maddas, I think there are some examples in the mail archives.
<Maddas>
I see
<Maddas>
I found some dating back to 1999, I wonder if there were any 'current'idiom
<Demitar>
Then again I'm no authority on this subject. And I'm not sure there's such a thing as an idiom on this subject.
<Maddas>
ok, I just wondered :)
<Demitar>
Asking questions will hopefully get you more enlightened than before, but there's no warranty. =)
* Demitar
finds an abundance of unclaimed domains...
mellum has quit [zelazny.freenode.net irc.freenode.net]
mellum has joined #ocaml
Demitar has quit [Read error: 110 (Connection timed out)]
<two-face>
I'm back
systems has joined #ocaml
whee has quit ["Leaving"]
Kinners has joined #ocaml
systems has quit ["Client Exiting"]
matthieu_ has joined #ocaml
polin8 has quit [Read error: 104 (Connection reset by peer)]
polin8 has joined #ocaml
det has quit ["Hey! Where'd my controlling terminal go?"]
Kinners has left #ocaml []
croesus has joined #ocaml
polin8_ has joined #ocaml
polin8_ has quit [Client Quit]
polin8_ has joined #ocaml
polin8_ has quit [Client Quit]
brwill_zzz is now known as brwill
lus|wazze has joined #ocaml
brwill is now known as brwill_gym
__DL__ has quit [Read error: 110 (Connection timed out)]
matthieu_ has quit [Remote closed the connection]
avn has joined #ocaml
__DL__ has joined #ocaml
bk__ has joined #ocaml
two-face has quit ["Client exiting"]
jdrake has joined #ocaml
<mellum>
Hmm, I thought if I have a .mli, I could only access the values from the corresponding .ml file mentioned there? That doesn't seem to be the case
<Smerdyakov>
What do you mean by "access values"?
<mellum>
never mind, seems to work now
<mellum>
Hmm, say I have an abstract data type with a certain interface foo.mli, and I have two implementations foo_1.ml and foo_2.ml for it, how can I from another module select one of them?
lus|wazze has quit ["The Ogre philosopher Gnerdel believed the purpose of life was to live as high on the food chain as possible. She refused to e]
<mrvn>
mellum: write a functor
<mellum>
Hmm. Idon't like functors. I'll just do ln -s foo_1.ml foo.ml :)
<mrvn>
I have the same problem. I defined a structure of functions and I have a function creating that in foo_1 and foo_2.
<Smerdyakov>
How can I make a class field mutable?
<mrvn>
mutable
<Smerdyakov>
What's the syntax to define a mutable class field?
<Smerdyakov>
Oh. mutable goes _after_ val. :P
lus|wazze has joined #ocaml
lus|wazze has quit [Client Quit]
__DL__ has quit ["Bye Bye"]
lus|wazze has joined #ocaml
<jdrake>
Smerdyakov, who isn't reading manuals?
<jdrake>
"val [mutable ]inst-var-name : typexpr "
* mrvn
<mrvn>
*hide*
bk__ has quit ["I'll be back"]
lus|wazze has quit ["The Ogre philosopher Gnerdel believed the purpose of life was to live as high on the food chain as possible. She refused to e]
lus|wazze has joined #ocaml
Xcalibor has joined #ocaml
<Xcalibor>
hiyas :)
lus|wazze has quit ["The Ogre philosopher Gnerdel believed the purpose of life was to live as high on the food chain as possible. She refused to e]
lus|wazze has joined #ocaml
Xcalibor has quit [Read error: 54 (Connection reset by peer)]
Xcalibor has joined #ocaml
<Xcalibor>
rehi
CSharpener has joined #ocaml
<Xcalibor>
CSharpener: salutations :)
<CSharpener>
Mortui te, ...
<CSharpener>
salutamus!
<Xcalibor>
:)
<CSharpener>
At the moment I am mainly testing Chatzilla.
<Xcalibor>
what's up?
<Xcalibor>
chatzilla, ah, nice
<Xcalibor>
:)
<CSharpener>
See, I answered before you asked!
<CSharpener>
And you?
<Xcalibor>
zapping here and there
<Xcalibor>
waiting for dinner, mostly
<CSharpener>
Ah, the OCaml must be bringing it now!
<Xcalibor>
yessir :)
<CSharpener>
So, what's your focus?
* Riastradh
focusses a solar furnace on something.
<CSharpener>
I'm pretty much a programming language junkie.
<CSharpener>
Mostly doing .NET these days.
<CSharpener>
Why am I listening to ocaml, you ask?
<CSharpener>
I've been playing a bit with SML.NET and F#.
<Xcalibor>
ah, i see
<Xcalibor>
but i undersdtood that f# was more in the line of Haskell
<CSharpener>
F# is an implementation of the core of the Caml programming language for the .NET Framework, along with cross-language extensions. The
<croesus>
Xcalibor: that's mondrian
<Xcalibor>
ah... wrong understanding, then...
<Xcalibor>
mondrian?
<CSharpener>
F# provides a subset of the OCaml libraries, so you don't have to use .NET libraries if it is not appropriate. It is possible to write large applications that can be cross-compiled as either OCaml bytecode, OCaml native code or F# code, for example, the F# compiler itself is written this way. This lets you reuse the investment you make in the core of a project while letting you write some parts of your application as F# code that makes use of .
<CSharpener>
Design-wise, F# is essentially a .NET implementation of the core of the OCaml programming language, with some minor design changes. The design extends the core OCaml language by making some guarantees about how ML constructs appear to .NET languages and by allowing the programmer to access .NET libraries, primarily via an extended "." notation (e.g. "val.ToString()" to call a .NET method).
<CSharpener>
Ah, now you have me downloading Mondrian.NET!
<Xcalibor>
xD
<Maddas>
ugh
<CSharpener>
Your focus = language sadist!
<CSharpener>
SML.NET mostly peels off from SML/NJ
<Maddas>
Did you code anything using .NET in F# already?
<Maddas>
I'd like to see it in action, if you have anything compiled lying around :-)
<CSharpener>
The CLS is very interesting, actually. What I really want to see is how languages as different as C# and F# can coexist and interoperate within the CLR.
* Xcalibor
has an innate dislike of m$...
<CSharpener>
I have a low opinion of M$ business "ethics" but tend to end up using their products because they work better for our customers than whatever little competition has been allowed to survive.
<Maddas>
Heh
<CSharpener>
I have an inordinately high opinion of .NET, though. It surprises me, truly.
<Maddas>
I just don't want to end up using anything platform-specific
<Maddas>
Risking that I'll end up on a platform where I can't use whatever I've learnt
<CSharpener>
I do not know how they let Anders and the crew do what they did. It's very non-M$ in philosophy and spirit.
<Xcalibor>
me used msdos for a long time... .then switched to OS/2 and then to GNU/Linux
<CSharpener>
I've been at this quite a few years and have worked on a large percentage of available platforms. I am platform agnostic.
<Xcalibor>
and only suffered windows as an obligation
<Riastradh>
I don't think Microsoft really cares about what happens in Microsoft Research.
<Xcalibor>
also suffered mac os 7, 8 and 9
<CSharpener>
I like Linux like I like a nice toy.
<Xcalibor>
i eat in linux
<Xcalibor>
and other unices
<Riastradh>
'Here, have some dough as long as you let us own your results and don't bother us.'
<CSharpener>
Unfortunately, when companies I work for need real work done, we find a lot missing in *nix.
<croesus>
Riastradh: I get the same feeling.
<Maddas>
I started with Dos/Windows 3.1 (Yes, I'm not very old), then 3.11, the rest of Windows series up to 2000, then I tried Linux for three days, went back to Windows 2000, and now I'm with FreeBSD since quite a while
<Maddas>
and as I'm switching to OS X, I am kinda scared of learning platform-specific stuff
<Maddas>
as in wasting time ;)
<CSharpener>
Riastradh: I'm not sure the bulk of M$ even knows of the existence of Microsoft Research!
<Xcalibor>
i wouldn't say ocaml is really platform-specific
<Riastradh>
Maddas, are you not aware that Darwin is based on FreeBSD?
<CSharpener>
I do not see anything from them on the upcoming PDC agenda.
<Maddas>
I am, Riastradh
<Maddas>
But I doubt that Mono will be ported there soon
<Maddas>
Riastradh: It's more that I don't want to delve into low-level or not widely supported things yet, as long as I don't need to
<CSharpener>
One thing I really like about .NET is that it can _potentially_ cross platforms and languages. I am very happy to see what has happened on Linux so far.
<CSharpener>
The idea that I can have people write some C#, some VB.NET, some F#, some SML.NET, and integrate it all with WhoKnowsWhat.NET is actually pretty exciting.
<mellum>
The idea has been around for years, though, and I don't see even a single major project using it.
<CSharpener>
Especially when I can use Anakrino or Lutz Roeder's Reflector to look at it all in either MSIL or C#.
<Maddas>
If the idea turns out the way it sounds, and F# is not far from O'Caml, then it'll be really cool.
<Maddas>
Actually, drop the "and F# is not far from O'Caml" part
<Maddas>
I'm just a bit conservative :)
<Riastradh>
I have major doubts about .NET and how well it will work between _completely_ different languages.
<CSharpener>
I'm not sure when you will see mixed systems in wide commercial circulation. I like the idea for the distant future, which is my personal now.
<croesus>
Riastradh: me too
<Riastradh>
Will it support TCO? Will it support full, multi-shot continuations?
<CSharpener>
Riastradh: that's why I'm getting started on F# and SML.NET. I want to see for myself what happens when you stir in some serious diversity.
<mellum>
What's TCO?
<Riastradh>
Tail-Call Optimization.
lus|wazze has quit ["The Ogre philosopher Gnerdel believed the purpose of life was to live as high on the food chain as possible. She refused to e]
<mellum>
Well, I don't see why it couldn't have that.
<croesus>
CSharpener: are you sure those tools will let you see the cil extensions?
<Riastradh>
Will it support CLOS-style, prototype-based, and Smalltalk-style object systems?
<Maddas>
I wonder if Parrot will allow for cross-language modules
<Riastradh>
What will it do in languages that can only have one of the above? (e.g., Smalltalk)
<CSharpener>
Reflector is great because I can go back and forth between the actual MSIL and the decompilation. The decompiler does not necessarily understand everything perfectly.
<CSharpener>
Some .NET evangelists claim there is "no difference" among .NET languages. That is not strictly true.
<CSharpener>
They all must be _at least_ CLS compliant.
<Riastradh>
Not only is it 'not strictly true'; it's completely wrong!
<CSharpener>
And probably *should* be completely wrong!
<Xcalibor>
no, it is not probably should, it is true
<CSharpener>
I do not need or want one language to rule them all ...
<Riastradh>
How would you deal with languages with different sorts of type systems?
<Riastradh>
How would an OCaml program interact with Haskell typeclasses?
<Xcalibor>
by that account, all language are _at least_ CPU compliant...
<CSharpener>
But if they can interoperate relatively seamlessly, then I can use various programming paradigms to handle the kinds of things they do best.
<CSharpener>
Riastradh: that remains to be seen. I haven't seen it done yet. That doesn't mean it will not work.
<CSharpener>
It depends on whether or not the necessary features are supported somewhere by the CLR.
<CSharpener>
I come from the old days, so to me it all boils down to whether various machine language programs can get along without blowing each other to bits.
<smkl>
typeclass would probably just be a record type that is used as an extra argument
<Riastradh>
How would a Haskell program use an OCaml functor?
<CSharpener>
Riastradh: Get Haskell.NET and F# and find out.
<smkl>
I think F# is like caml light ... it doesn't have functors
<CSharpener>
Well, folks, I have accomplished my initial aim, to test out Chatzilla, and now have to return to doing something worthwhile for my employer. I'll be lurking!
<croesus>
CSharpener: i think hugs98.net is just a bridge
<smkl>
for a functor, you'd probably have to weaken the types ...
<croesus>
most interop between .net and existing languages seem to be taking this route
<croesus>
ruby, python, etc. are all doing this too
<CSharpener>
Ah, you're right about Hugs98.net. Researching ....
<croesus>
that's what the buzz about ilx/f# is about
<croesus>
they created extensions for the cil to allow for functional langs
<CSharpener>
They have a lot of promise. Joseph Pelrine is well respected as are some of the others working on S#.
buggs|afk is now known as buggs
<CSharpener>
I haven't heard anything after this:
<CSharpener>
S#.NET Tech-preview Software Release [as of 06/03/2003 - Preparation for release is in progress]
<CSharpener>
The S#.NET release preparation is proceeding steadily along. The AOS.NET.dll supporting S# on .NET is finished and provides both runtime services and full reflection and debugging services for the S# compiler. The current work is focused on the VS.NET integration shell and related S# and .NET browser services.
<CSharpener>
croesus: $$ have often been a problem for the Smalltalk community, unfortunately! :(
<croesus>
CSharpener: true. i hear the amount of work they put in to get it to work justifies any price they charge, but I'm not sure of the market they will have.
<CSharpener>
Yeah. You're telling me again why I'm not still a Squeaker!
<CSharpener>
Well, it looks like I kept a few of you awake for a few moments. I really need to go do some paying work. Thanks for some great tips and resources and conversation. I'll be back!
CSharpener has quit ["ChatZilla 0.8.31 [Mozilla rv:1.4/20030612]"]
whee has joined #ocaml
croesus has left #ocaml []
lus|wazze has joined #ocaml
buggs|afk has joined #ocaml
buggs has quit [Read error: 60 (Operation timed out)]
<Xcalibor>
time for bed, g'night to all
Xcalibor has quit ["Terminando cliente"]
* Smerdyakov
complains that ocamlyacc gives shitty error messages.
<Smerdyakov>
As in, no error messages when parsing. :\
buggs|afk is now known as buggs
<jdrake>
ah nothing gives very good error messages back