Functional Programming Languages as Free Speech?
timster asks: "Okay, we've talked about functional programming languages (see Haskell for an example) here before, and I got to wondering. A procedural program is a set of statements of things to *do*, and so has an obvious "machine" aspect to it. A purely functional program, however, can be viewed as a single mathematical *expression*, which accomplishes its "purpose" through the mechanism of being evaluated. My question is: if DeCSS were written functionally, would its First Amendment protections be stronger?"
I was wondering about a similar issue a few weeks back (even submitted an AskSlashdot). Why go through that much effort? Why not just release a C program with 'main()' commented out? Then heavily comment it. Then release it as a white paper under the Open Content License. As delivered, it cannot successfully be compiled, so it's not source code. Given that your comments will say "here is how we would do this. For a code example read the next 50 lines".
Jesus was all right but his disciples were thick and ordinary. -John Lennon
That's imperative, you loser. And it's also OT. =)
Just because Scheme and Haskell are both classified as functional languages does not make them equivalent for this particular argument. The difference is that Haskell is purely functional (local variables don't exist) while Scheme is not. It's this property of Haskell that can sometimes make things more complicated to implement than they would be in a procedural language. However, there are many useful properties (like easier proofs of correctness) of programs written in a purely functional manner that would are lost by implementing in a procedural language or a hybrid like Scheme.
Sit there
Grind HD for a while
Crash
Repeat
Learn to Improvise
Implementative power is what you can do with a program written in the language, once it's finished; if you're to produce closed-source stuff, that's the only thing you're interested in, and that's why people have been brainwashed by forty years of closed source into not caring about more than it. The language could be "write-only", and "write-once", implementative power wouldn't be less.
Expressive power is the information you can exchange using the language with other people with whom you work. When programming is an incremental undertaking, what you care about is expressive power. That's what people need in the world of free software computing. To be very expressive, the language must be "read-write" and "write-indefinitely".
For instance, a language to describe finite state machines operating on an indefinite tape (Turing Machines) can implement any one-shot computations from integers to integers in asymptotically optimal space and time. But as a tool for interprogrammer communication, it is not nearly as expressive as Cayenne that allows to describe arbitrary functions from arbitrary higher-order types to any other, including the ability to define statically enforced logical invariants. In Cayenne (which compiles into Haskell, which can be compiled into machine code, bypassing C for everything but for system interface and runtime support), you can define a type whose elements are precisely all sort functions, excluding any buggy function that sometimes fail. The language can thus express much more than C or any other implemented language, for that matter.
-- Faré @ TUNES.org
-- Faré @ TUNES.org
Reflection & Cybernet
I know the difference between scheme and Haskell, but I recall that my scheme code had no defs or setfs so I was using it in a purely functional method.
"When you sit with a nice girl for two hours, it seems like two minutes. When you sit on a hot stove for two minutes, it
Actually cryptography is a pretty nice in a pure functional language. I've implemented a toy RSA encryption package (it differed from a real packaage in that it encrypted the entire message using the public key) in scheme and it was fairly straightforward. It took less than roughly 300 lines of code to implement key-generation, and encryption/decryption routines.
A better example of a problem area for a FP might be something like a word processor or a spread sheet but that may not be so difficult (I don't think anyone's tried it).
"When you sit with a nice girl for two hours, it seems like two minutes. When you sit on a hot stove for two minutes, it
notice that the judged banned DeCSS but he didnt ban the DeCSS whitepaper which showed how to crack the algorithm. The whitepaper was the equivalent of a functional representation of DeCSS. in general judges favour a text like presentation or a whitepaper to actual working code.
You're sloving a non-problem here.
-- the most controversial site on the Web
Computationally, this argument makes no sense. Basically, any program in a functional language can be written in an imperative one (otherwise one wouldn't be able to implement, say, Haskell in a regular computer). Sure, some programming idioms may fit the functional style better, but others come more naturally as imperative, and for these algorithms, an imperative language is more expressive. I feel that this is usually the case in applied number theory, in which algorithms naturally involve a lot of iteration, assignment, global variables and whatnot). Try to implement, say, Blowfish (or whatever) on Haskell (pure functional) and Eiffel (imperative with constraints), and Haskell advocates' "executable specification language" buzz suddenly doesn't sound so good anymore. (Don't get me wrong, I'm myself a big advocate of declarative programming. It's just not the Holy Grail.)
So, even if the US law people are ignorant enough to consider an algorithm's description in English as protected speech while that same algorithm's implementation in an actual programming language is outlawed (which wouldn't surprise me, coming from a country where there were export restrictions on the PGP sources in digital form but it was OK to print and publish worldwide a book containing nothing but these same sources in printed form), I don't think that it'd make a whole lot of a difference for the people who make these decisions whether the language used in the implementation is statement- or expression-oriented. Even if it does, however mildly, look like mathematical notation.
(Hrrrm. Wonder if the new language on which I'm working, whose concrete syntax translates to and from AMS-TeX and therefore can be typeset indistinguishably from actual math, would be an advantage, then.)
To the editors: your English is as bad as your Perl. Please go back to grade school.