Macs in Chemistry

Insanely Great Science

Xcode 9.0 is available for download

 

The new version of Xcode is available for download. Xcode 9.0 includes Swift 4 and SDKs for iOS 11, watchOS 4, tvOS 11 and macOS High Sierra 10.13.

  • The source code editor has been completely rebuilt for amazing speed. It scrolls at a constantly smooth rate, no matter the files size, also supports Markdown.
  • Refactoring to easily select and modify structure of code
  • Swift 4 compiler can also compile Swift 3 to aid transition
  • Xcode 9 makes working with source control – and with GitHub – easier and more tightly integrated.
  • Simulator app updated.

Comments

App Development with Swift

 

Apple Education has just announced a new app development curriculum designed to teach students how to start using Swift to create fully functional iPhone apps.

The course is available for free on iBooks and can be read on iPad, iPhone, and Mac..

This course is designed to teach you the skills needed to be an app developer capable of bringing your own ideas to life. Whether you’re new to coding or want to expand your skills, by the end of this course you should be able to build a fully functioning app of your own design.

The 900 page book is available here https://itunes.apple.com/gb/book/app-development-with-swift/id1219117996?


Comments

Functional Swift Conference 2017 slides available

 

The slides for the Functional Swift Conference 2017 are now online here http://2017.funswiftconf.com.

Comments

Swift Playgrounds

 

Swift Playgrounds is a revolutionary new app for iPad that makes learning Swift interactive and fun. Solve puzzles to master the basics using Swift, ideal for keeping occupied over the Christmas break.

Learning to code with Swift Playgrounds is incredibly engaging. The app comes with a complete set of Apple-designed lessons. Play your way through the basics in “Fundamentals of Swift” using real code to guide a character through a 3D world. Then move on to more advanced concepts.

There is a video here

I also notice that there have been a few updates to the Swift Algorithm Club there are now 79 contributors and an ever increasing list of algorithms.

All content is licensed under the terms of the MIT open source license.



Comments

Scriptarian: Scripting Studio for macOS

 

Scriptarian allows you to easily automate macOS using the Swift programming language, providing an alternative to AppleScript.

Scriptarian is built using Swift the new open-source programming language developed by Apple. Scriptarian analyzes all of your installed applications for AppleScript support and dynamically generates native Swift interfaces for them.

In addition to full support for the Swift Standard Library, Scriptarian includes ScriptingKit, a scripting framework we built from the ground up with Swift in mind. It lets you communicate with any AppleScript-enabled app and even provides various utility functions for speech synthesis, sound playback, file management, process management, and more. keynote


Comments

Objective-C id as Swift Any

 

The latest update on the Swift Blog describes one of the important changes in Swift 3.

In Swift 3, the id type in Objective-C now maps to the Any type in Swift, which describes a value of any type, whether a class, enum, struct, or any other Swift type.


Comments

Swift Algorithm Club

 

The Swift Algorithm Club is a new site that described implementations of popular algorithms and data structures in Swift. However there is also an added bonus in that there are also detailed explanations of how they work. The list below gives an idea of what is available or under construction, and I’m sure they would be delighted to receive contributions.

The algorithms

Searching

  • Linear Search. Find an element in an array.
  • Binary Search. Quickly find elements in a sorted array.
  • Count Occurrences. Count how often a value appears in an array.
  • Select Minimum / Maximum. Find the minimum/maximum value in an array.
  • k-th Largest Element. Find the k-th largest element in an array, such as the median.
  • Selection Sampling. Randomly choose a bunch of items from a collection.
  • Union-Find. Keeps track of disjoint sets and lets you quickly merge them.

String Search

  • Brute-Force String Search. A naive method.
  • Boyer-Moore. A fast method to search for substrings. It skips ahead based on a look-up table, to avoid looking at every character in the text.
  • Knuth-Morris-Pratt
  • Rabin-Karp
  • Longest Common Subsequence. Find the longest sequence of characters that appear in the same order in both strings.

Sorting

It's fun to see how sorting algorithms work, but in practice you'll almost never have to provide your own sorting routines. Swift's own sort() is more than up to the job. But if you're curious, read on...

Basic sorts:

  • Insertion Sort
  • Selection Sort
  • Shell Sort

Fast sorts:

  • Quicksort
  • Merge Sort
  • Heap Sort

Special-purpose sorts:

  • Counting Sort
  • Radix Sort
  • Topological Sort

Bad sorting algorithms (don't use these!):

  • Bubble Sort

Compression

  • Run-Length Encoding (RLE). Store repeated values as a single byte and a count.
  • Huffman Coding. Store more common elements using a smaller number of bits.

Miscellaneous

  • Shuffle. Randomly rearranges the contents of an array.
  • Comb Sort. An improve upon the Bubble Sort algorithm.

Mathematics

  • Greatest Common Divisor (GCD). Special bonus: the least common multiple.
  • Permutations and Combinations. Get your combinatorics on!
  • Shunting Yard Algorithm. Convert infix expressions to postfix.
  • Statistics

Machine learning

  • k-Means Clustering. Unsupervised classifier that partitions data into k clusters.
  • k-Nearest Neighbors
  • Linear Regression
  • Logistic Regression
  • Neural Networks
  • PageRank

Comments

Swift 3.0 released

 

The latest version of swift has been released.

Swift 3 is a source-breaking release, largely due to the changes in SE-0005 and SE-0006. These changes not only impact the names of the Standard Library APIs, but also completely change how Objective-C APIs (particularly from Cocoa) import into Swift. Many of the changes are largely mechanical, but they can be numerous in a typical Swift project. To help with moving to Swift 3, Xcode 8.0 contains a code migrator that can automatically handle many of the need source changes. There is also a migration guide available to guide you through many of the changes — especially through the ones that are less mechanical and require more direct scrutiny.

Thus there is better translation of Objective-C APIs into Swift, meaning that code imported from Objective-C and translated into Swift will be more readable and Swift-like. The bad news is any code previously imported from Objective-C into Swift will not work in Swift 3; it will need to be re-imported.

There was also a blog post describing how to work with JSON in swift, this is particularly important if your app communicates with a web application, information returned from the server is more often than not formatted as JSON.

import Foundation

let data: Data // received from a network request, for example
let json = try? JSONSerialization.jsonObject(with: data, options: [])

Comments

Xcode 8 released

 

With the release of iOS 10 comes an update to Xcode. Xcode 8.0 is a free download for OS X 10.11 or later. (An Apple ID is required for iOS development, and App Store submissions require registration in the Apple Developer Program.) The latest version brings Swift 3 and SDKs for iOS 10, watchOS 3, tvOS 10, macOS Sierra, Siri extensions, iMessage apps, and sticker packs for Messages, along with many other changes.

Xcode 8 includes everything you need to create amazing apps for iPhone, iPad, Mac, Apple Watch, and Apple TV. This radically faster version of the IDE features new editor extensions that you can use to completely customize your coding experience. New runtime issues alert you to hidden bugs by pointing out memory leaks, and a new Memory Debugger dives deep into your object graph. Swift 3 includes more natural and consistent API naming, which you can experiment with in the new Swift Playgrounds app for iPad.

Swift 3 is the first major release of the innovative programming language built completely in the open with the community of developers at Swift.org. This release unifies core API naming rules under a new public API Naming Guidelines document that makes writing Swift code feel even more natural. Popular system APIs such as Core Graphics and Grand Central Dispatch are more expressive and harmonize well with Swift.


Comments

End to End Swift

 

This looks interesting, Perfect

Perfect is an application server for Linux or OS X which provides a framework for developing web and other REST services in the Swift programming language. Its primary focus is on facilitating mobile apps which require backend server software, enabling you to use one language for both front and back ends.

Perfect relies on Home Brew for installing dependencies on OS X, once done you are up and running and can follow the Perfect tutorials


Comments

Swift 3

 

Swift Blog Update

Swift 3 beta was just released as part of Xcode 8 beta and includes numerous enhancements, many contributed by the open source community. The primary goal of Swift 3 is to implement the last major source changes necessary to allow Swift to coalesce as a consistent language throughout, resulting in a much more stable syntax for future releases.


Comments

Swift Programming Language Evolution

 

If you want to stay on top of the proposed changes to the Swift programming language then this repository is worth a browse https://github.com/apple/swift-evolution

This repository tracks the ongoing evolution of Swift. It contains:

Goals for upcoming Swift releases (this document). The Swift evolution review schedule tracking proposals to change Swift. The Swift evolution process that governs the evolution of Swift. Commonly Rejected Changes, proposals which have been denied in the past. This document describes goals for the Swift language on a per-release basis, usually listing minor releases adding to the currently shipping version and one major release out. Each release will have many smaller features or changes independent of these larger goals, and not all goals are reached for each release.


Comments

Swift @ IBM

 

For those interested in learning more about Swift there are a couple of blogs that are worth keeping an eye on. Swift is a modern open-source programming language for iOS, OS X, tvOS, watchOS and Linux.

There is the official Swift blog from Apple which has updates and code snippets, however more recently there has been a lot of activity of the Swift@ IBM blog.

In particular Bring Swift to the Cloud and the IBM Swift Sandbox that allows you to write Swift code in a browser and then execute it. You can try it out here https://swiftlang.ng.bluemix.net/#/repl.

Introduced in 2014, Swift is one of the fastest growing and most widely used programming languages. In just over two months since Apple open sourced the Swift language and IBM released its Swift Sandbox for early exploration of server-side programming in Swift, more than 100,000 developers from around the world have used the IBM Swift Sandbox and more than half a million code runs have been executed in the Sandbox to date

Press release


Comments

ObjCConverter

 

If you want to convert your Objective_Code to Swift this could be very useful ObjCConverter.

There is also an online converter if you want to try before you buy

The latest post on the Swift blog highlights interactive playgrounds.

Xcode 7.3 beta 3 adds interactive iOS and OS X playgrounds that allow you to click, drag, type, and otherwise interact with the user interfaces you code into your playground. These interfaces react just as they would within a full application. Interactive playgrounds help you to quickly prototype and build your applications, and simply provide another great way to interact with your code.


Comments

Swift Open Source

 

As I previously highlighted after the WWDC Apple have announced that Swift is now open source.

More details are on the Swift blog

Swift is now open source. Today Apple launched the open source Swift community, as well as amazing new tools and resources including: Swift.org – a site dedicated to the open source Swift community Public source code repositories at github.com/apple A new Swift package manager project for easily sharing and building code A Swift-native core libraries project with higher-level functionality above the standard library Platform support for all Apple platforms as well as Linux

Swift.org is an entirely new site dedicated to open source Swift. This site hosts resources for the community of developers that want to help evolve Swift, contribute fixes, and most importantly, interact with each other. It also provides development snapshots for Apple and Linux platforms, requires OS X 10.11 (El Capitan) or Ubuntu 14.04 or 15.10 (64-bit).

Source code is available on Github

Comments

CodeSwitch

 

This is probably the application that many programmers have been waiting for, CodeSwitch is the first Objective-C to Swift code converter for Mac OS X.

CodeSwitch will convert all of your Objective-C code into Swift code instantly. Simply copy-and-paste any Objective-C code into this program, and it will translate it to Swift in milliseconds.

So those legacy programs won't need a complete rewrite!

The latest post on the Swift blog highlights a new feature in Xcode 7.1, the ability to embed file, image, and color literals into your playground’s code.

For instance, there’s no need to type “myImage.jpg” in the editor – just drag your image from the Finder and the actual image will appear in-line with your code.

Useful if you tend to name images, image1, image 2 etc ;-)

Comments

Swift

 

I've mentioned the Swift blog before and I note there is a new entry describing the additions to Xcode 7.

I've also come across a couple of blogs that also be of interest Inessential by Brent Simmons, Kickingbear, and Weheartswift which helps you learn Swift from scratch.

Comments

Strings in Swift 2

 

The latest entry on the Swift Blog discusses a change in the way Strings are handled in Swift.

Read more here

Comments

Swift 2.0

 

More news on Swift 2.0 on the Swift Blog

Today at WWDC, we announced Swift 2.0. This new version has even better performance, a new error handling API, and first-class support for availability checking. And platform APIs feel even more natural in Swift with enhancements to the Apple SDKs.

Open Source In addition to new features, the big news is that Apple will be making Swift open source later this year. We are all incredibly excited about this, and look forward to giving you a lot more information as the open source release gets nearer. Here is what we can tell you so far:

Swift source code will be released under an OSI-approved permissive license. Contributions from the community will be accepted — and encouraged. At launch we intend to contribute ports for OS X, iOS, and Linux. Source code will include the Swift compiler and standard library. We think it would be amazing for Swift to be on all your favorite platforms. We are excited about the opportunities an open source Swift creates for our industry. Baked-in safety features combined with excellent speed mean it has the chance to dramatically improve software versus using C-based languages. Swift is packed with modern features, it’s fun to write, and we believe it will get used in a lot of places. Together, we have an exciting road ahead.

Comments

Swift Open Source

 

Perhaps one of the more unexpected news items from WWDC2015.

Swift is now Open Source!

Comments

Swift Updates

 

The latest update to Xcode 6.3 includes Swift 1.2, latest reports suggests a significant improvement in speed.

Rather than feeling like using a computer that’s 10 years obsolete, algorithms that were borderline rate limiting running in the main UI thread just happen like they ought to. As a reality check, I re-ran the horrendously underperforming algorithm that I complained about awhile back, and rather than taking 320 seconds to calculate 7 log P values, it now gets the job done in 30 seconds.

The latest entry on the Swift blog also describes means to improve performance.

Comments

New playgrounds in Swift

 

The latest entry on the Swift blog highlights additions to the playgrounds within Xcode 6.3 beta 3.

