Subject Re: [Firebird-Architect] JavaScript as Database Scripting Language
Author David Jencks
On Dec 26, 2008, at 7:32 AM, Jim Starkey wrote:

> The things that I like about JavaScript are:
>
> 1. Familiar and relatively terse syntax.
> 2. Soft types
>
Does that mean a weak type system? What do you like about it?
> 3. Extensible objects
> 4. Object inheritance (object can inherit attributes from another
> object)
> 5. Exception handling
>
> What I don't like:
>
> 1. Functions as assignable objects (aka first class function). I see
> the cost but not the benefit.
> 2. Function ambiguity. A single function can be a standalone
> function, a method on object, and an object constructor.
> 3. Invisible context. An attribute reference in a function is
> determined by the call path rather than the function definition.
> 4. The runtime cost of name resolution in such a complex environment.
>
> In short, I see excessive generality that results in difficult to
> diagnose bugs as well as unnecessary runtime overhead.
>
> I wonder whether substituting rudimentary class definitions for "first
> class" functions might make sense. Wouldn't be JavaScript anymore, but
> that wasn't a goal in the first place.
>
> Any thoughts?
>

That's how you pretend to have first class functions in java, and how
they are implemented in java bytecode in e.g. scala.

I'm extremely leery of any languages that don't have a strong compile
time (or syntax-check-time) type system. I got talked into writing
some groovy scripts because "it's so much more expressive than java"
and found it nothing but headaches.

I haven't actually written any code in either javascript or scala but
if this was my project I would start by writing a domain specific
language in scala and see how it worked.

thanks
david jencks

>
>
> --
> Jim Starkey
> President, NimbusDB, Inc.
> 978 526-1376
>
>
>