3 ms·
Victim of trying it the first week it came out, having to call down into C for anything POSIX, and giving up. If you don't have POSIX bindings, don't call yours
by crb002 9y ago
Victim of trying it the first week it came out, having to call down into C for anything POSIX, and giving up. If you don't have POSIX bindings, don't call yourself v 1.0.
- saagarjha 9y agoWhat exactly do you mean "call down into C"? You should be able to call C functions directly from Swift, albeit with UnsafePointer and the like.
- ainar-g 9y agoI assume, they mean that you don't need to have C at all. See how Go for example doesn't require C on most platforms to make syscalls (IIRC, the exceptions are Windows and Solaris).
- saagarjha 9y agoSo, based on this[1] they've just wrapped the calls with their own…not sure if there are any real benefits here. [1]: https://golang.org/src/syscall/syscall_linux.go https://golang.org/src/syscall/syscall_linux.go
- brutus1213 9y agoI've been using Swift for a few months and really want to like it. That said, breaking down to unsafepointer for newbie tasks is unacceptable IMHO. Try to do basic stuff like TCP/IP socket coms without a third party library or heck, just get the IPv4 address of your network interface.