Will we ever see an adoption of something other than C and C++?

Started by
50 comments, last by Finalspace 6 years, 7 months ago
46 minutes ago, matt77hias said:

JavaScript is considered as the assembly language for the web since it is the only programming language (HTML is a markup language, not a programming language) understood by all web browsers. We do not include real assembly languages in this discussion although they are still kind of unavoidable in the end (unless you are programming directly in machine language instructions, but there is a kind of 1:1 mapping anyway between machine and assembly languages), because they are too low level to be practical on a large scale in our code bases. I think similar arguments hold for JavaScript as well in some sense and we must take this into account while talking about the impact of JavaScript. Languages like TypeScript, CoffeeScript, Elm, etc. all transcompile to JavaScript in the end, since browsers can handle only the latter. Typescript for instance is a superior alternative to JavaScript and many large companies adopt it or plan to adopt it. This is especially due to the dynamic typed nature of JavaScript becoming a bottleneck in large code bases, since programmers eventually realize that their architectures are built on quicksand: without giant test suites (larger than for statically typed languages at least) you have no idea when your program is going to break in at compile-time (there is even no compile-time because JavaScript is generally a purely interpreted language). Furthermore, JavaScript has and had problems with standardization and formal verification.

There is even an iconic picture illustrating the quality of JavaScript (I don't know if this is the original picture :)):

4704268314_bb0e9d0ff3_b.thumb.jpg.a6b3fdbe30461539a6ce6ad04995beee.jpg

JavaScript will get be replaced as well. JS is old any rusty, slow and extremely error prone.

All applications / libraries written in that language are a nightmare.

Advertisement
4 hours ago, matt77hias said:

JavaScript is considered as the assembly language for the web

I've never heard anyone make that comparison before.  And it's kind of a terrible analogy.  Javascript is about as far from assembly as you can get in terms of the kinds of languages we've spoken about so far.  Unless you count data/markup in that conversation.

1 hour ago, trjh2k2 said:

I've never heard anyone make that comparison before.  And it's kind of a terrible analogy.

http://lmgtfy.com/?q=javascript+assembly+language+of+the+web

For instance: https://www.hanselman.com/blog/JavaScriptIsWebAssemblyLanguageAndThatsOK.aspx

(Just Googled it for you since the first time, I have heard it was during lectures.)

1 hour ago, trjh2k2 said:

And it's kind of a terrible analogy.  Javascript is about as far from assembly as you can get in terms of the kinds of languages we've spoken about so far.

"Of course, it is inaccurate because it's an analogy. That said, as analogies go, it's pretty good. Sure, assemblers are architecture and processor specific. Maybe "JavaScript is the Web's Bytecode" is better. At the very least, JavaScript is a totally reasonable compile target."

1 hour ago, trjh2k2 said:

Javascript is about as far from assembly as you can get in terms of the kinds of languages we've spoken about so far.

You need to take a look at the definition of assembly, because it can be seen much broader.

Java Bytecode for instance is clearly an assembly language generating instructions for a virtual processor, the JVM.

🧙

Googling it still doesn't mean I've heard anyone actually make that comparison, not that nobody has ever said it.  Thanks for being condescending about it though.

I skimmed through some of the top results, and I stick by my opinion- Javascript as assembly isn't a good analogy.  One of the top results starts with a comment about opening up the 'view source' of a page and being surprised by the fact that the markup and code for the page had been minified and obfuscated.  They proceeded to calling it a "GUID", which makes zero sense.  That's not what a GUID is, and minifying a page has nothing to do with assembly.  If the point was the ubiquity of use, then a comparison to C or C++ would have been better, since it seems super uncommon for people to actually write assembly instead of something higher level, whereas people just write plain JS all the time.  If the point was that you can compile other languages into Javascript, then that still is a bad analogy 'cause you can do that with almost any other language.

The first point is that JavaScript is the lowest programming level you can reach if you target the web and consider your browser as processor dictating the instruction set. The second point is that if people start looking at JavaScript in this way, where assembly is something you avoid in 99% of the cases in arbitrary (non-embedded) software projects, they start recognizing that they need to use higher programming languages. Higher in the sense that these languages are laid on top of JavaScript, though not that fundamentally different compared to the gap between x86 and C/C++ for instance.

Of course there are other languages A laid on top of other languages B. But here, nor A nor B are the most useful languages for general programming problems. JS on the other hand is completely inferior to TS for instance. With the exception of using existing JS libraries, you could not have an excuse to use JS.

Possible non-functional criteria used: usability, reliability, recoverability, supportability, adaptability, maintainability, configurability, etc. Applying these criteria to large general software projects, makes full JS (as opposed to the alternatives) as inferior as full assembly (as opposed to the alternatives) IMHO.

🧙

1 hour ago, matt77hias said:

JavaScript is the lowest programming level you can reach if you target the web and consider your browser as processor dictating the instruction set

I don't consider the browser to be a processor, I think that's also a bad analogy.

1 hour ago, matt77hias said:

The second point is that if people start looking at JavaScript in this way, where assembly is something you avoid in 99% of the cases in arbitrary (non-embedded) software projects, they start recognizing that they need to use higher programming languages.

Javscript is already a very high-level way of working, and I think it would be a stretch to say that it should be avoided like you would avoid writing assembly.  I know there are a lot of workflows that involve working at higher levels than that, and compiling stuff into javascript, or into subsets of it, etc., but it's just as common to just work in Javascript itself, as far as I know.

32 minutes ago, trjh2k2 said:

I don't consider the browser to be a processor, I think that's also a bad analogy.

All VMs are abstract (i.e. not concrete = backed by ICs) processors: JVM, CLR, JS Engine.

🧙

I get where you're going with it, but I don't think you'll convince me that it's a useful way to think about how javascript is used.  You can draw comparisons between browsers and processors if you want, but the comparison isn't useful, IMO.  Just my 2c.  For the record, I'm saying that from a place of having made entire games in both javascript and C++/c#, etc.

Javascript is actually quite similar to the original C in abstract philosophy: hide the details of the underlying machine under a uniform interface, and be prepared to execute in a broad variety of environments. Yes, JS is at least one layer of abstraction higher than C in terms of its "platform", but it's still a similar thought process.

Maybe you don't see the "use" of the similarities, but dismissing the parallels is a bit hasty IMO. And I don't see why having written a game in a language suddenly makes you authoritative on whether or not anyone else should make observations about that language and its similarities to others ;-)

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

On 20/09/2017 at 8:07 PM, Oluseyi said:

Hey guys, long time no post! Funny sequence of events that led to me checking in today.

My take: nothing will ever "replace" C++, because nothing will ever have the same degree of critical mass/hegemony that C had and C++ inherited. The language ecosystem will be more diverse and varied, with individual languages and their code being more generally portable, and practitioners more able to switch toolsets because the norm today is to have high-quality, cost-free, often open sourced implementations.

 

My other (and hotter!) take: JavaScript already "replaced" C++ as the language in which the largest subset of user-facing applications, and even server-side infrastructure, is written in.

An important difference to note is that JavaScript is forced onto the largest subset of user-facing developers. If google/ms/apple could get their fingers out and agree on a common vm JavaScript would die off practically overnight. Unfortunately MS already have a perfectly capable sln that they are prevented from using because of political. Google / Apple don't want to go down that road - they would end up delivering something very similar to .net and they know it.

Server side JavaScript only exists because JavaScript is a must on front end. People want to share their code base and that is the only practical way to do that. No sane developer would have independently developed JavaScript for server side if it didn't already exist.

This topic is closed to new replies.

Advertisement