4 ms·
Swift's APIs tend on the verbose side, but they can be wrapped up into much more concise versions. Since few people have been using Swift in this way, those wra
by jph00 8y ago
Swift's APIs tend on the verbose side, but they can be wrapped up into much more concise versions. Since few people have been using Swift in this way, those wrappers haven't really appeared yet (and because Swift packaging is still in such poor shape) but it will come - just like the "requests" library made http so much more concise and easy in Python.
The obvious question, of course, is: why bother? The answer is that this code runs at about the same speed as C. So if you're doing data munging of a big file, this is a really interesting approach. For data scientists, I think there is a lot of opportunity here.
- yxhuvud 8y agoBut then you might as well use Crystal instead, which already have scripting language usability while retaining the performance. I like the idea of swift and I want to like it, but everytime I look at APIs it seems they dropped the ball.
- coldtea 8y ago>But then you might as well use Crystal instead, which already have scripting language usability while retaining the performance. Without the libraries, documentation, maturity, and major support.
- yxhuvud 8y agoWell, assuming the plan is to run the program on something that is a server, the same basically holds true for swift as well. There simply isn't enough people using it for server stuff yet for it to have become battle proofed. But yes, if the plan is to run it locally on a mac, then your objection certainly hold.
- the_gipsy 8y agoExcuse me but swift libraries plain suck, because of the bad package management. Documentation is also poor and mostly “look at the example, tests, or source”.
- coldtea 8y agoDocumentation is poor? There is lots of documentation for every iOS/Mac class and feature on developer.apple.com, and for the language and standard library, and dozens of books (several of them made by Apple and free). Plus tons of third party blogs and videos on Swift programming. That's more than anything that can be said for Crystal documentation. And bad package management or not (I don't see much problem with it -- and you have several options to chose from, cocoa pods, carthage, etc), there are tons more libraries than Crystal has again.
- the_gipsy 8y agoOh sure the standard lib is well documented, I thought we were talking about 3rd party libs. > And bad package management or not (I don't see much problem with it -- and you have several options to chose from, cocoa pods, carthage, etc) That's the problem. It should be SPM, period. But few libs use that, and some still don't work on linux and you don't realize until you try to build. Carthage is slow, hard to integrate with xcode project and CLI. CocoaPods, I guess it was super useful before swift, but now it seems like it can only work with xcode projects.
- jph00 8y agoOh BTW there's already something for Swift inspired by python's Requests lib: https://github.com/JustHTTP/Just/blob/master/README.md https://github.com/JustHTTP/Just/blob/master/README.md
- BooneJS 8y agoMaking libraries concise is key - if you're trying to "write bash" in Swift, then being able to glue things together quickly and easily (as if you were piping to/from curl, grep, etc) is important.