473,948 Members | 14,668 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JavaScript Complier

Hi there,

Does anyone know if you can download a free javascript complier from
the net. I need to check my code for a project.

Thanks Shannon.

Nov 23 '05 #1
8 7106
JavaScript is generally interpreted language, but you may use Rhino
http://www.mozilla.org/rhino/jsc.html (you must know how to invoke java
programs and how to pass a path to Rhino .jar).
It 'compiles' JavaScript files to Java classes which can be run and
therefor tested.

Nov 23 '05 #2
> Does anyone know if you can download a free javascript complier from
the net. I need to check my code for a project.


Do you need a compiler or a code checker? If the latter, try
http://www.JSLint.com
Nov 23 '05 #3
Luke Matuszewski wrote:
JavaScript is generally interpreted language, [...]


It is not, otherwise it would be too slow for the Web. It is compiled (in
browsers: JIT-compiled) and the resulting byte-code is interpreted by a
Virtual Machine.

SpiderMonkey, Gecko's JavaScript engine written in C (the JavaScript
Reference implementation) , compiles (no need for quote characters)
JavaScript source code to JavaScript byte-code to be interpreted by
a JSVM.

<http://developer.mozil la.org/en/docs/SpiderMonkey>

Rhino, written in Java, among other features, can compile JavaScript
source code to both JavaScript byte-code to be interpreted by a JSVM
and Java byte-code to be interpreted by a JVM.

<http://www.mozilla.org/rhino/>
PointedEars
Nov 23 '05 #4

Thomas 'PointedEars' Lahn napisal(a):
Luke Matuszewski wrote:
JavaScript is generally interpreted language, [...]
It is not, otherwise it would be too slow for the Web. It is compiled (in
browsers: JIT-compiled)


You are saying that JavaScript is not interpreted language and then you
states that:
resulting byte-code is interpreted by aVirtual Machine.


In all ECMAScript specs there is NO SUGGESTION on how JavaScript
programs are executed (not a word about Garbage Collector and
JavaScript Virtual Machine). The implementation decides what format and
how it will be executed later.
I mentioned also '''''generally' ''' because there is no restriction it
would not be interpreted.
Implementation may decide to produce .exe (PE format file) or .bin (ELF
format file) as a result of compilation, or bytecode to be run on
implementation dependen JSVM (because in specs there is not a word
about format of bytecode, JIT or Hot Swap techniques and other things
like garbage collector algorithms used) but generally there is no need
to. Another case is Java Virtual Machine, which is described in Sun
Specs with Byte Code format - because Java Byte Code is required to run
on platform which has Java Runtime Envirnoment.

As a case of SpiderMonkey - there is no JSVM there - it is embedded
using shared library (or if needed statically linked in C code).

