Skip to main content

All Questions

111votes
3answers
16kviews

Why do Trampolines work?

I've been doing some functional JavaScript. I had thought that Tail-Call Optimization had been implemented, but as it turns out I was wrong. Thus, I've had to teach myself Trampolining. After a bit of ...
Ucenna's user avatar
  • 1,302
36votes
5answers
34kviews

Is Javascript a Functional Programming Language

Is Javascript a functional language? I know it has objects & you can do OOP with it also, but is it also a functional language, can it be used in that way? You know how OOP became/seems like the ...
Marek's user avatar
31votes
5answers
33kviews

Performance: recursion vs. iteration in Javascript

I have read recently some articles (e.g. http://dailyjs.com/2012/09/14/functional-programming/) about the functional aspects of Javascript and the relationship between Scheme and Javascript (the ...
mastazi's user avatar
26votes
1answer
4kviews

Are generator functions valid in functional programming?

The questions are: Do generators break the functional programming paradigm? Why or why not? If yes, can generators be used in functional programming and how? Consider the following: function * ...
Pete's user avatar
  • 1,247
23votes
5answers
4kviews

What is the benefit of having "no runtime errors", like Elm claims?

Some languages claim to have "no runtime errors" as a clear advantage over other languages that has them. I am confused on the matter. Runtime error is just a tool, as far as I know, and ...
atoth's user avatar
16votes
10answers
7kviews

Are immutable objects important only in multi-threaded applications and if so, how are shared immutable objects useful?

I think the answer to the first part of my question is, "yes" -- no point in making objects immutable in a single-threaded application (or I guess in a multi-threaded application if that ...
releseabe's user avatar
15votes
3answers
4kviews

How to write manageable code with functional programming?

I just started with functional programming (with JavaScript and Node.js) and from the look of things it looks as if the code I am writing would grow to be one hell of a code base to manage, when ...
dade's user avatar
  • 331
13votes
5answers
1kviews

Can *any* program task be expressed without state?

This is a theoretical question, but after many years of programming in what I now realize is "normal" imperative technique, using C++ mainly, I've discovered this other world of functional programming,...
johnbakers's user avatar
12votes
2answers
5kviews

A real-life example of using curry function? [closed]

I was struggled to find a real-life example of using curry function and get the benefit of using curry. When I google curry function I often see the example like let add = x => y => x + y; let ...
Qiulang 邱朗's user avatar
12votes
2answers
1kviews

Functional reactive programming — is Fay expressive enough?

So I'm doing a fairly involved javascript/html client with lots of ajax calls and other involvements of callback-ism. I'm entertaining the thought of using Fay for this purpose. I'm aware of Elm. ...
worldsayshi's user avatar
11votes
5answers
3kviews

Compute if a function is pure

As per Wikipedia: In computer programming, a function may be described as pure if both these statements about the function hold: The function always evaluates the same result value given the same ...
Oni's user avatar
  • 957
10votes
1answer
796views

Why most anonymous functions can't be JIT compiled and will never be optimized?

I just read https://techfindings.one/archives/2652 about functional programming and came accross this: anonymous functions can often not be JIT compiled and will never be optimized Can someone ...
thadeuszlay's user avatar
9votes
3answers
3kviews

Is a function getting a value from another function considered pure?

I'm trying to figure out a way to handle default variable values when making functions without side effects and have ended up with the following: function getDefaultSeparator() { return ':'; } ...
agost's user avatar
9votes
2answers
791views

How can I _read_ functional JavaScript code?

I believe I have learned some/many/most of the basic concepts underlying functional programming in JavaScript. However, I have trouble specifically reading functional code, even code I've written, and ...
Andrew Willems's user avatar
6votes
3answers
2kviews

What is the name for a NON-self-calling function?

I have a collection of normal functions and self-calling functions within a javascript file. In my comments i want to say something along the lines of "This script can contain both self-calling and ...
Alan Lapington's user avatar

153050per page
close