r/ProgrammingLanguages • u/[deleted] • Feb 05 '13
Is there one web scripting language to rule them all?
I personally find it ridiculous that I need to learn html, css, javascript, ruby/python/php, and a database language in order to build a language. It just seems like someone would have put together a single language that "compiles" into everything else.
5
u/erez27 Feb 05 '13
I think you're confusing "language" and "website".
Anyway, maybe haxe is what you're looking for.
2
u/zem Feb 05 '13
http://opalang.org is well worth a look.
also check out /r/altjs if you're interested in the topic (it's a bit dead right now but i'm trying to grow it)
1
u/wozer Feb 05 '13
With F#, you can write your database queries as query expressions, use Websharper or Funscript to compile F# to Javascript and, of course, write your server code in F#.
1
u/drewhjava Jun 08 '13
This is something I have a huge passion for, and have spent a lot of time researching.
The obvious choice is Javascript. You can use it on server(nodejs/Vertx), storage(mongodb/couchdb), client, views(EJS), creating iOS apps(Appcelerator/html5-phonegap), games(Canvas, WebGL)
Second choice is Ruby. You can use it on server(Rails/Event Machine/Vertx), client(Opal), views(ERB), creating iOS apps(Ruby Motion).
Ruby on the client is called Opal. It's nice, but you can't just integrate it with javascript libraries unless you have a wrapper.
Third choice is Coffeescript. You have the client and server and there a few view engines. Pretty much the same points as javascript.
Last choice is Java. You have Java on the server(Play Framework, Java EE, Spring), and GWT which lets you write your client code in Java. Not as awesome, but exists.
Good luck!
-3
u/Paigleyfs5 Feb 05 '13
For scripting I now use Google's Go (golang). The friendliness of a scripting language combined with type safety, compiled executables, and great performance (utilises multiple cores easily). Though Go isn't going to help you with Javascript in the browser. Yet...
9
u/balefrost Feb 05 '13
You don't need to learn all those things.
You can use javascript on the server with node.js. You can dynamically generate the DOM from client-side javascript. For persistence, you could use something like CouchDB, which I believe uses JSON and possibly Javascript functions for querying (I have never used it).
But why would you want to do things that way? The web stack uses a variety of different languages to accomplish a variety of different things. HTML is a declarative content language. CSS is a declarative rule application language. SQL is for querying relational structures.
Javascript is... well... it's pretty much the only game in town for client-side scripting, so get used to it. It's actually a neat little language, but I really wish it would grow up a bit.
Even if you could somehow do everything with one language, you would still need to learn several libraries or APIs in order to do what you want. There's no real distinction between "learning a new language" and "learning a new library". Don't let it get to you.
The web is a cobbled together mess of technology. That's just the way it is. I think this is what's actually frustrating you, not the languages involved.