Google App Engine

Unfortunally, the Google App Engine [1 ] only seems to support Java and Python.

I wonder if Jacl helps us?

NEM 2010-01-08: Yes, Jacl (or the TJC compiler) can be used to deploy Tcl applications to Google's app engine (technically, at least -- you'd have to check Google's terms of service). An example servlet that should work follows. This simple servlet evaluates any arbitrary code that you pass in the ?script= parameter (e.g., script=puts+%22Hello,%20World!%22). Obviously, don't deploy this to a production server!

package jacltest;

import java.io.IOException;
import java.io.PrintStream;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import tcl.lang.*;

/**
 * A simple demo of using Jacl to evaluate code for Google's AppEngine.
 * @author nem
 */
public class JaclServlet extends HttpServlet {
   
    /** 
     * Processes requests for the HTTP <code>GET</code> method.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintStream out = new PrintStream(response.getOutputStream());
        Interp interp = new Interp();
        StdChannel.setOut(out);
        StdChannel.setErr(out);

        try {
            out.println("<html>");
            out.println("<head>");
            out.println("<title>Jacl Results</title>");
            out.println("</head>");
            out.println("<body>");
            out.println("<pre>");
            String[] cmds = request.getParameterValues("script");
            for (String cmd : cmds) {
                try {
                    interp.eval(cmd);
                    out.println(interp.getResult().toString());
                } catch (TclException ex) {
                    out.println("ERROR: " + ex.getMessage());
                }
            }
            out.println("</pre>");
            out.println("</body>");
            out.println("</html>");
        } catch (Exception ex) {
            out.println("EXN: " + ex);
        } finally { 
            out.close();
            interp.dispose();
        }
    } 

  
    /** 
     * Returns a short description of the servlet.
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "Jacl interpreter";
    }

}