Is Harbour also a "Functional" programming language?

431 views
Skip to first unread message

Eric Lendvai

unread,
Oct 2, 2020, 4:11:25 AM10/2/20
to Harbour Users
Harbour is an "Object-Oriented", "Data-Centric" language that also supports functions, and has codeblocks.

Codeblocks are assigned to variables, can be passed to functions and methods, and even be returned from a function.

Does the existence of codeblocks as apart of the language make Harbour also a "Functional" programming language?

Angel Pais

unread,
Oct 2, 2020, 9:35:39 PM10/2/20
to harbou...@googlegroups.com
I would say Harbour is a dynamic superset of the C language, that adapts itself to every paradigm.
It's a compiler and it's an interpreter at the same time.
It has capabilities that hardly another dev tool has.
And it's preprocessor allows it to even redefine itself into another language.
I remember an experiment from years ago about using it to compile a COBOL program.
It is functional, procedural, oo and everything you like it to be.

Cheers

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/6a6c7b48-fb5a-44a8-8b8f-24c7b4cf340ao%40googlegroups.com.

Eric Lendvai

unread,
Oct 2, 2020, 9:42:14 PM10/2/20
to Harbour Users
Thanks Angel,

I will use some of your quotes during my presentation then :)

By the end of October the presentation video and white papers should be available to everyone.


Eric


On Friday, October 2, 2020 at 6:35:39 PM UTC-7, Angel Pais wrote:
I would say Harbour is a dynamic superset of the C language, that adapts itself to every paradigm.
It's a compiler and it's an interpreter at the same time.
It has capabilities that hardly another dev tool has.
And it's preprocessor allows it to even redefine itself into another language.
I remember an experiment from years ago about using it to compile a COBOL program.
It is functional, procedural, oo and everything you like it to be.

Cheers

El vie., 2 oct. 2020 a las 5:11, Eric Lendvai (<ericl...@gmail.com>) escribió:
Harbour is an "Object-Oriented", "Data-Centric" language that also supports functions, and has codeblocks.

Codeblocks are assigned to variables, can be passed to functions and methods, and even be returned from a function.

Does the existence of codeblocks as apart of the language make Harbour also a "Functional" programming language?

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbou...@googlegroups.com.

Angel Pais

unread,
Oct 2, 2020, 9:49:10 PM10/2/20
to harbou...@googlegroups.com
It's just my opinion about it but anyway...  be my guest!
I wish you big success in your presentation!


Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/27cd84e5-6941-4039-b7c7-49bda256ee2fo%40googlegroups.com.

Appliserver

unread,
Oct 3, 2020, 10:22:40 AM10/3/20
to harbou...@googlegroups.com

Il 03/10/2020 03:35, Angel Pais ha scritto:
> I would say Harbour is a dynamic superset of the C language, that
> adapts itself to every paradigm.
> It's a compiler and it's an interpreter at the same time.
+1
> It has capabilities that hardly another dev tool has.
+1
> And it's preprocessor allows it to even redefine itself into another
> language.
+1
> I remember an experiment from years ago about using it to compile a
> COBOL program.
Great!
> It is functional, procedural, oo and everything you like it to be.

Well... I know nothing about Haskell, apart it being the paradygm of
functional programming. What about comparing the two? What exactly means
"functional programming", in two words, for dummies?

Dan


alkresin

unread,
Oct 5, 2020, 9:19:07 AM10/5/20
to Harbour Users
Paul Graham wrote in his article "The roots of Lisp" in 2002: "It seems to me that there have been two really clean, consistent models of programming so far: the C model and the Lisp model. These two seem points of high ground, with swampy lowlands between them. ...  A popular recipe for new programming languages in the past 20 years has been to take the C model of computing and add to it, piecemeal, parts taken from the Lisp model, like runtime typing and garbage collection."

As many other modern languages, Harbour has some features, specific for functional languages. BTW, Harbour's pointers to functions @<funcName>() are more close to functional paradigm than codeblocks.
пятница, 2 октября 2020 г. в 11:11:25 UTC+3, Eric Lendvai:

Eric Lendvai

unread,
Oct 6, 2020, 1:17:20 AM10/6/20
to Harbour Users
Thank you Al for your explanation!

Do you have any Harbour sample code where you use the @<funcName>() features?

VFP does not have pointers to functions or codeblocks.

I do use codeblocks quite a bit now, but not the pointers to functions yet.

Thanks, Eric

Anand Kr Gupta

unread,
Oct 6, 2020, 4:45:49 AM10/6/20
to harbou...@googlegroups.com
I also agree with Angel Pais.
Also I have used the preprocessor to run a FoxPro prg in Harbour.

Best of Luck.

Anand
Working from Home


Seth Hovestol

unread,
Oct 7, 2020, 4:25:19 AM10/7/20
to Harbour Users
I'd argue that the definition of a functional language is that is centered around manipulating values rather than changing state. Under this definition most database calls invalidate a claim to being functional. 

The existence of first class functions (blocks and function pointers) isn't too consequential in terms of thinking a language is functional. In fact, I'd argue that c's function pointers are closer to a functional first class functions (https://stackoverflow.com/questions/840501/how-do-function-pointers-in-c-work) than harbours are, and C is generally considered, and in fact has already been invoked as in this conversation, the epitome of a not a functional language. 

In short, no harbour isn't a "functional" language, but that doesn't mean you cannot write in a way that behaves like a functional language. 

alkresin

unread,
Oct 7, 2020, 5:34:25 AM10/7/20
to Harbour Users
Eric, http://www.kresin.ru/en/hrbfaq_3.html#Doc2 - at the end of the subsection " 3.2 Some language extensions "

Regards, Alexander.
вторник, 6 октября 2020 г. в 08:17:20 UTC+3, Eric Lendvai:

Pete

unread,
Oct 7, 2020, 7:03:20 AM10/7/20
to Harbour Users
Although the worship of terminology is, most of the times, just an opportunity for an "academic"
(and not always productive) discussion, after doing a little "homework" (i.e., brief research in the net)
someone could almost safely say, that Harbour is not a "Functional" programming language,
rather the opposite, a general purpose "Procedural" programming language, with extended OOP capabilities.
(but this or the other classification hardly could increase or decrease the value of any language).

As Angel nicely put it, Harbour is "a dynamic superset of the C language, that adapts itself to every paradigm."
And then the question is, why you should strive to imitate this or that "paradigm", particularly when you don't
really need to? (ok, "just for the fun of doing it" :-), it'd be an acceptable reason but what else?)

Anyhow, if one wants to use (another one) tag, I'd suggest he/she to start labeling Harbour
as one of the few "Perfectional" programming languages.

(just my 2c).

regards,
Pete

Angel Pais

unread,
Oct 7, 2020, 8:40:44 AM10/7/20
to harbou...@googlegroups.com
I like that new category!  ( Perfectional ) lol

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages