AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Programming paradigm
Goto page 1, 2  Next
 
Reply to topic    AutoHotkey Community Forum Index -> General Chat
View previous topic :: View next topic  
Author Message
godsstigma



Joined: 04 Nov 2008
Posts: 222
Location: Memphis, TN

PostPosted: Sat Feb 20, 2010 1:01 am    Post subject: Programming paradigm Reply with quote

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
View user's profile Send private message
tank



Joined: 21 Dec 2007
Posts: 3700
Location: Louisville KY USA

PostPosted: Sat Feb 20, 2010 3:56 am    Post subject: Reply with quote

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
View user's profile Send private message
godsstigma



Joined: 04 Nov 2008
Posts: 222
Location: Memphis, TN

PostPosted: Sat Feb 20, 2010 3:58 am    Post subject: Reply with quote

That's what I thought, thanks Tank.
Back to top
View user's profile Send private message
Tuncay



Joined: 07 Nov 2006
Posts: 1886
Location: Germany

PostPosted: Sat Feb 20, 2010 9:36 am    Post subject: Reply with quote

With AutoHotkey_L you have OOP also. hehe.
_________________
{1:"ahkstdlib", 2:"my libs", 3:"my apps", 4:"my license"}
--> Don't feed the troll! <--
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tank



Joined: 21 Dec 2007
Posts: 3700
Location: Louisville KY USA

PostPosted: Sat Feb 20, 2010 1:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
godsstigma



Joined: 04 Nov 2008
Posts: 222
Location: Memphis, TN

PostPosted: Tue Feb 23, 2010 1:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
tank nlid
Guest





PostPosted: Tue Feb 23, 2010 2:14 pm    Post subject: Reply with quote

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

PostPosted: Tue Feb 23, 2010 2:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
jethrow



Joined: 24 May 2009
Posts: 1907
Location: Iowa, USA

PostPosted: Tue Feb 23, 2010 4:26 pm    Post subject: Reply with quote

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 Sad ... ( well, & a lil Ruby too Wink )
_________________
Very Happy - in case I forgot to smile
Basic Webpage Controls
COM Object Reference
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
tank



Joined: 21 Dec 2007
Posts: 3700
Location: Louisville KY USA

PostPosted: Tue Feb 23, 2010 5:18 pm    Post subject: Reply with quote

jethrow wrote:
And I thought I was learning OOP via AHK Sad ... ( well, & a lil Ruby too Wink )
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
View user's profile Send private message
jaco0646



Joined: 07 Oct 2006
Posts: 3113
Location: MN, USA

PostPosted: Tue Feb 23, 2010 5:54 pm    Post subject: Reply with quote

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! Wink

@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. Cool
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Tue Feb 23, 2010 6:17 pm    Post subject: Reply with quote

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. Cool
When someone such as I(a well known jerk Wink ) 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 Very Happy

@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

PostPosted: Tue Feb 23, 2010 6:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6836
Location: France (near Paris)

PostPosted: Wed Feb 24, 2010 8:30 pm    Post subject: Reply with quote

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... Smile

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
View user's profile Send private message Visit poster's website
Lexikos



Joined: 17 Oct 2006
Posts: 7295
Location: Australia

PostPosted: Fri Jun 18, 2010 2:53 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> General Chat All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group