AutoHotkey Community

It is currently May 27th, 2012, 4:25 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Programming paradigm
PostPosted: February 20th, 2010, 2:01 am 
Offline

Joined: November 4th, 2008, 10:25 pm
Posts: 222
Location: Memphis, TN
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 20th, 2010, 4:56 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
ahk is by definition a procedural language but in many ways fits the definition of functional as well

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 20th, 2010, 4:58 am 
Offline

Joined: November 4th, 2008, 10:25 pm
Posts: 222
Location: Memphis, TN
That's what I thought, thanks Tank.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 20th, 2010, 10:36 am 
Offline

Joined: November 7th, 2006, 9:47 pm
Posts: 1934
Location: Germany
With AutoHotkey_L you have OOP also. hehe.

_________________
{1:"ahkstdlib", 2:"my libs", 3:"my apps", 4:"my license"}
--> Don't feed the troll! <--


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 20th, 2010, 2:51 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
OOP without the ability to create classes?
no not really
AHK_L has a ways to go before it can be called OOP

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 23rd, 2010, 2:57 pm 
Offline

Joined: November 4th, 2008, 10:25 pm
Posts: 222
Location: Memphis, TN
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 23rd, 2010, 3:14 pm 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 23rd, 2010, 3:37 pm 
Offline

Joined: November 4th, 2008, 10:25 pm
Posts: 222
Location: Memphis, TN
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 23rd, 2010, 5:26 pm 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
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 :wink: )

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 23rd, 2010, 6:18 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
jethrow wrote:
And I thought I was learning OOP via AHK :( ... ( 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.

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 23rd, 2010, 6:54 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
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. 8)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 23rd, 2010, 7:17 pm 
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. 8)
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 :D

@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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 23rd, 2010, 7:18 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
last post was me

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2010, 9:30 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
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...

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 18th, 2010, 3:53 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
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.)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group