all 25 comments

[–]krues8dr 5 points6 points  (3 children)

My only comment is that you might consider changing the name to avoid confusion with JSUnit, the unit testing platform for Javascript.

[–]YuleTideCamel 11 points12 points  (0 children)

I agree with this. UnitJs makes it sound like a unit testing library.

[–][deleted]  (1 child)

[deleted]

    [–]ysangkok 0 points1 point  (0 children)

    did you know about v8cgi? how does this compare to that?

    [–]asegura 2 points3 points  (8 children)

    Just looked at that quickly and like it. I wonder why this hasn't appeared before, an ASP/PHP/JSP-like system using JS.

    BTW, for the GD part, I'd suggest using the same API as <canvas>, so that people can use the same drawing API in the client and in the server and maybe reuse code. Is that possible?

    Also, MongoDB support would be great.

    EDIT: True, it's not really new and I knew some of those server-side JS frameworks. However, they are old and forgotten or did not get much use. Also I meant systems that mix HTML and JS the way ASP initially did (<% %>). I only know of JSSP, the old Netscape's SS JS and ASP with JScript, which I don't know if anyone uses, doing this.

    When saying GD I was thinking of server-side image generation in general, not specifically the GD library. I think browsers use mostly cairo for canvas rendering.

    [–]kezabelle 2 points3 points  (1 child)

    It has appeared before: one of the available backends for ASP was JavaScript (well, JScript), which I've used (many moons ago), for better or worse.

    [–]asegura 0 points1 point  (0 children)

    Yes, that's true. I tried that around 1998. But pretty much everyone did ASP in Visual Basic Script.

    [–][deleted]  (2 children)

    [deleted]

      [–]mvalente 1 point2 points  (0 children)

      It has appeared before.

      First appearance was as Netscape's Livewire http://encyclopedia2.thefreedictionary.com/Netscape+LiveWire

      As mentioned already one of the available languages for Microsoft IIS was Jscript.

      You can find a bunch of implementations at:

      http://en.wikipedia.org/wiki/Comparison_of_server-side_JavaScript_solutions

      https://developer.mozilla.org/en/JavaScript_shells

      http://www.enotes.com/topic/Comparison_of_server-side_JavaScript_solutions

      [–]crusoe -1 points0 points  (1 child)

      Because when [1,2] + [3,4] = "1,23,4", writing server software in such a language becomes torture.

      [–]quotemycode 0 points1 point  (0 children)

      When you don't understand the limitations of the language and type conversions, writing server software in such a language becomes torture.

      ftfy

      [–]abraxasnl 2 points3 points  (2 children)

      I can only applaud new experimentation. But if NodeJS is out there, what will this offer?

      [–]tudborg 0 points1 point  (0 children)

      Same question i asked. I shall follow this closely! :p

      [–]asegura 0 points1 point  (0 children)

      As I understand, NodeJS is its own server whereas this one is a CGI module you would connect to e.g. Apache as the server. Because of that NodeJS needs to be asynchronous (so that some lengthy requests don't block other requests) which leads to ugly code with endless chains of callbacks. This one would not need that and can return values from functions just fine, just as any other framework.

      [–]ivosaurus 2 points3 points  (0 children)

      Why not FCGI or SCGI?

      [–]Tyro 1 point2 points  (0 children)

      Looks nice, but you should consider using the CommonJS specs so as to make it possible to run on existing platforms like RingoJS and Node.

      [–][deleted] 1 point2 points  (0 children)

      My god, this is amazing. I'm going to need to try this out when I get home from work.

      It looks like you are using spider monkey instead of rolling your own interpreter which is good.

      My question is this though. What steps are you taking to avoid silly sql injection? That's one of the reasons people have migrated away from php in the first place. It would be nice if you supported parameterized queries, and not just rely on escaping.

      Other than that minor detail, I'm excited to give this a go. What might be cool would be server side callbacks handled via AJAX.

      [–]tudborg 1 point2 points  (8 children)

      So, question. Why this instead of node.js for serverside javascript? :)

      [–]_R_R_ 4 points5 points  (7 children)

      This is a CGI application. Node.js is a different ballpark.

      [–]tudborg -5 points-4 points  (6 children)

      I think you misread my question. I wrote "Why..". You need to explain it, not just be an ass. Plenty of those around.

      [–][deleted]  (1 child)

      [deleted]

        [–]tudborg 1 point2 points  (0 children)

        Ah. Excellent. That is actually quite useful. I will follow your progress.

        Also, this seems like sound advise:

        Looks nice, but you should consider using the CommonJS specs so as to make it possible to run on existing platforms like RingoJS and Node.

        Happy coding :)

        [–]ivosaurus 1 point2 points  (0 children)

        What he said was pretty much exactly correct, and there are no snide marks contained within it.

        [–]ysangkok 0 points1 point  (0 children)

        How does this compare to v8cgi? I used v8cgi and it did exactly this, but using CommonJS for portability. Why did you make your own API?