Better HN
topnewbestaskshowjobs
Log inSign up

hooluupog

40 karma · joined Dec 3, 2013 (12y ago) · 19 submissions

none
Submissions

comment 8y ago · link · parent

Social platform.

comment 8y ago · link · parent

Go is not really 'pass by value' when passing slices. It just passes the pointer value instead of doing a deep copy(copying the backing array). When trying to grow a slice in a function, the result is unpredicted because of 'apend' implicitly choosing to allocate memory or not. In addition, it is not concurrent-safe to pass mutable data. To avoid the safety problem, you have to copy stuff and consequently suffer a performance penalty. A better way to solve the problem is to introduce immutibilty. If one day immutibilty is introduced in Go 2(or 3), i wish slices are really passed by value. Then everything is passed by value as default with the immutable data passed by reference. You can still use pointers to pass mutable data just like using '_' to explicitly ignore error handling.

Now in WAT 1,

    func grow(s []int) { // s is deep copied.
        s = append(s, 4, 5, 6)  // changing 's' does not effect original slice.
    }
Explicitly pass mutable slice,

    func grow(s *[]int) { // s is referenced.
        *s = append(*s, 4, 5, 6)  // changing 's' will always effect origin slice.
    }
Explicit is better than implicit.

comment 8y ago · link · parent

You are allowed to install other app stores on a android device.You can even install apps from unknown sources.But you need to be responsible for your own security.

comment 8y ago · link · parent

Google: ARCore MLkit Apple: ARKit CoreML

comment 8y ago · link · parent

Not the OP,maybe Bill Joy and John Carmack.

comment 8y ago · link · parent

But its users want.

comment 8y ago · link · parent

Flutter has the potential once it ported to desktop and even web(with WASM).

comment 8y ago · link · parent

But it's not compulsory on android.

comment 9y ago · link · parent

What a misleading title.Beijing Sinnet is just a shell company of amazon china(The same as Guxiang which is a shell company of google in china).

comment 9y ago · link · parent

Why should google's products must work with Amazon's products?It's not Amazon who sell google's products but google sell its own products via amazon online shopping platform.Does amazon echo have to work with google's product or install google's software or services to appear in search results?

comment 9y ago · link · parent

FYI,https://go.googlesource.com/gollvm/

comment 9y ago · link · parent

Absolutely agree with you.In china more and more people know the internet through wechat and do almost everything on wechat.

comment 9y ago · link · parent

Except china.

comment 9y ago · link · parent

According to what Fuchsia developer Travis Geiselbrecht said in the public Fuchsia IRC channel,the OS “isn’t a toy thing, it’s not a 20% project, it’s not a dumping ground of a dead thing that we don’t care about anymore.”[0]

[0]https://arstechnica.com/gadgets/2017/05/googles-fuchsia-smar...

comment 9y ago · link · parent

and Photos

comment 10y ago · link · parent

On the contrary,China proves what's so bad without the Play Store and GCM.Android is a mess there.

comment 11y ago · link · parent

https://groups.google.com/forum/#!topic/golang-dev/nMWoEAG55...

comment 11y ago · link · parent

Actually,erlang is being used in taobao.