|
This I know. What I am saying is I would like to see someone write a compiler (there already is an interpreter in Windows for scripting) that creates a native executable and/or a MSIL assembly.
I'm talking about writing a JavaScript compiler that allows one to write their desktop applications in JavaScript.
Obviously there are many components in the javaScript library that work exclusively with HTML, others with AJAX. These parts may or may not be desirable and would give a headache to the compiler engineer who was to create this "desktop compiler" for JS.
But there is so much elegance and beauty in the language that I would really like to see "JS++" or "JavaScript#".
Once ported to desktop usage many of the libraries would become obsolete (I would think) and a completely new language would evolve. It would most likely have to be called something else to avoid copyright infringment--just like Microsoft's version called "JScript". Pretty suttle, huh?
This task is far beyond my own capabilities but I've been tinkering and using only a for loop from JavaScript and converting to MSIL (I had an elementary understanding of x86 Assembly on 16-bit machines running DOS and I am probably further away from understanding as I've ever been). Just a brute-force method to see "if i could". I plan on devoting some time to learn about compiler design and obviously I must master JavaScript and understand MSIL completely.
I've digressed; my real purpose of writing this discussion was to discuss possibilities, reasons why it should or *should not* be made.
Basically, I love the language but I am not a web developer or designer. I write desktop windows applications and I would really like to, more as a novelty but nevertheless a useful tool as well, code a desktop app completely in JavaScript.
One more thing, I heard of a couple of languages that took the "good parts" and did away with the "bad" and the buggy and insecure of JavaScript. One was called CoffeeScript (Good Name!) and the others I don't remember. Do these run in the browser as well? They should as the are a subset of the total language.
Please, I'd really like some serious feedback on this. I know it sounds crazy but isn't that what hacking is all about? Pushing things to the limit and beyond? And I don't mean malicious users I'm talking about old school hackers--programmers that made their software do things that they were told was impossible at that time. This is what it is all about for me.
|
|
|
|
|
|
Thank you for the information; I'm quite amazed that I did not run into it during my massive "JavaScript Compiler" Bing campaign. You must be able to link to and utilize the power of the .net assemblies. I think I 'll be experimenting asap. Thanks for the heads up.
|
|
|
|
|
Hi,
to compile javascript into bytecode you nee a runtime machine inside of browsers
and operating system like windows too.
to compile javascript into machine code you need interface of operating system
and browsers.
to write you own browser in use of byte code like java see http://lobobrowser.org/java-browser.jsp
to translate jacascript into other language you must use interface.
html dom and javascript or vbscript .... version of microsoft is Net-Framwork.
opera and Co. translate internal javascript into bytecode.
see http://code.google.com/intl/en/closure/compiler/
translate javascript into java see http://www.mozilla.org/rhino/jsc.html
yep, for The Visual Studio .NET Command Prompt (called JScript.NET and can be compiled to create .exe files)
see http://msdn.microsoft.com/en-us/library/7435xtz6(v=vs.71).aspx
|
|
|
|
|
Hey thanks,
I'm glad I started this discussion because I've been thinking about it for a long time and now I have a lot of solid information to help me get started on a project. It will be done slowly in my scarce spare time I'd like to create a native compiler for JavaScript.
First, I know converting to MSIL or bytecode is the much easier way to go and with all this info iam well on my way. Thanks again and thanks to everyone who responded. 
|
|
|
|
|
Hi,
I need some info from you guys.
Can anyone please give me idea how to restrict user not to enter "<" and ">" character in text box and even user not able to paste these characters?
Thanks,
Inder K...
|
|
|
|
|
Hi,
after input of every char check this char and set .value of textarea with checked values.
|
|
|
|
|
|
You can either check the value on form validation and/or
handle the onChange event for the text box, and check for those characters.
________
John Y.
Developer
|
|
|
|
|
I need to perform the below function on my htm page load event:
1. When i call URL A which ends at .htm file;
2. This htm page should Call Url B ;
Should pass on the user name and password required for URL B: and read the response.
3. Read the response on the page.
If
{ can find the string "XYZABCD" on the page
then
Show "Available";
else
Show "Not Available"
|
|
|
|
|
Hi,
text inside of body of page --> use body.innerText
href of an location --> use location.href and location.replace(sURL)
onload event of document --> use document.onload=javascript_code
--------------------------------------------------
2 documents have different content.
To open a document inside of other document --> use window.open() and window.parent
---------------------------------------------------
for internet explorer
body object see http://msdn.microsoft.com/en-us/library/ms535205.aspx
location object see http://msdn.microsoft.com/en-us/library/ms535866.aspx
document object see http://msdn.microsoft.com/en-us/library/ms531073.aspx
window object see http://msdn.microsoft.com/en-us/library/ms535873.aspx
|
|
|
|
|
Good Morning...I have been using the name attribute (for years) to call an aspx page to load in an iFrame, and it's works perfectly. Unfortunately, it throws a warning that this is an outdated code method and should be replaced. I am sure this is an old story to most Java developers (I am not one), but old habits (especially one's that work perfectly) die hard. So, I decided to move forward and use a newer code call so my code would compile perfectly clean (error and message wise). The catch is that nothing that I have tried works. They all load the page, but none load the page in the frame. Obviously, there is a syntax issue that I am missing. Here is my latest attempt:
<%--Change Page Content in iFrame--%>
<script type="text/javascript">
var newPage = document.getElementById('iFrame');
function ChangePage(newPage) { iFrame.src = 'iHome.aspx' };
</script>
//Contents for menu 1 (Home)
var menu1 = new Array()
menu1[0] = '<a href="iHome.aspx" target="javascript:ChangePage(newPage)" onclick="javascript:ChangeLabel(home)">Home</a>'
So....all this to basically replace (target="f1"), where f1 was the name attribute of the frame (now deleted)...Go Figure. A slice of code here would be much appreciated. Thanks for your help...Pat
|
|
|
|
|
|
Hi,
Need to create a program using Javascript to read the binary file located in the PC(C or D drive) and copy the file contents to a variable in Java Script and send the file data to server. Can this be done without using Active X contols?
Am using 'file' input type in HTML 1.0 for getting the path of the file.
|
|
|
|
|
No, you cannot do that just using Javascript from a browser.
|
|
|
|
|
Hi,
Is there any other method to read without using Active X control?
Thanks
|
|
|
|
|
If all you want to do is get the file from the client to the server, the file input type will do it without any Javascript or ActiveX required.
If you want a bit more control over how it works, you could try something like SWFUpload[^] which uses a Flash movie to give you a progress bar, etc.
|
|
|
|
|
Hi,
Using file input type we can only browse the file, my requirement is
1)Browse the binary file
2)Read the contents of the file
3)store the file contents
4)send the stored file contents to server.
|
|
|
|
|
Using <input type="file"> , the contents of the file is loaded by the browser and sent to the server when you submit the form.
If you want to send the file without submitting the form, you will have to use Flash, or ActiveX, or something similar.
|
|
|
|
|
I was thinking it will only help to browse the path.
Will try. Thanks
|
|
|
|
|
Server side code is in CSP.
Upon using submit button, HttpMethod_Post is called.
In HttpMethod_Post function fopen will not work as path is in local PC and server is in the device
How to copy the data or send the data to server in the device??
Can you please provide code or link.
|
|
|
|
|
|
Hi,
How to get data when
When we use on the webpage we get the option to select the file to be read.
Upon submitting we get the data right but how to copy the recieved data or send to server??
The control goes to below code upon submitting.
if(request->getMethodType() == HttpMethod_Post)
{
}
|
|
|
|
|
Graham Breach wrote: No, you cannot do that just using Javascript from a browser.
Actually... You used to not be able to do it with a browser (was viewed as a security hole). However, with HTML5, browsers have started putting in functionality to trap the filestream when a user selects a file in the input box.
More details are here: http://www.html5rocks.com/en/tutorials/file/dndfiles/[^]
Personally, I still view it as a security problem because I remember all of the details from back in the day, but my opinions don't seem to be falling in line with the new generation of web folks. (yea, yea, get off my lawn and all that) 
|
|
|
|
|
Interesting stuff - thanks for the link. I always thought the file upload support was a bit too limited to be honest.
As long as the user still has to choose which files the browser can access this looks like a big improvement.
|
|
|
|