Playgrounds are now represented within Xcode as a bundle with a disclosure triangle that reveals Resources and Sources folders when clicked. These folders contain additional content that is easily accessible from your playground’s main Swift code. To see these folders, choose View > Navigators > Show Project Navigator (or just hit Command-1)

There is an example playground that calculates Mandelbrot set which looks like fun to play with.

mandlebrot

Comments

Swift course on iTunes U

 

I just noticed that there is are new Swift programming courses available on iTunes U.

The outstanding Stanford University iOS development courses on iTunes U has been updated to use Swift. The first two lectures from the new “Developing iOS 8 Apps with Swift” class are now live and additional lessons will be added as they are taught. In addition there is also a new course from Plymouth University in the UK.

Comments

Swift's unprecendented growth

 

he latest RedMonk Programming Language Rankings are now available, these rankings have been run since 2010 using essentially the same methodology so we can compare with historical data. The plot below compares popularity of Stack Overflow and GitHub.

lang.rank_.plot_.q1151

Whilst the top ten is pretty much as expected

1 JavaScript
2 Java
3 PHP
4 Python
5 C#
5 C++
5 Ruby
8 CSS
9 C
10 Objective-C

Perhaps the most important change is just outside the top 20.

the growth that Swift experienced is essentially unprecedented in the history of these rankings. When we see dramatic growth from a language it typically has jumped somewhere between 5 and 10 spots, and the closer the language gets to the Top 20 or within it, the more difficult growth is to come by. And yet Swift has gone from our 68th ranked language during Q3 to number 22 this quarter, a jump of 46 spots.

Swift is an innovative new programming language for Cocoa and Cocoa Touch and you can find out more about Swift on the Apple Developer site,



Comments

New Swift website

 

In addition to the Swift Blog there is now a dedicated Swift website

Swift is an innovative new programming language for Cocoa and Cocoa Touch. Writing code is interactive and fun, the syntax is concise yet expressive, and apps run lightning-fast. Swift is ready for your next iOS and OS X project — or for addition into your current app — because Swift code works side-by-side with Objective-C.

The latest entry on the Swift blog deals with “Failable Initialisers” a new feature in Swift 1.1 part of Xcode 6.1.

Comments

Impressions of Apple’s Swift, after a bit of practice

 

Swift is a new programming language from Apple for iOS and OS X apps that builds on the best of C and Objective-C, without the constraints of C compatibility. I’m delighted to hear that people are starting to explore it’s use in scientific applications. Dr. Alex M. Clark has posted his early impressions on the Cheminformatics blog, well worth a read.

There is also the Swift blog for more interesting tips.

Comments

Swift now at 1.0

 

It has just been announced that Swift has reached 1.0.

Today is the GM date for Swift on iOS. We have one more GM date to go for Mac. Swift for OS X currently requires the SDK for OS X Yosemite, and when Yosemite ships later this fall, Swift will also be GM on the Mac. In the meantime, you can keep developing your Mac apps with Swift by downloading the beta of Xcode 6.1.

Swift is an innovative new programming language for Cocoa and Cocoa Touch. Writing code is interactive and fun, the syntax is concise yet expressive, and apps run lightning-fast. Swift is ready for your next iOS and OS X project — or for addition into your current app — because Swift code works side-by-side with Objective-C.



Comments

Latest update on Swift blog

 

The latest post on the Swift developers blog concerns Value and Reference Types

Types in Swift fall into one of two categories: first, “value types”, where each instance keeps a unique copy of its data, usually defined as a struct, enum, or tuple. The second, “reference types”, where instances share a single copy of the data, and the type is usually defined as a class. In this post we explore the merits of value and reference types, and how to choose between them.

Comments

Balloons playground

 

An update on the swift blog

Many people have asked about the Balloons playground we demonstrated when introducing Swift at WWDC. Balloons shows that writing code can be interactive and fun, while presenting several great features of playgrounds. Now you can learn how the special effects were done with this tutorial version of ‘Balloons.playground’, which includes documentation and suggestions for experimentation.

This playground uses new features of SpriteKit and requires the latest beta versions of Xcode 6 and OS X Yosemite

Comments

Swift blog

 

Apple have started a new blog to help developers interested in Swift, Swift is a new programming language for Cocoa and Cocoa Touch.

Get started with Swift by downloading Xcode 6 beta, now available to all Registered Apple Developers for free. The Swift Resources tab has a ton of great links to videos, documentation, books, and sample code to help you become one of the world's first Swift experts. There's never been a better time to get coding!

The first blog entry deals with the issue of compatibility, and how to ensure your app will continue to function as the language evolves.

Comments