Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

First off let me say that I think this deserves a dedicated discussion on the mailing list or even on HN. I fear this thread will not be seen by most redis users, unless they also happen to be interested in TCL (selection bias).

However:

I really think that the right thing to do is to embed Jim Tcl, but there is a cultural barrier preventing me from doing this.

My datapoint as a happy redis user would be: Please don't. I have used TCL but don't like it. I also think there are rather few users who are versed in it and the obscure syntax would become a barrier to redis scripting gaining popularity.

My vote absolutely goes to Lua. That's still nowhere near as popular as javascript, python, ruby et al. But I think it's a much more accessible choice to people coming from the aforementioned languages (read: most people).



Well what I think is that Lua is not nice and clean either for most users.

It's silly that there isn't a clean compact implementation of a strictly algol like language. Imagine C at higher level, or the basic PHP constructs without the stupid parts. This one:

    function sum(a,b) {
       return a+b;
    }
No OOP, Data types: arrays, hashes, bool, integer, ... the obvious things, with operators to manipulate this stuff for the most boring tasks, and functions for all the rest.

The lingua franca for scripting, as all the other languages will be bised in a way or the other.


The problem is that clean, compact, strictly algol-like languages tend to snowball into hairy, ad-hoc languages.

Thing is, it wouldn't be that hard. How many compiler textbooks involve writing a minimal language like that? Tiger or Oberon, for instance. It's just that people don't stop at a tiny-but-sufficient, because they usually have a completely freestanding language in mind. Embedded languages need restraint to be useful. (Incidentally, I'm hoping to write a Prolog-ish language with embedding in mind this summer, but I already have a bunch of projects going.)

Lua is one of few cases where the authors have placed such a high priority on embedded use that the language has been kept small, even when it meant (gasp!) leaving things out of the standard library. It's more like a sane Javascript than an algol-like language, though. (I love it, but it's not everyone's style.)


That function is valid Lua.


No, the curly braces have a different meaning (lists and tables, what JavaScript calls "object literals"). In Lua, it'd be

    function sum(a,b)
       return a+b
    end
Close, though. (The semicolon is optional, and typically only used with multiple statements on one line.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: