Hacker Newsnew | past | comments | ask | show | jobs | submit | coetry's commentslogin

This looks really cool! Is there any overhead with using these bindings as opposed to using Swift and calling the APIs directly?


> Is there any overhead with using these bindings

Not the author, but yes. Go calling C is expensive, and that's precisely how this works. Whether or not that matters for your use case is another topic.


There's a bit of a write-up here:

https://www.cockroachlabs.com/blog/the-cost-and-complexity-o...

In their benchmark, calling a `func() {}` in Go vs a `void foo() {}` in C (via CGo) is almost 100x faster.

  $ go test -bench . -gcflags '-l'    # disable inlining for fairness
  BenchmarkCGO-8  10000000              171 ns/op
  BenchmarkGo-8   2000000000           1.83 ns/op

EDIT: And then you still have the extra overhead when using `C.CString` and `C.GoBytes` if you're passing those sorts of arguments to C.


But if the called function takes more than 200ns to execute, the overhead is less than 50%. Which probably is true for most relevant functions in an API


Go calling C is expensive compared to the normal function call overhead, but if the called function does significant work, should not introduce too much overhead.


> Go calling C is expensive

Is this true even if only primitives are passed and returned? If so, why? For comparison, Java is fast at that these days, if I understand correctly.

(Interesting related reading regarding Java: https://web.archive.org/web/20160304055443/http://nerds-cent... )


This is a good question that should be added in the readme. Would love an issue for it to also collect data


Happy New Year Everyone!


I just grabbed FF57 from the ftp link :), couldn't wait!


Hahah, that was a good one


I haven't had to change to really play around with it, but cycle.js (https://cycle.js.org/) is another option alongside Vue and Preact


The work that you are doing warms my heart and I wish you the best of growth and prosperity.


That actually is incredibly beautiful. It's crazy to think that the machine that generated it was devoid of the emotions behind this assembly of words.


Generating in the loosest sense.

Code up the format of a villanelle and find Twitter posts to fit.

https://en.wikipedia.org/wiki/Villanelle

> VillanelleBot, created by Felix Jung, is a bot that composes villanelles using random posts from Twitter. Each line corresponds to a full post on Twitter

If you click on the line it goes through to the tweet e.g.

> i ate curly fries and shaker fries

https://twitter.com/ahtaebvh/status/757935083135258626


Well is it? At some point, either we become like machines, or the machines become like us. There is a limit to how many times we can redraw the lines.


The common distinction between machine and life seems arbitrary. Suppose for instance you had essentially infinite resources to design a machine that self-replicates by stealing blood from mammals, etc etc. You would end up with something very much like the mosquito. Why is it a machine only when man designs it?

This is perhaps more apparent with viruses. They aren't living per se, but are halfway there. The assertion that the virus is not a machine seems to be a difference without a distinction.


The expression is "a distinction without a difference"


Oh yes! Thanks.


I actually used this a couple days ago for an interview. Cool stuff. The UI needs work, but functionality wise, really impressive. The quality was great and there were 3 people on the call. I'm not sure how it'll handle much more than that, but it worked great without any hiccups.


finally.

But seriously, great news. I've been spending a lot of time with WebRTC and this news truly made my day. I'm an Apple fan, they just need to do better adopting standards and making developers happy.


Just in time! My iPhone 6 just broke and its about time to get a new one. I have no problems going back to a smaller phone if it still carries the class and power of the phones that have recently come out. Not to mention the price makes me happy as well :)


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

Search: