<letrec>
rwmjones: Oh I see, thanks. But this could also be abstracted. Interface would be cleaner (my 2 cents).
<rwmjones>
yeah, it tends to confuse ... I don't use fold_* often enough so I usually end up looking up the signature
<rwmjones>
List.fold_left ;;
<xavierbot>
- : ('a -> 'b -> 'a) -> 'a -> 'b list -> 'a = <fun>
<rwmjones>
you could argue that following this to its logical conclusion, the type should be
<rwmjones>
fold_left basecase f list
<rwmjones>
fold_right list f basecase
<rwmjones>
or something :-)
<letrec>
Btw, I want to find the pairs of integers between [1..100] that match a certain condition (x+y==50 for instance). In Haskell I use a monad. How do I do that in Ocaml?
<Smerdyakov>
I assume you know how to write code that does this, but you are instead asking how to do it in less code using the standard library?
<letrec>
Yes.
<letrec>
I'd like an intelligent way of doing it. In Haskell a monad is elegant. In Ocaml I don't know.
<Smerdyakov>
You can use monads in OCaml, of course.
<letrec>
Ok, I'll google for that.
<Smerdyakov>
Maybe you'll find something, and maybe you won't.
bongy has joined #ocaml
<Smerdyakov>
The central point is that neither OCaml nor Haskell needs dedicated language features to support monad use.
<Smerdyakov>
If you really understand how monads work in Haskell, and if you've read the tutorial in the OCaml manual, then it should be clear how to duplicate everything you've done in Haskell with the list comprehension monad.
middayc has quit []
<Smerdyakov>
If you don't understand what I mean, then it's probably helpful to reimplement your Haskell list comprehension code without using "do" notation and without using anything from the prelude.
<Smerdyakov>
The exact same code will then work in OCaml, modulo surface syntax differences.
<rwmjones>
presumably letrec's haskell impl is also making good use of laziness to avoid generating O(n^2) lists?
<letrec>
Smerdyakov: I understand what you say. But I'm always surprised to hear that monads do not need compiler support. How the hell can a compiler understand that :)
<letrec>
rwmjones: indeed, that's why I was asking.
<Smerdyakov>
letrec, maybe you've confused monads with the IO monad?
<letrec>
Laziness really helps in that case.
<Smerdyakov>
You can implement lazy lists in OCaml easily enough.
<letrec>
What I was asking, really, is what is the canonical way of doing that with OCaml. Looks like there is none.
<Smerdyakov>
You can certainly write a higher-order function that is like [List.filter], but over the imaginary list of integer tuples in question. I think that would then be fairly canonical.
ziph has joined #ocaml
<rwmjones>
letrec, if you look back over the archives of this irc channel you'll see an implementation for lazy lists
AxleLonghorn has joined #ocaml
Linktim has quit [Read error: 113 (No route to host)]
OChameau has quit [Read error: 104 (Connection reset by peer)]
middayc has joined #ocaml
Linktim has joined #ocaml
<Yoric[DT]>
letrec: that's one of the things I hope we'll be able to standardize soon.
bongy has quit ["Leaving"]
OChameau has joined #ocaml
bluestorm has joined #ocaml
middayc has left #ocaml []
<letrec>
Yoric: ok, but are you talking about the fold_* story or the list monad one?
Morphous has joined #ocaml
<Yoric[DT]>
Lazy lists.
<letrec>
Yes, would be cool to have something more standardized.
<ziph>
Is F# O.T. here? :)
<Smerdyakov>
No, F# is on-topic.
bongy has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
<ziph>
I have a function add which is (CodeTypeMember -> unit) but F# doesn't like me calling it with a CodeMemberField (which is derived from CodeTypeMember).
<ziph>
Type constraint mismatch. The type
<ziph>
CodeTypeMember
<ziph>
is not compatibile with type
<ziph>
CodeMemberField.
<ziph>
The type 'CodeTypeMember' is not compatible with the type 'CodeMemberField'
<ziph>
Is the error, which seems odd to me.
<ziph>
I have a function "add" rather; "add" is the name of the function (not that that matters ;)
<bluestorm>
in OCaml, you have to explicitely subclass objects
<thelema>
ziph: maybe an explicit cast will fix things: (CodeMemberFieldVar :> CodeTypeMember)
<bluestorm>
i'm not sure it's the case in F# too, though
* rwmjones
things F# is off-topic here
<rwmjones>
things? thinks
<ziph>
The objects are subclassed in their .NET implementation (They are from the Microsoft CodeDom library).
<Smerdyakov>
ziph, it sounds to me like you're trying to subclass in the wrong direction.
<thelema>
rwmjones: only because it's not called ocaml.net
<Smerdyakov>
ziph, you're trying to use a class as one of its subclasses.
<rwmjones>
no, because microsoft needlessly embraced and extended the language ... they should have written an ocamlopt backend; in fact that would have been perfectly possible, see ocamljava
<ziph>
F# seems a bit yuck to me too, but it is the pill that'll let my work swallow Ocaml. ;)
<Smerdyakov>
rwmjones, I think that's a strange opinion. F# has many extensions beyond OCaml.
<rwmjones>
well that's the point isn't it ... if they'd supplied patches against OCaml instead of inventing their own (proprietary) language, then ocaml would have benefited
<Smerdyakov>
The OCaml team doesn't accept patches that add features.
<rwmjones>
yes it does ... what about patches that come from lexifi?
<Smerdyakov>
What I said is almost always true.
<Smerdyakov>
There may be exceptions, but it's true enough that I consider OCaml socially dead.
<hcarty>
Smerdyakov: They would be much more likely to from someone who is part of the consortium
petchema_ has joined #ocaml
<hcarty>
Which Microsoft is
<Smerdyakov>
hcarty, I still place the probability at close to 0.
<rwmjones>
ocaml is hardly 'socially dead'. I was at a meeting with 50 or so users last month.
<ziph>
Cool, n00b question -> flamewar in 2 minutes.
<Smerdyakov>
rwmjones, because the main implementation is so closed, I think it's pretty clear that OCaml will be gone soon.
<rwmjones>
now you're just trolling
<Smerdyakov>
Nope, I really believe this.
<Smerdyakov>
Where "soon" is 10-20 years
<rwmjones>
Smerdyakov, do you no longer work at a company which implements all their infrastructure in ocaml?
<Smerdyakov>
No, I still do.
<rwmjones>
anyway, ocaml is open source, it can be forked (even under the qpl)
<rwmjones>
so to state that it's a closed implementation which will necessarily die is obviously wrong
<Smerdyakov>
Then that would be forked-OCaml that continued, not OCaml.
<rwmjones>
if enough users are using it, and care, they will continue development
<rwmjones>
that's just nit-picking .. it'll be "ocaml++" or whatever, it'll be a continuation of the language
petchema has quit [No route to host]
<rwmjones>
whereas if MS lose interest in F#, there is _no way_ to fork it
<rwmjones>
so it _will_ die
<Smerdyakov>
I also think that there are much better language designs out there that will probably put OCaml out of business in the next 10 years.
<rwmjones>
well, that's probably true .. I have no problem with better languages, considering "state of the art" in the mainstream world is sh*t at the moment
AxleLonghorn has quit ["Leaving."]
<Smerdyakov>
I think it's not that unlikely that the best general purpose programming language will be Coq plus usability features in 10 years.
<ziph>
thelema, was that cast you mentioned :> ? My silly IRC client turned it in to a smiley.
<flux>
smerdyakov, best, maybe, do you think anyone would use it?-)
<Smerdyakov>
flux, I would.
<thelema>
ziph: yes, : > without the space
<ziph>
We're interviewing programmers at the moment; only 1 out of 10 can reverse an array. Coq would be funny.
<flux>
smerdyakov, how about such a significant part of developers that one doesn't need to write all the libraries by himself?
<Smerdyakov>
flux, enough smart people would use it that the situation would be fine.
<Smerdyakov>
I only care about improving productivity of the smartest developers.
<Smerdyakov>
That is, when it comes to general purpose languages.
<Smerdyakov>
Everyone else should be using DSLs.
<thelema>
Smerdyakov: so not your productivity?
<Smerdyakov>
thelema, this is some kind of clever insult? :P
<thelema>
Smerdyakov: no, just an observation that exclusionary ideas often exclude those with the original idea
<Smerdyakov>
thelema, I'll only say that any programming idea I advocate is one I would use.
<thelema>
I know I can't consider myself in the "smartest developers" category, after seeing some other people's work.
<ziph>
thelema, thanks, that did it. I was trying :?> having been confused by the documentation. :)
<thelema>
ziph: you're welcome
<thelema>
not that I program poorly (many people make me seem like the einstein of programming), but that some people just have a grasp of big ideas I don't and seem to manage complexity that I can't.
<Smerdyakov>
Almost everyone who codes in OCaml would fall in my target demographic.
<thelema>
J. Garrigue and X. Leroy seem part of the "smartest developers" club, at least one level above me.
<ziph>
I'd love to know how you find the smartest developers to hire. ;)
<thelema>
ziph: I like this article:
<Smerdyakov>
Veeeery easy.
<Smerdyakov>
Advertise for functional programmers.
<ziph>
Smerdyakov, I thought about that, but I would feel bad doing it since 90% of the work wouldn't be.
pattern has joined #ocaml
<thelema>
ziph: ask for candidates with "functional programming experience" - less implication that the work is all FP.
<Smerdyakov>
ziph, that's right. You see, you've just admitted that you are looking to fill positions using crappy languages. Good programmers don't want to use crappy languages, so I hope for the sake of the community that you can't trick them into joining you. :P
<ziph>
:)
<ziph>
I just want someone that can reverse an array. :)
<flux>
ziph, so that's what your company does, reverses arrays?-)
olleolleolle has joined #ocaml
<ziph>
Heh. :)
<ziph>
Aren't all languages crappy? :)
<flux>
ziph, what do you ask the inverviewee after they've solved the array reversing puzzle?
<thelema>
ziph: yes, like all mail clients - we try to find one that sucks less.
<ziph>
flux: you can riff on reversing arrays for a fair while. :)
<thelema>
ziph: most people don't reverse arrays much, so finding a programmer with experience reversing arrays...
<Smerdyakov>
I'd also like to add that good programmers don't use arrays much. :P
<ziph>
Reversing lists is fine too. :)
<Smerdyakov>
ziph, seriously, why do you think people should want to work at your company?
<ziph>
The only people that aren't programmers are the receptionist, accountant and support people? ;)
authentic has quit [No route to host]
<Smerdyakov>
ziph, do you really have any reason in mind why a good programmer should pick your company over the competition?
<thelema>
ziph: programmers don't necessarily make good managers
yaru1022 has quit [Remote closed the connection]
<ziph>
thelema: The managers (other than me) aren't career programmers.
petchema_ has quit [Remote closed the connection]
<Smerdyakov>
ziph, well, it seems you're ignoring my question, so my conclusion is that you were only joking when you asked about finding good programmers.
<ziph>
Smerdyakov: We probably aren't particularly competitive to be honest. The reason I've been happy is the small size, lack of dilbertesque things, good management and the amount of control we get over the direction of the company.
<ziph>
Sorry, I was pondering your question.
<ziph>
I think I'm more frustrated that a large number of people who claim to have the same job as me can't reverse an array. :)
<ziph>
I'm sure the same doesn't hold for, say, Doctors.
<thelema>
I've semi-choked on an interview simply joining two lists
<ziph>
What was tripping you up?
<thelema>
I got the code out, but it took *way* too much work.
<ziph>
(We also give people a PC with an IDE to do it on)
<thelema>
I knew what I wanted, but kept implementing rev_append on the whiteboard...
<flux>
no paper coding? pft..
<flux>
I suppose the level of actually writing working code in such a situation can be lowered due to the pressure
<thelema>
and my mind kept wanting to do it extra-efficiently - meaning just make the last null in the first list point to the head of the second list. But I couldn't recall the extlib trick to doing that in ocaml.
<flux>
so you were asked to write ocaml in a job interview?
<thelema>
yes
<thelema>
I didn't end up getting the job at Jane Street. :(
<rwmjones>
I think also a lot of people write rubbish/lies/wishes on the CV ... eg I interviewed someone who claimed to be a PhD & expert in Linux. My interview technique has always involved a linux machine hooked up to a projector and asking them to program a few simple tasks. This person couldn't even type commands on the command line. How he could claim to be a Linux programmer I've no idea.
<flux>
rwmjones, java coder perhaps?
<rwmjones>
it _was_ for a perl job :-)
<rwmjones>
but yeah, probably ...
<thelema>
PhD means "no practical experience" except in rare cases.
<rwmjones>
never trusted PhDs myself
<ziph>
I know some good PhD's.
<rwmjones>
"smart", but not "gets things done"
<Smerdyakov>
We have quite a few counterexamples to that at Jane Street, rwmjones. :P
<Smerdyakov>
I guess "quite a few" means "about 10 that I know of."
<rwmjones>
oh I'm sure, but it sounds like your hiring process works
<thelema>
can I take a quick survey? what syntax do you use for your chaining operator? (i.e. let (???) x f = f x)
<ziph>
Can I ask why there isn't a standard one? ;) ;)
<Smerdyakov>
|!
<thelema>
ziph: working to solve that problem right now
jderque has joined #ocaml
<ziph>
There isn't even a standard operator for function composition, is there? (I couldn't find it last time I went looking)
<rwmjones>
isn't (>>>) the "standard" one? never use it myself
<rwmjones>
thelema, can you give an example of when it's actually useful?
<thelema>
rwmjones: I do things like this with mine: Sys.readdir path |> Array.to_list |> List.map (Filename.concat path)
<ziph>
In F# when you have to horridly convert between .NET arrays and Lists constantly just to do some trival map'ing and filtering of .NET collections. ;)
<rwmjones>
I usually use:
<rwmjones>
let xs = Sys.readdir path in
<rwmjones>
let xs = Array.to_list xs in
<rwmjones>
etc.
<rwmjones>
although whether that's better or not I don't know
<thelema>
I like the visual flow, especially when I chain map and filter, it just looks nice to see the input going through a pipe through transformation functions
<ziph>
Reusing variable names like that is a bit strange.
<rwmjones>
ziph, it's definitely strange for non-functional programmers ... they get very confused by my code
<thelema>
I reuse variable names only when I do some sort of pre-processing of an argument: let s1 = String.lowercase s1
* rwmjones
recalls there is some issue with garbage collection too
<ziph>
rwmjones: Where is it common in functional programming?
<rwmjones>
like, the GC cannot collect if you use a composition operator, until the very end of the pipeline
<rwmjones>
ziph, since I'm essentially self-taught & have worked on my own in functional languages for years, it may not be
<thelema>
rwmjones: it seems that gc wouldn't be able to collect your original xs until it's left that scope.
<rwmjones>
I don't know .. at merjis we had huge datasets, and when GC happened was very important, but nowadays as long as it happens some time, it's ok
<thelema>
my example serves as syntactic sugar for [List.map (Filename.concat path) (Array.to_list (Sys.readdir path))]
<thelema>
the way a non-functional programmer would write it.
<ziph>
A non-functional programmer would write a for loop. :)
<thelema>
ziph: you're right.
<thelema>
rwmjones: can you help me with something - how do you pronounce merjis? merj-is? mer-yis?
<rwmjones>
mer-jis
<rwmjones>
literally
<thelema>
it seems foreign enough to get a funny pronounciation of the j.
<mwc>
rwmjones, like "merges" but with a different vowel?
<rwmjones>
yes
<rwmjones>
it was because we wanted to "merge" IT infrastructure
<rwmjones>
that was the original plan
<mwc>
ah
<rwmjones>
as with all startups, the plan changed many times
<mwc>
you still making money from it? that part of the plan changed with a lot of startups
<rwmjones>
ha ha, no
<mwc>
Too bad. I was hoping you could write a "Beating the odds" piece and shove it in PG's smug, lisping face
<ziph>
Hmm, there doesn't seem to be any functional programming jobs open in the country at the moment based on job site searches. :)
<ziph>
Err, this country rather.
<Smerdyakov>
ziph, Jane Street is always hiring.
<Smerdyakov>
And we don't need to use "job sites." :P
<ziph>
Yeah, I noticed. :)
<ziph>
Maybe we'll have to find a conference here to give talks at. :)
<ziph>
Maybe we should try Google ads, they work for selling our stuff.
<thelema>
ziph: jane street does :)
<ziph>
Yeah, that made me think of it.
<ziph>
If a job ad asked you to go to a web page and solve a couple of quick filter problems, would you do it? :)
<bluestorm>
thelema: i've heard F# programmers speaking of >> << for directional evaluation ( (<<) f x = f x, (>>) x f = f x), and <| |> for their point-free counterpart ( <| being the mathematical function composition )
<bluestorm>
i think this is quite nice
<bluestorm>
but the pointful version doesn't cope with OCaml associativity rules
<bluestorm>
because you want << to be right associative
coucou747 has joined #ocaml
<bluestorm>
i could still use @< >@ or ^< >^
xavierbot has quit [Read error: 110 (Connection timed out)]
<thelema>
what do you mean by point-free?
<bluestorm>
hm
<bluestorm>
i'd say a point-free function is one that is formulated without explicitly naming its parameters
<mwc>
thelema, point free style is sort of like unix piping
<thelema>
bla: point-free -> non-point-free conversion == eta expansion?
<bluestorm>
i think so
<mwc>
Pointful: h x = let y = f x in g y; Pointfree: h = f `compose` g
<mwc>
forget what the composition operator is in caml since I usually program pointfully in strict languages
<thelema>
gotcha.
<bluestorm>
in that case i just meant let (<|) f g x = f (g x) and let (|>) g f x = f (g x)
<bluestorm>
mwc: actually, there isn't a standard composition operator :p
ziph has quit []
ita has joined #ocaml
<mwc>
bluestorm, I see pointfree as being bad style in strict/impure languages
<mwc>
pointful style makes it explicit when things are computed
<bluestorm>
hm
<mwc>
I mean, it's still clear and explicit in point free style
<mwc>
it's just harder to read\
<bluestorm>
i think moderately point-free can be a win sometimes
<mwc>
C-style function pointer declarations are explicit too, but supposedly only one in 5 C++ programmers could correctly declare a prototype for set_new_handler
<thelema>
bluestorm: I've seen those definitions, but wouldn't imagine myself using (|>) g f x = f (g x)... I don't think. g |> f x evaluates as f (g x)
<bluestorm>
mwc: do you prefer List.filter (fun x -> x <> 0) li over List.filter ((<>) 0) li ?
<bluestorm>
thelema: it's quite nice in some cases
<bluestorm>
i mean, the whole point of using that > < stuff is to allow both directions to be used
<mwc>
bluestorm, well, the former
<thelema>
bluestorm: I think I see its use... for building a major composition that gets applied later.
zarvok has joined #ocaml
<bluestorm>
eg. in a streaming context : let process = check_input |> compute |> format_output
<thelema>
you're building a function. I like thinking about building a value: v0 |> fun0 |> fun1 |> fun2 applies fun0..2 in that order to v0
<coucou747>
salut all
<mwc>
morning coucou747
<bluestorm>
thelema: in that context, i'd use the pointful operators v0 >^ fun0 >^ fun1 >^ fun2
<bluestorm>
but of you course you could use |> as the pointful operator, it's just a matter of convention
<bluestorm>
i think having both is important, though
<thelema>
umm, the pointful operator goes g f x = f (g x), no?
<bluestorm>
let (>^) x f = f x
<bluestorm>
let (^<) f x = f x
OChameau has quit ["Leaving"]
|Catch22| has joined #ocaml
<thelema>
I guess those get used in a pointful way, whereas the f(g x) gets used in a point-free way, even though we define both in a pointful way
<bluestorm>
yes, that was the idea
ben__ has joined #ocaml
<thelema>
I think I have it now. Survey: who uses what subset of these operators? (xf, fx, gfx, fgx)?
<Smerdyakov>
Those don't look like operators to me.
<bluestorm>
i've used fx and fgx quite a lot
<bluestorm>
haven't used the two others much, due to the lack of standardization in that matter (and in my mind)
<thelema>
Smerdyakov: xf refers to let (??) x f = f x
ben__ has quit []
<bluestorm>
but if they were available in a standard (or extlib) way, i'd fight the "you'll confuse peoples reading your code" syndrome and use them, i guess
olleolleolle has quit []
<thelema>
smimou: gfx refers to let (??) g f x = f (g x)
* thelema
can't type nicks today
<hcarty>
thelema: I use xf, as I find it saves a lot of typing
<hcarty>
The Sdflow library has let (|>) x f = f x, so I use that operator
ita has quit ["Hasta luego!"]
authentic has joined #ocaml
middayc has joined #ocaml
gene9 has joined #ocaml
<bluestorm>
i prefer use the '|' character for point-free versions, because it reminds me of the shell pipes, wich are point-free
gene9 has quit [Client Quit]
<thelema>
bluestorm: easy to say, but the first "thing" in a shell pipe always generates data for the rest to work on.
<thelema>
I'd say shell pipes get used in a pointful manner.
middayc has left #ocaml []
<bluestorm>
the meaning of a | b still is "silently pass a's output to b's input", with no name for "the input"
vincenz has joined #ocaml
stbrn has joined #ocaml
<bluestorm>
when i write cat ... | grep ... i don't usually think of cat ... as the data, and grep ... as the function processing it
<thelema>
when I write a | b, I don't think of it needing an x to get started - the a has (or produces) all the data for the chain by itself
<bluestorm>
but you're right, it's not a rock solid interpretation, you could think of it in a pointful way as well
<thelema>
a differs from b in that it doesn't take input on stdin
<jderque>
is there any way to force associativity ?
<bluestorm>
thelema: i'd say there is an implicit parameter : writing a command line (or enclosing it inside ` `) is like giving an implicit () argument that start the processing
<bluestorm>
if you think the first argument _is_ the data, then why does "| grep ..." behaves differently from "grep ..." as the first part of the command-line ?
<bluestorm>
they're functions imho, not data
<thelema>
jdavis_: afaik, no way to force associativity
<bluestorm>
jderque: you can use @$ instead
<thelema>
bla: yeah, but the first one functions as the source for data, not a transformer
<bluestorm>
:]
<mwc>
thelema, not always, consider here documents like newname="$(sed -e '...' <<< "$name" | tr ... )"
<jderque>
ok, i'll try that.
<thelema>
mwc: the first one"
<thelema>
mwc: the "first one" in that case is the <<< "$name"
<mwc>
true
<mwc>
but it's not the first command
<mwc>
one could do: cat <<< "$name"
<mwc>
but not "$name" | sed
<bluestorm>
jderque: associativity and precedence is enforced by the first (or the first two) characters, you can find the complete description there : http://caml.inria.fr/pub/docs/manual-ocaml/expr.html#@manual.kwd33
<thelema>
mwc: if bash had a >>> operator, it would be first.
<jderque>
bluestorm: many thanks ! i didn't know that :-)
<jderque>
(it works indeed)
ReachingFarr has joined #ocaml
<thelema>
mwc: ("$name" >>> sed ... | tr ...)
<mwc>
thelema, true
<mwc>
but >>> n'est pas un pipe.
<mwc>
s/but/mais/
<bluestorm>
"une"
<bluestorm>
hm
<mwc>
alas, my high school french was never enough for me to really memorize the right article with each noun
<bluestorm>
actually "un" makes an enjoyable pun too :p
<thelema>
mwc: :)
goalieca has joined #ocaml
olleolleolle has joined #ocaml
olleolleolle has quit [Client Quit]
<mwc>
I suspect that most people who are born in a language with natural gender will never be able to become fully natural with grammatical gender.
<thelema>
s/language with/language/without/ ?
<thelema>
s/language with/language without/ ?
<bluestorm>
mwc: what's your native language ?
<mwc>
bluestorm, english
<bluestorm>
hm
<bluestorm>
doesn't english have gender considerations ?
<mwc>
Sure, but they're natural
<mwc>
boy = male
<bluestorm>
a, i see what you mean :p
<mwc>
woman = feminine
<bluestorm>
+h
<mwc>
nurse = male or female, depending on the actual person you're referring to
<mwc>
keyboard = neuter
<mwc>
with french, pipe = female
<mwc>
with latin: agricola = farmer, female
<mwc>
every time I try to use one of those languages, I trip up on the gender and have to remind myself how it works
<bluestorm>
don't you see the erotic side of "pipes" ? :-'
<thelema>
mwc: there's a few oddities even in english - ships are usually female
vincenz has left #ocaml []
<bluestorm>
you must be very confused by german, where "girl" is neuter :p
<mwc>
thelema, true, but those are more sentimental than anything
<Smerdyakov>
thelema, I would say that female ships are not part of the official English grammar. They're part of a subjective affectation.
<mwc>
bluestorm, latin, farmer is female.
<mwc>
Smerdyakov, actually, Lloyds (of London) tried to change all ship references in their contracts to neuter. They backed down
<mwc>
I think the rule in English is that only people have gender, and ships are personified.
<mwc>
IIRC, in Russian, ships are male
<Smerdyakov>
That's not the rule in English. That's the rule among communities who practice goofy variants of English.
<mwc>
bluestorm, I'm not really confused by grammatical gender, I just forget about it
<mwc>
The concept is simple, the application isn't, and my brain still hasn't successfully learned to store word*gender pairs in the vocab map
<mwc>
With latin it was slightly easier, for instance, first declension nouns are overwhelmingly female, though there are oddballs like agricola
<bluestorm>
do you try to speak latin very often ?
<mwc>
no, more amuse myself translating inscriptions and uttering the odd profanity
stbrn has quit ["leaving"]
<thelema>
"semper ubi sububi" <- found in a Italian restaurant in rural Illinois.
<thelema>
inscribed on the top of a column painted on the wall
<mwc>
heh, it's amusingly wrong
<mwc>
"Always where underwhere"
<Optikal__>
Is that how it's literally translated?
<Optikal__>
Or are you spelling wear wrong?
<bluestorm>
:D
<thelema>
# ubi : when, as soon as / wherein, whereby, whereas.
<mwc>
well, it can't be literally translated, since it's wrong
<mwc>
thelema, I looked it up to be sure, but: ubi adv (interrog) where; (relat) where, in which, with whom; when
<Optikal__>
"sempter usura subusura"
<Optikal__>
s/sempter/sempter
<mwc>
Collin's Latin Dictionary, 2001
<Optikal__>
GAAH
<Optikal__>
s/s/sempter/sempters/sempter/semper
<mwc>
s/Collin's/Collins/
<mwc>
Hahaha
<mwc>
Optikal__, you forgot to escape your / :)
<mwc>
plus usura = use, as in... The use of a sword requires much training
<mwc>
you're looking for "habitus"
<mwc>
but then there's no accepted translation for underwear since we didn't wear it well past the middle ages
<bluestorm>
it must be relatively rare for english native speakers to be versed in foreign languages
<mwc>
Well, I'm canadian, so at the very least, there's mandatory french education up until half way through secondary school
<mwc>
I attended primary school in french immersion, so I did all my schooling in french
<bluestorm>
hm, that's a nice thing about Quebec
<Optikal__>
They wore underwear in the middle ages sort of
<Optikal__>
They had tons of layers of clothes
<bluestorm>
however, to what i heard, english and french-speaking communities are a bit disconnected actually
<mwc>
bluestorm, actually, in Saskatchewan, they we had the option of taking Cree instead of French in high school
<mwc>
Cree being the language of the indigenous people of the region
<mwc>
s/they//
<mwc>
bluestorm, yes and no
<bluestorm>
hm, learning the indigene language looks like a very good idea to me
<Optikal__>
Why
<Optikal__>
?
thermoplyae has joined #ocaml
<bluestorm>
hm
<Optikal__>
Perhaps it is less expressive
<mwc>
In the early 90s, there was a Quebec separation movement that's quieted down, but never really died
<mwc>
bluestorm, no point really. Not even the natives really speak it any more
<bluestorm>
:p
<mwc>
I'd say that the bigger disconnect is between east and west, with Quebec being in the East
<bluestorm>
i'm afraid it's not as useful as french in the wider world, but still it could have been a good way to allow integration
<bluestorm>
(of course if nobody speak it anymore, then you can't do much for a dying language)
<mwc>
They gave us a prime minister named Trudeau. That's a four letter word where I come from
<Optikal__>
French is statically typed
<Optikal__>
They have the word police
<mwc>
hahah, so does Quebec
<mwc>
there was a law passed to the effect that English on any sign, if present, must be smaller than the French
<Optikal__>
Talk about an inferiority complex
<Optikal__>
yeesh
<bluestorm>
:p
<mwc>
Optikal__, they're concerned about English displacing French, and their culture along with it
<mwc>
I'd say if anything, ML is more like English
<Optikal__>
mwc: Exactly
<thelema>
bluestorm: common knowledge says that most native-english speakers don't speak other languages. Just like any rule, it has many exceptions.
<mwc>
You have dialects that while encoding nearly identical ideas, are utterly nonintercomprehensible
<mwc>
thelema, that and I think America is the largest bastion of english speakers
<mwc>
and they at best know a few words of spanish
<Optikal__>
Americans are required to take like 2 years of a foreign language in highschool
<ReachingFarr>
Hey, that's not fair. Some of us took Latin as well.
<mwc>
I can understand Americans without problem. I can generally understand British people, except for those with the Cockney accent
<mwc>
Optikal__, yes, but in an American high school ;)
<thelema>
mwc: almost everything said about americans as a group doesn't apply to >50% of us.
<Optikal__>
mwc: What about the DEEP south?
<ReachingFarr>
And it is a requirement at most Colleges to take another 2 years. Of course this does not imply fluency..
<mwc>
Optikal__, no problem
<mwc>
thelema, yeah, I know
<Optikal__>
Ever see King of the Hill?
<Optikal__>
Boomhauers do exist
<bluestorm>
thelema: in my experience, native english speakers are in Europe the less fluent in foreign languages
<thelema>
Optikal__: and worse.
<bluestorm>
french people being quite bad too
<mwc>
Optikal__, oh sure. And Canadians have Nuefies (Newfoundlanders)
<Optikal__>
Newfoundland is what hell looks like
<mwc>
Nuefies make Boomhauer look like a trained Orator
<Optikal__>
Craggy isolated houses built on sharp rocks
<bluestorm>
hm mwc, recently a canadian told me a canadian joke that he thought was very funny
<mwc>
Optikal__, but have you ever heard them speak?
<Optikal__>
mwc: Yeah
<bluestorm>
"A quebecois is a newfi that stopped on his way to Toronto"
<Optikal__>
Newfoundland dogs are great though
<mwc>
Optikal__, I hear a sentence from that and my brain sort of breaks trying to signal process what I've just heard
<mwc>
bluestorm, reminds me of another joke... "A newfoundlander(living in Toronto) asked by a newsperson what they thought about Quebec separating. His response: "Ou, that wud bee great eh! I'd be getting hume in hulf the toime."
<bluestorm>
:p
<mwc>
it sort of goes without saying that you meet most newfies outside of Newfoundland, since most of them have to leave to get work.
<Optikal__>
You ever heard of Tristran Da Cunha?
<mwc>
Ooops, that's my Western sensibility (hostility to the East) coming out.
<Optikal__>
It is the most remote archipelago in the world
<Optikal__>
and like only 4 families comprise the entire population of the island
<Optikal__>
and have for like more than a century
bongy has quit ["Leaving"]
<mwc>
Optikal__, hah, there are parts of Newfoundland like that :D
<Optikal__>
They don't allow immigration
<mwc>
there was a tourism ad for Newfoundland. The wife and I both made the same comment about FLKs at about the same time.
<Optikal__>
and tourism is strictly regulated
<mwc>
Optikal__, that's okay, in another century or so, it'll be reopen for colonization.
<Optikal__>
hehe
<Optikal__>
Or it will be discovered that while inbreeding makes you horribly disfigured and stupid, you develop super powers
<Optikal__>
and soon, they will dominate the world
<mwc>
possibly.
<mwc>
perhaps the Newfies have the same plan... scheming newfies
LordMetroid has joined #ocaml
<ReachingFarr>
If that were true the Hapsburgs would have ruled the world.
<LordMetroid>
Hello, channel
<mwc>
I haven't ripped on the East in a while, I'll try to control myself :)
<mwc>
Hello LordMetroid
<Optikal__>
Heh, one of the islands in the archipelago is named "Inaccessible island"
<mwc>
come to take us back on topic?
<LordMetroid>
I just got aware of OCAML's existence... Can you tell me a little bit about what difference it has compared to say Erlang or Haskell?
<mwc>
LordMetroid, well, unlike Erlang, and like Haskell, Ocaml is strongly typed
<bluestorm>
OCaml is impure, Haskell is pure
<mwc>
s/strongly/statically"
<mwc>
Ocaml is strict, Haskell is nonstrict
<bluestorm>
i'd say LordMetroid that OCaml is more "practical" than Haskell, for some value of "practical"
<LordMetroid>
I see...
<mwc>
example, in haskell, let fibs = 1 : 1 : zipWith (+) fibs (tail fibs)
<Optikal__>
Erlang is designed to be concurrent, ocaml is not
<mwc>
then you can do fibs !! 40 to get the 40th fibonnachi number
<bluestorm>
if think OCaml is easier to learn than Haskell
<bluestorm>
(if you come from basically every other programming language)
<thelema>
OCaml doesn't deviate from the mainstream quite as much as Haskell
<bluestorm>
while still providing most of the good bits of functional programming
<Optikal__>
I've heard that people arn't using functional languages in production systems because the only ones fast enough are the ones that allow you to code things imperatively
<mwc>
in Ocaml, adjusted for syntax of course, that would diverge
<thelema>
there's a place for imperative code, and there's a place for functional code. both coexist well in OCaml.
<thelema>
(and if you can't work without objects, you can have those too in OCaml)
<mwc>
indeed. If you think of C++ as a multiparadigm programming language, so is Caml.
<mwc>
Generic Programming: C++ has templates, Caml has modules (which are better.)
<Optikal__>
C++ doesn't do automatic memory management does it?
<mwc>
Object Orientated stuff: C++ has objects, so does Caml, with multiple inheritence and all that
<bluestorm>
a bit polemic though, and tackling advanced functionnalities of both languages, so probably not the best thing for a newcomer
<mwc>
LordMetroid, sure. C is sort of untouched at the lowest level of the OS and libs that have to work in those bowels.
<mwc>
C++ and Java are more "application" programming languages, that's Caml's domain too
<mwc>
and it's good at it.
<LordMetroid>
bluestorm: I'll see what I can make heads and tails of in the blog article
<mbishop>
OCaml has great C interactability, even if you aren't using the FFI
<LordMetroid>
mwc: I see... I am personally not so big of a fan of C++, java has great functionality out of the box and manages so much you can code more efficiently in it. Though you get some speed loss. I like Java for that. But the industry is using C++ so what can one do.
<mwc>
The one thing I do like about C++ is that it encourages you to deal with user defined types using value semantics instead of reference semantics
<mwc>
user defined values feel more first class in C++ than Java for that reason
mwc_ has joined #ocaml
jderque has quit ["leaving"]
love-pingoo has joined #ocaml
marmottine has quit [Remote closed the connection]
<hcarty>
LordMetroid: The OO parts of OCaml are fairly nice and easy to use in OCaml as well - they mix well with OO or non-OO code
<bluestorm>
hm
<bluestorm>
in my experience OO can raise delicate typing issues (delicate from my point of view, ie. "require to know a bit more than the layman point of view on parametric polymorphism")
<hcarty>
bluestorm: They probably can in some cases. And they seem to require more manual type annotations than other OCaml code
<bluestorm>
but i agree that OO in OCaml is very nice compared to the other OO languages i know (iirc, it's a matter of "structural typing")
<hcarty>
But anonymous object creation can be useful
<hcarty>
And, when speed is less of an issue, the name clashes that come with structures are not such an issue
<hcarty>
Or, at least, they are a different issue
<hcarty>
"they" being name clashes
<LordMetroid>
I read on Wikipedia taht OCaml reaches about 50% of the performance of C++... Isn't this a little bit low?
<mwc_>
LordMetroid, what kind of C++
<LordMetroid>
I have no idea
<mwc_>
C style?
<mwc_>
heavy STL code?
<mwc_>
Ocaml is comparable to high-level STL-using C++
<mwc_>
ie, the kind you'd want to write
<thelema>
LordMetroid: ocaml doesn't have a ceiling forcing it to be half as fast as C++
<bluestorm>
mwc_: there was a project to allow C++ metaprogramming with templates using an OCaml syntax
<bluestorm>
kind of simplified-OCaml -> compile-time templates computations translator
<bluestorm>
LordMetroid: performance comparisons are quite a mess
<LordMetroid>
mmm
<bluestorm>
but it has been showed that in some case OCaml perform better than C++
<bluestorm>
hm LordMetroid
<bluestorm>
i think you're referring to the X. Leroy quote
<LordMetroid>
Yes
<bluestorm>
saying that "a 50% performance should be expected at the very least", or something like that
<bluestorm>
that was not a general performance opinion
l_a_m has quit [Remote closed the connection]
<LordMetroid>
The references speaks of an almabecnhmark
<bluestorm>
iirc it's more something like "if you get less than that, then you know for sure that you've done something wrong"
<bluestorm>
(i studied the context a bit when considering translation to the french wiki page)
<LordMetroid>
Half the code lenght, poor OCaml guy got less payed :)
ReachingFarr has left #ocaml []
<bluestorm>
do some people _really_ pay developpers at the lines of code ratio ?
<LordMetroid>
I have no idea
<thelema>
If I was paid by LoC, every "let..in" statement I wrote would take up 3 lines minimum, and I'd write like rwmjones: no chaining, just lots of let x = f x in let x = f x in
<LordMetroid>
hehe
<thelema>
let x =
<thelema>
f input
<thelema>
in
<thelema>
let x =
<thelema>
g x
<thelema>
in
Linktim has quit ["Konversation terminated!§§§!"]
<Yoric[DT]>
Well, if I ended up paid by LoC, I'd start by writing a Java quotation for Camlp4 :)
<jlouis>
Yoric[DT]: ... which you would then use to write an Java-in-XML to plain Java translator for
<Yoric[DT]>
Good idea.
<Yoric[DT]>
Or perhaps I'll make my life easier and just use Object-XML.
psnively has joined #ocaml
<jlouis>
Yoric[DT]: yeah, and to top it off, you construct a language in which every character must be on its own line. And *then* you write the compiler from plain ocaml to this language
<jlouis>
You will become very rihc
onigiri has joined #ocaml
<Optikal__>
Verticle brainfuck
olleolleolle has joined #ocaml
thermoplyae has quit ["daddy's in space"]
love-pingoo has quit ["Connection reset by pear"]
zarvok has quit ["BitchX-1.1-final -- just do it."]
coucou747 has quit ["bye ca veut dire tchao en anglais"]
thermoplyae has joined #ocaml
ita has joined #ocaml
middayc_ has joined #ocaml
<thelema>
mwc: And if they cannot implement max or swap or linear search, what chances do they have to implement really complex stuff? These are my litmus tests: if a language allows me to implement max and swap and linear search generically - then it has some potential. -- Stepanov doesn't seem to approve of OCaml