Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Offline language most similar to javascript? [closed]

Tags:

javascript

Just a quick query ...

I would like to ask people's opinions as to which language is most similar to javascript? I don't program for a living, but I have been learning javascript in my spare time. I would now like to have a shot at making a desktop application, and I think it would help to choose one which is most similar, if at all possible, to javascript?

e.g. python, ruby, C#, visual basic ... I have no idea and haven't had much luck googling this

Thanks

Matt

like image 942
Matthew Klein Avatar asked Jan 03 '11 14:01

Matthew Klein


3 Answers

Why not use Javascript? Who says it can be used only for "online" programs?

There's a Windows Script Host on Windows that allows you to run Javascript programs from the command line or double-clicking in Explorer.

Other OS's have similar script engines.

like image 197
Cheeso Avatar answered Oct 14 '22 01:10

Cheeso


It depends on what you mean by "similar". Syntactically, JavaScript is part of the syntax tradition derived from the B programming language (C, C++, Java, and C# are others in this syntactic tradition). But that's just syntax. JavaScript isn't much like those (although both C# and, to a lesser extent Java, are getting more and more "functional" features added to them). If you're writing for Windows, you might take a good look at C# (and a subset of it is supported on Linux, in the form of the excellent Mono project).

You might look at JScript.Net, which is a language for the .Net platform that's, well, I'll say inspired by JavaScript. Again, that's a bit Windows-ish although (again) Mono provides a good layer for Linux.

Visual Basic (.Net or otherwise) will not be a good fit. Fairly easy syntax (BASIC was designed for easy syntax), but not very much like JavaScript.

If you don't mind a syntactic departure, both Ruby and Python are dynamic languages like JavaScript, and both are fairly popular these days for desktop apps (at least on Linux).

You certainly could use JavaScript if you want to. Someone else mentioned Adobe AIR, but I'll throw out another one: Rhino, which is JavaScript for Java. That gives you access to the huge collection of Java libraries out there (as the JavaScript code can interact with Java code and vice-versa). Whether you want to do a desktop app using Java technology (even though writing JavaScript) is obviously going to be up to you.

For command-line apps, you can use V8 directly, or NodeJS which uses V8 but has a lot more (and on Windows, JScript with Windows Scripting Host).

like image 45
T.J. Crowder Avatar answered Oct 14 '22 01:10

T.J. Crowder


You can use Adobe Air to run Javascript + HTML + CSS.

like image 31
David Murdoch Avatar answered Oct 14 '22 02:10

David Murdoch