Will server-side JavaScript take off? Which implem

2020-05-26 10:17发布

Does anyone see server-side JavaScript taking off? There are a couple of implementations out there, but it all seems to be a bit of a stretch (as in, "doing it BECAUSE WE CAN" type of attitude).

I'm curious to know if anyone actually writes JavaScript for the server-side and what their experiences with it have been to date.

Also, which implementation is generally seen as the most stable?

17条回答
Root(大扎)
2楼-- · 2020-05-26 10:43

I like to read Googler Steve Yegge's blog, and recently I came across this article of his where he argues that Mozilla Rhino is a good solution for server-side JS. It's a somewhat sloppy transcript, you might prefer to watch the video of the talk. It also offers a little bit of insight on why he thinks server-side JS is a good idea in the first place (or rather, why he thinks that it's a good idea to use a dynamic language to script Java). I thought the points he makes were convincing, so you might want to check it out.

A while earlier, he also posted something about dynamic languages in general (he's a big fan of them), just in case you were wondering why to use JS at all.

查看更多
冷血范
3楼-- · 2020-05-26 10:44
  • XChat can run Javascript plugins.
  • I've some accounting software completely written in Javascript.
  • There's this interesting IO library for V8: http://tinyclouds.org/node/
  • CouchDB is a document database with 'queries' written in Javascript (TraceMonkey).

Considering this, i believe, server-side Javascript did take off.

查看更多
Viruses.
4楼-- · 2020-05-26 10:47

I've never even heard of this, but it strikes me as using the wrong tool for the job. Since programming languages are just tools designed to help us solve some problem.

Why would you want to process something in Javascript when you can process it in PHP or ASP.NET which are designed specifically for this task?

Sure you can pound a nail in with a screw driver, but a hammer works much better because it was actually designed for it...

So no, I don't see it taking off.

查看更多
乱世女痞
5楼-- · 2020-05-26 10:48

Why would you want to process something in Javascript when you can process it in PHP or ASP.NET which are designed specifically for this task?

Perhaps because JavaScript is a more powerful programming language than those two? For example, it has functions as first-class data types and support for closures.

Steve Yegge has blogged about porting Ruby on Rails to server-side JavaScript as an internal project within Google ("Rhino on Rails"). He did it because he likes Rails but using Ruby isn't allowed within Google.

查看更多
狗以群分
6楼-- · 2020-05-26 10:49

It seems like most of you are put off by this idea because of how unpleasant the various client-side implementations of Javascript have been. I would check out existing solutions before passing judgment, though, because remember that no particular SS/JS solution is tied to the JS implementations currently being used in browsers. Javascript is based on ECMAScript, remember, a spec that is currently in a fairly mature state. I suspect that a SS/JS solution that supports more recent ECMA specs would be no more cumbersome than using other scripting languages for the task. Remember, Ruby wasn't written to be a "web language" originally, either.

查看更多
登录 后发表回答