Hacker News new | past | comments | ask | show | jobs | submit login

Maybe I'm just too pedantic, but this is not a functional language. Yes, you can write functional style code, but you can write functional style code in C, C++, Java, Python, JS, Ruby, Common Lisp, Scheme, etc etc. That does not make any of these languages 'functional'.



> Yes, you can write functional style code, but you can write functional style code in C, C++, Java, Python, JS, Ruby, Common Lisp, Scheme, etc etc. That does not make any of these languages 'functional'.

Lisp-family languages (both CL and its immediate predecessors, and Scheme) for a long time were the textbook example of functional languages. The relatively novel (and still niche) attempt to redefine things so that only pure functional languages are “functional languages”, and particularly the people that insist on this usage as if it were firmly established and abuse those who don't conform to their preferred redefinition, is a bit annoying.


This is not correct, lisp operations on lists have always been to modify in place, with copying versions added later. The technology did not exist to do functional programming efficiently enough (and to some extent that technology still does not exist generally).


Simply false. For example, LISP 1.5 manual had this definition for UNION:

  (union (lambda (x y) (cond ((null x) y) ((member
         (car x) y) (union (cdr x) y)) (t (cons (car x)
         (union (cdr x) y))))))
It had a MAPLIST (today called MAPCAR):

  maplist[x;fn]=[null[x]->NIL;
                 t->cons[fn[x];maplist[cdr[x];fn]]]
Or APPEND:

  append[x;y] = [null[x] -> y; T -> cons[car[x]; append[cdr[x];y]]]
Et cetera. Sure, it also had, say, NCONC. But it had these operators and style from the beginning, not surprisingly, as Lisp came from lambda calculus.


Only for those revisionist folks that have decided Haskell is the baseline for FP.


Functional doesn't really have a consistent definition, and you end up always with "yeah but"s in any discussion e.g. haskell isn't functional because C ffi and unsafePerformIO.

Point being, its very hard to say "X is or is not functional", as there isn't an objective consideration.

(FYI, I love Haskell and use it daily and write it professionally)


This language has mutable strings. This is in some sense the opposite of functional style.


So for me the primary qualifier is “are functions first class”; then “can functions be defined like data” (lambda); then “does it have a rich library of functionality that allows one to program functionally with it”; then “Is fp style idiomatic” ; then probably “does it have a good method to control mutability”; then “does it control side effects”

There may be some other examples in there. Personally I like things with controlled side effects. But it’s just my preferred set of trade offs.

Anyway I mean its just tough to be dogmatic about it. I get what you’re saying but why is that the dividing line?


Functional style does not allow for 'evolving' a value in multiple steps. In some sense this is the heart of the difference between functional style and other styles of programming.

Language features which are only possibly used in a non-functional style make me want to say that describing the language as 'functional' is either wrong or saying a language is 'functional' is a meaningless claim. If every language is functional, saying it is completely redundant.

I like your idea of saying FP style is idiomatic in that language might qualify the language as being described as 'functional', which I think agrees with my intuition that mutable strings being built in is evidence that calling that language 'Functional' is misleading or silly.


The main question for me is whether it has persistent data structures with structural sharing. If it has that, I'm happy to call it "functional." Without that it's hard to write efficient pure functions.


I've noticed that the language inspires how people write code, and the community.

Sure you can write functionally in Python with generators, first class and higher order functions, but its not really how the community writes (all the time).

Scheme isn't pure functional, it is mutable, but people write _as if_ it is immutable.


Is this Scheme/Common Lisp? Where are the cons cells?

Nope. There are no cons cells here.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: