Are there viable alternatives for Web 2.0 applications besides a lot of Javascript?

If you say that the syntax of the C-style syntax is on the axis of evil, you just hopelessly condemn it to suck and deal with it if you want to provide your users with cool web 2.0 applications - for example, things that are usually done using jQuery and Ajax, etc. .d.? Is there no other choice? We are currently creating intranet applications using pylons and a bunch of JavaScript along with a small amount of Evoque. Thus, it is obvious that for us the world would be a better place if instead there was an equivalent similar to PythonScript. But I haven’t seen anything like it yet except the Android ASE system, but obviously something is pretty unrelated. However - if browsers can support other scripting languages ​​....

+3
source share
4 answers

Another language supported by "some" "browsers" is VBScript, but .. you don't want to go there.

Support for other languages ​​is still ongoing.

Today you can have a framework or library for translating one language into JavaScript

Here are some of them along with a small sample:

  • GWT - Java

    // Add a button to remove this stock from the table.
    Button removeStockButton = new Button("x");
    removeStockButton.addClickHandler(new ClickHandler() {
           public void onClick(ClickEvent event) {
               int removedIndex = stocks.indexOf(symbol);
               stocks.remove(removedIndex);
               stocksFlexTable.removeRow(removedIndex + 1);
           }
    });
    stocksFlexTable.setWidget(row, 3, removeStockButton);
    
  • Pajamas - Python

    def greet(sender):
        Window.alert("Hello, AJAX!")
    
  • CofeeScript - (like Ruby)

    square: (x) -> x * x
    cube:   (x) -> square(x) * x
    
  • Pyscript - (similar to Python)

    // Example One
    function triangle(a,b):
        function sqroot(x): return Math.pow(x,.5)
        return sqroot( a*a + b*b )
    

From this, GWT is the most reliable.

+4
source

I believe that you just need to overcome this, but there are some options other than C that are “compiled” before JavaScript:

  • CoffeeScript inspired by Ruby and Potion
  • - Google Web Toolkit (Java) Python
+3

GWT, Java Javascript. . , , Python JVM, , , Python GWT.

http://pyjs.org/ , , .

0

"" - 2.0, GWT . : Silverlight, Flash, JavaFX. IronPython (.Net Python) Silverlight.

0

Source: https://habr.com/ru/post/1747081/


All Articles