Jump to content

Talk:JavaScript

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Perl should be added to the list of influencers of JavaScript

[edit]

See

- https://2ality.com/2013/02/javascript-influences.html

listing similar methods where the comments explicitly mention Perl

And consider the newer "use strict" which is literally a Perl pragma

I don't know how to add this information, since editing is protected. 2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D (talk) 03:36, 29 March 2025 (UTC)[reply]

Semi-protected edit request on 29 March 2025

[edit]

Add Perl to the list of "Influenced By", links to sources can be found in the talk section.


Reasoning:

It's not only very obvious that perl influenced methods in the Array, String and RegEx objects by name and semantic. The original source code of JavaScript is explicitly referencing Perl in the comments on numeral occasions.

Perl might be an unpopular language in 2025 but was very popular at the time of the creation of JS.

The "use strict" feature in newer instances of JS is a straight forward copy from Perl. 2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D (talk) 14:19, 29 March 2025 (UTC)[reply]

 Not done: please provide reliable sources that support the change you want to be made. Where you write "links to sources", do you mean the one link you included in the section you created just above? That's one person's blog, unfortunately, which doesn't qualify as a reliable source. Can you supplied at least one? Aside from that, I'm looking at where AWK, Self, and HyperTalk are listed and thinking that if they're truly a source they ought to be mentioned as such in the article's body, but they aren't. Largoplazo (talk) 15:03, 29 March 2025 (UTC)[reply]
This image from the Chinese blog entry mentioned in the other blog shows a grep in the original code base of JS mentioning Perl
https://images0.cnblogs.com/blog/116671/201302/06202428-4fa9b726d88d4a16be4ac498a60f9a95.jpg
What could be more obvious?
I will add more sources later, because my mobile Chrome keeps erasing the form whenever I change the tab searching for more...
I can start a detailed discussion at a programmers forum detailing the deep influence of Perl if this is considered "reliable" 2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D (talk) 16:16, 29 March 2025 (UTC)[reply]
That doesn't remotely qualify as a reliable source, and using it would probably amount to original research, which isn't permitted; at best, it's a primary source. Did you follow the link to the guideline about reliable sources to acquaint yourself with what's meant by that here? Largoplazo (talk) 16:19, 29 March 2025 (UTC)[reply]
The original code base at Mozilla is not a reliable source? 2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D (talk) 16:21, 29 March 2025 (UTC)[reply]
Not really because it's only claimed to be the real thing by a blog that itself isn't a reliable source. The MDN link you provided below is much more relevant. Largoplazo (talk) 16:55, 29 March 2025 (UTC)[reply]
2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D (talk) 17:04, 29 March 2025 (UTC)[reply]
cut and paste into the mobile interface of Wikipedia is creating weird amputated results. I apologize, but that's a technical problem beyond my influence.
Will need to fire up my laptop later and create an official request at MDN for a link to the original code. 2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D (talk) 17:20, 29 March 2025 (UTC)[reply]
https://github.com/ricardoquesada/Spidermonkey/blob/master/js/src/jsarray.cpp 2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D (talk) 17:06, 29 March 2025 (UTC)[reply]
AWK's influence was stated by Eich as using the 8 letter word 'function' instead 'sub' like in Perl.
I occasionally states in interviews that the 'onEVENT' callback naming syntax - like onMouseOver or onSubmit was inspired by HyperCard/HyperTalk, a hypertext system preceding HTML by many years. 2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D (talk) 16:32, 29 March 2025 (UTC)[reply]
I wasn't questioning the validity of the inclusion of AWK and HyperText, only commenting that they ought to be expanded on in the body of the article rather than relegated only to the infobox. Largoplazo (talk) 17:07, 29 March 2025 (UTC)[reply]
A tweet from Brendan Eich the creator of JS, Juli 4th 2017
Java inspired sort, which is in-place/mutating. TBH, JS1.0 in 1995 was under Perl influence; JS1.2 in 1997 fell more under Python influence.
12:00 vorm. · 4. Juli 2017
Source https://x.com/BrendanEich/status/881996154115837952
X has problems displaying it on some browsers like Chrome.
I did a screenshot with Firefox. Google search has it cached too. 2A00:FBC:E1C4:5A7E:988B:44F9:E011:2675 (talk) 12:36, 30 March 2025 (UTC)[reply]
This is a link the current source of the Spidermonkey implementation of JS Arrays:
https://searchfox.org/mozilla-central/source/js/src/builtin/Array.cpp
Searching for the word "Perl" shows a list of "Perl-ish methods" like
/* Perl-ish methods. */
JS_INLINABLE_FN("join", array_join, 1, 0, ArrayJoin),
JS_FN("reverse", array_reverse, 0, 0),
JS_TRAMPOLINE_FN("sort", array_sort, 1, 0, ArraySort),
JS_INLINABLE_FN("push", array_push, 1, 0, ArrayPush),
JS_INLINABLE_FN("pop", array_pop, 0, 0, ArrayPop),
JS_INLINABLE_FN("shift", array_shift, 0, 0, ArrayShift),
JS_FN("unshift", array_unshift, 1, 0),
JS_FNINFO("splice", array_splice, &array_splice_info, 2, 0),
Compare
- join http://perldoc.perl.org/functions/join.html
- reverse http://perldoc.perl.org/functions/reverse.html
- push http://perldoc.perl.org/functions/push.html
More corresponding Perl functions can be found in
http://perldoc.perl.org/perlfunc.html
I'm sure a repo of JS 1.0 would show more detailed comments regarding Perl.
Claiming that Hypertalk or AWK had bigger influence on JS most probably comes from anti-Perl zeitgeist. 2A00:FBC:E1C4:5A7E:988B:44F9:E011:2675 (talk) 12:44, 30 March 2025 (UTC)[reply]
"JavaScript borrows most of its syntax from Java, C, and C++, but it has also been influenced by Awk, Perl, and Python."
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#:~:text=JavaScript%20borrows%20most%20of%20its%20syntax%20from%20Java%2C%20C%2C%20and%20C%2B%2B%2C%20but%20it%20has%20also%20been%20influenced%20by%20Awk%2C%20Perl%2C%20and%20Python. 2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D (talk) 16:20, 29 March 2025 (UTC)[reply]
the mentioned blog entry grepping the original code base.
https://2ality.com/2013/02/javascript-influences.html
The link to the code base is broken, I will provide a new one later. 2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D (talk) 16:28, 29 March 2025 (UTC)[reply]
Brendan Eich, Creator of JavaScript, in “Coders at Work: Reflections on the Craft of Programming” Peter Seibel 2009 page 158/159
https://en.m.wikipedia.org/wiki/Coders_at_Work
”When I did JavaScript's regular expressions I was looking at Perl 4. I did step through it in the debugger, as well as read the code. And that gave me ideas; the implementation I did was similar. In this case the recursive backtracking nature of them was a little novel, so that I had to wrap my head around. It did help to just debug simple regular expressions, just to trace the execution. I know other programmers talk about this: you should step through code, you should understand what the dynamic state of the program looks like in various quick bird's-eye views or sanity checks, and I agree with that.” 2A00:FBC:E1C4:5A7E:A3D2:F879:5B28:77DA (talk) 14:05, 31 March 2025 (UTC)[reply]