As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
Since V8 compiles JavaScript into assembler, may we say that in the Chrome environment JavaScript is not anymore a script language but a programming language instead?
V8 compiles JavaScript source code directly into machine code when it
is first executed. There are no intermediate byte codes, no
interpreter.
https://developers.google.com/v8/design#mach_code
The very same question has been (better) debated here 10 months ago:
Can Javascript be considered a interpreted language when using Google Chrome (V8)?
"Scripting languages" are an (ill-defined) subset of "Programming languages", so its always been appropriate to refer to JavaScript as a programming language.
But basically, scripting is not a technical term. When we call something a scripting language, we're primarily making a linguistic and cultural judgment, not a technical judgment.
— Programming is Hard, Let's Go Scripting...
A script language is also a programming langauge.
Anyhow, the characteristics of the Javascript language hasn't changed even if the underlying implementation of the executing engine has changed. Javascript still has features that are very characteristic to what we see as a script language, like dynamic data types and dynamic code generation.
Javascript was originally a plain interpreted scripting language, but how the code is executed has changed a lot over the last few years. However, apart from how this affects performance, the language still works exactly as it has always done.
Program (Turing machine) is just a mathematical structure, a piece of information. You could create programming languages and write programs hudreds of years ago, without having any computer to run it.
Programming language is defined by it's specification, not by "things" that you do with it (compilation, interpretation etc.). You don't have to have a computer to write programs. If you know the specification, you can "run" your program on your input in your head or on paper and get an output.
Actually, first programs were written far before first electronic computer was invented.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
Javascript seems to become popular as an implementation language for other programming languages.
The article
Lightweight compilation of (C)LP to JavaScript. ICLP 2012
drew my attention on this.
There are a lot of proof-of-concept prototypes for Prolog systems written in Javascript around on the Web.
What are current, actively maintained, preferably ISO conforming Prolog systems written in Javascript?
The only Prolog in JavaScript I know is YieldProlog, but I haven't tried it extensively, just the code available in QueryEditor.
I was hoping than using the yield construct it was lightweight (I used extensively such construct in C#, and I found it - paired to lambda - rather powerful).
But when I inspected (summarily) the source, I found it really complex, despite the assumptions.
edit
I've found recently these contributions, that seem really interesting:
proscript and proscript2.
edit
a new implementation available:
Tau Prolog, brought to my attention from Jan on SWI mailing list
edit
Something new, hhprolog, a pure Prolog engine, based on code and documentation provided by Paul Tarau, ported by me to Javascript. So, available in both browsers and NodeJS.
The project is still preliminary, mostly needed is to bootstrap to interpreter: right now (pre)compiling Prolog to the (novel) virtual machine must be accomplished with SWI-Prolog installed, properly configured (JPL needed).
To implement such bootstrapping, I would probably need to implement negation, to reuse Paul' interface, or - better - attempt to implement something staying in the pure paradigm. In particular, only unbounded integer arithmetic (again by Paul Tarau, there is some Python code available - I will try lazily to port to Javascript).
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I know programming in general but always been doing either Delphi, VB 6 or C#.net! Now I must do web-dev and must do it fast! I haven't written a hello world in JavaScript yet and must learn jQuery because there are some charts that I must show in my web-app and looks like I must know JavaScript and jQuery to do that.
So I am looking for a jQuery resource that during its course or maybe at the first chapter gives us also a jump start on minimum JavaScript knowledge too. Some book or resource that I can hopefully sit and read through it in one day like 12 hours and after then learn enough to be able to use it and embed those darn charts and graphs into my web-app.
What do you suggest ?
The basics of Javascript as a language are actually fairly straightforward, particularly if you've got a background in several other languages as you have. You'll find it immediately familiar with curly braces and other syntax that you'll recognise from elsewhere.
If you've worked with C#, you will hopefully have been exposed to lambda functions or closures. These are very important in Javascript, where they are key for the event-driven code that drives most websites, and in particular if you're using a library like jQuery, where they are used for virtually everything. You need to get a strong handle on how these functions work if you're going to make head or tail of jQuery.
The other thing to be aware of is that Javascript's object handling works a bit differently to the other languages you's used to. There are similarities, but if you try to write your classes and objects in the way you're used to, you will get some unexpected results. See What type of language is JavaScript for more info on this.
Beyond that, I don't think you'll have a problem with the syntax.
The other thing to worry about is the DOM -- ie the browser's API which is accessed via Javascript. The DOM is not technically part of the Javascript language, but it is inextricably linked to it, and is as much part of the learning challenge as the language itself. jQuery abstracts a fair amount of the DOM away from you, but it still helps to know it.
Hope that helps get you started.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I'm a programming "enthusiast", not a pro, and I'm looking for an easy graphical programming environment (for desktop, on the Mac and iOS) similar to RealBasic or RunRev Livecode.
However, because my available time is limited, I'd rather spend it into something that uses a more ubiquitous language like Javascript/Html5 (so I can transfer this knowledge into other areas like web programming) rather than an idiosyncratic language like the one used by Livecode or RealBasic (which cannot be used outside of that specific programming environment).
I've looked into Appcelerator Titanium (which uses Javascript/HTML/CSS), but it doesn't seem to have an easy GUI development interface.
Any suggestions ?
Thanks.
Wakanda is likely the closest I've seen as well.
My experience on a Mac is that it isn't terribly stable. Not sure if that is just my env or if it's because it's still relatively new. I like, and am very impressed with what they are doing, but just not sure I can trust it yet for production level stuff.
Realsoftware has an awful lot of perks. I'm still exploring it but looks like it maybe what I'll use. It would be an easy decision if it was JS/HTML5! It's all compiled and server side tho - as I understand it.
EDIT:
Have a good look at Wakanda's NoSQL data capabilities. They are nothing short of amazing and very well thought out. Four types, storage, calculated, relational and alias. There's a good overview YouTube vid at https://vimeo.com/31837379
Have a look to the new Javascript Stack : Wakanda
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I want to learn Node.js. I'm sure, I will need good experience in Javascript (OOP). Is there any other technology i should know about to learn it? And also how long will it take me to starting implementing node.js taking into account i have decent experience in Javascript?
Thank You
http://www.crockford.com/javascript/inheritance.html
JavaScript is a class-free, object-oriented language, and as such, it
uses prototypal inheritance instead of classical inheritance. This can
be puzzling to programmers trained in conventional object-oriented
languages like C++ and Java. JavaScript's prototypal inheritance has
more expressive power than classical inheritance, as we will see
presently.
Javascript and Java are two different beasts.
I have been writing JavaScript for 8 years now, and I have never once
found need to use an uber function. The super idea is fairly important
in the classical pattern, but it appears to be unnecessary in the
prototypal and functional patterns. I now see my early attempts to
support the classical model in JavaScript as a mistake.
Some things I think you should look into.
Testing your code thoroughly with framework like for example mocha is very important.
learn npm to publish your own modules and to search for other modules.
A database like for example mysql, mongodb or redis and how to use them in node.js. I pesonally really like redis client library for it's insane speed.
Git(hub) to put your code into a repository(SCM).
Except from all kind of JavaScript programming experiences (OOP is not required) and depending from your former programming skills it also helpful to have a basic knowledge of:
the Posix API (what are file descriptors? what are pipes?)
what is HTTP? How does HTTP work?
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I occasionally write JavaScript code. I am interested in minifying it for better performance, but I don't plan to spend to much time on that, especially in testing the minified result.
I found this online service:
http://www.lotterypost.com/js-compress.aspx
So a couple questions:
Is it reliable?
Microsoft AJAX minifier vs. YUI Compressor, what's the best option?
Any other similar online tool to recommend (and why is it better than the above link)?
Google's Closure Compiler
is an excellent Javascript minifier and compiler. It analyzes the code and reports the detectable errors. It removes redundant space and unreferenced code, and renames objects to shortest possible names. You just need to compile together all Javascript files that belong to one HTML page.
That link you post happens to be the one that I use too.
Use the MS AJAX Minifer. It's way better than the yui one. besides:
http://stephenwalther.com/blog/archive/2009/10/16/using-the-new-microsoft-ajax-minifier.aspx:
The Microsoft Ajax team (I work on
this team) has been using this tool
internally for a number of years. For
example, we use the Microsoft Ajax
Minifier to minify the Microsoft Ajax
Library before publishing it.
Well if you don't trust me, run your source code (if you don't have an actual source code to test, just grab the source at http://code.jquery.com/jquery-1.6.2.js) through both and see which is more "minified".
==
Google has the Google Closure Compiler but it analyzes your code and removes unreferenced code (to furthur reduce the size of the resultant file). However usually this is not what you want because even though the functions/variables are not referenced within that file, it may be referenced from your other js files that make up your site)