Posts Tagged ‘javascript’
CouchDB built on Erlang
Written by Jevgeni Kabanov on March 9, 2008 – 10:40 pmCouchDB: The interesting thing is that CouchDB automatically provides the REST front end that you tend to build on top of Java object stores like JBoss Cache or Coherence — An even more interesting thing is that it’s built on Erlang. This project gets more interesting every time I hear about it — it binds a REST API to your data and behavior, it is automatically replicated with no SPOF and it is built on the best massive concurrency platform available at the moment! Now I just have to check it out myself (and refresh my very rusty Erlang skills).
Tags: erlang, javascript, REST, web
Posted in Uncategorized | No Comments »
JavaScript Puzzlers
Written by Jevgeni Kabanov on February 28, 2008 – 1:56 amI have just attended a great course on JavaScript soft typing by Peter Thiemann. No doubt I’ll write more about it later, but today I want to show how fun and quirky can JavaScript be.
Note that all puzzles are given in succession and every next one includes all the code of the previous ones. Also note that I tested the puzzles in Mozilla Rhino, and can’t be held responsible for how standards non-compliant browsers (read Internet Explorer) will behave.
Puzzle 1
> var obj = {x : 1}
What are the values of
1) obj.y
2) print(obj.y)
3) obj.y.z
Puzzle 2
> var x = "x" > obj.undefined = "gotcha" What are the values of 1) obj[x] 2) obj[obj.y]
Puzzle 3
> var a = 17 > a.x = 42 What are the values of 1) a.x
Puzzle 4
> var flag = new Boolean(false); > result = flag ? true : false; What are the values of 1) result
Puzzle 5
> function f() {return this.x}
What are the values of
1) f()
2) obj.f = f; obj.f()
3) new f()
Puzzle 6
> function g1() {
> u = 2;
> print(u);
> var u;
> u = 3;
> print(u);
> }
>
> function g2() {
> u = 4;
> print(u);
> eval("var u");
> u = 5;
> print(u);
> }
> u = 1;
> g1();
> print(u);
> g2();
> print(u);
1) What values are printed out?
Tags: javascript, types, web
Posted in creative | 1 Comment »
Aptana Jaxer or sliced bread?
Written by Jevgeni Kabanov on February 19, 2008 – 8:45 amSometimes a technology appears that is just so damn cool you are amazed. More often than not the ideas behind it can be quite simple.
Aptana Jaxer is exactly such a technology. There is nothing new about having a server-side API. There is nothing new about building applications in HTML and JavaScript. The genius part is running Mozilla engine on the server-side and having access to full server resources from the browser via a controlled environment with no extra layers.
As far as I understood the communication between server and client is done by:
- DOM updates are seamlessly propagated from the server to the client
- Function calls can be proxied to call to the server. All marshalling is done automagically
This pretty much means that code runs seamlessly in a mixed, secure environment.
Although the “runat” attribute that controls whether code is run server-side or client-side can be a bit unlogical at first, the setup can allow to build powerful applications with only one (count it, one) technology — HTML and JavaScript. And this is the technology you have to use anyway to even deploy something on the web.
Of course “the one technology” suffers from being dynamically typed and generally known for its quirkiness, but with JavaScript 2.0 support on the way to Mozilla and good IDE support (which Aptana is in a good position to provide) this technology might yet give a fresh meaning to the word web application.
An interesting question I’d like to ask from the Aptana developers is if we can add a third environment to the mix — desktop applications? Having the same API to use on the server, in the browser and (with less restrictions) on the desktop could give Adobe AIR a run for their money.
Tags: ajax, javascript, web
Posted in review | 3 Comments »