[http://developer.mozilla.org/en/docs...der%27s_Guide]
<quote>
The engine handles memory allocation for the JS data types and objects
needed to execute scripts, and it cleans up -- garbage collects -- the
data types and objects in memory that it no longer needs.
How Do You Use the Engine?
Generally, you build the JS engine as a shared resource. For example,
the engine is a DLL on Windows and Windows NT, and a shared library on
Unix. Then you link your application to it, and embed JS engine
application programming interface (API) calls in your application.
</quote>

As a result personally i think that Rhino is far more easier to use at
hoc than SpiderMonkey (Rhino only requires the Java Runtime Envirnoment
and nothing else).

BR.
Luke.

Nov 23 '05 #5
Douglas Crockford wrote:
Do you need a compiler or a code checker? If the latter,
try http://www.JSLint.com

I've tried to use it with IE, Opera and Mozilla, but the
"jslint" button doesn't do anything. Am I missing something?
JS works in all 3 browsers, my code esecutes as expected.
This is the code I cut and pasted in your page:
http://tinyurl.com/db8v6

Thanks! .:|:.
Nov 23 '05 #6
..:|:. wrote:
I've tried to use it with IE, Opera and Mozilla
Sorry, it's Firefox, not Mozilla.

some more data. When I click "jslint"...

....Opera says:
JSLint, The JavaScript Verifier
http://www.crockford.com/jslint/index.html
Event thread: click
Error:
name: ReferenceError
message: Statement on line 24: Reference to undefined variable: ‘output’
Backtrace:
Line 24 of inline#1 script in http://www.crockford.com/jslint/index.html
document.getEle mentById(‘outpu t’).innerHTML = r;
Line 1 of script
go();
selectinput();
return false;
At unknown location
[statement source code not available]
....Firefox says
Error: illegal character
Source File: http://www.crockford.com/jslint/index.html
Line: 82, Column: 28
Source Code:
document.getEle mentById(‘outpu t’).innerHTML = r;

Hope this helps, tanks, .:|:.
Nov 23 '05 #7
Luke Matuszewski wrote:
Thomas 'PointedEars' Lahn napisal(a):
Luke Matuszewski wrote:
> JavaScript is generally interpreted language, [...] It is not, otherwise it would be too slow for the Web. It is compiled
(in browsers: JIT-compiled)


You are saying that JavaScript is not interpreted language and then you
states that:


It is not only and not first an interpreted language.
resulting byte-code is interpreted by aVirtual Machine.


In all ECMAScript specs there is NO SUGGESTION on how JavaScript
programs are executed [...]


Of course not, we are talking about JavaScript, not ECMAScript or one
of its other implementations .
As a case of SpiderMonkey - there is no JSVM there - it is embedded
using shared library (or if needed statically linked in C code).


I wonder if the VM could be implemented through that C code. And
I know about JavaScript programs in byte-code used by at least SSJS.
PointedEars
Nov 23 '05 #8
shannon wrote:
Hi there,

Does anyone know if you can download a free javascript complier from
the net. I need to check my code for a project.

Thanks Shannon.


Is a compiler what you're really looking for? If you're just checking
your code, from what others have already said, JSLint may be what
you're looking for.

http://www.jslint.com

I did come across something more advanced however, and it seems to do a
pretty decent job of catching errors. It's called JS Sorcerer, but it
may do things too advanced for you to understand at this point of time.
If you still want to give it a try, they have an online demo. They
also appear to have an actual compiler if that's what you really
wanted.

http://www.dhitechnologies.com/produ.../testdrive.php

Nov 23 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1432
by: Francisco J. Reyes | last post by:
I get an Internal complier error when compiling C# windows project that uses a custom Class add as reference to the project. The problem appears to be related to the ENUM type used in the class controland where the windows project attempts to call the custom class property set\get a specific value using enum values from the custom class. Thanks in advance.
3
1688
by: Ygn | last post by:
#include <stdio.h> #include <winsock2.h> #include <windows.h> #include <process.h> #include <string.h> #include <winbase.h> #include <sys/socket.h> I would like to do compiling this header. When I try with my VC ++ I got error. So what the name of complier and where can I get it.
5
2759
by: Seven Kast USA | last post by:
Hi pelase explain me complier design of c and i need a small example complier design all phases in c programming . by KAST
2
4181
by: qbin_wang | last post by:
Hi: now i want to download a free c complier which can be used in windows system.and i see many posts in the comp.lang.c,but i don't find the answer.who can tell me the true and correct website that can download the c complier or tell me the c complier's name. thanks a lot.
2
3152
by: Ali Alsaffar | last post by:
Hi there, - I updated my windows XP professional with all critical updates available at windowsupdate.com - I updated Microsoft .NET Framework 1.1.4322 from thier also - I installed Visual Basic 6 Enterprise Edition - Then I also installed Visual Basic .NET 2003 Professional Edition - I created a new project in Visual Basic 6 successfully - Here is the problem: I failed to create a new Visual Basic project in Visual Basic .NET 2002 I got...
11
2297
by: jryden | last post by:
I wrote the following code into a console program in Visual C++6. If you build a release build and select custom optimizations and select 'general optimizations' as the only optimization then you will end up with incorrect results. Every line seems to be important, even the unrelated bits. Any one have the time or inclination to try this out for themselves and try to explain it? #include "stdafx.h" #include <string>
1
2535
by: tccode97 | last post by:
Hi, I need an urgent help. I am developing a socket application in VC++ that uses asynchronous connnection. After doing search on google, I found the following link http://msdn2.microsoft.com/en-us/library/system.net.sockets.udpclient...
11
2658
by: neha | last post by:
Hi My question is : Would the expression *p++=c be disallowed by the complier. The answer given in the book is: No.Because here even though the vlue of p is acced twice it is used to modify two different objects p and *p.
11
5197
by: =?iso-8859-1?q?Martin_M=FCcke?= | last post by:
Hi, I am looking for a good javascript obfuscator - I found several on the web, but I am looking for one that can also handle javascript in jsp, html and java files - so I need a javascript obfuscator that handles my entire web project. Is there anything like that, preferable as a Eclipse plugin? Thanks,
0
10167
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9989
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
11355
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9898
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7432
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6120
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4543
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3547
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.