Talk:JavaScript: Difference between revisions

Content deleted Content added
prune nonsense
 
(43 intermediate revisions by 24 users not shown)
Line 54:
::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" [[Special:Contributions/2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D|2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D]] ([[User talk:2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D|talk]]) 16:16, 29 March 2025 (UTC)
:::That doesn't remotely qualify as a reliable source, and using it would probably amount to [[WP:OR|original research]], which isn't permitted; at best, it's a primary source. Did you follow the link to the guideline about [[WP:RS|reliable sources]] to acquaint yourself with what's meant by that here? [[User:Largoplazo|Largoplazo]] ([[User talk:Largoplazo|talk]]) 16:19, 29 March 2025 (UTC)
::::The original code base at Mozilla is not a reliable source? [[Special:Contributions/2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D|2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D]] ([[User talk:2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D|talk]]) 16:21, 29 March 2025 (UTC)
:::::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. [[User:Largoplazo|Largoplazo]] ([[User talk:Largoplazo|talk]]) 16:55, 29 March 2025 (UTC)
:::::: [[Special:Contributions/2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D|2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D]] ([[User talk:2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D|talk]]) 17:04, 29 March 2025 (UTC)
:::::::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. [[Special:Contributions/2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D|2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D]] ([[User talk:2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D|talk]]) 17:20, 29 March 2025 (UTC)
::::::https://github.com/ricardoquesada/Spidermonkey/blob/master/js/src/jsarray.cpp [[Special:Contributions/2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D|2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D]] ([[User talk:2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D|talk]]) 17:06, 29 March 2025 (UTC)
::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. [[Special:Contributions/2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D|2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D]] ([[User talk:2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D|talk]]) 16:32, 29 March 2025 (UTC)
:::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. [[User:Largoplazo|Largoplazo]] ([[User talk:Largoplazo|talk]]) 17:07, 29 March 2025 (UTC)
::A tweet from Brendan Eich the creator of JS, Juli 4th 2017
::<code></code>
::<code>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.</code>
::<code>12:00 vorm. · 4. Juli 2017</code>
::<code></code>
::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. [[Special:Contributions/2A00:FBC:E1C4:5A7E:988B:44F9:E011:2675|2A00:FBC:E1C4:5A7E:988B:44F9:E011:2675]] ([[User talk:2A00:FBC:E1C4:5A7E:988B:44F9:E011:2675|talk]]) 12:36, 30 March 2025 (UTC)
::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
::<code></code>
:: <code>/* Perl-ish methods. */</code>
:: <code>JS_INLINABLE_FN("join", array_join, 1, 0, ArrayJoin),</code>
:: <code>JS_FN("reverse", array_reverse, 0, 0),</code>
:: <code>JS_TRAMPOLINE_FN("sort", array_sort, 1, 0, ArraySort),</code>
:: <code>JS_INLINABLE_FN("push", array_push, 1, 0, ArrayPush),</code>
:: <code>JS_INLINABLE_FN("pop", array_pop, 0, 0, ArrayPop),</code>
:: <code>JS_INLINABLE_FN("shift", array_shift, 0, 0, ArrayShift),</code>
:: J<code>S_FN("unshift", array_unshift, 1, 0),</code>
:: <code>JS_FNINFO("splice", array_splice, &array_splice_info, 2, 0),</code>
::<code></code>
::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. [[Special:Contributions/2A00:FBC:E1C4:5A7E:988B:44F9:E011:2675|2A00:FBC:E1C4:5A7E:988B:44F9:E011:2675]] ([[User talk:2A00:FBC:E1C4:5A7E:988B:44F9:E011:2675|talk]]) 12:44, 30 March 2025 (UTC)
:"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. [[Special:Contributions/2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D|2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D]] ([[User talk:2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D|talk]]) 16:20, 29 March 2025 (UTC)
: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. [[Special:Contributions/2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D|2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D]] ([[User talk:2A00:FBC:E1C4:5A7E:952E:5756:15EC:39D|talk]]) 16:28, 29 March 2025 (UTC)
:[[Brendan Eich]], Creator of JavaScript, in “Coders at Work: Reflections on the Craft of Programming” Peter Seibel 2009 page 158/159
:[[Coders at Work|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.”'' [[Special:Contributions/2A00:FBC:E1C4:5A7E:A3D2:F879:5B28:77DA|2A00:FBC:E1C4:5A7E:A3D2:F879:5B28:77DA]] ([[User talk:2A00:FBC:E1C4:5A7E:A3D2:F879:5B28:77DA|talk]]) 14:05, 31 March 2025 (UTC)
 
[[File:X mark.svg|20px|link=|alt=]] '''Not done for now''': please establish a [[Wikipedia:Consensus|consensus]] for this alteration '''[[Wikipedia:Edit requests|before]]''' using the {{Tlx|Edit semi-protected}} template.<!-- Template:ESp --> This is now self-evidently not an uncontroversial change. As such a consensus needs to be developed here before reopening the edit request. [[User:PianoDan|PianoDan]] ([[User talk:PianoDan|talk]]) 19:38, 3 April 2025 (UTC)
 
:Most replies are by me, and it's hardly controversial.
:The reference to a publication with an interview of the creator of JS ticks all criteria of a reliable source:
:Brendan Eich, Creator of JavaScript, in “Coders at Work: Reflections on the Craft of Programming” Peter Seibel 2009 page 158/159
:Furthermore I linked to a tweet from the official account of Brendan Eich were he admits that "JS1.0 was influenced by Perl"
:Please explain how this can be controversial! [[Special:Contributions/2A00:FBC:E1FB:13BD:158B:C9C3:CD94:6E6D|2A00:FBC:E1FB:13BD:158B:C9C3:CD94:6E6D]] ([[User talk:2A00:FBC:E1FB:13BD:158B:C9C3:CD94:6E6D|talk]]) 11:07, 4 April 2025 (UTC)
::Sure - the policy is found at [[WP:SUNS]]. The relevant bit is that editors should respond to "either uncontroversial improvements (correcting typos, grammar, or reference formatting; improving the reliability or efficiency of template code) or are already supported by a consensus of editors, usually on the protected page's talk page." Since you have at least one editor disagreeing, it's not obviously a consensus opeion yet. [[User:PianoDan|PianoDan]] ([[User talk:PianoDan|talk]]) 16:20, 5 April 2025 (UTC)
:::He just stopped replying to the newer better suggestions.
:::This is just a game of frustrating people. [[Special:Contributions/2A00:FBC:EAD3:EB97:F83E:310C:4505:5E42|2A00:FBC:EAD3:EB97:F83E:310C:4505:5E42]] ([[User talk:2A00:FBC:EAD3:EB97:F83E:310C:4505:5E42|talk]]) 12:21, 8 April 2025 (UTC)
 
== Semi-protected edit request on 30 May 2025 ==
 
{{edit semi-protected|JavaScript|answered=y}}
Add https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise as the missing citation under Features > Promises and Async/await.
 
Alternatively, remove "Features > Promises and Async/await" altogether, as it is already covered by the following two entries (Promises, Async/await) [[User:Lunamason|Lunamason]] ([[User talk:Lunamason|talk]]) 01:53, 30 May 2025 (UTC)
:{{done}}<!-- Template:ESp --> I opted for your second suggestion. [[User:DrOrinScrivello|DrOrinScrivello]] ([[User talk:DrOrinScrivello|talk]]) 18:14, 30 May 2025 (UTC)
 
== Image ==
 
The pages for CSS and HTML have their official logos as the image, while this page has a screenshot of js code. I think for consistency, this should have the js logo as it's main image [[Special:Contributions/129.97.60.173|129.97.60.173]] ([[User talk:129.97.60.173|talk]]) 00:36, 26 July 2025 (UTC)