<sporkmonger>
qwr: so, i'm back... anyways, I just tried this, and it doesn't work... http://ocaml.pastewith.us/66
<orbitz>
whats the error?
<sporkmonger>
same kind of issue, act_t isn't defined when predicate_t is defined, and if i reverse the order, same deal
<sporkmonger>
Unbound type constructor act_t
<orbitz>
ho wdo you expec tthis would work? each object woudl be infinite in size
<sporkmonger>
so... use a ref instead?
<orbitz>
redesign it wthout the circile depenency
<sporkmonger>
can't be done
<orbitz>
why?
<sporkmonger>
not for technical reasons
<sporkmonger>
hard to explain, but in a nutshell, i'm working from a spec, and the people i'm working for believe in the spec with near religious fervor
<orbitz>
the spec defines how your objects have to be defined?
<sporkmonger>
more or less yeah
<orbitz>
dont tell them?
<sporkmonger>
they're CS guys
<sporkmonger>
they'll notice :-P
<orbitz>
a variaent might work
<orbitz>
make one of then an 'option' type
<sporkmonger>
hmm, well, technically, i should've done that anyways
<sporkmonger>
but that doesn't make the error go away
<orbitz>
not sur eif it'llw ork, but mutable case : predicate_t option
<sporkmonger>
yeah, that's what i have
<sporkmonger>
same error
<sporkmonger>
is there any way to do something like in C
<sporkmonger>
where you declare upfront
<sporkmonger>
"hey, at some point, i'm gonna define this thing, don't yell at me"
<orbitz>
you can have an abstract type in ocaml by simpley doing type foo
<orbitz>
but i'm not sure htat'll help
<sporkmonger>
won't that yell at me for having multiple declarations tho?
<orbitz>
circular dependences aren't somethign fucntional languages handle well
<sporkmonger>
i haven't played with interfaces yet at all, would that help maybe?
<orbitz>
probably not
<orbitz>
i'd iagine th eonly way to ge this to work woudl be with a variant, but i'm really not sure how
<sporkmonger>
ahah
<sporkmonger>
type act_t = ... and predicate_t = ...
<sporkmonger>
and then in act.ml
<sporkmonger>
type t = Knowledge.act_t;;
<sporkmonger>
so i define the actual type in one module together, and copy the types into their own modules
jknick has joined #ocaml
<orbitz>
i thought 'and' defined something without takin ginto account the bindings defined in teh same xpression?
<orbitz>
like it does with 'let'
<orbitz>
but i gess i'm wrong
JunkYard has joined #ocaml
kopophex has quit [Connection timed out]
JunkYard has left #ocaml []
thelema has joined #ocaml
sporkmonger has quit []
sporkmonger has joined #ocaml
thelema has quit [Read error: 110 (Connection timed out)]
szell has joined #ocaml
sporkmonger has quit []
jonafan_ has joined #ocaml
orbitz has quit [Connection timed out]
|Catch22| has quit ["To the best of my knowledge, I guess that I'm fresh"]
szell` has quit [Connection timed out]
jonafan has quit [Read error: 110 (Connection timed out)]
shortcircuit has quit [Read error: 110 (Connection timed out)]
shortcircuit has joined #ocaml
schme has joined #ocaml
ikaros has joined #ocaml
z[x] has joined #ocaml
z[x] has quit [Remote closed the connection]
filp has joined #ocaml
hkBst has joined #ocaml
Demitar has joined #ocaml
OChameau has joined #ocaml
schme has quit [Excess Flood]
schme has joined #ocaml
schme has quit [Remote closed the connection]
munga has joined #ocaml
Linktim has joined #ocaml
yangsx has quit [Read error: 110 (Connection timed out)]
Demitar has quit ["Burn the land and boil the sea. You can't take the sky from me."]
munga has quit ["Leaving"]
magthe has joined #ocaml
LordMetroid has joined #ocaml
Tetsuo has joined #ocaml
jknick has quit ["leaving"]
sporkmonger has joined #ocaml
sporkmonger has quit [Client Quit]
Linktim has quit [Read error: 104 (Connection reset by peer)]
sporkmonger has joined #ocaml
Linktim has joined #ocaml
<flx>
hmm.. gprof says 5 top functions are gc-related.. so what should I do, allocate less?-)
<bluestorm>
flx: could you show those top function time usage ?
<bluestorm>
in some case you can have improvements by tweaking the GC only
<bluestorm>
(to be executed before the main program execution)
<flx>
wow, I didn't actually expect things to improve :)
<flx>
but it takes 1/4 of the time now (in the non-profiling version)
<bluestorm>
(you could try different values, depending on how much memory you're willing to dedicate)
<flx>
what this might be telling though that my benchmark is unrealistic
<bluestorm>
hm
<flx>
(it's message passing; I doubt I'll ever be sending messages at that rate)
<bluestorm>
i've seen real usage examples with a x10 speedup related to GC tweaking
<bluestorm>
basically, if you allocate a lot of small object that you know will stay for very long (and so eventually get into the major pool), caml_oldify_* and the likes will have a lot of work that can be eased by tweaking the Gc (or even calling for some collections yourself at the right place)
<flx>
although if I switched to more imperative approach, the gc could go down without tuning..
<bluestorm>
hm
<flx>
it is difficult to know what it the biggest allocator, though. perhaps I'm just creating too many temporary tuples.
<bluestorm>
i prefer tuning the GC to tuning my code style
<bluestorm>
but actually it happens that an imperative strategy is locally better
<flx>
region inference could give a nice performance boost with certain cases ;)
petchema has joined #ocaml
flx is now known as flux
<flux>
bluestorm, btw, do you have an idea how to find functions like "camlMbox__fun_1261" ?
<bluestorm>
this is an anonymous function
<flux>
yes
<flux>
hm, actually the surrounding functions in the call chain might give me an idea
<bluestorm>
you mean, the call tree ?
<flux>
yes
<bluestorm>
yes, that would probably give you the location
<flux>
I was hoping the number would be the line or character number, but no
<bluestorm>
the other way i know to see the unmangled names is to see the generated assembly, wich is even less easy to read :p
<flux>
(I wonder why they aren't; perhaps the information is lost at that point of code generation)
<tsuyoshi>
yeah.. the line numbers are long gone by the time it gets to assembly output
<tsuyoshi>
it wouldn't be terribly difficult to keep them though
<flux>
I would imagine the symbols would be generated before generating the assembly?
LordMetroid has quit [Read error: 110 (Connection timed out)]
LordMetroid has joined #ocaml
<tsuyoshi>
I don't know, lemme check
<tsuyoshi>
hmm.. not really
<tsuyoshi>
labels are given numbers (starting from 99) in asmcomp/linearize.ml
<tsuyoshi>
oh wait.. that's local labels
<tsuyoshi>
hm where the hell are the anonymous functions labelled
kopophex has joined #ocaml
lordmetroid_ has joined #ocaml
coucou747 has joined #ocaml
lordmetroid__ has joined #ocaml
<tsuyoshi>
gah.. I don't know, I give up..
<tsuyoshi>
why did we want to know this again
<tsuyoshi>
oh wait I think I see.. uhm
<flux>
:)
<flux>
persistent you are
vpalle has joined #ocaml
orbitz has joined #ocaml
<tsuyoshi>
the label is generated in the assembly emission stage.. it consists of the name ("" if anonymous) followed by a number 99 or greater
<flux>
ok, so the name could be something that would be generated earlier
<tsuyoshi>
oh wait.. where is the number added
<tsuyoshi>
I remember seeing it but it's not in the assembly emission
LordMetroid has quit [Connection timed out]
ikaros_ has joined #ocaml
<bluestorm>
tsuyoshi:
<bluestorm>
there are numbers (although for variables, not for functions) in the -drawlambda output
lordmetroid_ has quit [Connection timed out]
<bluestorm>
wich ocamlc has too
<bluestorm>
so i think it's done much earlier than at assembly emission
<tsuyoshi>
so wait.. the issue here is.. you want to see where you're generating garbage in an anonymous function?
<bluestorm>
tsuyoshi: i think the original question was just "how could i locate easily that anonymous function in my code ?"
<tsuyoshi>
you may not realize this.. but just calling such a function generates garbage, even if it does nothing
<bluestorm>
(given the unmangled name)
<orbitz>
bluestorm: do you follow caml-list?
<bluestorm>
orbitz: for a short time, yes
<tsuyoshi>
I remember trying to see if I could get my code to generate less garbage one time and then I found out anonymous functions did and I just gave up there
<orbitz>
ah so not currently
<bluestorm>
i'm currently following caml-list
<orbitz>
wha tdo you think of this summer project thread, specifically about trying to stop the world fo ra gc?
<bluestorm>
hm
<bluestorm>
i'm not competent on the multi-threading question
<bluestorm>
orbitz: i'd say it's only an re-occurence of the very common "ocaml multithreading is not satisfying" discussion
<orbitz>
i wonder how an erlang-in-ocaml would do
<bluestorm>
wich i'm not sure is very serious. The inria people are quite clear on that matter : they do not consider it is an interesting problem; on the other hand, some people seem to be happy with Unix.fork (), jharrop included, when he's not babbling about F#
<orbitz>
really? that's interesting and sems somewhat short sited, concurrency seems to be but clearly increasing
<bluestorm>
orbitz: i had a look at JOcaml recently
<orbitz>
what did you think?
<orbitz>
i have only looked at some code, not actually played with it
<bluestorm>
i'm not sure what issues it can solve, but it's quite funny to think with
<orbitz>
well apaprently it can solve raytracing problems:)
<bluestorm>
(hm, i only read the tutorial/manual, i'm waiting for a erlangese friend to lend me some code to port)
<orbitz>
have you ever looked at the vodka programming language
<bluestorm>
nope
<bluestorm>
however
<orbitz>
it's a language built around join calculus, it's kind of neat
<bluestorm>
as a first approach, i thought that the Jocaml concurrency model (join calculus ?) is a bit harder to think with than erlang message-passing
<orbitz>
i have a feeling it's like an imperative programming going functional. it makes no sense right up until the point it makes complete sense
ikaros has quit [Read error: 110 (Connection timed out)]
<tsuyoshi>
considering the cache-coherency issues.. I think threading with mutexes etc. is kind of a dead end
<tsuyoshi>
and I think that's all concurrent gc really lets you do.. so I suspect it's not worthwhile
<bluestorm>
seems reasonable
<orbitz>
tsuyoshi: what are the options other thanc urrent gca nd stopping the world?
<orbitz>
disjointed heaps?
<tsuyoshi>
there ought to be some snazzy functional concurrency paradigm, but I haven't seen anything too snazzy yet
<orbitz>
erlang uses either disjointed or hybrid heaps
<tsuyoshi>
orbitz: well in theory, if you have purely functional code, concurrency should be easy
<bluestorm>
orbitz: what about Unix.fork () ?
<tsuyoshi>
if you have all the threads do separate work that can be merged
<orbitz>
bluestorm: that makes communication expensive
<bluestorm>
orbitz: it seems me that in every model, the communication is expensive once you have enough cores
<tsuyoshi>
but I think we need a concrete problem that could be solved with concurrency, and then figure out the best way to model it
<tsuyoshi>
concurrent raytracing, for example, is not too important to most people
<orbitz>
servers?
<orbitz>
a http server i steh stndard erlang example
<tsuyoshi>
what kind of servers are cpu-bound?
delamarche has joined #ocaml
<tsuyoshi>
http servers generally are network-bound
<orbitz>
it's not being cpu bound, it's easy of writing cocnurrent code
<orbitz>
ease*
<tsuyoshi>
you mean, just handling concurrent connections?
<orbitz>
yes
<tsuyoshi>
that can be done with fork
<orbitz>
a new process per connection?
<tsuyoshi>
it's not even really that slow, imo
<bluestorm>
orbitz: that's the standard way to do it
hcarty has joined #ocaml
<orbitz>
it also doesn't scale particualrlyw ell
pango_ has quit [Remote closed the connection]
<bluestorm>
see Unix.establish_server
<bluestorm>
orbitz: hm, iirc modern OS tend to support that kind of things quite well
<tsuyoshi>
well it depends on what you're doing when you handle a request
<bluestorm>
i'm not speaking of erlang-like billions of processes, but erlang processes are not representative of the usual process (much lighter)
<tsuyoshi>
I dunno.. most things on the web I see are network or disk bound
<orbitz>
context switching ebtween OS processes is pretty heavy when you ge ta lotof them
kopophex has quit [Connection reset by peer]
<bluestorm>
orbitz: i'd be interested in tests
lordmetroid_ has joined #ocaml
<orbitz>
a fork'ing server is pretty limited, te best i've seen apache due under that is abotu 4k connections
<orbitz>
serving static data
vpalle has quit [Read error: 110 (Connection timed out)]
<delamarche>
i was playing with ocamlp3l not too long ago
<bluestorm>
it might be possible to use cothread to spawn some process (say, (number of CPU) + 1) and use threads for the rest
<delamarche>
i thought the ocaml runtime suffered from GIL-like problems, though, doesn't it? Like only one thread can run at a time?
<delamarche>
Or am I just completely misinformed?
<hcarty>
delamarche: Did you have any success with ocamlp3l?
<bluestorm>
delamarche: only one thread can run at a time
<delamarche>
hcarty: It's still very much a prototype, but I liked it
<delamarche>
but for fine-grained parallelism it's not so great
<delamarche>
it's designed to distribute across machines
<hcarty>
I have been unable to get any examples to run using the parallel implementation, only sequential and graphical
<bluestorm>
what do you call "fine-grained parallelism" ?
<orbitz>
bluestorm: looking superficially at the Thread module it seems to offer teh same constructs as somethign like pthreads which I don't think is very capable of solving making concurrency easier
<bluestorm>
orbitz: see Event
<bluestorm>
(you've got mutexes, semaphores (Condition, iirc) and Event)
<hcarty>
JoCaml on the other hand does seem to work quite nicely. It's just too bad that it is separate from mainline OCaml.
<delamarche>
bluestorm: One moment, phone
<hcarty>
That's a big plus for ocamlp3l, since it is really just a few libraries on top of vanilla OCaml
<bluestorm>
orbitz: CoThread provides STM
<orbitz>
i haven't used STM, i hear it' spretty good though
<bluestorm>
and OCsigen has a monadic Lwt concurrency model
l_a_m has joined #ocaml
<bluestorm>
all in all, i think there is not so much to lament about the state of concurrency in OCaml
<bluestorm>
and i'm not sure a "concurrent GC" would help that much
<bluestorm>
(i mean, it has it own complexity and runtime overhead, while supporting a programming model that is not likely to stay for long)
lordmetroid__ has quit [Read error: 110 (Connection timed out)]
<bluestorm>
(of course that doesn't mean the Summer of Code project is not interesting. I'm just saying that it's maybe not a chicken-killing issue)
<bluestorm>
heh, and i hope the QtCaml guys will succeed too :}
<orbitz>
ha
<orbitz>
i just want me some inter operator overlaodign
|Catch22| has joined #ocaml
lordmetroid_ has joined #ocaml
postalchris has joined #ocaml
lordmetroid_ has quit [Client Quit]
jonafan_ is now known as jonafan
LordMetroid has quit [Connection timed out]
Morphous has quit [Read error: 110 (Connection timed out)]
Morphous has joined #ocaml
<delamarche>
There's a SoC project to allow concurrent GC in OCaml? Dear god
<delamarche>
That is super cool
<bluestorm>
it seems me that all those SoC projects are super cool
<delamarche>
Like you say, it's not a show-stopping issue, but it's still neato
coucou747 has quit [Read error: 110 (Connection timed out)]
det has joined #ocaml
sporkmonger has quit [Read error: 104 (Connection reset by peer)]
sporkmonger has joined #ocaml
lordmetroid_ has joined #ocaml
lordmetroid_ has quit [Client Quit]
det has quit [Read error: 104 (Connection reset by peer)]
det has joined #ocaml
lordmetroid_ has joined #ocaml
LordMetroid has quit [Nick collision from services.]
lordmetroid_ is now known as LordMetroid
hsuh has joined #ocaml
postalchris has quit [Read error: 110 (Connection timed out)]
hsuh has quit [Remote closed the connection]
bzzbzz has joined #ocaml
hsuh has joined #ocaml
postalchris has joined #ocaml
coucou747 has joined #ocaml
LordMetroid has quit [Connection timed out]
evn_ has joined #ocaml
<flux>
I suppose EasyOcaml is exciting if you're part of university staff
<delamarche>
It should be excited for anyone who likes the idea of other people adopting OCaml.
<delamarche>
*exciting
<delamarche>
DrScheme + HTDP is a fantastic approach to learning computer science, IMO, whether it is teaching it to newbie students, or whether it is to 'unlearn' a javaschool approach that one may have been subjected to in one's education.
hsuh has quit [Remote closed the connection]
psnively has joined #ocaml
<flux>
perhaps it's a useful tool for newcomers to try out their program in EasyCaml too, but how much has DrScheme gained traction among people going from another language to scheme?
<flux>
I rarely hear of it
<flux>
especially when the newcomer knows that the language is a subset "of the real thing"
nuncanada has quit ["Leaving"]
<psnively>
? DrScheme supports both subsets and supersets of R5RS.
<flux>
I was referring to EasyOcaml
<psnively>
Ah. That I'm not familiar with. :-)
<flux>
it's janet's ocaml summer of code project
<hcarty>
I think there is already a simple Dr. Scheme plugin for OCaml. Hopefully it will be made to work with EasyOcaml as well.
<psnively>
EasyOCaml: Because plain OCaml isn't easy enough/
<bluestorm>
i agree the name is a bit awkward
olleolleolle has joined #ocaml
<olleolleolle>
Hi Ocamlers. I just got wind of Ocsigen.
<olleolleolle>
The README pointed to http://godi.camlcity.org/godi/ - and I am on OS X, and it seems I need the ocamlssl thing.
<olleolleolle>
Godi looks great.
<bluestorm>
olleolleolle: so you tried to install all of ocaml libraries and dependencies through godi ?
<bluestorm>
s/ocaml/ocsigen/
<olleolleolle>
Not yet, I'm in the process of.
ygrek has quit [Remote closed the connection]
<delamarche>
flux: The difference here is that there's very little reason to go from an existing language to Scheme if you're not a student. However, there are obviously very real advantages of going from some other language to OCaml, and EasyOCaml can provide a sane learning path in that pursuit.
<delamarche>
IMO
<delamarche>
Right now, if someone has no functional programming experience, what I do is refer them to DrScheme, SICP, HTDP, etc. to cut their teeth and learn the basics
<delamarche>
and then 'graduate' to OCaml
<delamarche>
Now, hopefully, they'll be able to cut straight to the chase.
<bluestorm>
hm
l_a_m has quit [Remote closed the connection]
<bluestorm>
i know a lot of places where people learn caml as a first language
<bluestorm>
and actually, some of them even still use caml light
<delamarche>
I'm not saying it's not possible.
<bluestorm>
(iirc caml light error messages are internationalized)
<delamarche>
I'm saying the road is made smoother in scheme-land by all these tools that have specifically been designed to teach you the basics in a gentle way.
<delamarche>
Again, just my opinion
<delamarche>
I mean, lots of CS1 courses are taught in OCaml.
<bluestorm>
delamarche: but some of the objectives of the easyocaml seems to be concerning the type system
<bluestorm>
(better type error messages)
<bluestorm>
wich would be helpful even for people coming from scheme, obviously
LordMetroid has joined #ocaml
<delamarche>
I'm not so interested in that. I'm more interested in the fact that they're mapping the pedagogical approach used by the PLT people to OCaml. I think that's really cool.
<delamarche>
But definitely helpful, yes!
<olleolleolle>
bluestorm: I have a question; was it bad that I did "sudo ./bootstrap" instead of pointing to a dir like /home/olle/ocamlstuff ?
<bluestorm>
hmm
<olleolleolle>
(when installing the godi)
<Smerdyakov>
You guys just watch. The pedagogical approach based on correctness proofs for each program is gonna take over the market.
<bluestorm>
i don't recall the godi installation procedure exactly
<delamarche>
Smerdyakov: That would be awesome.
<delamarche>
:)
<orbitz>
Smerdyakov: shall i hold my breath?
<olleolleolle>
No problem, it put its stuff in /opt/godi I think.
<bluestorm>
i'm not sure there are a lot of feedback from osX users on godi
<olleolleolle>
It's OK, I'll be "one of the few" instead.
<olleolleolle>
Seems like it's working like it should. Lots of compiling output. Things are happening, verbosely.
<bluestorm>
:p
<bluestorm>
ocaml libraries are actually quite fast to compile imho (if you've ever tried GHC...)
<olleolleolle>
Hehe, ye olde GHC is famously long-winded in her compilations.
lordmetroid_ has joined #ocaml
lordmetroid_ has quit [Client Quit]
fremo has joined #ocaml
LordMetroid has quit [Connection timed out]
<olleolleolle>
gah, ran into a build error when using godi_console to build sqlite3 bindings.
<olleolleolle>
"> sqlite3_stubs.c:782: warning: implicit declaration of function 'sqlite3_transfer_bindings'"