TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

CommonJS effort sets JavaScript on path for world domination

126 pointsby baxterover 15 years ago

7 comments

cbetzover 15 years ago
Javascript is my favorite language, but building very large systems composed of interdependent modules is still very tricky and everybody does it differently (especially when you leave the browser and talk about the various server-side JS offerings).<p>The problem is that various ECMAScript standards committees never really considered "programming in the large". The CommonJS project is important because it aims to fill this gap and create a real JS ecosystem by:<p>1) Creating a standard for interoperable modules that handles scoping (i.e. module X can't mess with module Y) AND dependency resolution. 2) Attempting to define a set of standard APIs for binary data, files/sockets [streams], and anything else that you might want in a good standard library.<p>I encourage everyone who writes a lot of JS to join the CommonJS discussion group. Currently, the module API spec is mostly complete (and there are a good number of working implementations). The hot topic now is the Binary data API, which is extremely important because it will be used as a base for all subsequent modules that want to manipulate binary data.
评论 #969854 未加载
评论 #970728 未加载
评论 #970656 未加载
jerfover 15 years ago
The biggest problem with "Javascript on the server" right now is that Javascript has no concurrency story whatsoever. You could easily hack in shared-state threading, but there would be no faster way to turn me off of Javascript forever than to do that. You could hack in message-passing, but it won't be clean and you're still going to have terrible fun trying to not pass mutable references, which, again, if you leave that in I will run screaming. STM isn't exactly going to be easy to stick in either.<p>(I say I will "run screaming" not merely because I don't want to deal with it, but because I don't want to deal with yet more libraries based on shared-state concurrency. No. I've left that behind and I'm not going back, and certainly not in a space where I've got an abundance of languages to choose from.)<p>Without a solution to that problem, I see this as a terribly, terribly wrong move, and a terrible time for JS to try to be picking up the server. Servers are <i>in</i> the multicore age and have been for a couple years now.<p>(And if your answer is "well, we'll just keep all the tasks simple and we won't need multiple threads", I would remind you that you're running <i>on the server</i>, which often needs to do, you know, <i>actual work</i>. A language that can't do that may have a small niche, but it's going to be an uphill battle against entrenched competitors.)
评论 #970958 未加载
评论 #970198 未加载
评论 #970205 未加载
评论 #970178 未加载
评论 #970193 未加载
shimonover 15 years ago
What I want is an extension for my web framework that transparently pre-renders certain Javascript-generated parts of the page, and then sends the browser a serialized version of that page that includes not only DOM structure but fully wired-up event handlers.<p>This should be possible using HTML and &#60;script&#62; tags, but will take some serious work to become plausibly cross-browser. But if that work happens, there will be a way to automatically provide the usability/speed benefits that previously required dual client &#38; server implementations without the attendant cost. And that will drive a lot of people to using whatever standards those tools are built on.
tmikewover 15 years ago
This is kind of cool, but who is going to digest all of it? The techno folks may have some technology pieces working, but nobody out in the main world would be able to figure it out. I got a little dizzy just looking at all the links to all the pieces in just this one article. Let alone actually reading them all.<p>I like Java script but I think making it go server side is backwards. Why not make Python or Perl or Ruby go client side instead? (I am sure plenty of folks smarter than me have already thought about and probably worked on it.) Those languages already have all the parts they need except a connection to the browser dom. Java script has a connection to the dom and practically nothing else. These other languages have been getting tweaked for years on the server side. It just seems like such a big byte to get Java script to work as a regular language like the others. It also ignores some of the things that are lurking like Erlang and Clojure. It sounds correct that there are lots of Java script programmers. However are there lots of Java script <i>only</i> programmers? I doubt it. While it is compelling to write one language every where, I dream about it sometimes, we aren't close yet.<p>So embedding the Perl, or whatever, interpreter into the browser is probably a chore, but it is also probably doable, the browser should be able to deal with multiple languages. I think it is just that the people that are capable of doing that job looked at it and said. "Crap! I will just learn Java script." So the reality in my mind is that programming in two or three or four languages is just easier than doing all that other work. Everybody does it. In fact we say I know Java, or Python, or Java script, but that is just a word to give us a frame of reference when we communicate with each other. In fact what we really know is how to program computers and Python is a subset of the total global programming skill that I have. It is a like speaking English in some specific domain. There is jargon everywhere, one can speak English but one tends to get easily lost if one listens to lawyers speak to each other or doctors, and one is also not a doctor or a lawyer. Does that mean we should create a generalized English that both doctors and lawyers can use in each of their specific domains? Seems a little silly when one thinks about it. Is making Java script work everywhere is really buying all that much?
评论 #969916 未加载
评论 #969877 未加载
评论 #969768 未加载
评论 #971948 未加载
pquernaover 15 years ago
I'm glad the JSGI spec is fleshing out, the web connector API will allow many more frameworks to get started easily, rather than forcing Javascript programers to hack on java or C to build a webserver first.<p>Once JSGI is done, it really will allow the experimentation you see from Rack and WSGI in the respective Ruby and Python worlds.<p>I guess its about time to update my old mod_v8 to support jsgi :D <a href="http://news.ycombinator.com/item?id=408707" rel="nofollow">http://news.ycombinator.com/item?id=408707</a>
emilis_infoover 15 years ago
The CommonJS module system is really a step forward.<p>For the last two months I've been developing a webapp on Helma NG and I like it very much. Parts of the framework fit together nicely. The community on IRC is very helpful and provides answers in the rare cases where source code and documentations is not enough.<p>I also want to praise the project developers for their code quality -- even though I use a version from git I haven't had a single problem with frequent updating and re-building it.
azgolferover 15 years ago
Funny that no one seems to mention that IIS runs JavaScript (aka JScript) on the server, and has since the beginning.
评论 #971658 未加载