Should Lucee add functional programming concepts?

Hi,

I wonder if it would make sense to add functional programming concepts to
lucee?

Or stay more or less an OO language?

What are the pros and cons?

Would it be possible for Lucee to have advantages over Scala and Clojure?

How complex would this be?
Here a link with some infos: http://code.google.com/p/functionalcf/

Regards
Thorsten

I wonder if it would make sense to add functional programming concepts to lucee?

Do you have specific concepts in mind? I ask because I’m wondering what you think FP is about (given the link you added).

Or stay more or less an OO language?

We’re talking about .lucee scripts being like CFCs and there’s been a lot of progress switching from typeFunction(data,args) style calls to data.function(args) style calls, e.g., myArray.map( function(elem) { return 2 * elem; } )

What are the pros and cons?

I can talk your ear off about the benefits of functional programming :slight_smile:

Would it be possible for Lucee to have advantages over Scala and Clojure?

Every language has pros and cons and is better for certain things than other languages. Scala and Clojure are both extremely different to Lucee (CFML). I’ve used all three in production. Scala is primarily an OOP language with a strong static type system that also supports FP style coding (painfully, IMO, which is partly why I no longer use Scala). Clojure is an FP language with a strong dynamic type system that also supports some useful facets of OOP style coding (very elegantly). Scala is “traditional” insofar as it’s “like” Java with a lot less boilerplate and syntax noise (although it can be argued that Scala also adds its own flavor of “noise” in terms of syntax). Clojure is a Lisp so it’s homoiconic (code is data).

Here a link with some infos: http://code.google.com/p/functionalcf/ http://code.google.com/p/functionalcf/
You understand that’s just a Lisp interpreter written in CFML, right? See Nick’s post on his mailing list (the only post, from back in 2011):

https://groups.google.com/forum/#!topic/functionalcf-discuss/2vl9V12LXHw <https://groups.google.com/forum/#!topic/functionalcf-discuss/2vl9V12LXHw>

Sean Corfield – (904) 302-SEAN
An Architect’s View – http://corfield.org/

“Perfection is the enemy of the good.”
– Gustave Flaubert, French realist novelist (1821-1880)On Feb 6, 2015, at 2:08 AM, @thorsteneilers wrote:

Destructuring is present in a lot of languages and it’s a very convenient, as are spread and gather, but that’s not really anything to do with functional programming.

Sean Corfield – (904) 302-SEAN
An Architect’s View – http://corfield.org/

“Perfection is the enemy of the good.”
– Gustave Flaubert, French realist novelist (1821-1880)On Feb 6, 2015, at 11:59 AM, Jonas Hauß <@Jonas_Hauss> wrote:

How about destructuring from lisp? E.g. the ECMAScript 6 implementation?

Yeah, you’re right. My fault.
I’ve seen the comment about lisp and just got excited about some of it’s features.

How about destructuring from lisp? E.g. the ECMAScript 6 implementation?

destructuring:
var surname = function (name) {
var [first, last] = name;
return last;
}

surname([“Jonas”, “Hauss”]);
//=> “Hauss”

Or even gathering:
var num = [“one”, “two”, “three”];
[“zero”, …num]
//=> [“zero”,“one”,“two”,“three”]

I really like these features from common lisp and working with it in JS is so much and really helpful!

Hi,

I wonder if it would make sense to add functional programming concepts to
lucee?

Or stay more or less an OO language?

What are the pros and cons?

Would it be possible for Lucee to have advantages over Scala and Clojure?

How complex would this be?
Here a link with some infos: http://code.google.com/p/functionalcf/

The examples in your link seem to be conflating Lisp-style code syntax
with the idea of functional programming. And I don’t think that’s a valid
(or appropriate) conflation to make?

If the question is should we have Lisp style syntax option? My opinion is
firmly “no”. Not least of all because the syntax looks grubby to me, but
also because ppl already struggle with tags vs script syntax, and we don’t
need to muddy the water further.

I am, however, all for more functional programming “constructs” being
brought into the language. But using the mechanics of the existing syntax
style.On Friday, 6 February 2015 10:08:52 UTC, thorste...@googlemail.com wrote:


Adam


Adam