My Computer Forum Computer Science Forum

Go Back   My Computer Forum > Computer Science Forum > Programming

Programming Programming Languages, Interpreters, and Compilers - Assembly, Declarative, Machine, Object Oriented, Iterative


Reply
 
LinkBack Thread Tools Display Modes
December 29th, 2011, 11:41 AM   #1
 
Joined: Sep 2011
Posts: 13
A Language That will run Anywhere Javascript/clojure/closure

For people who aren't professional programmers what they want to do is to be able to write something that will just work everywhere. They don't want something which will require them to install software to adapt their programs to each platform. They may not have the necessary privileges or the required time to install the necessary software on the computer they are using.



In the office environments I have been in since graduation, I have not been given any tools to program or write scripts beyond what comes in the standard office environment. Companies usually lock their registries and frown on people installing software on their computer. Using the tools provided one should expect they will probably have access to visual basic for application (that is you can write office macros) and your web browser will probably be able to run javascript.Using visual basic is usually the easiest environment for automating office tasks but I have never scene it given much praise as an environment for actually building real applications. Visual basic is generally the language used for automating that which is already built. Moreover, you are likely stuck with the application version of visual basic and not a stand alone environment.



You may be able to run visual basic script independently of an application by changing the extension to .vb or .vs but this is likely not supported for security reasons. There may be operating system tools to compile various dot net languages into byte code but the use of such tools may violate cooperate policy.



You will also likely have access to shell tools which include cmd.exe (AKA dos) and powershell. The default powershell security is usually quite high and if there are ways around this default security one should ask if it would be considered "circumventing corporate security"



So well visual basic is preferred if you have a specific office application task you wish to automate, I would not invest a lot of time in it building general purpose libraries to assist ones programming needs in visual basic. Javascript is known as the assembly language of the web. Almost every office environment has access to a web browser, and thanks to HTML5 many companies are replacing native aps with web aps. If your phone or tabet is a webos phone (such as palm) you can write aps for it in C or javascript.



Google docs is an example of replacing native applications with web application. Moreover, there is no need to run a webpage from the web. You can run it from your local computer and this usually means less security restrictions. Additional browsers such as firefox and I believe chrome are largely buit with javascript and have a lot of extensions programed in javascript.



A downside of using javascript for office programming is that companies tend to track what websites employes visit. Consequently visual basic may be lower key. However, I am not sure if they track url requests to localhost. However, I doubt IT would consider an offline javascript application running though a web browser a security concern. This would be especially true if you are just doing some small scale math or parsing application.Now, java script isn't tied strictly to web browsers (with all the security application that entails). It can be run in the JVM (java virtual machine) by using Rhino, it can be run under windows script host (dot net environment) and their is also just int time compilers for it so it can be run independently of a common run-time environment.



If though you are running it though a web browser, you can do IO (input/output) by using form fields, Ajax server requests or you can automate the browser using OLE automation (interface it with say powershell or visual basic). I would recommend the following:

Simple math or parsing: Ruining in a webbrower is fine.

Input using forms, output to a separate field or possibly a new web page.

Automating IO: Perhaps try interfacing with powershell and visual basic with the web browser page.Stand Alone applications: Run using a common run-time environment and do most inter-operation within that environment. The Java virtual machine (by using rhino and bean scripting framework) would be my preference but dot net can be made portable by using mono.



Going further, Javascript is known as the "Assembly Language of the Web". Continuing in that Analogy most people don't program in Assembly. A few languages have been created to address the problems with Javascript. The correct language to organize large javascript projects in is called closure and was created by Google to program large web applications such as gmail. Other popular languages which complie to java script include:

coffee script and jquery.

I am learning towards learning clojure-script which can be complied into googles java script coding conventions (A.K.A closure). Clojure-script is based of the JVM (java virutual machine) language called "clojure" which is a lisp designed to run in the JVM. Lisp family languages are popular in artificial intelligence applications and they are considered a functional programming language.



Functional programming languages are often popular programming language for parallel computing and the interest in them has grown considerably since the wide spread introduction of multi-core computers. Moreover, the most common language used to automate auto cad languages is a lisp which was formally called auto-lisp and more recently has been upgraded to a language called visual-lisp to make it compatible with the dot net environment.Another advantage of lisp family languages is the program is a data structure. This makes it much more conducive to a style of programming where the program writes code. For instance a lisp would be a good language for genetic algorithms.Auto-lisp generally works with DFX codes. (see: http://www.jefferypsanders.com/autolispintr_dxftbl.html and http://images.autodesk.com/adsk/files/acad_dxf0.pdf)



DFX is the original autocad format which is text based and consequently can be easily manipulated by any programming languages. If you wish to see the result there is an open source CAD program called librecad (http://librecad.org/cms/home.html) which is based on qcad which can read and edit dfx files. There is also a package that librecad is considering including called libredwg which will allow it to also view dwg files. (See: http://blog.librecad.org/2011/04/adding-dwg-support/ )One project I would like to do is to write a library in clojure script which mirrors the functionality of autolisp. This way I could automaticaly change autocad files by simply providing them as input to a web browser. Additionaly any tools I build which use this library would be easy to port to autolisp.
John Creighton is offline  
 

My Computer Forum is free to register and we welcome everyone!

April 29th, 2012, 08:56 PM   #2
 
Joined: Apr 2012
Posts: 4
Re: A Language That will run Anywhere Javascript/clojure/clo

hello John Creighton..! I think it's very useful with me
andyou111 is offline  
Reply

  My Computer Forum > Computer Science Forum > Programming

Tags
language, run



Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript to CSS code bulf Tech Support 1 December 18th, 2011 01:42 PM





Copyright © 2018 My Computer Forum Forum. All rights reserved.