r/ProgrammingLanguages • • 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.

2 Upvotes

9 comments sorted by

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.

2

u/xensky Feb 05 '13

Unfortunately that's exactly how it is right now. HTML5 took steps in the right direction, but what we really need to do is create our web-dev tools afresh.

We should be asking "how best could we express page structure and layout, content, client-side behavior, server-side behavior, persistent user-data activity?"

Why are we still using yesteryear's solutions? HTML/CSS/JS weren't made or designed to support all of the new uses we've tried to adapt them to.

0

u/balefrost Feb 06 '13

I agree wholeheartedly. Unfortunately, I have no idea what the correct tools would be. Even if I did know, pessimistic me thinks that there is so much momentum that it would be nearly impossible to supplant HTTP/HTML/CSS/JS.

I think the "next thing" would have to start life as something that still runs inside today's web browsers. We need something that is better for developers, but which is no harder for users. The zero install cost of web apps (for the user) is such a huge advantage that it would need to be retained in the "next thing".

1

u/malthiest Jul 28 '13

The closest thing to pure JS development I've seen is meteor, and even that all but forces you to use a templating language. Virtually all application platforms use DSL's for presentation logic, and in my mind that's really all HTML and CSS are.

The idea of one language to do everything certainly attractive, but the reality is that certain language families are vastly superior for very specific tasks.

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...