mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
<palomer_> class virtual ['a] variable_number_of_children = <--how do I say that 'a has to be a subclass of Foo ?
<qwr> palomer_: is this really possible?
<palomer_> err, of foo
<palomer_> I'm asking!
<qwr> ;)
<thelema> constraint
<palomer_> where do I put the constraint?
* thelema looks up the syntax
<thelema> instead of a method. class ['a] vnoc = class constraint 'a = #foo end
LordMetroid has quit [Read error: 110 (Connection timed out)]
<palomer_> instead of a method/
<palomer_> ?
<thelema> you put it in the middle, with the methods...
<palomer_> gotcha!
<palomer_> thx!
lordmetroid__ has joined #ocaml
jprieur has quit ["Connection reset by beer"]
LordMetroid has joined #ocaml
mbishop_ has quit [Read error: 113 (No route to host)]
mbishop_ has joined #ocaml
lordmetroid_ has quit [Read error: 110 (Connection timed out)]
evn has joined #ocaml
lordmetroid__ has quit [Success]
prince has joined #ocaml
coucou747 has quit ["bye ca veut dire tchao en anglais"]
thermoplyae has joined #ocaml
Oatmeat has joined #ocaml
Oatmeat has quit [Remote closed the connection]
mbishop_ has quit [Read error: 113 (No route to host)]
mbishop_ has joined #ocaml
adu has joined #ocaml
magnus_ has joined #ocaml
<palomer_> module A (X: sig type t:>f end) = <--how do I define a functor like this?
<thelema> X : sig type t constraint t = #f end
<thelema> ??
<palomer_> so I have to use constraints, eh?
<thelema> :> definitely isn't allowed in a module type.
<thelema> you can use 'X with type x = #f' to add a constraint to an existing module type
<Ramzi> alright thelema, thank you for your help.
<Ramzi> peace.
<thelema> cheers
Ramzi has quit ["http://irc.netsplit.de/"]
thermoplyae has left #ocaml []
<palomer_> class ['a] variable_number_of_children = class constraint 'a = term end <-- I tried putting this where I would usually put a method, and I get a syntax error
<thelema> object ['a] vnoc = class constraint 'a = foo end
<thelema> object ['a] vnoc = object constraint 'a = foo end
<thelema> class ['a] vnoc = object constraint 'a = foo end <- 3rd time's the charm
<palomer_> oh, so I should type constraint 'a = foo
<palomer_> Smerdyakov, I remember you saying that you didn't like type constraints. am I mistaken?
adu has quit [Remote closed the connection]
electron_x has joined #ocaml
adu has joined #ocaml
<thelema> palomer_: no, you need class xxx = object blah end
<Smerdyakov> palomer_, they have funny semantics.
<electron_x> just wandering how does ocaml compare to haskell?
<mbishop_> it's a lot less lazy :)
<electron_x> i'm thinking of making a big app in haskell would ocaml be better?
<thelema> electron_x: I'm sure the haskell people would tell you haskell is fine for big apps. And asking in this channel, you'll get a more ocaml-positive view.
hsuh has joined #ocaml
<mbishop_> I think the real question is, what kind of application?
LordMetroid has quit ["Leaving"]
<palomer_> imho, ocaml is easier to learn
<electron_x> is it better suited for large apps?
<palomer_> I don't think you can answer that question without knowing what kind of app
<mbishop_> I suppose ocaml is slightly more suited for larger applications, given the object oreinted features, but I think pretty much any language is well suited for large apps, personally
seafood_ has joined #ocaml
<palomer_> hrmphh
<palomer_> double hrmphhh
jaked1 has joined #ocaml
<qwr> nice
postalchris has joined #ocaml
* qwr got ocaml type checker to create a stack overflow ;)
postalchris has quit [Client Quit]
<qwr> # type 'a tb = #zz as 'b constraint 'a tb = 'b;;
<qwr> (#zz can be replaced with something else)
mbisho has joined #ocaml
<qwr> palomer_: btw, type 'a tz = #zz as 'b constraint 'b tz = 'a;; works for "subtyping" relation type
electron_x has left #ocaml []
<qwr> (or type 'a tz = #zz 'a constraint 'a tz = 'a)
* qwr wonders, if that can be written somehow simpler
<qwr> err, type 'a tz = #zz as 'a constraint 'a tz = 'a
<qwr> (actually its imho a constraint of having methods of zz - structural typing)
ramkrsna has joined #ocaml
mbishop_ has quit [Read error: 110 (Connection timed out)]
<qwr> hmm, simpler is type 'a t = 'a constraint 'a = #zz;;
* qwr finally got what was going on...
<palomer_> hrmmmmmmmmph
<palomer_> I managed to fudge it so I don't have to use constraints
evn has left #ocaml []
<palomer_> I don't like it though
<palomer_> ok, time to bring out the big guns
<palomer_> functor time!
hsuh has quit ["boring"]
jlouis has quit ["Leaving"]
* palomer_ considers sticking everything in the base class
<palomer_> it would be deliciously evil
johnnowak has joined #ocaml
mbisho is now known as mbishop
^authentic has joined #ocaml
adu has quit ["Bye"]
authentic has quit [Read error: 110 (Connection timed out)]
^authentic is now known as authentic
Jeff_123 has joined #ocaml
<Jeff_123> Is anyone here who could give me some pointers in camlp4?
<Jeff_123> I'd like to augment the lexer if possible.
<Jeff_123> specifically, a token like 0x123LU I would like to become (UInt64.of_string "0x123LU")
derenrich has joined #ocaml
<derenrich> Since ocaml doesn't incase functions in brackets or some other characters how does it know when I'm done defining the function and am now writing something else?
<Jeff_123> because you've typed a keyword such as "let" or "type"
<Jeff_123> or you can end your function in ;;
<Jeff_123> OR you can enclose the function body in ( )
johnnowak has quit []
* palomer_ notices that caml4p is more and more popular
<Jeff_123> it'd be even MORE popular if I could find some good documentation and/or tutorials
<Jeff_123> ie for version 3.10
|Catch22| has quit ["To the best of my knowledge, I guess that I'm fresh"]
derenrich has quit ["ChatZilla 0.9.81 [Firefox 3.0b5/2008040514]"]
ramkrsna has quit [Read error: 110 (Connection timed out)]
<thelema> Jeff_123: ocaml-tutorial.org - manual at http://caml.inria.fr/pub/docs/manual-ocaml/index.html
<Jeff_123> the official camlp4 manual is out of date
<Jeff_123> I've looked at caml-tutorial but couldnt' find an example of extending caml's lexer
<Jeff_123> thanks for trying though
mbishop_ has joined #ocaml
<Jeff_123> it looks like what I want to make is a "quotation expander"
mbishop has quit [Read error: 110 (Connection timed out)]
ramkrsna has joined #ocaml
thelema has quit [Read error: 110 (Connection timed out)]
<Jeff_123> this is something like what I'm looking for http://brion.inria.fr/gallium/index.php/Quotation
Jeff_123 has quit []
Yoric[DT] has joined #ocaml
kelaouchi has joined #ocaml
ramkrsna has quit ["Leaving"]
ramkrsna has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
kappa has joined #ocaml
<kappa> hello, can anyone kindly point me an example of camlidl + caml COM component + returning array of strings (and how to clean it up later)
<kappa> apparently, the example from the manual (returning array of doubles doesn't work...
<kappa> the examples in the distribution deal only with basic return types. There is also an example with returning string and it works (but looks like a memory leak)
<kappa> And - does anybody know what are the chances for unicode_patch to make it way in trunk?
ramkrsna has quit ["Leaving"]
mwc has joined #ocaml
thelema has joined #ocaml
<kappa> ok, camlidl_malloc allocates with CoTaskMemAlloc so CoTaskMemFree is ok to use but nevertheless some small leak remains somewhere
<kappa> aha, sorry, thats not a leak, Gc.full_major sorts it out. So I am almost happy :)
coucou747 has joined #ocaml
^authentic has joined #ocaml
schme has joined #ocaml
seafood_ has quit []
authentic has quit [Read error: 110 (Connection timed out)]
^authentic is now known as authentic
schme has quit [Remote closed the connection]
schme has joined #ocaml
kappa_ has joined #ocaml
kappa has quit [Remote closed the connection]
filp has joined #ocaml
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
glenker has left #ocaml []
Tetsuo has joined #ocaml
hkBst has joined #ocaml
OChameau has joined #ocaml
mfp_ is now known as mfp
LordMetroid has joined #ocaml
rwmjones has quit [Read error: 110 (Connection timed out)]
rwmjones has joined #ocaml
debian_42 has joined #ocaml
<debian_42> ow does every week on debian shootout ocaml keep getting sloer and Haskell GHC keeps getting faster
<debian_42> someone needs to update that stuff and optimize the examples or something
magthe has joined #ocaml
<debian_42> how in the world
<debian_42> in the extra language gentoo GHC is above ocaml and in this oen its way below
<debian_42> these are both i686 processros i dont get it
ikaros has joined #ocaml
schme has quit [Remote closed the connection]
schme has joined #ocaml
goalieca has quit [Remote closed the connection]
schme has quit [Client Quit]
schme has joined #ocaml
schme has quit [Remote closed the connection]
schme has joined #ocaml
schme has quit ["bfirc sucks."]
schme has joined #ocaml
yangsx has quit [Read error: 110 (Connection timed out)]
<mwc> debian_42, haskell has a bigger community, so more people hack on those examples
<mwc> of course, the haskell crowd would say that the semantics of haskell let the compiler do insanely scary optimizations to the code
mwc has quit ["Leaving"]
schme has quit ["bfirc dans ta gueule."]
<debian_42> well out of all 4 of those benchamrks hskell only does well on 2 of them on the other 2 ocaml beati t by a very large margin
schme has joined #ocaml
<qwr> debian_42: those haskell examples source are imho optimized by looking the generated assembler code
<debian_42> qwr: yea im sure i just htink its a bunch of propaganda something goes from spot 30 to spot 10 in matter of days
<qwr> debian_42: somewhat. you should take those with some salt ;)
<qwr> debian_42: those optimised examples show how fast the language can be, if you really try to make the code fast
<qwr> debian_42: as not all languages examples are not so optimised, its somewhat unfair
<qwr> debian_42: but if you allow +/- 10 position error or look what runtimes are in same speed class, you get approximate idea of how fast some languages tend to be
<qwr> debian_42: if you just write normal code (and casually mix imperative/functional styles in ocaml), I'd think that ocaml is usually faster than haskell
<qwr> debian_42: for pure functional code haskell probably beats ocaml
Demitar has quit [Read error: 110 (Connection timed out)]
<qwr> (haskell's problem for me is, that I predict very little it's memory use/thunking - applicative order seems easier to predict when writing code)
<qwr> but often i don't care either...
<debian_42> qwr: how about OO style ?
<debian_42> benchamrks can give you a good idea if the lang is fast or if its a slow like javascrit or something
<debian_42> but i hate how people treat it like competition
<debian_42> i know the hwole point o ocmal is functional tuff but i really like oo style programming and a little imperative
<debian_42> althohg ive been getting into functionl more recently
<qwr> I don't know, but i suspect ocaml OO calls a much slower than C++/D, and probably slower than non-interface method calls in jvm
<debian_42> ah yea
<qwr> debian_42: basically - with D or single inheritance C you can just take index in method table
<debian_42> you liek the D lanugae ?
<debian_42> typos
<qwr> debian_42: on ocaml you have structural typing
<qwr> debian_42: yes D as languagage
<qwr> debian_42: which at runtime is basically duck typing... unless you specialise
<debian_42> i wonder if objective C is any good
<debian_42> dont har much about that one
<debian_42> if im not mistaken objective c is an apple thing
<qwr> don't know. if you want static type checks, then objective C probably sucks ;)
<qwr> (static as compile-time ;))
<schme> debian_42: how abouts smalltalk if you like the OO?
<debian_42> schme: i never liekd smalltalk to be honest
<debian_42> nor any of its implmentations
<schme> I hear ya. :)
* qwr misread the liek D question.
<debian_42> oh sorry
<debian_42> typos :P
<debian_42> yea i think D has a very good future
<debian_42> I've used it a little
<qwr> debian_42: D is much like C#/java imho. although without vm and faster
<debian_42> yea cool stuff
<debian_42> you like scritping laanguages ?
<debian_42> wow scripting*
<qwr> debian_42: but I don't really understand why I should use D when I can ocaml (unless I really want easier C function usage)?
<debian_42> just flip a coin
ikaros_ has joined #ocaml
<debian_42> both great languages
<qwr> debian_42: perl is good for writing small scripts :P
<debian_42> perl is my least fav scripting lang
<debian_42> its dead lol
<debian_42> ruby is also not very good and of course Python for the win!
<debian_42> php is also good for web, what it was designed for
<qwr> if i want to write larger script, i would probably take haskell ;)
<debian_42> then you have ot use finctional though
<qwr> and web... is it really scripting?
<debian_42> functional*
<debian_42> yea
<qwr> debian_42: few monads won't kill... and haskell has almost usable standard library
<debian_42> web is scripting
* qwr . o O ( ocsigen could be fun for web... currently i'm stuck with bastardised jvm web shit though. )
<debian_42> you use java for web ?
Tetsuo has quit ["Leaving"]
<qwr> debian_42: client requirements about running in java application servers
<debian_42> i would rather write a site in C then java
<qwr> C would suck more there
<debian_42> why not use php ?
<debian_42> or python or heh even ruby
<qwr> debian_42: jruby could be option ;)
<debian_42> lol
<debian_42> use jython first
<qwr> debian_42: but currently i use just build-time java code generation
<debian_42> i know nothingabout java never even looked into the basics of it
ikaros has quit [Read error: 110 (Connection timed out)]
<debian_42> now i do like javascript lol
<qwr> runtime type errors suck on big systems ;)
<debian_42> i could never even get past the bloated jvm they distribute ofr windows
<debian_42> not sure baout their server solutions
<debian_42> about*
det has quit [Remote closed the connection]
<qwr> debian_42: weblogic appserver takes about 800MB memory on my workstation. and about 400MB disk
* qwr hopes that info encourages you :P
<debian_42> lol
<debian_42> what is it running ?
<qwr> parts of one customs system?
<qwr> (for development)
<qwr> anyway the ocsigen examples look nice: http://www.ocsigen.org/tutorial1.0.0-1#p1moreexamples
* qwr likes that web page parts seem to be nicely composable there
ikaros_ has quit ["segfault"]
mikeX has quit ["leaving"]
<debian_42> qwr: functional is good but the reusability of OO is un deniable
m3ga has joined #ocaml
* qwr wonders, when i really denied it?
<debian_42> qwr: no you didn't i was just stating hehehe
kappa__ has joined #ocaml
<qwr> although, OO is good at limited domains
<qwr> mostly those, where composite pattern applies
Linktim has joined #ocaml
LordMetroid has quit ["Leaving"]
<qwr> (and functionally are closures equivalent to OO - just different tradeoffs)
kappa has joined #ocaml
<debian_42> qwr: yea but i dont do anything that serious programming wise so OO stuff has always worked for me pretty well
<qwr> debian_42: I tend to use very much interfaces with one method in java, and those would be more natural to express as functions
<debian_42> yea
<debian_42> qwr: im done learning new langauges for now maybe someday java might be worth a look
<qwr> debian_42: compared to D/Ocaml imho only interesting staff in java is runtime reflection/bytecode generation and loading bytecode modules in runtime
<qwr> (and you can load modules at runtime in ocaml too. probably also in D with dlopen tricks - although that would be quite unsafe)
Linktim_ has joined #ocaml
Linktim- has joined #ocaml
zenhacker_rouan has joined #ocaml
<zenhacker_rouan> hi everyone
<zenhacker_rouan> does ocaml support vectors
<zenhacker_rouan> resizeable arrays
<m3ga> have a look at DynArray in ExtLib
<zenhacker_rouan> m3ga: thnx
<zenhacker_rouan> also, does the $MB limit for arrays still exist
<m3ga> there is a limit, i forget what it is. its rather low on 32 bit but not a problem on 64 bit
kappa__ has quit [Remote closed the connection]
schme has quit [Remote closed the connection]
kappa_ has quit [Remote closed the connection]
<zenhacker_rouan> m3ga: thnx
Linktim has quit [Read error: 110 (Connection timed out)]
<rwmjones> it's 16 megabytes for strings and arrays on 32 bit platforms, effectively unlimited on 64 bit
<m3ga> limited by 'you can't afford to buy enough memory to hit the limit' :-)
<zenhacker_rouan> rwmjones: thnx
Linktim_ has quit [Read error: 110 (Connection timed out)]
coucou747 has quit ["bye ca veut dire tchao en anglais"]
coucou747 has joined #ocaml
seafood_ has joined #ocaml
kappa has quit [Remote closed the connection]
Linktim_ has joined #ocaml
kappa has joined #ocaml
Linktim- has quit [Read error: 110 (Connection timed out)]
Linktim has joined #ocaml
hsuh has joined #ocaml
kappa_ has joined #ocaml
Linktim_ has quit [Read error: 110 (Connection timed out)]
m3ga has quit ["disappearing into the sunset"]
Linktim_ has joined #ocaml
zenhacker_rouan has left #ocaml []
hsuh has quit ["work"]
Linktim- has joined #ocaml
RobertFischer has joined #ocaml
Linktim has quit [Read error: 110 (Connection timed out)]
kappa has quit [Remote closed the connection]
Linktim_ has quit [Read error: 110 (Connection timed out)]
vincenz has quit [Remote closed the connection]
bluestorm has joined #ocaml
Linktim_ has joined #ocaml
Linktim- has quit [Read error: 110 (Connection timed out)]
<RobertFischer> Somewhere there's a variable interpolation camlp4 script kicking around. Anyone have it?
Linktim has joined #ocaml
<bluestorm> RobertFischer: variable interpolation ?
<RobertFischer> Yeah. Dropping variables into strings.
<RobertFischer> Well, into string literals, to be more precise.
<bluestorm> i'm afraid i don't see how you could use that
det has joined #ocaml
<RobertFischer> Assuming the variable was a string, it's not too hard.
<RobertFischer> At least, the concept is pretty simple.
<flux> some people just prefer the ever-so-slightly more succinct "Hello ${name}, you are ${string_of_int age} years old" notation
<flux> perhaps if you drop the {}'s it's even shorter, but then you lose the capability to embed expressions
<flux> the module does exist, I've seen it, but I don't know if it's been upgraded for 3.10.x
<RobertFischer> Yeah. The concept is something like: Grep for #{\w+} in strings, and replace it with the construct " ^ $1 ^ ".
<RobertFischer> I don't care if it's been upgraded. I'm just using it as part of a blog post to show that syntax experimentation and customization isn't limited to dynamic languages.
<flux> well, google for it :)
<RobertFischer> Will do.
<RobertFischer> I was hoping someone just had it on their desk.
TaXules has quit [Remote closed the connection]
seafood_ has quit []
Linktim_ has quit [Read error: 110 (Connection timed out)]
TaXules has joined #ocaml
<bluestorm> sorry, i just didn't know what you were talking about
<RobertFischer> bluestorm: Thank you very much!
Linktim has quit [Read error: 110 (Connection timed out)]
<flux> hm, I could see that include_file -feature being useful writing cgis
Tetsuo has joined #ocaml
jlouis has joined #ocaml
seafood_ has joined #ocaml
delamarche has joined #ocaml
ttt-- has joined #ocaml
seafood_ has quit []
seafood_ has joined #ocaml
ikaros has joined #ocaml
seafood_ has quit []
kappa_ has quit [Remote closed the connection]
ikaros has quit [Client Quit]
ikaros has joined #ocaml
seafood_ has joined #ocaml
seafood_ has quit [Client Quit]
delamarche has quit [Read error: 104 (Connection reset by peer)]
delamarche has joined #ocaml
sporkmonger has quit [Read error: 104 (Connection reset by peer)]
sporkmonger has joined #ocaml
Morphous has joined #ocaml
ygrek has joined #ocaml
ygrek has quit [Client Quit]
Yoric[DT] has joined #ocaml
ygrek has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
RobertFischer has quit []
thelema has quit [Read error: 110 (Connection timed out)]
pango_ has quit [Remote closed the connection]
<hcarty> bluestorm: I would like to (try to) make a Bigarray sub and slice extension, something to do the following: http://ocaml.pastewith.us/60
<hcarty> Does this seem like a reasonable undertaking for a person new to camlp4
<hcarty> ?
<hcarty> Mistype in there... http://ocaml.pastewith.us/61 is fixed
pango_ has joined #ocaml
ikaros has quit ["segfault"]
^authentic has joined #ocaml
ikaros has joined #ocaml
ttt-- has quit [Read error: 110 (Connection timed out)]
authentic has quit [Read error: 110 (Connection timed out)]
^authentic is now known as authentic
Snrrrub has quit [Read error: 110 (Connection timed out)]
RobertFischer has joined #ocaml
<bluestorm> hcarty: seems reasonable, yes
<bluestorm> however, are you sure that it doesn't conflict with an existing notation ?
<bluestorm> hum
<bluestorm> seems ok
<bluestorm> hm
<bluestorm> hcarty: handling _ in expressions is not so easy actually
<hcarty> bluestorm: I don't think it conflicts
<bluestorm> i think that for a first try you should try something that is already a valid expression, like ()
<bluestorm> ba.{3, ()} instead of ba.{3, _}
<hcarty> I remember you mentioning some trickery to get _ to work in one of your extensions
<bluestorm> yes
<bluestorm> but i'm still not sure it's the best way to go, and definitely not the simplest at first :p
<hcarty> It is something that would be very useful for what I am doing now, so I thought I would ask and take a look
<bluestorm> (see http://bluestorm.info/camlp4/pa_holes.ml.html , i use an AstFilter)
<bluestorm> the idea is to allow "_" in all expressions, not only the specific syntax of mine
<bluestorm> then, after the syntaxic transformation (that removed the _ in the "good places"), i use a filter to spot any abusive use of _ outside my defined syntax, and fail at camlp4-time
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
ygrek has quit [Client Quit]
ikaros has quit [Read error: 104 (Connection reset by peer)]
ygrek has joined #ocaml
olleolleolle has joined #ocaml
Jedai has quit [Remote closed the connection]
olleolleolle has left #ocaml []
|Catch22| has joined #ocaml
marmottine has joined #ocaml
ikaros has joined #ocaml
ikaros_ has joined #ocaml
magthe has quit ["Ex-Chat"]
thelema has joined #ocaml
^authentic has joined #ocaml
jonafan is now known as jonathansreallyo
jonathansreallyo is now known as jonafan
kotarak has joined #ocaml
kotarak has quit [Client Quit]
kotarak has joined #ocaml
ikaros has quit [Read error: 110 (Connection timed out)]
authentic has quit [Read error: 110 (Connection timed out)]
^authentic is now known as authentic
ikaros_ has quit [Remote closed the connection]
ppsmimou has quit ["Leaving"]
jules_ has joined #ocaml
RobertFischer has quit ["Taking off -- check out http://smokejumperit.com and http://enfranchisedmind.com/blog/"]
mbishop_ is now known as mbishop
sporkmonger has quit []
sporkmonger has joined #ocaml
filp has quit ["Bye"]
sporkmonger has quit [Client Quit]
sporkmonger has joined #ocaml
ttt-- has joined #ocaml
marmottine has quit [Remote closed the connection]
psnively has joined #ocaml
^authentic has joined #ocaml
OChameau has quit ["Leaving"]
jules_ has left #ocaml []
jules_ has joined #ocaml
Linktim has joined #ocaml
<psnively> Hello, all.
debian_42 has quit ["Leaving."]
<sporkmonger> i tried calling open_out "~/.somefile" and it threw a Sys_error("~/. somefile: No such file or directory")
<sporkmonger> does ocaml not understand ~ in filenames?
<psnively> No. Nor do most languages.
<sporkmonger> ruby does :-(
<psnively> That is a UNIX shell construct.
<sporkmonger> ok... is there a way around that?
<psnively> I would argue that that's a flaw (that is, if you want globbing, use a globbing module).
<psnively> Lessee here...
<psnively> There appears to be globbing support in http://raevnos.pennmush.org/code/annexlib/index.html
<sporkmonger> i also need to accept input from users, and they have to be able to use the ~ syntax so
authentic has quit [Read error: 110 (Connection timed out)]
^authentic is now known as authentic
<bluestorm> sporkmonger: Unix.getenv "HOME" ?
<sporkmonger> well, that's kind what i was getting at
<sporkmonger> i don't think that works
<psnively> Yeah, you want a shell-style globbing module.
<sporkmonger> ^ what he said
<psnively> I confess to never having used AnnexLib, so YMMV.
<sporkmonger> i was sort of hoping there might be a globbing function somewhere in the Unix module :-(
<sporkmonger> what about Unix.openfile?
<psnively> Not AFAIK.
<sporkmonger> huh...
<sporkmonger> # Unix.openfile "~/.profile";;
<sporkmonger> Reference to undefined global `Unix'
<sporkmonger> am i missing something?
<jules_> forgot #load "unix.cma"?
<sporkmonger> sure, cept it's only forgetting if you knew to do that at some point in the past :-D
<psnively> ==
<psnively> Welcome, newbie. ;-)
<psnively> Anyway, I just looked at AnnexLib's glob module, and basically it does glob syntax -> regular expression compilation, using either OCaml's built-in Str module, or the more efficient third-party PCRE module.
<psnively> What you do with the regex then is up to you.
ttt-- has quit [Read error: 110 (Connection timed out)]
<gildor> you can try fileutils glob
Linktim has quit [Read error: 110 (Connection timed out)]
|Catch22| has quit ["To the best of my knowledge, I guess that I'm fresh"]
<psnively> Wow. Never heard of ocaml-fileutils before.
<psnively> Thanks!
<gildor> #require "fileutils";;
<gildor> filter (Match ".*-agent") (ls ".");;
<gildor> But this is maybe not what you are expecting (not a real glob)
<sporkmonger> i'm pretty sure what i really want is something like
<psnively> Couldn't hurt to try it.
<sporkmonger> expand_path "~/.profile" -> "/users/sporkmonger/.profile"
<gildor> next version
<psnively> Heh
Linktim has joined #ocaml
<gildor> ;-)
<sporkmonger> doesn't help me today :-(
<psnively> No, it doesn't.
<gildor> sorry
<psnively> gildor, can you bump up the priority of that work? You have a customer. :-)
<flux> that annex seems to have a pretty useful set of functions
Linktim has quit [Remote closed the connection]
<gildor> submit the bug to my bug tracking, will do it when i will have release the new version of ocaml-gettext
<gildor> sorry for cutting the discussion, i need to go
<sporkmonger> yay
<sporkmonger> UnixExtras.tilde_expand
^authentic has joined #ocaml
<sporkmonger> good enough
<psnively> UnixExtras?
<psnively> Oh, in AnnexLib.
<psnively> Nice.
bluestorm has quit [Remote closed the connection]
<sporkmonger> bleh
<sporkmonger> knew that was gonna bite me
<sporkmonger> ok
<sporkmonger> so i bought a new laptop yesterday
<sporkmonger> went to compile ocaml
<sporkmonger> make world went fine
<sporkmonger> but make opt died
<pango_> zsh allows to define extra ~ aliases. For example, I use ~doc for /usr/share/doc and ~ocaml for `ocamlc -where`. But I don't expect either to work in configuration files ;)
<sporkmonger> so i have a half-working install of ocaml
<psnively> sporkmonger: Bleah.
<sporkmonger> mhmm
<sporkmonger> so ocamlopt doesn't work
<sporkmonger> and thus, findlib won't compile
<sporkmonger> so anyone know what's causing this:
<psnively> Yes: You're building an outdated version of OCaml on Intel Leopard. :-)
<psnively> Actually, just Leopard, Intel or not.
<sporkmonger> ugh
goalieca has joined #ocaml
<sporkmonger> grumblecakes...
<psnively> I recommend 3.10.2 and following the "Getting Started on Mac OS X" instructions on the Wiki to build using the Tk framework.
<sporkmonger> i guess that's going to put the kibosh on playing with jocaml
<sporkmonger> at least on this box
<psnively> No it isn't. I play with JoCaml on Leopard.
<sporkmonger> isn't jocaml 3.10.0 still?
<psnively> Yes. You can specify an ocamlc and standard library to use, and it will just warn you about the version mismatch.
<sporkmonger> oh ok
<sporkmonger> i knew it complained, didn't realize it was just a warning
<psnively> Well, you ARE taking a risk, but AFAICT, the risk shows up in the usual way (that is, "conflicting assumptions" about modules with differing MD5 hashes).
<psnively> It hasn't bitten me yet, but I'm hardly stressing it, either.
<sporkmonger> k
musically_ut has joined #ocaml
<sporkmonger> well, i'm a way from doing anything tricky with jocaml
<psnively> Likewise.
<sporkmonger> still working on just getting stuff working normally in regular ocaml
<psnively> I remember that stage well. :-)
<psnively> I find OCaml quite addictive. If you aren't already, I highly recommend using Tuareg Mode in EMACS, and OMake for building.
<sporkmonger> OMake?
<psnively> Once you get a bit further along, Tuareg Mode + OMake -P are REALLY nice.
<sporkmonger> i've got a simple shell script build right now
<psnively> Nice thing about Tuareg + OMake -P: trying out some code by typing it into a source file, executing the line you just typed with a keystroke, and having OMake -P keep your build up-to-date when you save the buffer.
<psnively> Very slick.
<psnively> (OMake -P monitors the filesystem for changes and rebuilds.)
<jules_> how do I run a glcaml example, like this: http://glcaml.sourceforge.net/lesson07.ml.html? I don't know which arguments ocamlopt/c needs to compile a program that needs glcaml. The examples do work (they are compiled when you compile glcaml), but I don't know how to do it myself.
<psnively> It's a very nice blend of interactive development plus binary build.
<sporkmonger> behind the scenes, what is tuareg doing?
<jules_> tuareg is an editing mode for emacs
<sporkmonger> i know
<psnively> Nothing; it's just a very nice EMACS mode with essentially the usual "run toplevel as a subprocess" integration.
<sporkmonger> ok
<sporkmonger> so there's nothing stopping me from running OMake -P with textmate + toplevel in terminal?
<psnively> jules_: Good question. I'm actually digging into evolving lablgl as a side project.
<psnively> sporkmonger: Nope. Let me know how that works out. :-)
<sporkmonger> sure
<sporkmonger> yeah, i like emacs for when i'm sshed into something
<sporkmonger> but i generaly find it easier to modify tm bundles than emacs elisp
<jules_> psnively, do you mean bringing lablgl up to date to the latest opengl standard?
<sporkmonger> lower barrier to entry
rhar has joined #ocaml
LordMetroid has joined #ocaml
authentic has quit [Connection timed out]
^authentic is now known as authentic
<sporkmonger> grr @ omake install bootstrapping
<psnively> jules_: Yes, among other things.
<sporkmonger> i hate being surprised by packaging that don't use configure/make
<jules_> have you been able to compile a basic glcaml program?
<psnively> There's quite little configure/make in the OCaml world.
<psnively> I actually haven't looked at glcaml... the thin-wrapper/non-typesafe stuff makes it pretty much a non-starter for me.
<sporkmonger> i guess i just like packages that don't make me read INSTALL
<psnively> So this one will take another 60 seconds of your time... ;-)
<flux> I'm thinking not many non-C use "the real configure"; however, I wouldn't mind if they did provide the script 'configure' for doing some configure-like task, and some projects do just that
<jules_> until now I've only used .cm(x)a libraries, are there any other types of libraries? glcaml doesn't seem to have a .cm(x)a file.
sdfsdfsd has joined #ocaml
<psnively> Maybe the whole thing is a .a file with an interface.
<psnively> For a thin wrapper, that wouldn't be a huge shock.
<jules_> there's glcaml_stub.c/.o and glcaml.ml, .mli, .cmi, .cmo
<psnively> Oh. Maybe there's a target to combine glcaml_stub.o and glcaml.cmo?
<sporkmonger> bleh, pcre always gives me problems
<jules_> how would I do that?
<jules_> or where can I find information on compiling programs using such files?
ikaros has joined #ocaml
<sporkmonger> finally got annexlib installed :-P
<sporkmonger> so, never having used an external lib before, what do i need to do to use it?
<sporkmonger> or a pointer to the docs for doing so works too
<psnively> sporkmonger: In general, you #load "library.cma";; and open Module;; to bring bindings into scope.
<jules_> #load "library" usually works for me ;)
<sporkmonger> ok
<psnively> jules_: Ah. glcaml is OCamlMakefile-based.
<jules_> yes
<jules_> does that mean that that's the only way to compile it?
<jules_> I mean compile programs that use it
<flux> no
<flux> you can compile depending programs in whatever means you know how to
<sporkmonger> uhm, #load "annexlib.cma";; <-- doesn't find it
<jules_> try locate annexlib.cma in a console
<jules_> annexlib.cma should be in a directory where ocaml can find it
<sporkmonger> it's in site-lib
<psnively> Oh. Try #require "annexlib";;
<sporkmonger> # #require "annexlib";;
<sporkmonger> Unknown directive `require'.
<psnively> Sorry. #use "topfind";;
<jules_> the OcamlMakeFile is very huge. I tried to make sense of it, but that's almost impossible.
<psnively> ==jules_
<sporkmonger> # #use "topfind";;
<psnively> So read the docs. ;-)
<sporkmonger> The files /usr/local/lib/ocaml/site-lib/findlib/findlib_top.cma
<sporkmonger> and /usr/local/lib/ocaml/toploop.cmi
<sporkmonger> disagree over interface Types
<sporkmonger> - : unit = ()
<sporkmonger> Reference to undefined global `Topfind'
<sporkmonger> ^ is that normal?
<psnively> Ah. It seems that you have an out-of-date findlib relative to your OCaml build.
<sporkmonger> sigh
<psnively> (This, incidentally, is why GODI exists).
<sporkmonger> could've sworn i grabbed the latest version
<sporkmonger> GODI is?
<sporkmonger> findlib 1.2.1
<psnively> Yes. But it was apparently compiled for a different version of OCaml than you currently have.
<sporkmonger> i miss rubygems
<psnively> So you'll appreciate GODI, then. :-)
jules_ has quit [Read error: 104 (Connection reset by peer)]
jules_ has joined #ocaml
<sporkmonger> -sigh-
<sporkmonger> godi failed install
<sporkmonger> godi_create: only one package name allowed ('-I' extraneous)
<psnively> Interesting...
<psnively> Doing bootstrap_stage2 now myself.
<sporkmonger> anyone know offhand what the command for creating users in os x is?
<psnively> So GODI is apparently at OCaml 3.10.1 rather than 3.10.2. That's unfortunate.
<psnively> Not offhand. I know it's a PIA on the command line.
<sporkmonger> yeah
<jules_> this ocamlmakefile is quite wonderful. I don't know how it works, but it does :) thanks for the docs page.
<psnively> jules_: Sure thing. Glad you got it worked out. :-)
<sporkmonger> ok, so back to where i started
<sporkmonger> findlib
<sporkmonger> i have version 1.2.1
<psnively> Right.
<sporkmonger> and ocaml 3.10.2
<jules_> when would you use ocamlmakefile and when omake?
<psnively> I would never use OCamlMakefile personally.
* psnively shrugs.
<sporkmonger> so, #use "topfind";; dies
<sporkmonger> how do i get it to not die?
<psnively> Rebuild findlib.
RobertFischer has joined #ocaml
<sporkmonger> aaaaaah, ok, i misunderstood what you meant before
<sporkmonger> i thought you were saying findlib 1.2.1 didn't work with 3.10.2
<sporkmonger> ok, cool
<psnively> Sorry, yes, this is the recurring headache: OCaml is quite version-sensitive across compiled modules. Every module is identified by its MD5 hash: no match, no link.
<psnively> In other words, it's VERY aggressive about maintaining type-safety across linked modules.
<psnively> What GODI gives you is very much like RubyGems: it tracks dependencies and automagically redownloads/rebuilds anything that it needs to in order to satisfy those dependencies.
<psnively> Incidentally, I'm well into the bootstrap_stage2 process on GODI on my Intel Leopard box here, so I don't know why it didn't work for you.
<sporkmonger> yeah...
<psnively> It just completed and I'm now running godi_console.
<psnively> Hmmm.
<sporkmonger> well, i didn't even get through bootstrap
<psnively> Right. Most odd.
^authentic has joined #ocaml
<jules_> do you have to recompile libraries that depend on updated libraries because ocaml performs inter-library optimizations, or only because of type safety?
<psnively> Both.
<psnively> But be aware that heavy functorization really does hide enough from the compiler/linker that optimization becomes difficult.
<jules_> I thought functors were a compile time business?
jprieur has joined #ocaml
<psnively> Not entirely.
<psnively> They really do an excellent job of representation-hiding.
<pango_> it relies on polymorphism
<pango_> so no, it's not templates
<psnively> sporkmonger: I'll have to dig into your GODI issues this evening or something.
<sporkmonger> psnively: thanks
<psnively> I have a working GODI installation on Intel Leopard now. :-(
<psnively> So I haven't reproduced your problem.
<psnively> Which complicates things. :-)
jules_ has quit ["Leaving"]
musically_ut has quit [Remote closed the connection]
authentic has quit [Read error: 110 (Connection timed out)]
^authentic is now known as authentic
sdfsdfsd has quit ["Leaving"]
vfdfdfvd has joined #ocaml
vfdfdfvd has left #ocaml []
vfdfdfvd has joined #ocaml
<sporkmonger> psnively: so i'm mostly up and running with omake, but how would i compile in annexlib?
vfdfdfvd has quit [Client Quit]
<psnively> I think just by including annexlib.cm(x)a in your dependencies and ensuring that your site-lib is on the search path for libraries.
<psnively> I can look at that this evening too.
<sporkmonger> nm, figured it out
<sporkmonger> just googled for someone else's omakefile and annexlib :-P
jaked1 has quit [Remote closed the connection]
<psnively> Heh. Nice.
<psnively> OMakefiles are generally pretty simple.
<palomer_> http://ocaml.pastebin.com/m7745ebf4 <--this code works! how could this possible be true?
<palomer_> possibly
<Yoric[DT]> Why shouldn't it ?
<palomer_> I thought that 'a could not be refined
<palomer_> how do you manually refine 'a?
<palomer_> (in foo)
<palomer_> class ['a:some_class_type] foo (a:'a) = ...
<palomer_> (which, of course, doesn't work)
musically_ut has joined #ocaml
delamarche has quit []
Yoric[DT] has quit ["Ex-Chat"]
authentic has left #ocaml []
authentic has joined #ocaml
<jonafan> is there any reason i shouldn't use polymorphic variants a lot?
bluestorm has joined #ocaml
<psnively> jonafan: They impose some runtime overhead.
<psnively> Apart from that, I can't see any reason: they're one of OCaml's killer features, IMHO.
<flux> well, they can be prone to bigger type error messages
<psnively> As can any sufficiently-rich type, really.
<jonafan> i'm kind of playing with the idea of objects running on their own threads that receive messages (polymorphic variants) over event channels
<flux> yes, but most of the time you can just use normal sum types
<jonafan> A) it's awesome
<jonafan> B) it's almost directly analogous to traditional objects except they can't return values easily
<psnively> flux: Most of the time, sure. Polymorphic variants have some nice "open code" properties.
<flux> also it's easier to search for instances of a type when you don't use polymorphic variants
<psnively> Yep, fair enough.
<flux> atleast if you have grep-annot at your disposal ;-) (it greps the type-annotated versions of .ml -files)
<psnively> Right on.
<jonafan> C) anything can substitute as a subtype as long as it responds at least as many messages
<psnively> jonafan: Sounds like you've read, or should, "Code reuse through polymorphic variants" and/or "On the (un)reality of virtual types."
<flux> at times you really want to use polymorphic variants, and one of those times I've found that out has been passing messages between threads
<flux> it's easier to handle part of the sum type in a function and forward the rest to another function with them (while still preserving compile time safety about case coverage etc)
ygrek has quit [Remote closed the connection]
<psnively> Indeed.
<jonafan> i'm putting them on my reading list
<psnively> Highly recommended.
<jonafan> but this is how object oriented programming should work
<jonafan> too bad ocaml uses green threads
<jonafan> but still
<psnively> 1) I call that a feature, and 2) it also has OS-native threads.
RobertFischer has quit ["Taking off -- check out http://smokejumperit.com and http://enfranchisedmind.com/blog/"]
<flux> it's less of a feature when you want to make use of your 2-4-8 cpu's
<flux> there are optoins, however, such as cothreads and jcaml
<flux> jocaml even
<psnively> Both of which I would argue are the Right Thing vs. POSIX threads.
<flux> well, at times it could be nice to be able to efficiently share strings
<psnively> Is there some reason that coThreads prevents that?
<flux> let's say you have a bunch of data you receive from network and you want to perform some algorithm on it, which produces about the same amount of data
<flux> and you have two cpu's
<psnively> Yes yes, I understand the use case. :-)
<flux> so you don't want to copy stuff via pipes to do that, it comes expensive
<flux> I was under the impression coThreads did just that
<psnively> You may be right; I haven't looked at the implementation that closely, honestly.
hkBst has quit ["Konversation terminated!"]
lordmetroid_ has joined #ocaml
coucou747 has quit [Remote closed the connection]
lordmetroid__ has joined #ocaml
coucou747 has joined #ocaml
bluestorm has quit ["Konversation terminated!"]
^authentic has joined #ocaml
musically_ut has quit [Remote closed the connection]
LordMetroid has quit [Connection timed out]
lordmetroid_ has quit [Success]
evn has joined #ocaml
authentic has quit [Connection timed out]
^authentic is now known as authentic
kotarak has quit ["Xaide, leka nosht"]
Morphous_ has joined #ocaml
coucou747 has quit ["bye ca veut dire tchao en anglais"]
Demitar_ has joined #ocaml
Demitar has joined #ocaml
Demitar_ has quit [Client Quit]
Amorphous has joined #ocaml
goalieca has quit ["Ex-Chat"]
Morphous has quit [Read error: 110 (Connection timed out)]
Morphous_ has quit [Connection timed out]
lordmetroid__ has quit [Read error: 110 (Connection timed out)]
lordmetroid__ has joined #ocaml
Jedai has joined #ocaml
psnively has quit []
ikaros has quit ["segfault"]
Tac-Tics has joined #ocaml
lordmetroid__ has quit [Connection timed out]
jlouis has quit ["brb"]
jlouis has joined #ocaml
Tac-Tics has quit [Read error: 110 (Connection timed out)]
bzzbzz has joined #ocaml
LordMetroid has joined #ocaml
Tetsuo has quit [Remote closed the connection]
yangsx has joined #ocaml