| View previous topic :: View next topic |
| Author |
Message |
godsstigma
Joined: 04 Nov 2008 Posts: 222 Location: Memphis, TN
|
Posted: Sat Feb 20, 2010 1:01 am Post subject: Programming paradigm |
|
|
AHK and AutoIt would be considered what type of programming paradigm.
Procedural?
I know ultimately it is a scripting language, but what would it most closely resemble? |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 3700 Location: Louisville KY USA
|
Posted: Sat Feb 20, 2010 3:56 am Post subject: |
|
|
ahk is by definition a procedural language but in many ways fits the definition of functional as well _________________
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed; |
|
| Back to top |
|
 |
godsstigma
Joined: 04 Nov 2008 Posts: 222 Location: Memphis, TN
|
Posted: Sat Feb 20, 2010 3:58 am Post subject: |
|
|
| That's what I thought, thanks Tank. |
|
| Back to top |
|
 |
Tuncay
Joined: 07 Nov 2006 Posts: 1886 Location: Germany
|
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 3700 Location: Louisville KY USA
|
Posted: Sat Feb 20, 2010 1:51 pm Post subject: |
|
|
OOP without the ability to create classes?
no not really
AHK_L has a ways to go before it can be called OOP _________________
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed; |
|
| Back to top |
|
 |
godsstigma
Joined: 04 Nov 2008 Posts: 222 Location: Memphis, TN
|
Posted: Tue Feb 23, 2010 1:57 pm Post subject: |
|
|
| tank wrote: | | ahk is by definition a procedural language but in many ways fits the definition of functional as well |
Tank, can you explain to me how AHK can be described as a functional language? |
|
| Back to top |
|
 |
tank nlid Guest
|
Posted: Tue Feb 23, 2010 2:14 pm Post subject: |
|
|
i am not going to recide the definition of functional programing here it is done in various places on the web
if you have some argument on some basis that refutes this offer it |
|
| Back to top |
|
 |
godsstigma
Joined: 04 Nov 2008 Posts: 222 Location: Memphis, TN
|
Posted: Tue Feb 23, 2010 2:37 pm Post subject: |
|
|
I wasn't trying to refute your statement but rather trying to understand better.
I am guessing that AHK can be partly considered a functional language by the fact that it supports higher-order functions and recursion? |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 1907 Location: Iowa, USA
|
Posted: Tue Feb 23, 2010 4:26 pm Post subject: |
|
|
| tank wrote: | OOP without the ability to create classes?
no not really
AHK_L has a ways to go before it can be called OOP |
And I thought I was learning OOP via AHK ... ( well, & a lil Ruby too ) _________________
- in case I forgot to smile
Basic Webpage Controls
COM Object Reference |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 3700 Location: Louisville KY USA
|
Posted: Tue Feb 23, 2010 5:18 pm Post subject: |
|
|
| jethrow wrote: | And I thought I was learning OOP via AHK ... ( well, & a lil Ruby too ) | Its close but as you cant define objects just store references to other objects. I suppose yyou can create objects and sort of properties but you cant really define a method within an object so its an almost but not quite. .
public vs private memory management outside if what is available with functions
dont get me wrong for learning oop u can do almost everything with ahk_l except define true classes. _________________
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed; |
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 3113 Location: MN, USA
|
Posted: Tue Feb 23, 2010 5:54 pm Post subject: |
|
|
Saying that AHK "in many ways fits the definition of functional" may be a bit of a stretch. I think it is more fair to say that AHK implements some aspects of functional programming; but using functions and using functional programming are not identical concepts. Purely functional programming excludes the basic components of the procedural paradigm.
● No variables
● No assignments
● No iteration (loops)
I'm not sure how complex a program you could write in AHK without these things... not that it couldn't be done, but I think it would be difficult as you would repeatedly find yourself reverting to a procedural style to suit AHK's strengths.
@tank
Hey, you did ask for someone to refute it!
@jethrow
I still have yet to try any of the other flavors of AHK, but in gauging the "OOPness" of a language, look for data abstraction. Abstract data types are usually called classes, as tank said. They offer some very important features.
● Encapsulation (data hiding)
● Inheritance
● Dynamic method binding (polymorphism)
@godsstigma
Interesting thread. The AHK community is evolving, to find several participants on such a theoretical topic. This is a far cry from game macros.  |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Feb 23, 2010 6:17 pm Post subject: |
|
|
| jaco0646 wrote: | | but using functions and using functional programming are not identical concepts | We are saying the same thing. Its a close but no cigar coorilation but its much further towards a functional than not
| jaco0646 wrote: | @jethrow
I still have yet to try any of the other flavors of AHK, but in gauging the "OOPness" of a language, look for data abstraction. Abstract data types are usually called classes, as tank said. They offer some very important features.
● Encapsulation (data hiding)
● Inheritance
● Dynamic method binding (polymorphism) | Yes much more specifically said sorry i hate jargonizing my communication but in this case its necesary thanks for doing this part better
| jaco0646 wrote: | @godsstigma
Interesting thread. The AHK community is evolving, to find several participants on such a theoretical topic. This is a far cry from game macros.  | When someone such as I(a well known jerk ) ask to be refuted i am asking for it. I dont get mad upset or otherwise emotionally marred. I enjoy healthy factual debate. What irritates me is lack of effort which is much different that someone who is willing and able to cite reliable documentation that contradicts me. Like everyone being mistaken and making mistakes helps us grow
@jaco0646 of course i did and i meant it even if i aggree or dissagree. Thanks for not letting my being a more than occasional ass keep you from doing it |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 3700 Location: Louisville KY USA
|
Posted: Tue Feb 23, 2010 6:18 pm Post subject: |
|
|
last post was me _________________
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed; |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6836 Location: France (near Paris)
|
Posted: Wed Feb 24, 2010 8:30 pm Post subject: |
|
|
| tank nlid wrote: | | if you have some argument on some basis that refutes this offer it |
Looks like a way to dodge the problem. I can say that AHK is a concatenative language and give nothing to prove it, asking people to prove otherwise. A bit lazy...
AHK isn't functional, no more than C, for example. It has callbacks, but it doesn't have closures, to mention only a small side of functional programming. Likewise, it should have tail call recursion to enforce functional aspect (no iteration as jaco0646 points out).
Other things, like functions with no side effect, are more for pure functional languages, hardly usable in real world. After all, functions doing I/O, for example, need to have side effect... _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7295 Location: Australia
|
Posted: Fri Jun 18, 2010 2:53 pm Post subject: |
|
|
| tank wrote: | OOP without the ability to create classes?
no not really | "Prototype-based programming is a style of object-oriented programming in which classes are not present, ...(more)."
| tank wrote: | | you cant really define a method within an object | Why doesn't this hastily written example qualify?
| Code: | foo := foo()
foo.bar()
foo() {
return Object("base", Object("bar", "foo_bar"))
}
foo_bar() {
MsgBox Barred!
} |
I personally don't see the importance in "classifying" AutoHotkey(_L) as a language - OOP, functional or otherwise. (In that case, why did I post in this thread? Nobody knows.) |
|
| Back to top |
|
 |
|