Porting Node to Windows With Microsoft’s Help
blog.nodejs.org
blog.nodejs.org
I'm only into part-time/hobby development and so havent been able to justify spending the time (or the money) to do a Unix based OS setup for this, since all my machines run Windows.
With a node executable and native Windows support, it means i can have a dabble more often, which could lead to completion of a real project, even if im only working on it part time. I think for that reason alone, it will increase adoption of Node many fold. Not that i have anything against Apache, but it might just get unseated as the hobbyist's first choice as multi-platform web server (assuming its still on the top spot. I havent used it in ages).
I just hope it doesnt get restricted to the Windows Server family of OSes. I did a quick dig, and can see Windows 7 supports IOCP, so i'm hopeful.
(I've meanwhile reversed my setup to reflect the majority of my dev work: physically installed Ubuntu, virtualized Windows.)
I do see what you are saying though, and its ideal for someone that isnt as unfamiliar as i
Having a reflective moment a couple of weeks ago, I decided to learn something completely different (for me) and try Ruby. Not wanting to become type-cast as a Windows guy, I chose to do it on a unix based system. For this, I use an Ubuntu image in Virtual Box, and have been very happy.
> I just feel 'safer' in Windows.
I guess I could say I'm the same, though I think its more down to simply preferring Windows 7's UI/UX over the likes of Gnome and KDE. I've also tried customising a whole variety Linux window mangers, but always gave up.
So what I'm doing now is using Virtual Box in headless mode, then ssh-ing in with X-forwarding enabled. This gives me new icons in Windows 7's task bar for every 'remote' Linux window I have open. (though really I don't use much more than a terminal and maybe gvim). To an observer looking over my shoulder, it would just appear that the 'remote' Linux applications are native Windows programs.
[edit] I didn't really address your point about the learning curve to learning a new OS. This is valid issue and all I can suggest is to give it a try, and using a VM is an easy way to just dip in. You can get pre-installed Virtual Box images for many Linux distros such that it is really easy to get started. Unfortunately, my set-up took quite a bit of effort to get started (even with my familiarity with unix), but using a full-screen Linux VM is a good place to get started.
I guess what I was describing is just where you can go with it once you're comfortable.
If you do want to see a new cool API that Node.js should eventually take advantage of, check out User-Mode Scheduling in Win7+ at http://msdn.microsoft.com/en-us/library/dd627187(VS.85).aspx ; you can schedule your own async IO threads in userspace and save on kernel transitions.
And for what its worth, I'm actually working full time at my startup which is based on .Net and running on Azure. :)
Edit - Btw I enjoyed your thoughts on this post: http://www.openmymind.net/2011/5/3/Dealing-with-Now-and-why-...
- Building node.js on Cygwin (be sure to RTFM regarding which version to build). https://github.com/ry/node/wiki/Building-node.js-on-Cygwin-(...
- helpful comments on StackOverflow - in particular running the obscure ash.exe and doing rebaseall seemed to help http://stackoverflow.com/questions/3360948/compiling-node-js...
- self-contained windows binaries of nodejs - I did't try this, but seems like it could save some headaches http://node-js.prcn.co.cc/
Is this a joke? It sounds like it could be, but if it is, I can't tell.
That was the world before ~2005. The use of Windows has always been predicated on the notion that for-pay software is the default, and that, as a business model it is desirable. Linux has always been the opposite. Thus, as Linux users, we get the attention of open source developers -- usually people who are developing things about which they are passionate. We also have to suffer through version <1.0 (often, <<1.0).
The "cool" software, much of it, is still Windows only (or maybe Windows and Mac). The Gimp and Inkscape are pale imitations of Photoshop and Illustrator. Video editing that is as good as Premiere or Final Cut? Forget about it. And forget about modern gaming too.
All of that has to be run with Wine, if it can be run at all.
Driver support is minimal as well -- Nvidia only last week released a beta driver which begins to address bugs which arise in Gnome 3, while introducing new ones. Imagine if that were the case with Windows: your graphics driver did not operate properly with your desktop shell and you have to wait for a new driver.
So be happy that you have Cygwin, which can almost perfectly implement a Linux environment. Wine only occasionally runs a program well enough to be usable.
No, OSX runs on the Darwin kernel, not Linux. For a number of reasons, you can't take an app designed for OSX and run it on a laptop using Ubuntu (or another Linux distro).
Apple considered, for some time, replacing classic MacOS with Linux (I have used Apple's MkLinux a lot).
Every piece of free software we run (that we didn't write) is a favor. It's built by people generous enough to share what they did and shared so the same generous people could cooperate and build upon rhat other generous people did before them. No free license prevents such software from running on Windows and none ever will. If you feel like porting, you will be welcome.
The fact there is really no need to do it, however, because most of it runs perfectly well under Cygwin, remains.
I haven't seen anything about the POSIX subsystem that should be in Windows. It seems to me it could be used to build a more Windows-ish Cygwin.
Also, never forget Cygwin is the work of very generous people who wanted Windows users to have a free Unix-like environment they could use to run code that would be very painful to compile under Windows otherwise.
I'm arguing on behalf of a simple hypothesis, that Windows users know Windows and do not know Linux/Unix or POSIX. Moreover, they may not want or may not have the time to learn Linux/Unix or POSIX subsystem. They do not know nor can take advantage of what a "free Unix-like environment" provides. They know what they know. Cygwin adds a heavy emulation layer into Windows which they do not know. To be clear, they do know JavaScript and they do understand what running JavaScript on the server means.
Is Cygwin a technological achievement in and of itself? Yes, absolutely. Is Wine? Yes, absolutely. Is ability to run node.js or git on Windows through Cygwin? Yes, absolutely. Is that an awesome hack (in the best sense of the word) for people that understand the Cygwin emulation layer? Yes, absolutely. Is it an achievement for Windows-only developers and users who don't understand -nix idioms or POSIX subsytem? No, it isn't.
That's all I'm saying. I'm not offering a better solution -- I don't have one. I'm just saying that when someone from the -nix side says that something runs on Cygwin that they should respect and empathize with what that means for Windows users operationally.
To use an analogy, earlier a youtube video was posted about a first encounter between a tribe in Papua New Guinea and some white travelers. The white people had amazing tools are artifacts -- mirrors, matches, plastic cups, knives, etc -- which the tribal peoples had never seen before nor had a framework of understanding within which to reason about them. Are the tools cool? Yes -- the knife whittled wood far more effectively than their crude tools. Are the tools scary and hard to understand? Yes -- the tribesman covered the mirror with a leaf (!) because he couldn't understand how it worked or if it was (presumably) some sort of magic. The *nix command-line/file-system/permissions apparatus is incomprehensible magic voodoo to someone who's only had Windows console experience their entire life. So for the "white man" to say "but it runs in Cygwin" to the primitive native peoples is perhaps a tad presumptive. That's not to say that the native peoples are lesser beings intellectually viz. "don't eat that poisonous flower", Windows has had IOCP since NT4.
I think it's a wonderful example of the way the process should work that Microsoft is stepping up to help Ryan/Joyent port node.js to idiomatic Windows.
What Microsoft is doing here is preventing the deployment of a non-Windows servers to run node.js workloads because it also runs on Windows, much like what the PR they did with the PHP folks when they made sure PHP ran fine on IIS or, earlier, when Microsoft acquired Sofrimage only to validate Windows NT as a competitor to IRIX. Don't expect any commitment from Microsoft to the node.js community or any continued investment after they reach the goal of diverting enough resources into this port.
And, finally, Microsoft is not stepping up to help Ryan and Joyent. Microsoft is stepping up to prevent Ryan and Joyent to disrupt, in any measure, the Windows ecosystem.
Perhaps they'll help get it working as-is, then help with a project to make the framework more engine agnostic, then move over to using theirs instead of V8.
The cynic would suggest that "extinguish" comes next, though I can't see that working for them in this case in this day so maybe they'll be sensible/good enough not to try that one...
Microsoft are effectively ceding server site JavaScript on windows to Google's JavaScript engine without a fight.
On MS's past form, I doubt they will cede server-side JS to Google's engine permanently. They have money to throw at people to throw at making their engine and node work together, if they so desire.
What worries me is that lots of Node.js code may get developed on Windows and be unable to run on other implementations. I have seen Windows-only Java code. I know it can be done.
And it always seems a waste, for it already should run fine under Cygwin, much closer to the original implementation.
I would love to use javascript as a scripting language for my .Net programs, and I can't use the one MS built for IE, instead I need to go with less than complete codeplex projects.
I don't really understand why the console subsystem in Windows is so slow that it can actually add a significant amount of time to a build with lots of scrolling text.
Even the "slow" Terminal.app is a whiz by comparison, to say nothing of Gnome Terminal, or, rxvt.
I you really should install cygwin (and MinTTY).
http://www.catb.org/~esr/writings/unix-koans/shell-tools.htm...
A plethora of compilers, interpreters, tools, toys...
It's slow, true, but for development, how fast you need it to be?
And there is an advantage (I will regret saying this) in hardware support. You can use a broader selection of hardware with Windows than you can on Linux. Windows can be brain-dead from time to time (it insisted on rotating my notebook screen when I unplugged the rotated LCD) and I never got that Dell to suspend or hibernate to my satisfaction, but, with Cygwin, it's the next best thing after OSX. The first option for developing stuff that won't run on Windows is, of course, a real Unix (the kind that runs X).
If you're deploying to a Linux box it makes even more sense.
Haven't tested it, and it's no ORM, but it's something.
Hell they can't even settle on a single UI technology, .Net has 3 right now, looks like a 4th coming in Win8.
M$ involved in any way with Joyent and/or Node.js = really bad idea
Node on Windows is great, or at least kinda cool, but the direct involvement of Microsoft in 'embracing' disruptive upstart technologies has, historically, been a decidedly not-great thing for said technologies.
Why on earth would one assume things will be different this time around?