Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #24594
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2014-06-03 19:15 -0700 |
| References | <da2909bd-58cc-4183-8b3c-167039985491@googlegroups.com> <1wrr3wcXt2iTFwiZ@invalid.uk.co.demon.merlyn.invalid> <586acd4a-249d-4a91-a71a-9cd6187634dd@googlegroups.com> <2PRbYy35ejjTFwYN@invalid.uk.co.demon.merlyn.invalid> |
| Message-ID | <d3bc8230-d5ec-4bf6-8cc6-5102cf3a4cc5@googlegroups.com> (permalink) |
| Subject | Re: ANN: Ramda, a new functional programming library |
| From | Scott Sauyet <scott.sauyet@gmail.com> |
Dr J R Stockton wrote: > Scott Sauyet posted: >>Dr J R Stockton wrote: >>> Scott Sauyet posted: >>> >>>> I'm looking for feedback on a new functional programming library for >>>> Javascript that I've been developing with a friend. [ ... ] >>> >>> If the library is not being written IN JavaScript (or even if it is), >>> you could consider implementing (maybe more efficiently) the improved >>> date object in <http://www.merlyn.demon.co.uk/js-dobj2.htm>. [ ... ] >> >> Although that looks to be interesting code, and an improvement on >> the existing Date constructor function in several important ways, I >> don't think it would be a good fit for Ramda. >> >> Ramda is about offering functional programming (FP) tools to the >> user. >> ... > > Not only do I not understand how to use FP, I don't understand many of > the words used in writing about it. And I doubt whether I ever will. Well, I'm no spring chicken, and I find I'm learning it, probably more slowly than I would have thirty years ago, but still reasonable well. I find it a more interesting way and a more powerful way to program than some of the other models I've used. >> DATE2 is an OO construct, a constructor function with a beefy >> prototype object. It creates mutable objects, usually a no-no in FP >> code, and it carries a great deal of inaccessible internal state. >> These features are fine for OO, but not for FP. > > Inaccessible internal state? AFAIR, and you'll have noticed the date of > the page, there should not be any. There is accessible state such as > DATE2.GMT, and there are internal variables in methods, and there is the > accessible date value. Otherwise, could you name an example? I probably mispoke. There is a real difficulty, in fact a near impossibility before ES6, in efficiently working with entirely encapsulated data that is still avaialable to prototype functions. So there is not likely to be totally inaccessible internal data that is used by these prototype functions, but the internal Date object, `this.Q` looks to me like something one *had better not* manipulate for fear of undermining the integrity of the DATE2 object. Am I mistaken about that? > The beefiness to which you refer is, I think, because DATE2 handles for > I/O many standard date formats, including ISO week numbering and (IIRC) > YMD using a single Roman character for the month, I-XII or i-xii. Also > it has to work round vexing features of the standard Object, such as > new Date(14, 7, 4) giving the (UK) start of WWI rather than a date in > the Year of the Consulship of Pompeius and Appuleius (767 AUC). Although I didn't look at every detail, I did see the sorts of things that this code did. While that's a nice chunk of work, functional programming is more commonly about exploiting the similarites between different sorts of objects, abstracting out common patterns of use into shared functions. That almost necessitates slim interfaces. > I think it would look simpler if it were implemented not IN JavaScript > but BY those who have coded the JavaScript Date Object in whatever > language was used. Well Ramda is a library for Javsacript, written in Javascript. So it's probably no help here. > OTOH, the Object does not do as much as it could about the dates of > Summer Time (I've only recently discovered that the end of Summer Time > can depend on the date of Easter Sunday). Over the years, you've taught me a few surprising things about dates, but that one's quite surprising. What are the circumstances in which this occurs? >> I have a talk I've given several times discussing the ideas involved >> in functional programming as applied to Javascript. [1] > >> [1] <http://scott.sauyet.com/Javascript/Talk/FunctionalProgramming> > > Includes "Not available in current versions Javascript" on slide 22. > Trivial - needs an "of". Important - Web pages persist, so there should > be a "current date" value given at the beginning. That's a very good idea. I will try to fix it next time I'm in there editing it. Thanks, -- Scott
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-27 20:13 -0700
Re: ANN: Ramda, a new functional programming library John C <rescattered@gmail.com> - 2014-05-27 21:00 -0700
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-28 04:37 -0700
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-28 04:36 -0700
Re: ANN: Ramda, a new functional programming library "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-05-28 08:49 -0700
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-28 15:59 -0700
Re: ANN: Ramda, a new functional programming library "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-05-28 16:15 -0700
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-28 17:05 -0700
Re: ANN: Ramda, a new functional programming library Christoph Michael Becker <cmbecker69@arcor.de> - 2014-05-30 14:53 +0200
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-30 11:14 -0700
Re: ANN: Ramda, a new functional programming library Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-05-29 19:40 +0100
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-29 17:55 -0700
Re: ANN: Ramda, a new functional programming library Christoph Michael Becker <cmbecker69@arcor.de> - 2014-05-30 14:05 +0200
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-30 11:10 -0700
Re: ANN: Ramda, a new functional programming library John C <rescattered@gmail.com> - 2014-05-30 06:25 -0700
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-30 11:23 -0700
Re: ANN: Ramda, a new functional programming library John C <rescattered@gmail.com> - 2014-05-30 12:44 -0700
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-30 13:39 -0700
Re: ANN: Ramda, a new functional programming library John C <rescattered@gmail.com> - 2014-05-30 19:17 -0700
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-31 09:52 -0700
Re: ANN: Ramda, a new functional programming library Christoph Michael Becker <cmbecker69@arcor.de> - 2014-05-31 22:24 +0200
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-06-01 06:55 -0700
Re: ANN: Ramda, a new functional programming library Christoph Michael Becker <cmbecker69@arcor.de> - 2014-05-31 21:00 +0200
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-06-01 06:54 -0700
Re: ANN: Ramda, a new functional programming library Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-06-01 19:05 +0100
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-06-01 19:28 -0700
Re: ANN: Ramda, a new functional programming library Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-06-03 22:01 +0100
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-06-03 19:15 -0700
Re: ANN: Ramda, a new functional programming library Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-06-05 23:41 +0100
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-06-06 11:36 -0700
Re: ANN: Ramda, a new functional programming library Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-06-07 23:13 +0100
Re: ANN: Ramda, a new functional programming library billyroberts111@gmail.com - 2016-03-06 10:22 -0800
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2016-03-06 17:52 -0800
Re: ANN: Ramda, a new functional programming library "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-03-07 10:50 +0100
csiph-web