Author |
Message |
wtd
|
Posted: Sat Sep 10, 2005 5:46 pm Post subject: "Expression Oriented Programming"? |
|
|
Just thought I'd run this idea past the gurus here.
There are lots of ways of describing and categorizing programming languages.
Just to name a few:
- Procedural
- Imperative
- Functional
- Logic
- Object-oriented
- Aspect-oriented
But I find that there's one I don't hear much about outside of some Lisp circles.
I look at a language like Ruby, Perl or Smalltalk, for instance, and I see something that obviously isn't a proper "functional programming language", but still shares a lot of the same "feel".
As I pondered this, it struck me that I had gotten that functional vibe because everything returns a value of some kind. Everything is an expression.
So I'm wondering... is "expression oriented programming language" a valuable term? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
rizzix
|
Posted: Sat Sep 10, 2005 6:34 pm Post subject: (No subject) |
|
|
hmm i think you got the concept of "functional programming languages" kindof wrong.. Haskell is a functional programming language... C/Perl/Ruby etc.. dont use proper functions.. the so called "functions" in those languages are really partial functions... (one or more element may not be associated with any element in the co-domain)
edit:... |
|
|
|
|
|
wtd
|
Posted: Sat Sep 10, 2005 6:37 pm Post subject: (No subject) |
|
|
Huh?
I specifically said those languages aren't proper functional programming languages. Just that they feel a bit like functional programming languages in everyday use.
And yes, they all fit into one or the other of the other categories I mentioned (Ruby for instance is object-oriented). |
|
|
|
|
|
rizzix
|
Posted: Sat Sep 10, 2005 6:38 pm Post subject: (No subject) |
|
|
yes.. well what i mean is.. they may feel like it.. but they are NOT functional programming languages.. but only because they allow you to define partial functions..
edit: (when i wrote that post, i was really refering to "As I pondered this, it struck me that I had gotten that functional vibe because everything returns a value of some kind. Everything is an expression." i'm sorry if i misunderstood it.. but i thought ur definition of a functional programing language is a language that has procedures which can return some value..) |
|
|
|
|
|
rizzix
|
Posted: Sat Sep 10, 2005 6:51 pm Post subject: (No subject) |
|
|
anyway.. "expression" may not be a good term.. because in a functional programming language.. everything is an expression.. i mean everything... soo.. yea..
and dosen't "procedural" cover up that definition? |
|
|
|
|
|
MihaiG
|
Posted: Sat Sep 10, 2005 7:10 pm Post subject: (No subject) |
|
|
rizzix wrote: anyway.. "expression" may not be a good term.. because in a functional programming language.. everything is an expression.. i mean everything... soo.. yea..
and dosen't "procedural" cover up that definition?
ill have to go with rizziz on that one 8) 8) |
|
|
|
|
|
wtd
|
Posted: Sat Sep 10, 2005 7:18 pm Post subject: (No subject) |
|
|
I know this is an overly simple example, but when I think procedural, I think:
code: | some_var : some_type
get(some_var)
put(som_var) |
As opposed to a more expression oriented:
|
|
|
|
|
|
wtd
|
Posted: Sat Sep 10, 2005 7:24 pm Post subject: (No subject) |
|
|
Or perhaps:
code: | if foo then
bar = 42
else
bar = 27
end |
vs.
code: | bar = if foo then
42
else
27
end |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
|