Shuffling the stack: first faltering steps on Factor

In my neverending quest of avoiding actually getting any of my projects ready, I started playing with Factor. In four years, Slava Pestov and the other folks hacking on Factor have created an extremely impressive language, beating many other dynamic languages like Python and Ruby in speed and providing an environment that doesn't make the Factor 2.0 goal "Best interactive development environment of any programming language" sound like an impossible idea.

But it does have a steep learning curve. The concepts of the language aren't difficult — in many ways it resembles other dynamic languages — but it feels like I'm clumsily trying to perform mental gymnastics instead of actually being productive. See, it's a Forth-style stack shuffling concatenative programming language. There are named variables (dynamically scoped, which feels weird, but that does have its uses when used sparingly) and these days there are even lexically scoped named locals, but depending on those instead of getting used to stack manipulation would be cheating, no? So now I'm slowly dupping, overing, tucking and swapping my way through simple algorithms, trying to switch my head into the right gear.

This is how all software should be

 $sudo -u couchdb /opt/couchdb/bin/couchdb 
 couch 0.7.0a572 (LogLevel=info)
 CouchDB is starting.
 CouchDB has started. Time to relax.

It's a bit like having a dictionary with the words "Don't panic" printed on the cover in big, friendly letters.

Resin: Javascript in JSPs?

Am I missing something here? JSP Templates vs.

/test.jsp:1: 'javascript' is not supported as a JSP scripting language.

1:  <%@ page language="javascript" %>

That's what Resin 3.1.2 tells me.

Update: Right, now I noticed this in Resin 3.0.0 release notes:

Since the JavaScript for JSP was used by too few users, it no longer makes sense to continue support.

Arf.

Apparently Tomcat, Jetty and Glassfish all support only Java in JSPs, not any javax.script implementations. Now I'm trying to figure out how to use EJS from scripting.dev.java.net. Any other Javascript templating options for servlets? I know Helma, but I'm interested in the front-end code (templates, value objects, possibly controllers) only.

© Juri Pakaste 2024