authentic has quit [Read error: 104 (Connection reset by peer)]
authentic has joined #ocaml
Axioplase has joined #ocaml
thermoplyae has joined #ocaml
nuncanada has quit ["Leaving"]
det has joined #ocaml
thermoplyae has left #ocaml []
AxleLonghorn has joined #ocaml
AxleLonghorn has left #ocaml []
doy has joined #ocaml
<doy>
do i need to do anything special to build .c files with ocamlmakefile?
<doy>
other than adding it to SOURCES?
yminsky has joined #ocaml
<hcarty>
doy: For simple cases that should be enough
pango has joined #ocaml
Axioplase has quit ["leaving"]
LaProfeciaViene has joined #ocaml
sphericalchicken has joined #ocaml
shortcircuit has quit [Client Quit]
seafood has quit []
shortcircuit has joined #ocaml
doy has left #ocaml []
Snark has joined #ocaml
sphericalchicken has quit ["BitchX: roqz yer nutz!"]
filp has joined #ocaml
hkBst has joined #ocaml
yminsky_ has joined #ocaml
yminsky has quit [Read error: 104 (Connection reset by peer)]
Snark has quit ["Ex-Chat"]
l_a_m_ has joined #ocaml
dobblego has joined #ocaml
vbmithr has joined #ocaml
jlouis has quit [Remote closed the connection]
dobblego has quit [Remote closed the connection]
hkBst has quit ["Konversation terminated!"]
thelema has quit [Read error: 110 (Connection timed out)]
jonafan_ has joined #ocaml
yziquel has joined #ocaml
jonafan has quit [Read error: 110 (Connection timed out)]
Snark has joined #ocaml
munga has joined #ocaml
dobblego has joined #ocaml
structured has quit [Read error: 110 (Connection timed out)]
structured has joined #ocaml
det_ has joined #ocaml
det_ has quit [Read error: 104 (Connection reset by peer)]
Yoric[DT] has joined #ocaml
det has quit [Remote closed the connection]
munga has quit ["Leaving"]
Chile` has quit [Read error: 110 (Connection timed out)]
Snark has quit ["Ex-Chat"]
<tsuyoshi>
so I had an idea wrt threads...
<tsuyoshi>
what if you did this: start a thread with clone(), mmap a new heap for it, then when you want the return value from the thread, wait for it to die, then take the heap from the thread and combine it with the main heap
<tsuyoshi>
then you basically have like the forking concurrency, but the return value is not marshalled or copied
<tsuyoshi>
think I'll wait till the next release to try this.. I understand they have a new page table scheme for the heap
<Yoric[DT]>
How do you know it died ?
<tsuyoshi>
uhh.. waitpid I guess?
<Yoric[DT]>
Oh, ok, a new heavy process.
<flux>
tsuyoshi, works great if the thread ever wants to return a single value?
<Yoric[DT]>
Is that for CoThreads or anything such ?
<tsuyoshi>
oh now they have waittid in linux
<tsuyoshi>
flux: well the idea is, it's a single value but it can be a tuple, list, array, record, etc.
<tsuyoshi>
flux: and everything allocated by the new thread is combined with the main thread's heap, so the gc will go over it etc.
<flux>
tsuyoshi, how big operation would that be?
<flux>
close to constant time ?
<tsuyoshi>
combining the heap you mean?
<flux>
yes
<tsuyoshi>
I don't know
<tsuyoshi>
I guess that's the part that determines how feasible it is
<flux>
that can't scale to a large number of threads, can it? atleast on 32-bit platforms the address space can get chewed very quickly?
<flux>
fun idea nevertheles
<tsuyoshi>
well it depends on how much memory you need for the stack and heap
<flux>
once the thread has been spawned, and the parent process makes big allocations, fragmentation of the address space would be need to be taken into account?
<tsuyoshi>
I think that is mmap's problem.. the heap allocations would all go through mmap
<flux>
doesn't ocaml gc at the moment assume that everything between addresses x and y belong to ocaml..
<tsuyoshi>
yeah, but that's supposed to change in the next release
<tsuyoshi>
that's exactly what the new page table scheme is supposed to fix
<tsuyoshi>
because it was breaking horribly on amd64
<flux>
so the new thread would run in the same address space (but different copy) than the original?
<flux>
or how..
<tsuyoshi>
yeah, same address space
<flux>
ocaml stuff would be at addresses a-b and new thread at b-c, or a-b?
<tsuyoshi>
only fresh allocations in the new thread would be in the thread's own heap, until it exits and the heap is combined
<flux>
would it be able to mutate stuff in the a-b range?
<tsuyoshi>
so passing values back and forth between running threads wouldn't really work
structured has quit [Read error: 113 (No route to host)]
bluestorm has joined #ocaml
<tsuyoshi>
mutation wouldn't really work.. I mean, it would under certain circumstances.. but you have synchronization and gc issues
AxleLonghorn has joined #ocaml
AxleLonghorn has left #ocaml []
<tsuyoshi>
I'm just thinking of purely functional threads
<tsuyoshi>
I've done enough code with c and posix threads.. I want to get away from mutexes etc., it's a nightmare to debug that stuff
<flux>
message passing is the way to go
<flux>
I've been lately doing a server with n "threads" with a cps monad, and Event-like asynchronous message passing
<tsuyoshi>
well I am just thinking.. if your code is purely functional, parallelizing it should be trivial
<flux>
well, it's not
Smerdyakov has joined #ocaml
<tsuyoshi>
ok so why not?
<flux>
because it's difficult?
<tsuyoshi>
hmm.. I like to think about it but to be honest I have never seen anything which really needed to be run on multiple processors
<flux>
adding a state monad somewhere makes everything which can see the state change to also be under the state monad
<flux>
not very easy when you threads can pass messages to each other in a fashion that isn't very visible from the upper levels
<tsuyoshi>
video encoding and raytracing are the only things really...
<tsuyoshi>
and those two are extremely easy to parallelize
<flux>
tsuyoshi, well, the server could use parallelization if enough load was given to it
<tsuyoshi>
what kind of server?
<flux>
it converses with a number of devices and exchanges data
<flux>
..between the devices and the database
<tsuyoshi>
what does it do?
<flux>
it basically keeps database on sync with the state of the devices, plus sometimes passes on interactive commands to them
<flux>
then certain agregate information can be retrieved (list of devices) and certain events can be waited (a device establishes/breaks a connection)
<tsuyoshi>
huh? what kind of devices?
<tsuyoshi>
hrm.. I hope this internet cafe can break a $50 bill
<flux>
nah, I don't get into specifics ;)
<tsuyoshi>
cambodian atms suck.. even in the us the atms don't give out bills that big
<orbitz>
and they charge you like whoa
<tsuyoshi>
hrm.. wonder how hard it is to get ocaml working on my mp3 player
yminsky_ has quit [Read error: 110 (Connection timed out)]
vbmithr has quit [Read error: 131 (Connection reset by peer)]
vbmithr has joined #ocaml
yminsky has joined #ocaml
Yoric[DT] has quit [Read error: 113 (No route to host)]
seafood has joined #ocaml
yminsky has quit [Read error: 110 (Connection timed out)]
struk_atwork2 is now known as structured
RobertFischer has joined #ocaml
mqtt has joined #ocaml
yminsky has joined #ocaml
<mqtt>
Hi everybody.
<vixey>
hi mqtt
<mqtt>
I have a question about rectypes. Let say you have a non-recursive opaque type 'a t. You form its fixpoint with type word = word t, and the unique elements of the type with type letter = unit t. Is there a way to then define a function head (w:word) : letter which returns the first "constructor" of the type?
<mqtt>
(is that clear enough?)
<Smerdyakov>
You haven't given enough information about what functions on [t] are available.
LordMetroid has joined #ocaml
bluestorm has quit ["Konversation terminated!"]
<mqtt>
hmmm... that's the question actually. What is the minimum set of functions available on t to do it? But let's say you have a standard non-recursive fold...
<mqtt>
an example would be type 'a t = O | I of 'a. Then you can form type bool = unit t (booleans), and type nat = nat t (type of peano natural numbers). How can you then code the test-to-zero function without referring to I or O?
<Smerdyakov>
It's trivial to write a complete signature for [t].
<Smerdyakov>
You provide the polymorphic elimination principle in a module where [t] is abstract.
<Smerdyakov>
The types for these principles are read from a very regular recipe. Coq, for instance, defines the principles for every inductive type definition.
<Smerdyakov>
Add value versions of [O] and [I] to the module and you're done; now clients of the module can do everything they could have done with the datatype definition directly.
<mqtt>
could you be more specific? What would be the elimination principle on my example?
<mqtt>
oh
<mqtt>
you mean add a type t' = I | O ??
<Smerdyakov>
module type GimpyT = sig type 'a t; val o : 'a t; val i : 'a -> 'a t; val elim : 'b -> ('a -> 'b) -> 'a t -> 'b end
<mqtt>
ok let me think...
yminsky has quit [Read error: 110 (Connection timed out)]
<mqtt>
Smerdyakov, but then the module signature would depend on t !
<Smerdyakov>
Yes. This is supposed to be the original module where you make [t] available.
<Smerdyakov>
Not any of the particular client modules you were talking about
RobertFischer has left #ocaml []
yminsky has joined #ocaml
postalchris has joined #ocaml
filp has quit ["Bye"]
pango has quit [Remote closed the connection]
pango has joined #ocaml
mattam has quit ["Lost terminal"]
<mqtt>
Here is the code i'm working on. I'm trying to define a fixpointing functor for generic datastructures: http://hpaste.org/7988
Snark_ has joined #ocaml
Snark_ is now known as Snark
Axioplase has joined #ocaml
petchema has quit [Read error: 110 (Connection timed out)]
yminsky has quit [Connection timed out]
<Smerdyakov>
mqtt, that definitely won't parse, because module names must be capitalized.
<mqtt>
ok so s/fixpoint/Fixpoint
jonafan_ is now known as jonafan
mattam has joined #ocaml
Chile` has joined #ocaml
prince has quit [Client Quit]
<Smerdyakov>
mqtt, what functionality do you mean for [RECTYPE] to provide?
<mqtt>
Smerdyakov, what do you mean? what functions?
<Smerdyakov>
No, I mean implementations of [RECTYPE]. The whole things.
<mqtt>
I just want it to be ANY non-recursive datatype, provided with a fixed set of basic functions on it.
<Smerdyakov>
Oh, I see.
<Smerdyakov>
That probably won't work out very well.
<Smerdyakov>
You would need to be more specific about what can implement [RECTYPE].
<mqtt>
Smerdyakov, are you a Coq dev?
<Smerdyakov>
(And it's very odd to name the signature [RECTYPE] when you want precisely _non_-recursive types!)
<mqtt>
(that's right :)
<Smerdyakov>
I'm not an official Coq developer. I've made some modifications and extensions for my own purposes.
<mqtt>
ok so let's talk real: t is kind_of_term
<mqtt>
and you probably know that constr = (constr,constr) kind_of_term
<Smerdyakov>
Mmhm
<Smerdyakov>
Though it's not exposed outside the module
<mqtt>
and now I want to define a new structure for G.Huet's tries, applied to constrs: I had a trie = (trie list,trie list) kind_of_term.
<mqtt>
But this is too specific and not very nice. So my idea was to have a Trie functor, which takes a type 'a t with some standard functions, and builds the corresponding trie, with functions like add, mem, etc...
<Smerdyakov>
So you want terms where, instead of specific subterms, you have lists of possible choices for what could go in that position?
<mqtt>
YES!
<mqtt>
i want to do a tree of terms, in which search is linear
<Smerdyakov>
Have you read "Scrap your Boilerplate"?
<mqtt>
what is that?
<Smerdyakov>
A paper on generic programming in Haskell
<mqtt>
no... does it talk about this problem?
<Smerdyakov>
You can come up with the generic functions you want for particular use cases, but I think that paper (or its follow-ups) define one function "gfold" that suffices for most everything.
<Smerdyakov>
You would probably be fine in your case just coming up with generic functions as they occur to you.
<mqtt>
i'll have a look at this paper...
postalchris has quit [Read error: 110 (Connection timed out)]
<mqtt>
thanks Smerdyakov, bye.
mqtt has quit ["Quitte"]
Snrrrub has joined #ocaml
yminsky has joined #ocaml
RobertFischer has joined #ocaml
jarimatti has joined #ocaml
vixey has quit ["* I'm too lame to read BitchX.doc *"]
yminsky has quit [Connection timed out]
letrec has quit [Read error: 110 (Connection timed out)]
postalchris has joined #ocaml
mfp_ has joined #ocaml
mfp has quit [Read error: 110 (Connection timed out)]
structured has quit [Read error: 104 (Connection reset by peer)]
<RobertFischer>
Anyone worked with ANSITerminal? I'm having some difficulties with it.
<RobertFischer>
Specifically, "scroll" doesn't seem to.
Linktim has joined #ocaml
struk_atwork has joined #ocaml
bluestorm has joined #ocaml
<RobertFischer>
Okay, so I'm a bit stumped.
Yoric[DT] has joined #ocaml
<RobertFischer>
Ne'ermind...figured it out.
yminsky has joined #ocaml
jlouis has joined #ocaml
l_a_m_ has quit [Remote closed the connection]
yminsky has quit [Read error: 110 (Connection timed out)]
guillem has joined #ocaml
marmottine has joined #ocaml
jarimatti has left #ocaml []
LordMetroid has quit ["Leaving"]
<flux>
what was the problem?
Snark has quit ["Ex-Chat"]
yminsky has joined #ocaml
smimou has quit ["bli"]
ygrek has joined #ocaml
yminsky has quit [Read error: 110 (Connection timed out)]
yminsky has joined #ocaml
LordMetroid has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
AxleLonghorn has joined #ocaml
AxleLonghorn has left #ocaml []
<RobertFischer>
flux: I had a method f: unit -> unit, g: unit -> 'a, and I wanted a method h: unit->'a which executed f(); g. And I wanted to do it without specifying the arguments.
<RobertFischer>
But let h = f (); g causes f to be evaluated, and then defines h to g, which is not what I want.
<RobertFischer>
The stumped part was because I couldn't figure out why f() wasn't being called when I called h.
<RobertFischer>
I gave up being cute with partials and threw some arguments in, and so I have h = fun x y -> (f(); g x y). This is a little disappointing (I didn't want to have to specify the "pass through" arguments), but it works.
ygrek has quit [Remote closed the connection]
LordMetroid has quit ["Leaving"]
marmottine has quit ["Quitte"]
Yoric[DT] has quit ["Ex-Chat"]
bluestorm has quit ["Konversation terminated!"]
Axioplase has quit ["brb"]
<pango>
RobertFischer: I guess you mean functions...
<RobertFischer>
pango: As opposed to...?
<pango>
methods
<RobertFischer>
Yeah, just functions.
pango_ has joined #ocaml
<pango_>
what about let h = let () = f () in g
<qwr>
let h () = ...
<pango_>
nope, just h
<pango_>
ah, I see what you mean... it will affect the evaluation time of f ()
<qwr>
yes.
Axioplase has joined #ocaml
<qwr>
unit -> 'a is fun signature... some marshalling or it throws an exeption?
pango has quit [Remote closed the connection]
ofaurax has joined #ocaml
Linktim has quit [Remote closed the connection]
seafood has quit [Connection reset by peer]
seafood has joined #ocaml
vbmithr has quit ["Zz"]
Axioplase has quit ["Lost terminal"]
postalchris has quit [Read error: 110 (Connection timed out)]