12 ms·
Is there any code in Firefox (as of 2020) that comes from Netscape Navigator?
- tyingq 7y agoServer side, so not in Firefox, but I personally got a lot of mileage out of NSAPI. For the company I worked at, at the time, it was the only way to do something better than old-school, fork a process per request, CGI. We had persistent socket processes handling web requests, in parallel, WAY before things like mod_perl or FastCGI. As I remember, it was there around 1995 or so. Many thanks to any former Netscapers. For comparison mod_perl was 1999 or so. FastCGI was really beta and unknown (as I remember) in late 96.
- macintux 7y agoI have far less fond memories of Netscape Web Server. We had a clunky CGI script that crawled the filesystem on request, no doubt a security hole waiting to happen, but Netscape made it worse. (It's possible that other web servers did, or even still do, but I really hope not.) Anything that the script sent to standard error, which could reveal things like filesystem paths and other sensitive data, was not only logged, but also fed back to the web client as part of the response. Luckily, because stderr wasn't buffered, in our case it was fed to the browser before any headers, causing the web client to throw up a server error instead of displaying the error messages themselves.
- DonHopkins 7y agoNSAPI, the server based Netscape Server Application Programming Interface, is not to be confused with NPAPI, the browser based Netscape Plug-in Application Programming Interface. (I only say that because I just confused them, then realized my mistake.) NSAPI: https://en.wikipedia.org/wiki/Netscape_Server_Application_Programming_Interface https://en.wikipedia.org/wiki/Netscape_Server_Application_Pr... NPAPI: https://en.wikipedia.org/wiki/NPAPI https://en.wikipedia.org/wiki/NPAPI FWIW, here's some feedback I wrote up and sent to Netscape about the original version of the Netscape plug-in API (NPAPI), when I worked at Kaleida. This was from around 1995, when JavaScript was called LiveScript, before anything like LiveConnect/XPConnect/NPRuntime existed, when Netscape though Java was the solution to all their problems, and before ActiveX of course (but I warned them about Microsoft's use of OLE in the browser), so plug-ins only had very limited if any interaction with LiveScript and DOM. ScriptX was a multimedia scripting language, a lot like object oriented Lisp or Python with built-in graphics and multimedia libraries. But unfortunately it was not designed to be an extension language library that could plug into another application like Netscape, the way Python does so well. So I made a "ScriptX Plug-Out" that integrated ScriptX running in another process with a Netscape plug-in via Apple Events. https://donhopkins.com/home/archive/netscape/Netscape-Plugin-API-Feedback.txt https://donhopkins.com/home/archive/netscape/Netscape-Plugin... >I hope NetScape can come up with a plug-in interface that is good enough that they can implement their own navigator components with it (like the mail reader, outliner, progressive jpeg viewer, etc). The only way it's going to go anywhere is if they work closely with developers, and use the plug-in interface for non-trivial things themselves. Microsoft already has a VRML plug-in for their navigator, so presumably they have a plug-in interface, and from what I've seen on their web site, it may not be "good enough", but it's probably going to do a lot more that you can do with NetScape right now, since they're exposing a lot of their navigator's functionality through OLE. They seem to understand that there's a much bigger picture, and that the problems aren't trivial. Java isn't going to magically solve all those problems, folks.
- balnaphone 7y ago> For comparison mod_perl was 1999 or so I used mod_perl extensively in the summer (May-Aug) of 1996; it was the only way I found to embed perl directly into the server process, at the time. See also http://apache.perl.org/about/history.html http://apache.perl.org/about/history.html
- tyingq 7y agoAhh. Okay. My memory was off then. Sounds like mod_perl co-existed with NSAPI.
- hu3 7y ago> In fact, if my calculations are correct, out of 65,745 lines in the original nsprpub, 36,046 are present unchanged in the current version of nsprpub, i.e. 54.8%. This supports the statement that code is read many times more than written. So think about that when trying to be clever.
- lmilcin 7y agoI play a mind game in which the smartest code is the one that looks dumbest and is easiest to understand (of course while still working best).
- jodrellblank 7y agoHow do you know anyone has ever read that code? Surely they read the lines they changed - that's where the problems were - did they necessarily read the lines they left alone? Even if it is true that code is read many times more than it is written, isn't that an argument for writing shorter, more dense code, so there's less of it to read? And an argument for more clever code so it's more interesting to read? If you're going to spend the next six months reading, that doesn't make you want all books to turn into Spot the Dog, does it? To the contrary the more you do something, the better you get at doing it; reading more code is often suggested as a way to make yourself better at programming. In fact, isn't it equally an argument for "if people have to read the code, there aren't enough comments, and/or there wasn't enough code verification"? Comments are for people to read, code is for computers to execute. The refrain "code is for people to read and only incidentally for machines to execute" is like saying "engines are for people to watch and only incidentally to move vehicles" - it would lead to engines made of perspex, taking up the size of a room so there's plenty of open spaces to stick your head in for a look around, interrupting the combustion cycles for cleaning and washing cycles, moving at 10 rpm so it's not too fast to see...
- rovr138 7y ago> How do you know anyone has ever read that code? Surely they read the lines they changed - that's where the problems were Of course. To fix an issue on a line, you need to know the context it’s used on and what happens with the line before and after. You also know what calls it or under what context. > did they necessarily read the lines they left alone? We can’t say for all of them, but they must have read lines that directly interact with it.
- ape4 7y agoOf course, lots of Firefox is Rust now. (edit: I'm saying "lots", not "most")
- MBlume 7y agoI don't think this is true? I think Mozilla is interested in using Rust for new code where that makes sense, but the vast majority of Firefox as shipped today is still C++
- stonewareslord 7y agoThey're working on porting it. See Oxidation Project: https://wiki.mozilla.org/Oxidation#Rust_Components https://wiki.mozilla.org/Oxidation#Rust_Components e: Edit url to point to rust status in Firefox
- dblohm7 7y agoOnly in specific cases. See the “Recommendations” section in that document.
- google234123 7y agoNice tangent. Is this why it's market share is falling?
- pnako 7y agoFirefox market share + Firefox Rust usage is mostly stable.
- canada_dry 7y agoMakes me wonder, is there a tool like grammarly [1] for source code? One that checks for large chunks of copied code from other open source projects? [1] https://www.grammarly.com/plagiarism-checker https://www.grammarly.com/plagiarism-checker
- bjterry 7y agoI interned at a company called Palamida that did this around 2006. They were eventually acquired by Flexera. One of their competitors was Black Duck Software which was acquired by Synopsys.
- touisteur 7y agoGuys from AdaCore working on a new Ada parsing and semantic manipulation library had a small try, fun read : https://blog.adacore.com/a-usable-copy-paste-detector-in-few-lines-of-python https://blog.adacore.com/a-usable-copy-paste-detector-in-few...
- lanna 7y agoThere is PMD's CPD: https://pmd.github.io/latest/pmd_userdocs_cpd.html https://pmd.github.io/latest/pmd_userdocs_cpd.html
- DonHopkins 7y agoI saved some choice examples of code from the awful X-Windows version of Netscape Navigator, on my Motif Angst Page: http://art.net/~hopkins/Don/unix-haters/x-windows/motif.html http://art.net/~hopkins/Don/unix-haters/x-windows/motif.html Including some classic comments like: /* sets the parent window to 0 to fool Motif into not generating a grab */ And: /* * This is a horrible function which should not be needed. * use it to put the resize method back the way the XlwMenu * class initializer put it. Motif screws with this when * the XlwMenu class gets instantiated. */
- asveikau 7y agoAs Motif expertise is now an obsolete skill, I don't think this ages well. Short version: in some places, they don't like how the library works. In others, they are working around library bugs. In all cases, they seem severely pissed off about it, which is probably a bigger issue than Motif.
- tpmx 7y agoIs Firefox still using using that horrible COM-workalike from Netscape/Mozilla (XPCOM)? This was the thing that immediately turned me off from this codebase back in the late 90s. To this day, I remember the excitement from the buildup to the first open source release of "Mozilla (Netscape 4.something)"... and then downloading the code and seeing this horrible complexity. And suddenly understanding why Netscape was so dysfunctional.
- DonHopkins 7y agoThere is actually a technical term of art (two actually) for the process of removing XP/COM interfaces from Mozilla: "decomification" and "decomtamination", and another related term "outparamdelling". https://news.ycombinator.com/item?id=20266627 https://news.ycombinator.com/item?id=20266627 >It certainly had a lot of problems and limitations, and OLE/ActiveX/DCOM/DirectX/etc took it way too far, then Mozilla XP/COM cloned it and also took it way too far (and then back again: see "decomification" and "decomtamination"), but it really was a pretty elegant and successful solution to the problems it was designed to address at the time. https://wiki.mozilla.org/Gecko:DeCOMtamination https://wiki.mozilla.org/Gecko:DeCOMtamination http://taras.glek.net/blog/categories/decomtamination/ http://taras.glek.net/blog/categories/decomtamination/ https://blog.mozilla.org/tglek/category/decomtamination/ https://blog.mozilla.org/tglek/category/decomtamination/ https://news.ycombinator.com/item?id=12968830 https://news.ycombinator.com/item?id=12968830 >Mozilla underwent a process of "DeCOMification", because they went too far with XP/COM, and wanted to dial it way back. https://bugzilla.mozilla.org/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=__all__&product=&content=decomify&comments=0&comments=1 https://bugzilla.mozilla.org/buglist.cgi?query_format=specif... >Can someone link to a synopsis describing what "COM" is? It's hard to search for. (e.g. microsoft com visual studio) https://news.ycombinator.com/item?id=12975257 https://news.ycombinator.com/item?id=12975257 >Glad you asked! One of my favorite topics. ;) [...] >And Mozilla came up with XP/COM [14], for implementing components in Mozilla/Firefox/XULRunner/etc, enabling programmers to implement and consume XP/COM components in C++ or JavaScript. Of course it has its own IDL and tooling, and suffers from many of the same problems that COM did. >Mozilla didn't go nearly as far down the rabbit hole as Microsoft did, and later backtracked in their valiant "deCOMification" aka "deCOMtamination" and "outparamdelling" efforts [15]. An example of outparamdelling: https://bugzilla.mozilla.org/show_bug.cgi?id=455943 https://bugzilla.mozilla.org/show_bug.cgi?id=455943
- kbumsik 7y agoContributed Firefox a little bit two years ago. Here is the file I contributed: [1] You will immediately see a lot of NS_ (or ns) prefixed names in the source code. Without knowing about Firefox's history I thought like that Firefox has history with Apple (NeXTSTEP). But no, NS_ are the legacy from Netscape. It was fun to get to know its history from the source code when I was contributing it :) [1]: https://dxr.mozilla.org/mozilla-central/source/dom/media/MediaRecorder.cpp https://dxr.mozilla.org/mozilla-central/source/dom/media/Med...
- DonHopkins 7y agoApple uses a lot of historical legacy NS prefixes too, but in their case it stands for NeXT Step! ;) I used to call the browser Netscapé, which rhymes with Nescafé, back in the 90's when it was the world's leading distributer of Java. https://en.wikipedia.org/wiki/Nescaf%C3%A9 https://en.wikipedia.org/wiki/Nescaf%C3%A9 >Nescafé is a brand of coffee made by Nestlé. It comes in many different forms. The name is a portmanteau of the words "Nestlé" and "café". Nestlé first introduced their flagship coffee brand in Switzerland on 1 April 1938.
- jmspring 7y agoA lot of the code in libnss (security code) looks quite similar to code that was written in the mid 90s. I don't have archives, but browsing multiple files there is a lot of familiarity there.
- mintplant 7y agoSearchfox is super handy for spelunking through the Mozilla codebase. For example: https://searchfox.org/mozilla-central/search?q=Netscape+Communications&path= https://searchfox.org/mozilla-central/search?q=Netscape+Comm...
- bits_of_bytes 7y agoLots of Microsoft Edge (pre chromium) code that stretched back to at least IE4 (along with comments with TODOs for long departed employees) The style around naming, spacing, etc was very different, and not always cleaned up, so it was easy to tell what was old.
- jasonkester 7y agoIt's worth noting that it was Netscape Navigator 6 that this was all based on. As in, the ground-up rewrite of the entire product that ultimately killed the company. You know, the one that was so different to its predecessor that it couldn't render Netscape.com. So yes, maybe some "Netscape" is in there still. Just not Netscape 4, the good one we think about when remembering Navigator.
- toyg 7y agoNetscape 4 was utter rubbish. There is a reason it was rewritten: it had lost the browser war, because it couldn’t be updated quickly enough to keep up with IE’s rate of adoption of new standard features.
- jsjddbbwj 7y agoIs there any code in WebKit that comes from khtml? Is there any code in Source that comes from idtech 2?
- qznc 7y agoFor a small personal project [0], it was 14 lines after three years continued in a company. [0] http://beza1e1.tuxen.de/tipiwiki.html http://beza1e1.tuxen.de/tipiwiki.html
- rozab 7y agoThis was a good read. Question from a naive programmer: the writer mentions 'cute comments' in the codebase, like // Assertion: Now we know the name of the current page Is this style frowned upon? I've always thought it's a very clear way of communicating. There's a reason many maths papers are written like this. Do my co-workers think my comments are silly? :(
- qznc 7y agoComments is a mostly subjective topic. In this case, I have two arguments against the comment. First, it just says what the three simple lines of code above did. Comments should rather focus on the "why" to provide information which the code cannot give. Second, assertions should be code (or somehow machine readable).
- rvp-x 7y agoThat "stack grows upwards" conditional is a giveaway of ancient code. The only architecture I know still using that regularly is PA-RISC, and it's very rare for people to care about it today.