Better HN
topnewbestaskshowjobs
Log inSign up

swordfeng

11 karma · joined May 7, 2016 (10y ago) · 7 submissions

5A11 FEDD F991 B901 B98F F2C3 732A FCA7 03D1 198A keybase.io/swordfeng [ my public key: https://keybase.io/swordfeng; my proof: https://keybase.io/swordfeng/sigs/_2TDwz5gBG0mprUs1VOaTcSdkHVTx2Th-tp-mbu21Jc ]
Submissions

comment 10mo ago · link · parent

You know what I feel when I see someone adding a dependency injection framework to a micro micro service with merely 6 classes...

comment 7y ago · link · parent

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.

comment 7y ago · link · parent

A previous post: https://news.ycombinator.com/item?id=19238221

comment 7y ago · link · parent

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.

comment 9y ago · link · parent

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...

6.

Your State Is Not Mine: A Closer Look at Evading Stateful Internet Censorship [pdf](cs.ucr.edu ↗)

1 points · by swordfeng · 9y ago · 1 comment

comment 9y ago · link · parent

[] marks the beginning of a lambda. In which declares whether variables are passed by value(=) or reference(&).