<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_>
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>
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
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
<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)]