SwiftFoundation

所属分类:Linux/Unix编程
开发工具:Swift
文件大小:0KB
下载次数:0
上传日期:2020-06-06 20:21:02
上 传 者sh-1993
说明:  跨平台、面向协议的编程基础库,以补充Swift标准库。(纯Swift,Sup...
(Cross-Platform, Protocol-Oriented Programming base library to complement the Swift Standard Library. (Pure Swift, Supports Linux))

文件列表:
.travis.yml (1061, 2020-06-05)
LICENSE (1088, 2020-06-05)
Package.swift (553, 2020-06-05)
Sources/ (0, 2020-06-05)
Sources/SwiftFoundation/ (0, 2020-06-05)
Sources/SwiftFoundation/Base64.swift (10104, 2020-06-05)
Sources/SwiftFoundation/ComparisonResult.swift (649, 2020-06-05)
Sources/SwiftFoundation/ContiguousBytes.swift (4273, 2020-06-05)
Sources/SwiftFoundation/Data.swift (42028, 2020-06-05)
Sources/SwiftFoundation/DataProtocol.swift (12730, 2020-06-05)
Sources/SwiftFoundation/Date.swift (8098, 2020-06-05)
Sources/SwiftFoundation/Extensions/ (0, 2020-06-05)
Sources/SwiftFoundation/Extensions/Hexadecimal.swift (1171, 2020-06-05)
Sources/SwiftFoundation/Extensions/Integer.swift (219, 2020-06-05)
Sources/SwiftFoundation/POSIXError.swift (1268, 2020-06-05)
Sources/SwiftFoundation/POSIXTime.swift (4198, 2020-06-05)
Sources/SwiftFoundation/Thread.swift (2930, 2020-06-05)
Sources/SwiftFoundation/URL.swift (3009, 2020-06-05)
Sources/SwiftFoundation/UUID.swift (5292, 2020-06-05)
SwiftFoundation.xcodeproj/ (0, 2020-06-05)
SwiftFoundation.xcodeproj/SwiftFoundationTests_Info.plist (723, 2020-06-05)
SwiftFoundation.xcodeproj/SwiftFoundation_Info.plist (723, 2020-06-05)
SwiftFoundation.xcodeproj/project.pbxproj (21042, 2020-06-05)
SwiftFoundation.xcodeproj/project.xcworkspace/ (0, 2020-06-05)
SwiftFoundation.xcodeproj/project.xcworkspace/contents.xcworkspacedata (134, 2020-06-05)
SwiftFoundation.xcodeproj/project.xcworkspace/xcshareddata/ (0, 2020-06-05)
SwiftFoundation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (238, 2020-06-05)
SwiftFoundation.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings (269, 2020-06-05)
SwiftFoundation.xcodeproj/project.xcworkspace/xcuserdata/ (0, 2020-06-05)
SwiftFoundation.xcodeproj/project.xcworkspace/xcuserdata/coleman.xcuserdatad/ (0, 2020-06-05)
SwiftFoundation.xcodeproj/project.xcworkspace/xcuserdata/coleman.xcuserdatad/UserInterfaceState.xcuserstate (30504, 2020-06-05)
SwiftFoundation.xcodeproj/xcshareddata/ (0, 2020-06-05)
SwiftFoundation.xcodeproj/xcshareddata/xcschemes/ (0, 2020-06-05)
SwiftFoundation.xcodeproj/xcshareddata/xcschemes/SwiftFoundation-Package.xcscheme (2517, 2020-06-05)
Tests/ (0, 2020-06-05)
Tests/LinuxMain.swift (286, 2020-06-05)
Tests/SwiftFoundationTests/ (0, 2020-06-05)
Tests/SwiftFoundationTests/DataTests.swift (963, 2020-06-05)
... ...

# SwiftFoundation # [![Swift](https://img.shields.io/badge/swift-5.0-orange.svg?style=flat)](https://developer.apple.com/swift/) [![Platforms](https://img.shields.io/badge/platform-osx%20%7C%20ios%20%7C%20watchos%20%7C%20tvos%20%7C%20linux%20%7C%20wasm-lightgrey.svg)](https://developer.apple.com/swift/) [![Release](https://img.shields.io/github/release/pureswift/swiftfoundation.svg)](https://github.com/PureSwift/SwiftFoundation/releases) [![License](https://img.shields.io/badge/license-MIT-71787A.svg)](https://tldrlegal.com/license/mit-license) [![Build Status](https://travis-ci.org/PureSwift/SwiftFoundation.svg?branch=develop)](https://travis-ci.org/PureSwift/SwiftFoundation) Cross-Platform, Protocol-Oriented Programming base library to complement the Swift Standard Library. ## Goals - Provide a cross-platform *interface* that mimics Apple's Foundation framework. - Provide a POSIX-based *implementation* for maximum portability. - *Rewrite* Foundation with Protocol-Oriented Programming principals. - Long-term Pure Swift *replacement* for the Cocoa frameworks. ## Problems with [Apple's Foundation](https://github.com/apple/swift-corelibs-foundation) - **Objective-C** - Apple's Foundation is an old API designed for Objective-C. While it works great (on Apple's platforms) and has a nice API for Objective-C programming, when imported into Swift, you can see the shortcomings of its 20+ year old API. - **Unimplemented** - The [open source version](https://github.com/apple/swift-corelibs-foundation) of Apple's Foundation is severly lacking implementation. Most methods are marked with ```NSUnimplemented()```. Only a small subset of Foundation based on CoreFoundation is implemented (e.g. ```NSArray```, ```NSString```, ```NSDictionary```). Basic Functionality like JSON, Base64, and even HTTP requests are not implemented. - **Portability** - Since Apple's Foundation is backed by CoreFoundation, the only supported platforms are currently Linux, Darwin, and (potentially) Windows. Supporting other platforms (e.g. ARM Linux, BSD, SunOS) would require changes to the CoreFoundation codebase, written in C, which is not good for a long term Swift base library. We want all of our code to be understood by any Swift programmer. - **Protocol Oriented Programming** - Perhaps the biggest reason to use this library, is to break free from the old *Object-Oriented Programming* paradigms. Swift structures and protocols free you from pointers and memory management, along with bugs related to multithreaded environments. Creating structs for basic types like ```Date``` and ```UUID``` allows you to use ```let``` and ```var``` correctly. Structs also bring huge performance improvements since the compiler can perform more optimizations and doesn't have to create all the metadata needed for the Swift class runtime. ## Targeted Platforms - Darwin (macOS, iOS, watchOS, tvOS) - Linux (Ubuntu x86_64, [Debian Armv7](https://github.com/uraimo/buildSwiftOnARM)) - [WebAssembly](https://swiftwasm.org) (wasm32) ## Implemented To see what parts of Foundation are implemented, just look at the unit tests. Completed functionality will be fully unit tested. Note that there is some functionality that is written as a protocol only, that will not be included on this list. - [x] Base64 - [x] Data - [x] Date - [ ] FileManager - [ ] JSON - [ ] RegularExpression (POSIX, not ICU) - [x] Thread - [x] URL - [x] UUID # License This program is free software; you can redistribute it and/or modify it under the terms of the MIT License.

近期下载者

相关文件


收藏者