mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.0 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
^authentic has joined #ocaml
m3ga has joined #ocaml
authentic has quit [Read error: 110 (Connection timed out)]
^authentic is now known as authentic
[azoic] has joined #ocaml
smimou has quit ["bli"]
psnively has quit []
buluca has quit [Read error: 113 (No route to host)]
screwt840 has quit [Excess Flood]
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
[azoic1 has joined #ocaml
[azoic] has quit [Read error: 110 (Connection timed out)]
yminsky has joined #ocaml
mordaunt has joined #ocaml
Mr_Awesome has joined #ocaml
yminsky has quit []
Abo-Marwan14 has quit [Excess Flood]
m3ga has quit ["disappearing into the sunset"]
crathman has joined #ocaml
crathman has quit ["ChatZilla 0.9.78.1 [Firefox 2.0.0.7/2007091417]"]
hircus has joined #ocaml
<hircus> hello all
<hircus> quick question: given a file channel, how do I find out the current position in it?
<hircus> I want to read a file, but instead of looping to EOF, stop after I exceed a particular position
<hircus> if I use Unix.openfile I have access to the seek functions, but is there no way but to keep track of the position in file manually?
<hircus> ah, lseek 0 SEEK_CUR gives that. sorry
screwt840 has joined #ocaml
mrsolo_ has joined #ocaml
mrsolo_ is now known as mrsolo
Abo-Marwan14 has joined #ocaml
mrsolo has quit [Read error: 104 (Connection reset by peer)]
mrsolo has joined #ocaml
mordaunt has quit [Read error: 104 (Connection reset by peer)]
jonafan has joined #ocaml
jonathanv has quit [Read error: 110 (Connection timed out)]
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
szsz has joined #ocaml
seafoodX has joined #ocaml
[azoic1 has quit [Read error: 110 (Connection timed out)]
Tetsuo has joined #ocaml
hircus has quit ["Ex-Chat"]
Nutssh has joined #ocaml
Tetsuo has quit ["Leaving"]
buluca has joined #ocaml
mrsolo has quit [Read error: 104 (Connection reset by peer)]
smimou has joined #ocaml
sioraiocht has quit []
szsz has left #ocaml []
olivier has joined #ocaml
bla has quit [Read error: 113 (No route to host)]
olivier has quit [Remote closed the connection]
jlouis_ has joined #ocaml
screwt840 has quit [Read error: 104 (Connection reset by peer)]
Abo-Marwan14 has quit [Read error: 104 (Connection reset by peer)]
Abo-Marwan14 has joined #ocaml
jlouis has quit [Read error: 110 (Connection timed out)]
piggybox_ has quit [Read error: 110 (Connection timed out)]
buluca has quit [Read error: 113 (No route to host)]
screwt840 has joined #ocaml
piggybox_ has joined #ocaml
bla has joined #ocaml
buluca has joined #ocaml
Tetsuo has joined #ocaml
jlouis has joined #ocaml
jlouis_ has quit [Read error: 110 (Connection timed out)]
Tetsuo has quit [Remote closed the connection]
buluca has quit [Read error: 113 (No route to host)]
fritte has left #ocaml []
seafoodX has quit []
Mr_Awesome has joined #ocaml
claudiotainen has joined #ocaml
buluca has joined #ocaml
<claudiotainen> what's the ocaml for C scanf ?
<rwmjones> claudiotainen, scanf
<rwmjones> there's a Scanf module which contains
<rwmjones> equivalent functions
<claudiotainen> found it, thank you jones
<claudiotainen> and tell me : what module does print_string belong to ?
<gim> Pervasives ?
<claudiotainen> great, foun this too, thanks a lot
claudiotainen has quit ["leafChat IRC client: http://www.leafdigital.com/Software/leafChat/"]
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
[azoic] has joined #ocaml
[azoic] has quit ["Leaving."]
<jonafan> over the last few days, i've seen a few people refer to ruby as a functional language
<jonafan> ... why? there's nothing functional about ruby
screwt840 has quit [Read error: 104 (Connection reset by peer)]
Abo-Marwan14 has quit [Read error: 104 (Connection reset by peer)]
pango_- has joined #ocaml
sioraiocht has joined #ocaml
Abo-Marwan14 has joined #ocaml
pango_ has quit [Remote closed the connection]
pango_- is now known as pango_
screwt840 has joined #ocaml
bla has quit [Read error: 110 (Connection timed out)]
bla has joined #ocaml
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
piggybox_ has quit [Read error: 110 (Connection timed out)]
buluca has quit [Read error: 113 (No route to host)]
buluca has joined #ocaml
<zbrown> jonafan: It has functional aspects, as ruby is a fully qualified "lisp"
ita has joined #ocaml
<zbrown> jonafan: Its not a pure functional language, but it like python has functional aspects to it
<ita> zbrown: you know ocaml+twt ? :-)
<zbrown> ita: nope ;) I'm learning ocaml currently, don't even know what twt is
<ita> zbrown: http://people.csail.mit.edu/mikelin/ocaml+twt/ <- if you like python, you will like this
<zbrown> ita: mmmm I'm indifferent to python, I think its a nice language but I have little use of it ;) I'm also not keen on python's syntax
<zbrown> ita: I indent my code nicely, but I still like my start/end characters :-D
<ita> bah
<zbrown> ita: eh?
Tetsuo has joined #ocaml
sioraiocht has quit [Read error: 104 (Connection reset by peer)]
sioraiocht has joined #ocaml
Abo-Marwan14 has quit [Read error: 104 (Connection reset by peer)]
screwt840 has quit [Read error: 104 (Connection reset by peer)]
bluestorm_ has joined #ocaml
psnively has joined #ocaml
sioraiocht has quit [Read error: 104 (Connection reset by peer)]
sioraiocht has joined #ocaml
<jonafan> functional aspects don't appease me
sioraiocht has quit [Client Quit]
Jedai has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
screwt840 has joined #ocaml
Abo-Marwan14 has joined #ocaml
sioraiocht has joined #ocaml
Torment has quit [Read error: 110 (Connection timed out)]
crathman has joined #ocaml
sioraiocht has quit [Read error: 104 (Connection reset by peer)]
malc_ has joined #ocaml
leo037 has joined #ocaml
gim_ has joined #ocaml
<zbrown> jonafan: ;) Its still a lisp whether you like it or not
<zbrown> jonafan: http://tech.rufy.com/2006/11/functional-programming-in-ruby.html <-- see this blog. I personally don't consider it a functional language either, I just provide the argument for argument's sake ;)
sioraiocht has joined #ocaml
<pango_> (I haven't used functors in a while, so I'm a bit rusty...) I'm trying to add the same elements in two Sets (that only differ in ordering), but I get a type mismatch: http://pastebin.be/5902
<pango_> (for a bit of context, it's a simple cache simulator)
<pango_> eh, as usual I found the answer just after asking... removing ': Set.OrderedType' type annotations made their type t non-abstract and all is fine...
piggybox_ has joined #ocaml
psnively has quit []
sioraiocht has quit [Read error: 104 (Connection reset by peer)]
DT has joined #ocaml
<DT> hi
<DT> Could anyone give me a hand with the new camlp4 ?
<bluestorm_> hm
<bluestorm_> depends of what kind of hand you need
<DT> I'm a newbie with camlp4 and I'm trying to customize types.
<bluestorm_> wich types ?
<DT> Essentially, I want to be able to write
<DT> type 'a annotated 'a test = (*some type definition*)
<DT> and have a second auxiliary type defined as the same type as test
<DT> that would be essentially equivalent to
<bluestorm_> so you want to change the OCaml syntax for type declarations
<DT> indeed
<DT> type 'a test = (*same type definition*)
<DT> and 'a test_annotated = (*a simple type definition for annotations*)
<bluestorm_> (i'm not sure your syntax is very solid, wouldn't a type ['a annotated] 'a test create less conflicts ? )
<DT> Good for me.
<bluestorm_> i think the best way to look at is the actual camlp4 code
<DT> I mean, either would work for me.
<DT> Yeah, that's what I've been doing for the past hour.
<DT> I just can't seem to figure what's public, what isn't.
<bluestorm_> in camlp4/Camlp4Parser
<bluestorm_> Parsers
<bluestorm_> look for Camlp4OCamlRevisedParser.ml
<bluestorm_> there is the complete definition of the revised grammar
<bluestorm_> hm
<DT> With the old camlp4 (not that I was any good with it), I figured out that I had to customize type_declaration.
<malc_> pango_: you can leave it, adding with type t = cache_entry will also work
<bluestorm_> you should look at Camlp4OCamlParser.ml too
<DT> Here, I just can't find type_declaration, but I can't find the equivalent.
<DT> I'd rather look at Camlp4OCamlParser.ml -- let's not complicate things with revised syntax.
<bluestorm_> because the regular syntax changes the type declaration syntax
<bluestorm_> hm
<bluestorm_> DT: the regular syntax is defined as an extension of the revised one
<bluestorm_> so sometimes you'll have to look at the revised one, to see what the regular one is working upon
<bluestorm_> but concerning type declarations, i think there almost entirely redefined in the regular syntax
<bluestorm_> so Camlp4OCamlParser.ml may be enough
<pango_> grmbl like each time I wonder whether I need a map or a set, I end up requiring features from both
<bluestorm_> haha DT
<bluestorm_> i just looked the files
<bluestorm_> and type_declaration is defined in Camlp4OCamlRevisedParser.ml
<DT> ?
* DT is wondering what to do.
azoic has quit ["leaving"]
azoic has joined #ocaml
<DT> Well, I'll take a look at Camlp4OCamlRevisedParser.ml after all.
* DT had just started learning the old revised syntax when the new one came up.
<bluestorm_> hm
<bluestorm_> i'm not sure there that different
<bluestorm_> s/there/they are/
<DT> So, at the moment, do I need to apply any functor myself to have access to anything useful in Camlp4OCamlRevisedParser.ml ?
* DT notices that the definition of type_declaration has changed a lot.
<bluestorm_> hm
<bluestorm_> i think the best way to do your thing would be to define a SyntaxExtension yourself
<bluestorm_> hm
<bluestorm_> i'm looking for a little example
<DT> That would be great, thanks.
<DT> The wiki contains nothing about syntax extensions.
<DT> Would lambda_quot.ml (from the distribution) be a good start ?
<bluestorm_> i have not tested that code
<bluestorm_> (i basically took OCamlParser.ml and took a lot of stuff away)
<DT> Ok, thanks.
<bluestorm_> that example use the revised syntax
<DT> hcarty: spent a few hours on it...
<bluestorm_> but switching to the regular one should not be that hard
<DT> The one page I'd be interested in is essentially empty...
<bluestorm_> and hm
<DT> bluestorm_: thanks.
<bluestorm_> Gram.Entry.clear and DELETE_RULE might be useful
<bluestorm_> but DELETE_RULE is sometimes a bit tricky to use
<bluestorm_> hm
<bluestorm_> noon time
<bluestorm_> good luck ^^
<DT> Do I take it that sequence is defined somewhere in Camlp4OCamlRevisedParser.ml ?
<DT> (enjoy your meal :))
filp has joined #ocaml
psnively has joined #ocaml
Mr_Awesome has joined #ocaml
malc_ has quit ["leaving"]
buluca has joined #ocaml
gene9 has joined #ocaml
Tetsuo has quit ["Leaving"]
<DT> Well, I'm progressing.
* DT will continue later.
DT has quit ["Ex-Chat"]
gene9 has quit ["Leaving"]
filp has quit ["Bye"]
sioraiocht has joined #ocaml
crathman has quit ["ChatZilla 0.9.78.1 [Firefox 2.0.0.7/2007091417]"]
rfischer has joined #ocaml
bluestorm_ has quit [Remote closed the connection]
<jonafan> zbrown i read the ruby thing. you can pass functions into methods using function pointers in c, but c isn't functional. QED
<rfischer> Someone arguing that Ruby is a functional language?
<jonafan> nobody here is
<jonafan> but i've seen people claim it several times over the past couple of days
<rfischer> Weird -- that's undereducation.
<rfischer> It's more like a functional language than, say, Java, I suppose.
<jonafan> haha yeah
leo037 has quit ["Leaving"]
leo037 has joined #ocaml
ita has quit ["Hasta luego!"]
<mbishop> ruby is about a functional as python
<mbishop> which is to say, not much at all
jlouis_ has joined #ocaml
<zbrown> jonafan: ya, I'm not impressed by the arguments. It may borrow "ideas" from functional programming,b ut its certainly not functional in essence
<zbrown> jonafan: its the same as calling C object oriented, yes you can model object orientation in C, but by its nature it is not
<jonafan> to be functional, you also have to reject a lot of the ideas of other languages
<zbrown> jonafan: yup
<jonafan> ruby doesn't do taht
<jonafan> ruby tries to adopt everything
<zbrown> I think OCaml is a nice balance of the main paradigms
<jonafan> yes, i do like it
<rfischer> Proof that Ruby isn't functional. :D
<jonafan> i was kind of turned off by the mutable strings for a while, but i'm over it
leo037 has quit ["Leaving"]
<zbrown> I'm learning OCaml partly from interest and partly from necessity since I have a shot at working on F# at Microsoft which has a lot of influence from OCaml
<zbrown> I've been hopping around functional languages looking for one to get to know well and se in my toolkit. I like haskell but not to a point of using it for serious programs. Erlang is nice but its slow for a lot of things I do, so OCaml seemed a logical choice
<rfischer> Erlang has its one really cute stunt.
<rfischer> And Haskell is theoretically pretty a la Lisp.
<rfischer> But Ocaml is an actual practical language.
<zbrown> exactly
<jonafan> i'm learning haskell next
<zbrown> Haskell is too unpredictable and difficult to ensure
<jonafan> how so?
<zbrown> jonafan: lazy evaluation, a lot of times you write something and dont' realize that what you've written is doing more than what you expected
<zbrown> jonafan: gratned you can demand strict evaluatino
<jonafan> oh
<zbrown> jonafan: run time is unpredictable, but often is very fast
<jonafan> you can do some pretty neat things with lazy evaluation
<zbrown> yes indeed
<zbrown> Haskell is great, and beautiful, but in a toolkit I'm not sure I'd get much use otu of it
<rfischer> You can do lazy stuff in OCaml, too.
<zbrown> rfischer: true
<rfischer> And just wait until adlib is done -- Brian and I are working on that right now: http://sourceforge.net/projects/adlib-ocaml/
jlouis has quit [Read error: 110 (Connection timed out)]
<rfischer> Then you'll get lazy eval and deferred monads for pretty cheap.
<zbrown> ooo nifty
<zbrown> now riddle me this, an internship with google or an internship with microsoft? ;)
<jonafan> google
<rfischer> Google.
<rfischer> There's a lot more innovation at Google, and it looks better on a resume.
<jonafan> google has relatively good karma
<zbrown> hmmm
<rfischer> The big issue for me is that they've got known-good development culture.
<zbrown> indeed, but I want to work on compilers and languages :-/
<rfischer> Do you want to be an academic or do you want to make money?
<zbrown> my only problem with Google is their distaste for "upper management"
<jonafan> i'm not sure a lot of innovation is coming from ms in that realm either
<zbrown> rfischer: eh make money, which means thats it lol
<zbrown> jonafan: the only thing thye have going for them is F#
<jonafan> which is a copy of ocaml
<zbrown> rfischer: If I were to work on languagse, it'd have to be at a company, I get bored if I'm not given a lot of work
<zbrown> jonafan: eh, its ocaml + haskell + C#
<zbrown> not just ocaml
<rfischer> There are few places where you're going to work at a language at a company.
<rfischer> Very, very few.
<zbrown> I have no distaste of Microsoft
<zbrown> rfischer: true, compilers is an interesting area
<rfischer> And I'm just saying, if you want to be in the business world, Google is a better bet.
<zbrown> rfischer: I suspect as much, though for a long term career choice I'm not sure
<zbrown> rfischer: seeing as advancement in google is next to impossible
psnively has quit []
<jonafan> dude
<rfischer> Then leave them. I've been in a hiring position off-and-on through my career, and knowing nothing else, I would hire someone who had worked at Google over someone who worked at Microsoft in a heartbeat.
<rfischer> Google is much better for your resume.
<jonafan> MS is under serious pressure on all fronts
<rfischer> Even if you're only there for a brief while.
<zbrown> this is true
<rfischer> (jonafan: particularly from Google.)
<zbrown> Google would be a 5-8 year stint
<jonafan> they can't beat google on anything
<zbrown> tops
<rfischer> That's fine.
<zbrown> well assuming I get the internship with Google, thats the way I'd go I think
<zbrown> Not to mention I have 2 friends at google
<rfischer> if you're just going into the business world, I'd say that you probably shouldn't stay anywhere more than two years.
<jonafan> in tech, i don't think you'd want to work anywhere for 5 to 8 years
<zbrown> why's that?
<rfischer> For the first ten years of your career, you should be moving on very rapidly. For the first three, you're basically going to be hopping.
<rfischer> And you'll be making a LOT more money each time you hop.
<rfischer> The value of a new developer is so much less than the value of a developer with 3 years of experience, and companies just don't keep up with that market value increase.
<zbrown> hmmm interesting
<rfischer> And the reason you should keep hopping is so that you 1) get exposure to different cultures; 2) get exposure to different technologies; and 3) remember that you are not your job.
<zbrown> rfischer: so jump around for a bit and then settle down with a company or start my own (if I have that big idea)
<rfischer> Pretty much.
<zbrown> ah
<zbrown> interesting
<rfischer> In all honesty, you'll probably be in a different career in 5 to 8 years anyway.
<zbrown> rfischer: different career? what do you mean?
<rfischer> Well, I've only been in the industry for about 6 years, and most of my friends who started into computers have moved into something else.
<rfischer> People just don't squat in careers as much anymore.
<zbrown> rfischer: hmmm I dunno what else I'd do lol
<rfischer> You'll find out in 5 years.
<rfischer> Don't worry about it.
<jonafan> shit, i'm a pretty hardcore nerd and i fancy moving on
<zbrown> I'm really only good at two things, maybe three, math, cs and engineering
<rfischer> You'll probably discover new talents in the course of the next half-decade.
<rfischer> And new things you're interested in.
<zbrown> hmmm interesting
<jonafan> to be honest, only two of my closest friends ever worked in the fields they got their degrees in
<zbrown> well in the next decade I'll probably be back in grad school for an MBA+MS CS
<rfischer> Stop planning.
<zbrown> rfischer: its not a plan ;) Its just a comment from knowing myself
<zbrown> I just really enjoy school
<rfischer> You may think you know what you're talking about, but mark my words -- in 5 years, you'll be a totally different person, and a complete surprise to who you are now.
<jonafan> haha
<rfischer> Planning for more than the next year or two is just a waste of time.
<zbrown> true ;) I never erally have plans, I just know a general direction I want to go
<zbrown> I know at some point I'd like to go to grad school, but I wouldn't say thats an absolute, I'd need the right conditions
<rfischer> Not to say you shouldn't set yourself up the most possible opportunities by being wise with your money and time, but any time you start a sentence with, "in the next decade I", you're ending it by lying.
<zbrown> heh, like I said, just a general idea
<zbrown> all I do know from experience is I don't want to be just another suit
<rfischer> That's for damn sure.
<jonafan> life is too short to plan in decades
<rfischer> I've got a motto: "Maintain forward momentum."
<zbrown> rfischer: I know that I want to be working on a product, not on deals, and thats about it
<rfischer> Well, then you're going to be someone's employee forever.
<rfischer> And that can be cool, if you find the right someone to be an employee of.
<zbrown> from there, I just want to make enough to live comfortably and retire decently, beyond that I'm not looking to be the next billionaire. I'm content to hack code with my computers
<zbrown> :)
CRathman has joined #ocaml
<zbrown> hmmm actually thats not true, I want to be involved with the product, but I don't want to be so high up in a management hierarchy that I'm disconnected from the developers
<zbrown> rfischer: what exactly do you do anyhow if you don't mind my asking
<zbrown> ?
<zbrown> rfischer: nifty
<zbrown> your own business?
<rfischer> Yup.
<zbrown> rfischer: very cool
<rfischer> I also spend a lot of time building web apps for my wife: http://graphickarma.com
<zbrown> rfischer: well I know for pretty damn sure that I want to work for a company where the code or product makes the money
<zbrown> so not working on IT infrastructure
<zbrown> rfischer: thats pretty cool, do you and your wife both work from home?
<rfischer> I'm usually at a client site.
<rfischer> My wife works from home.
<rfischer> I
<zbrown> ah ok
<rfischer> I'm looking to line up some telecommuting gigs, but nothing's surfaced yet.
<rfischer> The client-site gigs usually pay better.
<zbrown> rfischer: ya
<rfischer> Regrettable, but true.
<zbrown> hah ya
mordaunt has joined #ocaml
<zbrown> rfischer: thanks for the advice
<zbrown> jonafan: you too
<rfischer> NP.
<rfischer> I'm full of worthless advice.
<zbrown> gotten a lot of good advice in the last 48 hours lol
<zbrown> my dad helped me realize yesterday that I was definitely not meant for academic research
<rfischer> That's a good thing to figure out.
<zbrown> I was so caught up in thinking I wanted to be doing research and then about 2 days ago I realized I hated how much utter bullshit I read in academic paperss that I have to read for my research now lol
<zbrown> 90% of academic papers are just rehashes of a person's original thesis
<zbrown> I like to solve immediate problems, not create new ones which academic is very good at doing
<rfischer> I gotta run. But you're totally right.
rfischer has left #ocaml []
rfischer has joined #ocaml
rfischer has quit [Client Quit]
MoeD has joined #ocaml
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
CRathman has quit [Read error: 110 (Connection timed out)]
smimou has quit ["bli"]