Hacker News new | past | comments | ask | show | jobs | submit | koush's comments login

This is certainly something that is doable and crossed my mind, but I did not want to have the await be restricted to functions that conform to the typical return arguments. For now at least.


How about

  try await foo = bar(baz)
as shorthand for

  await error, foo = bar(baz)
  if (error) throw error


That's exactly how this was done. I'm going to implement "yield" as well when I have some time. They both just leverage coroutines.


node-fibers is one attempt to put coroutines into node. I like it because it uses libcoro, which is nice and tight and uses ucontext, and because it works as a module without forking the core of node. Once you've 'fiberized' the server modules to start each request in its own fiber and implemented a call-with-current-continuation on Function.prototype, we're pretty much at the same place you've arrived but without new keywords.


Ah I missed this. I once tried to implement coroutines in v8 but v8 makes use of getspecific and setspecific pthread methods which makes it more complicated.


Not sure to be honest! I am still very new the to scene so I am unaware of this project. At first glance, we seem to have different approaches towards the same goal though.


It exits the function, and resumes it when the callback completes. So other requests can be processed while the async function is (a)waiting.


Perfect :).


This is the @koush referenced in the article. To repost what I said on reddit last week:

"To clear up any confusion, I was not offered a job, just an interview, which I declined out of principle. For those saying "I'm going to regret being principled", etc. Probably not. Android App sales have been more than good to me. Good, enterprising, devs should never find themselves short of opportunities."

I wasn't trying to "ride on the geohot wave to get 15 mins of fame". Without beating my drum too much, I've already achieved a moderate degree of it within the Android community. http://twitter.com/#!/koush

I had been tweeting about geohot's happenings for the past few months, and then I got that recruiter email. So I responded, and took a screenshot because the whole thing was a pretty ironic, and tweeted it. Then ~16000 followers made it go viral: http://twitter.com/#!/koush/status/46345951819993088


Koush.. I just wanted to thank you. 1) for not taking SCEA up on their offer, but more importantly, 2) for Clockwork Recovery. You are pretty much one of the only reasons we all have these great rooted Android phones. Thank you.


Fairly old news. I ported Mono to Android a few years ago and got Python and Ruby running that way.

http://www.koushikdutta.com/2009/02/monodalvik-interop.html



really great effort, i will try it out, but why is it so large?


Because it's .NET, therefore has to include the .NET library (to be of any use at all aside from a virtual machine). Or in this case, the Mono version of the .NET library. It's a big library.


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

Search: