[dundee] Tiling Window Managers.... XMonad anyone?
Iain Barnett
iainspeed at gmail.com
Wed Jul 8 14:01:18 UTC 2009
2009/7/8 Rick Moynihan <rick.moynihan at gmail.com>
> Perhaps I'm nitpicking but SQL/regexes are actually declarative
> languages, likewise the definition you supplied is a great description
> of declarative languages.
>
> Functional programming is a style of programming that encourages you
> to write your code as 'pure functions', i.e. procedure's that given
> the same inputs always return the same result without mutating state
> or causing side effects.
>
> This said, there can be a lot of similarity between functional
> langauges and declarative ones, as functional languages allow you to
> easily raise the abstraction so as to provide a declarative
> interpretation.
>
> I think the conflation of the two has probably come from your Haskell
> exposure... The reason Haskell is sometimes described as declarative
> comes more from its laziness i.e. leaving evaluation order up to the
> language than anything else.
I certainly don't mind a bit of nitpicking, I'm quite partial to it myself
:)
I agree with what you say, although I'd counter (in a way that actual agrees
with you, but I'm not sure what the word for that is?) that you can't write
in a functional style without being declarative. Essentially, pure functions
are declarations, which is why they can be used lazily. But it's not the
laziness that makes them declarative, that's a choice made by the compiler.
Because they're pure, they don't alter program flow and are therefore
declarative. To use them you'd have to build an impure function and call
them from that, unless you want one of those progs that doesn't speak to the
outside world, I forget the name.
You could take any of the languages, including Haskell (and certainly I've
seen it done to SQL a lot), and force a procedural style onto them, but then
they also wouldn't be (as) declarative anymore.
Maybe this is down to my main exposure being Haskell, and the style of SQL I
write - which is correct (if I do say so myself), and not the sort I've seen
most developers I've worked with use. The bane of my existence is having to
explain why booleans shouldn't be in databases and what 3NF is. To
professionals!
>
>
> Anyway, you should check out clojure, it's a practical lisp for the
I was about to write "I will", but then I read the words "practical lisp" :)
Iain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.lug.org.uk/pipermail/dundee/attachments/20090708/674b4ec7/attachment.htm
More information about the dundee
mailing list