Alpounet changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.1 out now! Get yours from http://caml.inria.fr/ocaml/release.html
Pimm has quit [Remote closed the connection]
BiDOrD has quit [Remote closed the connection]
__mattam__ has joined #ocaml
mattam has quit [Read error: 104 (Connection reset by peer)]
Associat0r has quit [Read error: 104 (Connection reset by peer)]
Associat0r has joined #ocaml
Narrenschiff has quit []
snowbeard has left #ocaml []
snowbeard has joined #ocaml
<thelema> At the risk of adding too much to my plate, I'm wondering if it's possible to CAS in OCaml
<orbitz> Computational Algebraic System?
<thelema> Compare And Store
<thelema> err, compare and swap
snowbeard has quit ["Client Quit"]
<orbitz> ok
<thelema> Related to all the talk about multiprocessing and ocaml
__mattam__ has quit [Read error: 60 (Operation timed out)]
bind_return has joined #ocaml
joewilliams has quit [Remote closed the connection]
ikaros_ has quit ["Leave the magic to Houdini"]
EliasAmaral has joined #ocaml
Modius has joined #ocaml
snowbeard has joined #ocaml
tmaedaZ is now known as tmaeda
efarrar has joined #ocaml
<efarrar> hey diginux
tmaeda is now known as tmaedaZ
Associat0r has quit [Read error: 104 (Connection reset by peer)]
Associat0r has joined #ocaml
tmaedaZ has quit [Read error: 60 (Operation timed out)]
caligula__ has joined #ocaml
caligula_ has quit [Read error: 110 (Connection timed out)]
tmaedaZ has joined #ocaml
struktured has quit [Read error: 110 (Connection timed out)]
<palomer> erm, coding after eating a chocolate, peanut butter and banana crepe is not recommended
<flux> all your variables get names like chocolate1, peanut_butter' and banana_crepe?
<palomer> flux!
<palomer> how's it going?
<palomer> working on any interesting projects?
<flux> nope. well, got my n900, so perhaps I'll play around a bit on the christmas holidays.. or maybe I'll just do nothing at all :)
<palomer> intense
_unK has quit [Remote closed the connection]
<flux> quite true
ulfdoz has joined #ocaml
struktured has joined #ocaml
ulfdoz has quit [Read error: 60 (Operation timed out)]
valross has quit ["Ex-Chat"]
jdavis has joined #ocaml
<jdavis> is it possible to attach the debugger to a running process?
demitar has quit ["Ex-Chat"]
jdavis has quit ["Leaving"]
joewilliams has joined #ocaml
struktured has quit [Read error: 110 (Connection timed out)]
joewilliams has quit [Remote closed the connection]
<thieusoai> how do I use something from extlib ? I have it installed on my Linux box but not sure how to use it
<thieusoai> oh nv
<thieusoai> I think I have to link it against my project
Submarine has joined #ocaml
fx_ has joined #ocaml
Associat0r has quit []
mjsor has joined #ocaml
mjsor has quit []
alp_ has quit [Client Quit]
snowbeard has quit ["Client Quit"]
albacker has joined #ocaml
albacker has quit ["Leaving"]
munga has joined #ocaml
Submarine has quit ["Leaving"]
det__ has joined #ocaml
det has quit [Read error: 104 (Connection reset by peer)]
mjsor has joined #ocaml
ttamttam has joined #ocaml
EliasAmaral has quit [Read error: 110 (Connection timed out)]
EliasAmaral has joined #ocaml
Alpounet has joined #ocaml
thrasibule has joined #ocaml
_zack has joined #ocaml
mjsor has quit []
Modius has quit [Read error: 60 (Operation timed out)]
<_zack> rwmjones: on fedora 64bits, is ocaml installed under /usr/lib/ocaml or /usr/lib64/ocaml ?
mjsor has joined #ocaml
thrasibule_ has joined #ocaml
thrasibule has quit [Read error: 60 (Operation timed out)]
mjsor has quit []
<EliasAmaral> _zack, if it's about the shebang, what about #!/usr/bin/env ocamlrun ?
<_zack> EliasAmaral: it is not about the shebang
<EliasAmaral> ocaml is usually at /usr/bin/ocaml, but i think you can go to the site of fedora and see the list of files for each package
<_zack> I just need the output of `ocamlc -where` on a Fedora 64bit machine
<EliasAmaral> (there is the info for ubuntu and debian for example)
<_zack> EliasAmaral: I do the packging for debian, I know the details there :)
<EliasAmaral> i think there is no sense in putting it in lib. it's a user binary
<_zack> `ocamlc -where` it is where the libs are, not where the binary is
<EliasAmaral> ah
<EliasAmaral> ok, i don't know :)
thrasibule_ has quit [Read error: 110 (Connection timed out)]
eldragon has joined #ocaml
_andre has joined #ocaml
ubuntu_ has joined #ocaml
_zack has quit ["Leaving."]
_zack has joined #ocaml
<fx_> # lsb_release -d
<fx_> Description:CentOS release 5.4 (Final)
<fx_> # uname -m
<fx_> x86_64
<fx_> # ocamlc -where
<fx_> /usr/lib64/ocaml
Pimm has joined #ocaml
<ubuntu_> http://en.wikipedia.org/wiki/Software_transactional_memory is this something "new" in programming languages? I am trying to find a C implementation, none of what I find seems madure
<ubuntu_> there is an ocaml implementation too, but the site doesn't open, http://cothreads.sourceforge.net/
<ubuntu_> s/madure/mature/
EliasAmaral has quit [Nick collision from services.]
EliasAmaral has joined #ocaml
EliasAmaral has quit [Remote closed the connection]
ubuntu_ has quit [Remote closed the connection]
EliasAmaral has joined #ocaml
ikaros has joined #ocaml
<EliasAmaral> I think I need a C library :( (But I am not sure)
<Camarade_Tux> but I thought there was a more recent release of cothreads
<EliasAmaral> Is this library compatible with Event?
fx_ has quit [Read error: 60 (Operation timed out)]
Associat0r has joined #ocaml
tmaedaZ has quit [Read error: 60 (Operation timed out)]
fx_ has joined #ocaml
<mfp> EliasAmaral: IIRC cothreads subsumes Event and related modules
tmaedaZ has joined #ocaml
<mfp> it featured 3(?) engines: Thread, process-based and network
<mfp> also some STM stuff
<mfp> it's a pity the site is down
<EliasAmaral> hm.
_zack has quit ["Leaving."]
<EliasAmaral> they provide their own Event?
<EliasAmaral> or they are meant to replace, but with another interface}
<mfp> I think its own, with binary compatibility between the 3 engines, so you could pick one at link time
<mfp> "coThreads implements the same API of the standard Threads library as different execution engines (process, netwoker(TODO)), so that a single copy of source code can be compiled and deployed to different environments without modification"
<mfp> " coThreads is also a super set of the standard Threads library, with extra components (STM etc.), functions (spawn etc.), and features (object-level compatibility etc.)"
<Camarade_Tux> mfp: well, the sourceforge project page is still up and archive.org has it hopefully ( http://web.archive.org/web/20080511170615/http://cothreads.sourceforge.net/ )
<Camarade_Tux> (well, parts of it)
<mfp> the IPC bm figures given by Erik Rigtorp are interesting
<Camarade_Tux> yup, I thought exactly the same :-)
<mfp> this one max/avg/min (ns) -> Pthreads mutex shm: 27582/5246/6577 vs. TCP on loopback: 29017/7471/7885
<mfp> erm max/min/avg
<EliasAmaral> I want to have at least the dream of the possibility of someday to have actual parallelism
<EliasAmaral> http://common-lisp.net/project/cl-stm/ does anyone know this lib?
<Camarade_Tux> nah, it's nice to have a smaller avg than min :P
<EliasAmaral> CL-STM is currently being developed by Hoan Ton-That for the Google Summer of Code 2006. > I fear when I hear this, because we are in 2009
tmaedaZ is now known as tmaeda
<mfp> with concurrent GCs being so hard to implement, maybe we should focus on code mobility to make message passing + distributed programming easier
<mfp> following the Erlang route
<EliasAmaral> message passing is expensive
<EliasAmaral> it is getting cheaper, but in some areas is still too expensive
<EliasAmaral> mfp, I think CML have a concurrent GC
<mfp> EliasAmaral: how well does it scale? how good is the single-core throughput?
<EliasAmaral> i dunno
<EliasAmaral> maybe it should be the case of having two gcs
<EliasAmaral> doing the switch ar compile time
<EliasAmaral> it that's the problem
<mfp> remember Doligez & Leroy did write a concurrent GC for Caml Special Light back in the 90s, and they're saying it's too complex ("despite a machine-checked correctness proof") & doesn't scale
<EliasAmaral> hmm
<mrvn> EliasAmaral: The hart part then is to detect when some data is shared with other cores.
<EliasAmaral> why not assume that all data is shared?
<mrvn> EliasAmaral: And you should switch at runtime or dynamic link time like Linux now does in the kernel.
<mrvn> EliasAmaral: If all data is shared then no single GC can say when data is unreachable.
<EliasAmaral> hmmmm.
<mrvn> EliasAmaral: The speed gain would be if a thread allocates some data, uses it a bit, forgets it and then the GC for that thread can free it without the need to communicate with other GCs.
<EliasAmaral> why not make a per-thread reference count?
<EliasAmaral> or make all existing mechanisms to be per-thread
<mrvn> EliasAmaral: And have 1024 counters for a single float?
<EliasAmaral> mrvn, oh, it would need to have a gc per core?
<EliasAmaral> nobody have 1024 cores
<EliasAmaral> ... well
<mrvn> EliasAmaral: there were such systems in the past and just wait a while.
<mrvn> Also when do you increase the thread counter? You need to catch when data crosses threads then.
<EliasAmaral> mrvn, i thought that the interesting part of multi-core is that you can do deallocation in a core
<EliasAmaral> and use the others to run the program
<mrvn> EliasAmaral: I don't think that will perform well. While the GC runs the other thread could move pointers around without the GC seeing it. So you would need to write protect pages the GC has already looked at for all cores.
<EliasAmaral> you would need to protect the pages gc will free, and pages that point to it
<mrvn> No, every page that contains a mutable pointer. And since the GC doesn't know which do it has to protect all.
<mrvn> You could probably stop the world and then run bits of the GC on every core, each covering a different minor heap and use IPC to communicate where pointers cross between heaps.
<mrvn> All the temporary data of threads would be local to the threads heap and no IPC would be needed. Only when data is shared IPC would occur. So you wouldn't loose too much for that overhead.
bluestorm has joined #ocaml
_zack has joined #ocaml
<EliasAmaral> mrvn, that's when explicit allocation wins
<EliasAmaral> but it's harder to prove that it doesn't have a bug
<mrvn> EliasAmaral: Or carefull planning.
<mrvn> Generally I don't think you can construct a case where (valid) explicit allocation is ever slower. It just is damn complicated to do right.
<EliasAmaral> maybe the problem is that GCs are too general. maybe a GC that don't works with everything can perform well in a multi-core environment
<EliasAmaral> http://common-lisp.net/project/cl-stm/ I liked it, but... I don't know common lisp
<mrvn> yes. I believe the trick is to get the GC on each core to work mostly on local data with few cases where it needs to coordinate between cores.
<mrvn> But just like with the first single-core GCs that is something that just needs time and bright ideas to develope.
<mrvn> imho
<EliasAmaral> yeah :)
<EliasAmaral> and maybe the C-$ programming language will adopt it at the convention of programming fashion..
<EliasAmaral> in 2035
<EliasAmaral> (but of course it could be the case that nobody ever solve this problem before 2035)
<mrvn> EliasAmaral: I'm actually considering writing a C-to-C compiler that uses tagged pointers and structures similar to what ocaml uses and a GC.
<EliasAmaral> i.e. a macro language for C
<mrvn> no, a true source ransformation.
<mrvn> transformation even
<EliasAmaral> but macros can do turing-complete transforms
<EliasAmaral> i mean, lisp-style macros
<EliasAmaral> you indeed are just writing macros if you want to make any kind of computation at compile-time
<mrvn> I would want to do stricter type checking too if possible.
<mrvn> Like catch conversions between off_t (64bit) and int (32bit).
<EliasAmaral> Hmm. I think macros can do that. but that's beside the point. You don't want to structure your C-to-C compiler around macros?
<mrvn> I would write it in ocaml.
<EliasAmaral> it ought to be easly extensible
<mrvn> Parse the C code into an AST, transform the AST, output the new code.
<EliasAmaral> yes, but the "transform" part
<mrvn> hardcoded. :)
<EliasAmaral> you can do this in a lot of ways
<EliasAmaral> I was about to say it: you shouldn't hardcode *this*
<EliasAmaral> you should at least make a module interface. why?
<mrvn> hehe. You need to hardcode a lot because the GC needs fixed structures to interface with.
<EliasAmaral> because the parse things and the transform things are actually two distinct tasks
<EliasAmaral> Hmmm.
<mrvn> Nothing wrong with having a Parse, GCify and Print module.
<EliasAmaral> ah, you want a C gc too.
<orbitz> Anyone here knwo anything about Thrift, the FB protocol?
<EliasAmaral> why not using a existing GC for C?
<orbitz> The wikipage says: Extendable through Caml web services.
<orbitz> and i'm thinking this must be a mistake...
<mrvn> EliasAmaral: because there is non that isn't conservative (and therefore crap).
<mrvn> EliasAmaral: I also want to bound check pointers.
<EliasAmaral> How GC would run?
<mrvn> as part of malloc/free.
<EliasAmaral> Hmmmm.
<orbitz> mrvn: If that's what you want, Go probably isn't a half-bad choice..
<mrvn> orbitz: the point would be that it would be able to run most C code as is.
<mrvn> Just more securely.
<orbitz> What about Cyclone? Isn't that mostly C?
<mrvn> mostly C doesn't run existing C code.
<EliasAmaral> mrvn, it seems nice
<orbitz> mrvn: deepnds on how far away from C it actually is
<mrvn> orbitz: that would still require a C-to-Cyclone compiler.
<EliasAmaral> Polymorphism replaces some uses of void *
<mrvn> orbitz: But Cyclone goes in the right direction. Just I want to make the changes automatically that Cyclone provides manually.
<orbitz> mrvn: not if C is a proper subset of Cyclone
<EliasAmaral> it is not, orbitz. there is restrictions on pointer arithmetic
<EliasAmaral> eg. if you want pointer arithmetic, you have to reclare it as int? instead of int*
<mrvn> For example Cyclone has fat pointers (pointer with bounds check). But C specs specifically say a pointer is only valid in the allocated region. So making every pointer fat in the compiler is perfectly legal. Compilers just don't do it for speed reasons.
<EliasAmaral> it seems like a very interesting language. anyone here heard of/likes bitC?
<orbitz> BitC is dead from what i know
<EliasAmaral> dead? really? i though it was a wonderful project when i saw it. :(
<orbitz> being a wonderful project doesn't make it actively developed
<bluestorm> the main guy behind BitC accepted a job at Microsoft
<bluestorm> wich specifically asked him to stop working on it
<EliasAmaral> .... o.o
<EliasAmaral> how sinister
<bluestorm> well, MS is doing lots of things in the "next-gen OS" space these days
<bluestorm> and they have an active research around this
<EliasAmaral> why a formally-specified low level programming language would hurt microsoft?
<mrvn> If you can beat the competition then buy them.
<EliasAmaral> that's because it is open source?
<bluestorm> Singularity, blah blah
<bluestorm> EliasAmaral: they're working on the same kind of things
munga has quit [Read error: 60 (Operation timed out)]
<EliasAmaral> I would love to use a formally-defined kernel
<bluestorm> so I suppose there were interested in Shapiro's expertise
<EliasAmaral> it's just that someone have to make it easier to program and faster to run
<EliasAmaral> something I think I know: a formal specification means nothing without a source code to check
<EliasAmaral> .. right?
<bluestorm> hm
<bluestorm> it's a bit more complicated than the "formal specficitation + informal implementation" dichotomy
<bluestorm> eg. in some cases you can extract the program from the specification/proofs
<EliasAmaral> yeah, but you can do this in an efficient way?
<EliasAmaral> and, if you can extract the program from the specification, the specification itself is the source code.
<bluestorm> that's a research topic
<EliasAmaral> it's just that the programming language is now specification-based
<bluestorm> the answer being "we try to, but it's not easy"
<EliasAmaral> bluestorm, I mean: microsoft of course wants to hide the code. but, if we talk about specifications, they can't hide it if they want to prove the program is mathematically correct
<bluestorm> ( if you're interested in OS verification : http://ertos.nicta.com.au/research/sel4/ )
<bluestorm> i'm not exactly sure microsoft really want to hide the code
<bluestorm> they've done it in the past
<EliasAmaral> unless they can prove the binary is correct without saying how it was produced, this worries me (but at least it's an improvement: with a formal specification one can implement a perfect equivalent)
<bluestorm> but they might publish the source of their Microkernel if they don't see any disadvantage to it
<bluestorm> actually, Singularity source code has been released in the past
<bluestorm> (not under a free software licence, but nonetheless)
<bluestorm> and Apple also relase source code of it's core kernel and system
<EliasAmaral> but then they lose that holy grail of "we have the sole implementation of the relevant api". maybe this is the sign that the web already won?
<bluestorm> hm
<bluestorm> this is just the kernel
<EliasAmaral> if this is true, i am just glad chromium is open source. i do not care that chrome have spyware etc, if i can run without
<EliasAmaral> bluestorm, they should want to protect their userland api too
<bluestorm> they could still hide the source of further frameworks (around .NET for example)
<EliasAmaral> to verify a userland library should be easier
<bluestorm> hm
<bluestorm> I don't think they are planning to build the whole OS with included precise formal verification
<bluestorm> they're interested in veryfing the kernel, because it's not-too-big and quite critical
<bluestorm> but you shouldn't expect a formally specified GUI framework anytime soon, imho
<EliasAmaral> what about verifying the hardware drivers? a lot of them are based on hardware specs
<EliasAmaral> bluestorm, yeah. but i would love it nonetheless:)
<EliasAmaral> http://ertos.nicta.com.au/research/sel4/ is open source?
<EliasAmaral> something that don't see easy to formalize is networking
<EliasAmaral> because to follow the rfcs is not enough to make a secure system
<bluestorm> EliasAmaral: Sel4 is open research and (I believe) open source
<bluestorm> they're related to http://www.ok-labs.com/ , wich sells µkernel-based open source software
Modius has joined #ocaml
itewsh has joined #ocaml
<palomer> there should be a dedicated ocaml list for multicore discussions
itewsh has quit [Connection reset by peer]
itewsh has joined #ocaml
Modius_ has joined #ocaml
<Camarade_Tux> http://www.google.co.uk/search?num=50&hl=en&q=annual%20discussion%20threading%20xavier%20leroy -> "It seems that the annual discussion on threads started again. Allow
<Camarade_Tux> me to deliver again my standard lecture on this topic.
<Camarade_Tux> bah, \n-fail
Modius has quit [Read error: 60 (Operation timed out)]
ubuntu_ has joined #ocaml
EliasAmaral has quit [Nick collision from services.]
ubuntu_ is now known as EliasAmaral
ViciousPlant has joined #ocaml
Alpounet has quit ["``Do what you think you can't do.'' -- E. Roosevelt"]
Pimm has quit [Read error: 110 (Connection timed out)]
ikaros has quit ["Leave the magic to Houdini"]
_unK has joined #ocaml
ViciousPlant has quit [Read error: 60 (Operation timed out)]
joewilliams has joined #ocaml
<maskd> that message is depressing
<maskd> Shared-memory multiprocessors have never really "taken off", at least in the general public.
<maskd> what would he say today?
EliasAmaral has quit [Remote closed the connection]
<Camarade_Tux> that my Phenom II X4 prefers multi-processing to multi-threading?
<bluestorm> maskd: I suppose OCaml maintainers don't have much time to work on multi-processing
<bluestorm> there are others people working on it (eg. Ocamlm4MultiCore), but progress is slow due to lack of workforce
<maskd> oc4mc seems promising
<maskd> but something in mainline would be better
_andre has quit ["leaving"]
_andre has joined #ocaml
Pimm has joined #ocaml
Alpounet has joined #ocaml
caligula_ has joined #ocaml
fx_ has quit [Read error: 60 (Operation timed out)]
caligula__ has quit [Read error: 60 (Operation timed out)]
_zack has quit ["Leaving."]
<palomer> camlp4 is extremely nice
<thelema> I'll have to take your word for it.
<bluestorm> palomer: and you're motivated enough to write a good up-to-date documentation ?
<bluestorm> (its not so difficult, you only have to adapt the pre 3.10 documentation for a beginning)
* thelema just wrote PMap.pop
Snark has joined #ocaml
<palomer> I don't understand the nitty gritty of it
<palomer> it would be a good exercise though
<palomer> I don't even understand ocaml to my satisfaction
<thelema> should PMap.pop return ((key,value),map) or (key, value, map)?
ikaros has joined #ocaml
<palomer> I'd go with ((key,value),map)
<palomer> for no particular reason though
<thelema> yeah, it's totally a style thing, I think
<Camarade_Tux> key, value, map, takes less memory and allocates less
<thelema> yes, I know, but you might want the pair of k,v to do something with
<thelema> although I'll admit that most functions are curried relative to k,v
<thelema> so you'd have to separate them
<thelema> (k,v),m matches the semantics of maps as sets of pairs
Tianon has joined #ocaml
<Camarade_Tux> (otoh I don't know if you want to pop a million of times per second)
ikaros has quit [farmer.freenode.net irc.freenode.net]
Amorphous has quit [farmer.freenode.net irc.freenode.net]
acatout_ has quit [farmer.freenode.net irc.freenode.net]
<thelema> It's an alternative way to iterate through a map, especially if you might stop in the middle
<thelema> and need the remaining map for something else
<Camarade_Tux> yeah, true
<thelema> My most common use case for pop would be getting some sort of loop started - you do it once to initialize things, and then you use some other iterator to go through the rest
ikaros has joined #ocaml
Amorphous has joined #ocaml
acatout_ has joined #ocaml
Jan_Flanders has joined #ocaml
bacam has quit [Read error: 113 (No route to host)]
Pepe_ has quit [farmer.freenode.net irc.freenode.net]
smimram has quit [farmer.freenode.net irc.freenode.net]
palomer has quit [farmer.freenode.net irc.freenode.net]
infoe_ has quit [farmer.freenode.net irc.freenode.net]
Camarade_Tux has quit [farmer.freenode.net irc.freenode.net]
Boney has quit [farmer.freenode.net irc.freenode.net]
jimmyb2187 has quit [farmer.freenode.net irc.freenode.net]
gildor has quit [farmer.freenode.net irc.freenode.net]
safire_ has quit [farmer.freenode.net irc.freenode.net]
Tianon has quit [farmer.freenode.net irc.freenode.net]
diml has quit [farmer.freenode.net irc.freenode.net]
willb has quit [farmer.freenode.net irc.freenode.net]
Pepe_ has joined #ocaml
Tianon has joined #ocaml
smimram has joined #ocaml
palomer has joined #ocaml
infoe_ has joined #ocaml
Camarade_Tux has joined #ocaml
Boney has joined #ocaml
jimmyb2187 has joined #ocaml
gildor has joined #ocaml
safire_ has joined #ocaml
willb has joined #ocaml
diml has joined #ocaml
jimmyb2187 has left #ocaml []
jimmyb2187 has joined #ocaml
spicey has joined #ocaml
<palomer> hmmm
<palomer> I'm using camlp4 to associate every type to a unique integer
<palomer> the problem is that the reference counter will reset after every source file
<palomer> how do I fix this?
<palomer> nevermind, I'll just add a call to generate_unique_id to the source file
<spicey> I'm slightly confused with ocaml packaging. I'm trying to install lwt under arch linux, and it wishes for a react library (ocamlfind ocamldep -package react fails). react from darcs builds nicely and drops itself under /usr/lib/ocaml/react, yet lwt is still dissatisfied, and I'm scratching my head what does it want - some ocamlfind magic maybe?
<mfp> spicey: is react included in ocamlfind list after installing it?
<mfp> (... 's output)
johnnowak has joined #ocaml
johnnowak has quit [Client Quit]
<spicey> no. and, judging from its build script, it doesn't care about ocamlfind at all
<spicey> aha, ocamlfind install react META in its folder does the trick
<mfp> you have to install the cmi, cmxa, etc. too
<spicey> Those files are mentioned in META, aren't they understood automagically?
<mfp> nope
<palomer> how do you do the prototypical "all positive numbers" infinite list in ocaml?
<mfp> spicey: META only indicates which options to pass to ocamlc/opt depending on the active predicates
<spicey> mfp, "ocamlfind install react react.cmi" -> ocamlfind: The META file is missing. it looks like it wants only META?
diml has quit [farmer.freenode.net irc.freenode.net]
safire_ has quit [farmer.freenode.net irc.freenode.net]
gildor has quit [farmer.freenode.net irc.freenode.net]
palomer has quit [farmer.freenode.net irc.freenode.net]
smimram has quit [farmer.freenode.net irc.freenode.net]
Boney has quit [farmer.freenode.net irc.freenode.net]
Camarade_Tux has quit [farmer.freenode.net irc.freenode.net]
infoe_ has quit [farmer.freenode.net irc.freenode.net]
willb has quit [farmer.freenode.net irc.freenode.net]
<mfp> spicey: ocamlfind install react META react.cmi react.cmo react.cmx react.o react.mli
<Alpounet> thelema, cheers!
<spicey> so, the whole point of "ocamlfind install" is just to make a folder under site-lib and copy files there?
<mfp> yes. It also rewrites some stuff in the META and registers the DLLs if needed.
Smerdyakov has joined #ocaml
<mfp> s/yes/essentially/
_andre has quit ["Lost terminal"]
Camarade_Tux has joined #ocaml
Amorphous has quit [Read error: 113 (No route to host)]
<mrvn> re
<Jan_Flanders> Hi, I'm trying to make a minor adjustment to an existing ocaml source file. Someone in another channel gave me a line to make the adjustment but the compiler says: 'syntax error'. :S
<Jan_Flanders> This is the offending line : let table = match read_byte ch with 0x89 -> nread 7; "" | 0x47 -> nread 5; "" | 0xFF -> parse_jpg_table ch
<Jan_Flanders> A bit more script is available here : http://pastebin.com/m362c4ab3
<Jan_Flanders> The entire file can be seen here : http://adnez.game-host.org:8081/ocamlproblem/swfParser.ml
<Jan_Flanders> I don't know any OCaml and was hoping someone could help me out with this. :)
<orbitz> put an 'in' at teh end
<Jan_Flanders> Yeah I tried that. ;)
<Jan_Flanders> I'll do so again and post the error I'm getting when I do so
Amorphous has joined #ocaml
<orbitz> k
<orbitz> lien 18 lokos wrong..
<Tianon> you just made my day, orbitz :)
<orbitz> Tianon: i make everyones day!
<Jan_Flanders> File "swfParser.ml", line 1188, characters 53-54: This expression has type int but is here used with type IO.input
<Jan_Flanders> Is what I get when putting an in at the end
<orbitz> what line is that
<Jan_Flanders> let table = match read_byte ch with 0x89 -> nread 7; "" | 0x47 -> nread 5; "" | 0xFF -> parse_jpg_table ch in
<Jan_Flanders> The same I posted before. :)
efarrar has quit [Read error: 113 (No route to host)]
<orbitz> no, as in pastebin it and mark wehre the error is
<orbitz> pastebin
<orbitz> what type does parse_jpg_table have
<Jan_Flanders> Not sure, that function is also in the paste, or should I be able to find it elsewhere as well?.
<orbitz> uhh line 18 is competley wrong
<orbitz> i think you want ot move the block youa dded to line 13
<Jan_Flanders> By line line 18 you mean | 0x15 -> ?
<orbitz> yes
Smerdyakov has quit ["Leaving"]
demitar has joined #ocaml
smimram has joined #ocaml
palomer has joined #ocaml
infoe_ has joined #ocaml
Boney has joined #ocaml
gildor has joined #ocaml
safire_ has joined #ocaml
willb has joined #ocaml
diml has joined #ocaml
<Jan_Flanders> It's not wrong, but it comes out of a too big part to past which is why I gave you the link to the entire file
<orbitz> yes and i looked at teh etnire fiel
<orbitz> and it is wrong
<Jan_Flanders> line 20 is what it originally was and that worked fine
Amorphous has quit [farmer.freenode.net irc.freenode.net]
jimmyb2187 has quit [farmer.freenode.net irc.freenode.net]
acatout_ has quit [farmer.freenode.net irc.freenode.net]
ikaros has quit [farmer.freenode.net irc.freenode.net]
<Jan_Flanders> in the paste
<Jan_Flanders> But I want to skip the parse_jpg_table when the first byte is not 0xFF
<orbitz> not in the file you gave me
<Jan_Flanders> http://pastebin.com/m1802582f is a better paste
<orbitz> lien 20 does not appear in the orignal file you gave
det__ has quit [Read error: 110 (Connection timed out)]
<spicey> mfp, trying to use something from lwt in toplevel (namely I wanted just to get to try calling Lwt_unix.sleep), I hit the wall: http://codepad.org/fQZMlBU0 am I doing something completely wrong, or is this because I'm trying to use darcs-version, or something else altogether?
<orbitz> it is pare of parse_tag
<orbitz> not parse_jpg_table
<mfp> spicey: #require "lwt.unix";;
ygrek has joined #ocaml
<orbitz> Jan_Flanders: oh, i see what you are tryign to show
<Jan_Flanders> ok good, as it is really in the original. :)
<Jan_Flanders> I can pastebin the original if you like so we have linenumbers with it
det has joined #ocaml
<Jan_Flanders> but no syntax colouring as it will take ages
<spicey> mfp, very nice, thank you (I've never used topfind before)
<mfp> spicey: btw. there's a lwt syntax extension, try #camlp4o;; #require "lwt.syntax";;
<mfp> then you can do open Lwt;; lwt foo = return 1;;
<mfp> lwt x = y in z becomes Lwt.bind y (fun x -> z)
<mfp> also, try_lwt foo with X -> bar is translated to Lwt.catch (fun () -> foo) (function X -> bar | e -> Lwt.fail e)
<mfp> the latter is very convenient
<orbitz> Jan_Flanders: i do not belive read_byte does what you think it does
<orbitz> actually i'm not sure
<orbitz> no type annotation makes it ahrd to tell
Amorphous has joined #ocaml
jimmyb2187 has joined #ocaml
ikaros has joined #ocaml
acatout_ has joined #ocaml
det has quit [Read error: 60 (Operation timed out)]
<Jan_Flanders> maybe I can use nread 1 instead of readByte?
<orbitz> mayeb?
<orbitz> not particuarlly easy to debug without at estcase
<Jan_Flanders> Shot in the dark though since, as I said , I don't know any Ocaml
<orbitz> go back to the author
<Jan_Flanders> Yes I can ask him. Just thought it wouldn't be too hard for anyone familiar with Ocaml, but it's hard to judge for me
<orbitz> Jan_Flanders: actually, you probably ened ()'s around everything with a ;
<orbitz> let table = match .. with num -> (fo; "") | other ..
<Jan_Flanders> let table = match read_byte ch with 0x89 -> (nread 7; "") | 0x47 -> (nread 5; "") | 0xFF -> parse_jpg_table ch in
<Jan_Flanders> like that?
<orbitz> yes
<Jan_Flanders> This expression has type int but is here used with type IO.input
<Jan_Flanders> it's about that line
<orbitz> split it over multiple lines so you know what line it is complaining about
<Jan_Flanders> Sounds so easy and was thinking about it before but I don't know even where I can split. :D
<orbitz> on |'s
<Jan_Flanders> change read_byte to nread 1 ?
<orbitz> but 0x89 -> on a new line too
<Jan_Flanders> Ah ok. Another thing I noticed as well is that all the other nread's have the ch as well likelet data = nread ch (len - 2) in , while the lines I have say: nread 7
TaXules has quit [Read error: 60 (Operation timed out)]
<orbitz> you probably need it too then
<Jan_Flanders> | 0x47 -> (nread ch 5; "") should I put in after each line or is one at the end enough?
<Jan_Flanders> 'in'
<Jan_Flanders> like : | 0x47 -> (nread ch 5 in; "")
<orbitz> uhh no, in is just at the end, in corresponse to let
<Jan_Flanders> ok
snowbeard has joined #ocaml
demitar has quit [Read error: 110 (Connection timed out)]
ccasin has joined #ocaml
<orbitz> you need to surround each nread with a let _ = nread .. in "" prob easiet way
<orbitz> i forget if there is an easy way to through out data form a non ()
<Jan_Flanders> | 0x47 -> (let_ = nread ch 5; "")
<Jan_Flanders> like that? :s
<Jan_Flanders> _ means 'don't care'?
<orbitz> 0x47 -> let _ = nread ch 5 in ""
<Jan_Flanders> ok thnx I'll try
<Jan_Flanders> File "swfParser.ml", line 1188, characters 15-145: Warning: this pattern-matching is not exhaustive. Here is an example of a value that is not matched: 0
<Jan_Flanders> let table = match read_byte ch with
<Jan_Flanders> Just ignore the warning?
slash_ has joined #ocaml
<orbitz> what do you want to do in the case of another value?
<orbitz> if so, handle it
<Jan_Flanders> in the case of another value it should fail
det has joined #ocaml
<orbitz> Jan_Flanders: then at end | _ -> raise (Failure "ZOMG I DUNNO WTF JUST HAPPEND")
<Jan_Flanders> http://pastebin.com/m40e05ba0 like it does here or somehow
<Jan_Flanders> ah ok I'll try yours first
<Jan_Flanders> Ignoring the warning lead to other errors btw
<Jan_Flanders> anything I put there gives me syntax error
<orbitz> show me
<Jan_Flanders> | _ -> raise (Failure "ZOMG I DUNNO WTF JUST HAPPEND") just gives 'syntax error'
<orbitz> full context please
<orbitz> | 0xFF -> parse_jpg_table ch in
<orbitz> is wrong
<orbitz> in corresponds to let
<orbitz> you have no let here
<orbitz> nor do you need one
<orbitz> just remove the in
<orbitz> that in probably correspond to let table
<orbitz> so you still need a in
<Jan_Flanders> maybe it's easier to change the parse_jpg_table function itself?
<orbitz> what?
<orbitz> you just need to move the 'in' to the end..
<Jan_Flanders> ah ok
TaXules has joined #ocaml
<Tianon> orbitz: regarding throwing out data from a non-unit, just use ignore: ignore ("anything") or ignore (some_function "") -- ignore will return unit
<Jan_Flanders> it compiles without warnings or errors but the changes apparently break other stuff.
<orbitz> ah ok
_unK has quit [Remote closed the connection]
<Tianon> I'm pretty new to OCaml myself, but that's one I know :)
<Jan_Flanders> Thanks for helping orbitz, but I guess this is a too complicated script
<Jan_Flanders> It fails very early on now.
ksson has joined #ocaml
Deformative has quit [Read error: 60 (Operation timed out)]
Alpounet has quit [Read error: 60 (Operation timed out)]
Alpounet has joined #ocaml
<rwmjones> Jan_Flanders, are you using an editor which understands ocaml, indentation etc? it really helps when writing code ...
<palomer> emacs!
<rwmjones> for example, it looks like you're missing a close paren at the end
<rwmjones> well indeed, emacs + tuareg mode is great
<Jan_Flanders> no I'm not unfortunately. I was only changing 1 line of code anyway
<Jan_Flanders> I do use eclipse for java, flashdevelop for actionscript etc. I just use notepad++ for Ocaml
<Jan_Flanders> But all the Ocaml looks like Chinese to me, I have absolutely not a single clue what it all does. I had hoped I would be able to change just 1 line of code, but even that seems like quite a feat.
<Jan_Flanders> I code in several others languages but none of them are functional and none have a syntax even near what Ocaml has
<mrvn> Jan_Flanders: ocaml is functional and use type inference. That usualy means you spend 50% of your time writing code, 50% fixing compiler/type errors and then 10% to fix bugs in your algorithm.
<Jan_Flanders> I mostly code in haXe which has type inference as well. It's a nice thing when writing code, but when working with someone else it's a pita as you don't know any of the datatypes
<Jan_Flanders> I usually put in some error just to get a compiler error telling me what datatype it expects
<Jan_Flanders> orbitz thanks for all the help and effort. :)
<palomer> I sometimes most of the posts on caml-list come from jon harrop using different names
ygrek has quit [Remote closed the connection]
<palomer> sometimes think
<Jan_Flanders> bbl my stomach and brain needs food.
<palomer> anyone know how to package my ocaml library in a deb?
itewsh has quit ["There are only 10 kinds of people: those who understand binary and those who don't"]
<mrvn> palomer: take an existing ocaml lib package, rename and edit
valross has joined #ocaml
Snark has quit ["Ex-Chat"]
<palomer> mrvn, that's what I was thinking
<palomer> but that involves getting the files in the deb
<mfp> palomer: nope, you have to take the *source* package
<mfp> dl the source package -> [ounit_1.0.3-5.dsc] [ounit_1.0.3.orig.tar.gz] [ounit_1.0.3-5.diff.gz]
<mfp> either unpack with dpkg-source -x ounit_1.0.3-5.dsc or untar & apply the patch
<mfp> then look at ounit-1.0.3/debian
<ksson> if you have debian: apt-get source ounit
<palomer> source package?
<palomer> doesn't that contain the source?
<palomer> ah, so you're suggesting I only provide a source package?
<ksson> no, but in the sources (of ounit, for example) you can look at how it is done
<palomer> the libounit-ocaml-dev source package is a bunch of .ml files, a META, and a Makefile
<palomer> I see nothing debian specific
<ksson> there is a debian/ dir
<palomer> ounit_1.0.3.orig.tar.gz <--I can't find a debian dir in that file
<ksson> do you have a debian system?
<palomer> oh, it's in the diff maybe
<ksson> then try the "apt-get source" trick
<ksson> yes, it might be in the diff
<ksson> (i don't know much about debian packaging, but i guess the magic is in the debian/ subdir :))
<ksson> you also can just release a .tar.gz, and some day the debian developers will make a package of it
<ksson> they do a really good job
<palomer> yeah, it's in the diff
<bluestorm> btw, if you're interested in testing, you should give a look at Kaputt and siblings
<bluestorm> QuickCheck-like goodness coming for OCaml, only waiting for wider adoption
<palomer> ah, the good old days of quickcheck
<palomer> the debian directory contains loads of files
snowbeard has quit [Remote closed the connection]
snowbeard has joined #ocaml
snowbeard has left #ocaml []
stan__ has joined #ocaml
_unK has joined #ocaml
ksson has quit ["leaving"]
efarrar has joined #ocaml
nagnatron has joined #ocaml
Deformative has joined #ocaml
bacam has joined #ocaml
slash_ has quit [Client Quit]
Pimm has quit [Read error: 110 (Connection timed out)]
Deformative has quit [Read error: 110 (Connection timed out)]