News for hackers. Stuff that matters.

swordfeng

Re:Avoid Mini-Frameworks on Wednesday December 31, 2025 @12:16AM (#46441560)
You know what I feel when I see someone adding a dependency injection framework to a micro micro service with merely 6 classes...
Re:Node.js and Python Interoperability on Sunday June 16, 2019 @04:48AM (#20194564)
I was once trying to do something even crazier: exposing full python accessibility to node.js, using proxies. So that you can use python objects and functions as native javascript objects and functions. It is feasible because the languages and runtimes share a number of common designs.

There were several tough things however. The first was error handling. Yes you can catch exceptions in native code and convert it to exceptions in the other language, but it's not straightforward to keep stacktraces. The second was circular references between runtimes. Since references across boundaries are global, garbage collector on either side could not reclaim circularly referenced objects. Although this could be resolved by manually breaking up the circle, it could be better to have weak references. (Or maybe other utilities, idk what would be more elegant.) The third was that js has no operator overloading, so I had to use .__add__() for example to call the python add operator.

One line example: https://github.com/swordfeng/pyjs/blob/master/test/jsobject.... It's a toy project I did years ago and not even compiling now. Also I was wondering if anyone really need to do things in this way, given there are bunch of popular and stable RPC libraries. But I was happy to learn something about underlying cpython and v8 from it.

Re:WireGuard for iOS on Thursday December 20, 2018 @12:24AM (#18722704)
I know someone do use wireguard to bypass the GFW. It's not blocked at the moment. However, a concern is that the UDP-based protocol is not hard to detect.
The "state" in title stands both for the TCP state, and the country - an ironic meme in China. It is the opposite of "our country", a phrase usually seen in official media. The government does not even admit the existance of the GFW, which is one of the reasons why people say they are living in a different "state". The meme is explained here: http://foreignpolicy.com/2015/06/25/chinas-your-country-we-j...
Re:Coroutines are now in Clang trunk, libc++ on Friday May 26, 2017 @10:32AM (#14424296)
[] marks the beginning of a lambda. In which declares whether variables are passed by value(=) or reference(&).