Old 06-05-2014, 07:05 AM   #1
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default Apple's Swift

What do you guys think about this new development language from Apple?

As someone who gave iPhone development a go with Objective C and eventually decided it was too steep a leaning curve for me personally (motivation wise anyway), I think I might give it another go now with Swift.

Thoughts in general?

https://developer.apple.com/swift/
Lawrence is offline   Reply With Quote
Old 06-05-2014, 07:55 AM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Well, it's obviously an attempt by Apple to lock in developers. Swift is very unlikely to ever appear in a usable form on other platforms. That has been the case in practice with Objective C, too, but at least in principle it has been available for Windows/Linux...Swift just takes that further. Nothing you do with it, is likely to ever be reusable in any way for other platforms.

It's "nice" how they "stole" some of the ideas by Bret Victor for interactive development into XCode. See http://vimeo.com/36579366 Victor is a former Apple employee though...

The language likely isn't anything significantly new. I haven't read much of the documentation yet, though. But I can't see how it could be really radically different.

What did you find difficult about Objective-C? The language seems to me like a fairly straightforward extension to C. What has made me not want to look much into it is that the language is basically just a way to access Apple's Cocoa, which is a huge proprietary framework to learn. Any effort put into learning that isn't going to help with development on other platforms.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 06-05-2014, 08:10 AM   #3
Gates of Horn & Ivory
Human being with feelings
 
Gates of Horn & Ivory's Avatar
 
Join Date: Apr 2014
Posts: 97
Default

I definitely intend to give it a try... in fact, I'd love to give it a try right now, but as far as I can work out, the XCode beta that runs Swift (and "playgrounds", etc) is only available to registered (ie, paying) developers, much like the current Yosemite beta. Oh well. It'll probably be out fairly soon anyway.
Gates of Horn & Ivory is offline   Reply With Quote
Old 06-05-2014, 08:13 AM   #4
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default

Quote:
What did you find difficult about Objective-C?
I have no background in C so it was all brand new to me, the language and the framework.
Lawrence is offline   Reply With Quote
Old 06-05-2014, 08:28 AM   #5
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by Lawrence View Post
I have no background in C so it was all brand new to me, the language and the framework.
OK, then...What do you find difficult about C?
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 06-05-2014, 08:37 AM   #6
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default

Quote:
Originally Posted by Xenakios View Post
OK, then...What do you find difficult about C?
How much time do you have?

From someone with no formal training, being self-taught in "basic" languages, C and C++ and the header files and the general readability is an obstacle. That's to be expected though, given the circumstance.

Having said that, a reasonably intelligent and motivated person could sit down and take the time to learn those things, but for the things i've actually wanted to do, I could do it faster and easier in basic, so I could never really get motivated to dig in and learn C or C++ or similar.

Obviously, for the stuff you guys do, DSP, plugins, audio, it's not a choice, it's kinda a requirement. But for the stuff I typically do, not so much.

The iPhone was the exception, something i actually wanted to do, port an application to the iPhone, so i gave it a... half-assed ... try.
Lawrence is offline   Reply With Quote
Old 06-05-2014, 08:41 AM   #7
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by Lawrence View Post
C and C++ and the header files
That's actually a constant pain for even experienced C++ developers. Sometimes dealing with header files/other issues with code dependencies makes me want to cry...(I think C generally is so low level and requires such a mindset that header files there are not considered a significant problem.) It's an ongoing effort that C++ would allow dealing with these issues in an easier manner, but so far there isn't anything standardized.

I can't really comment on the readibility issue...I didn't find C particularly different after exposure to (Visual) Basic and Pascal/Delphi. With C++ it did take me a few years before I dared approaching the more complicated things like iterators and templates.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.

Last edited by Xenakios; 06-05-2014 at 08:46 AM.
Xenakios is offline   Reply With Quote
Old 06-05-2014, 08:49 AM   #8
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default

Yeah. Swift looks to me - at first glance anyway - more like something closer to basic. I wouldn't personally care so much about the coding skills translating, only really caring if I can port an idea to iPhone with less drama and make it work.

We part time hackers leave the heavy duty coding to you professionals. We code in .Net or RealBasic or whatever, something fast and easy. RealBasic is kinda cool, being cross platform. I think they changed the name though.

Having said that, I've yet to do any Windows phone development. i should probably be looking in that direction first tbh.
Lawrence is offline   Reply With Quote
Old 06-05-2014, 08:55 AM   #9
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by Lawrence View Post
We part time hackers leave the heavy duty coding to you professionals. We code in .Net or RealBasic or whatever, something fast and easy.
Well, I wish I was a "professional". (As in getting regularly paid for developing code.) I certainly wouldn't mind things to be a LOT easier, especially for GUI stuff. (As long as integration into C or C++ for heavy duty calculations was available.) Unfortunately, as things are, especially plugins tend to be very complicated to interoperate with all the various languages/frameworks that are supposed to make things easier.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 06-05-2014, 08:57 AM   #10
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default

Quote:
Originally Posted by Xenakios View Post
I can't really comment on the readibility issue...I didn't find C particularly different after exposure to (Visual) Basic and Pascal/Delphi. With C++ it did take me a few years before I dared approaching the more complicated things like iterators and templates.
My deepest foray into "C" anything is probably C#. I've coded side by side in VB and C#, running two instances of VS, and the VB code always looks more readable to me.

That may be more that I'm just used to it though. All those brackets give me the willy's.

But since they compile the same, I didn't see any real point in continuing coding in C#... for anything I wanted to do.
Lawrence is offline   Reply With Quote
Old 06-05-2014, 10:11 AM   #11
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,269
Default

Quote:
Originally Posted by Lawrence View Post
and the VB code always looks more readable to me.

That may be more that I'm just used to it though. All those brackets give me the willy's.

But since they compile the same, I didn't see any real point in continuing coding in C#... for anything I wanted to do.
As much as I loved VB, it now feels like a redheaded stepchild to me. The thing about C# is once over the hump we are much better prepared for most C/C++/Java type languages because they are so syntactically related. Other languages just start to make much more sense. With VB you are sort of stuck in it's way of doing things making many other languages look foreign.

Those brackets all follow the same mantra... For every opening one there is a closing one, nothing more and after awhile they make much more sense visually. Just reflecting/venting on how much I used to love VB and how I now despise it LOL but I want to iterate I'm not trashing it (too badly).

For the bigger discussion, technology at this level is now or becoming "everyday guy's" work. What I mean is that to continue serve demand, creating apps is going to need to be easier where people who don't know the underlying concepts can get things done. So regardless of who comes out with more and more layman type top level languages they are more and more required because the need is bigger than the number of people who are willing or can understand the lower level interworkings.
__________________
Music is what feelings sound like.

Last edited by karbomusic; 06-05-2014 at 10:17 AM.
karbomusic is offline   Reply With Quote
Old 06-05-2014, 10:17 AM   #12
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default

Quote:
we are much better prepared for most C/C++/Java type languages
For sure. That's kinda what i was saying, that it didn't so much apply to me, needing to be prepared for the other languages. What I did development wise as a corporate staffer didn't require any of that.

But yes, if you have bigger plans it's a good idea to get familiar with all that because so many languages are kinda styled after C.
Lawrence is offline   Reply With Quote
Old 06-05-2014, 10:22 AM   #13
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,269
Default

Quote:
What I did development wise as a corporate staffer didn't require any of that.
That's pretty much VB's main target audience IMHO. All those guys who spend all day in access and excel doing reports on data etc. then start wrapping VB apps around it. Once you get very far outside of that though everything gets more bandaidish but that's just how it occurs to me. I can't trash it, I cut my teeth on it.
__________________
Music is what feelings sound like.
karbomusic is offline   Reply With Quote
Old 06-05-2014, 02:08 PM   #14
toddhisattva
Human being with feelings
 
toddhisattva's Avatar
 
Join Date: Jun 2008
Location: Austin
Posts: 289
Default taSer

Quote:
Originally Posted by Lawrence View Post
What do you guys think about this new development language from Apple?

As someone who gave iPhone development a go with Objective C and eventually decided it was too steep a leaning curve for me personally (motivation wise anyway), I think I might give it another go now with Swift.

Thoughts in general?

https://developer.apple.com/swift/
To my eyes (about halfway through the book) it's a lot like Python but not nearly as easy. The rules about structs and classes and who gets copied when and the special rules for arrays and so on. I'm sure the rules will make more sense once I get a dev box and I can poke around and feel how they interact.

It should be easier than Objective-C because Swift is just one unified language, and not C with Smalltalky objects glued on.

Its "nil" reminds me of Lua's "nil" and I'm sure there's an ontology or nihilism joke in that.

I very much like its type safety and range checking. Adding one to max int should produce an error and not a wrap around. I do believe Apple wants to write an OS in it for those reasons.
toddhisattva is offline   Reply With Quote
Old 06-05-2014, 04:31 PM   #15
Geoff Waddington
Human being with feelings
 
Geoff Waddington's Avatar
 
Join Date: Mar 2009
Location: Dartmouth, Nova Scotia
Posts: 11,252
Default

Quote:
Originally Posted by Lawrence
What do you guys think about this new development language from Apple?
I think it looks promising.

It leans towards the expressivity/productivity of the scripting type languages without the constraints and performance penalties.

Full disclosure - I have programmed professionally in the following languages:
TMS9900 assembly (TI-99/4a)
80x86 assembly
68000 assembly
So many flavours of basic I can't remember all of them
Forth
Object/1
Actor
Delphi
Java
C
C++
C#
Smalltalk -- Digitalk, Object Arts, VisualAge, ParcPlace
Perl, automator mi, and many other scripting and XMLy type languages
SQL -- if you can call that a programming language

I've also played around with outliers like Eiffel, etc.

I really liked Objective C, it was a nice marriage of C and Smalltalk concepts.

To me Swift adds some nice functional language concepts, tuple support, type inference, generics, closures, true support for nil, a break from the C flavoured languages in that there is no "main", etc.

It also adds a TON of syntactic sugar, e.g.
I can extend Int with a generic "repetitions" method so that I can say:
500.repetitions { println("Hello World") } to get 500 lines to output to the console, very functional/Smalltalky, and concise.

It is actually a compiled language, there were some very respectable performance numbers presented during the WWDC keynote.

As far as it being proprietary to Apple I say "Whatever…" the promise of Java "write once run everywhere" quickly turned into "write once test everywhere"

I once ported a HUGE large financial institution app with a TON of UI from OS/2 VisualAge to AIX VisualAge in a morning, and I have NEVER come close on any other cross-platform dream that someone had, except for ParcPlace Smalltalk which even had the ability to mimic any supported OS on any other development OS -- You could be programming on OS/2 and say "I wonder what this would look like on the Mac?", press a button, and voila -- Mac interface displayed and fully functional on OS/2.

Can you tell I'm somewhat of a Smalltalk biggot ?

My favourite languages are Smalltalk and C, so that's my bias, FWIW.
__________________
To install you need the CSI Software and Support Files
For installation instructions and documentation see the Wiki
Donate -- via PayPal to waddingtongeoff@gmail.com

Last edited by Geoff Waddington; 06-05-2014 at 04:38 PM.
Geoff Waddington is offline   Reply With Quote
Old 06-05-2014, 06:42 PM   #16
msore
Human being with feelings
 
msore's Avatar
 
Join Date: Dec 2010
Location: San Rafael
Posts: 11,594
Default

Wow. Geoff. Smalltalk and C? Is that kind of like saying your two favorite music genres are tango and accordion polka?
__________________
My religion is all or none.
msore is offline   Reply With Quote
Old 06-06-2014, 03:12 AM   #17
Geoff Waddington
Human being with feelings
 
Geoff Waddington's Avatar
 
Join Date: Mar 2009
Location: Dartmouth, Nova Scotia
Posts: 11,252
Default

Quote:
Originally Posted by msore
Wow. Geoff. Smalltalk and C? Is that kind of like saying your two favorite music genres are tango and accordion polka


I like C because it is a superb portable assembly language -- You can do ALMOST anything you can do in assembly, and you can always drop down to assembly if you absolutely have to.

I like Smalltalk because it frees me from "language babysitting" (header files, linking, all that sort of nonsense that any modern compiler environment can infer/auto-generate).
I am then free to think about the actual solution I'm trying to code.
If I need more performance, I can always drop down to C and call it from Smalltalk.

C++ is NOT my favourite language.

Swift does look interesting, I just watched the Advanced Swift video from WWDC, some very powerful deep concepts exposed to the programmer, I'm going to have to watch that video again, and that doesn't happen often to me
__________________
To install you need the CSI Software and Support Files
For installation instructions and documentation see the Wiki
Donate -- via PayPal to waddingtongeoff@gmail.com
Geoff Waddington is offline   Reply With Quote
Old 06-06-2014, 07:18 AM   #18
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default

Quote:
header files, linking, all that sort of nonsense that any modern compiler environment can infer/auto-generate).
That's what I was getting at earlier in response to Gopher's question about C++. Anyone who can follow the basic general logic of coding can understand the flow of the code in a C style language block, but when you start adding the header files and all that it all gets a bit more complex, at least for people like me, being an amateur.

At any rate, when I saw you tackling EuCon it was quite apparent to me that you were a very experienced coder, or you'd probably have never attempted that. I can only imagine the relative complexity of that.

Anyway, most casual coders aren't writing DAWS or other really complex things. In fact, the casual coder won't even really have the math skills to develop those kinds of things. Most ordinary people just want a fast and easy way to develop custom applications, which is why VB was a major hit from day one. It's not about building skills to get a job that you're not seeking, it's (to people like us) about producing something useful, by yourself.

To Karbo's point, those language skills translate directly to MS scripting and because corporate America is pretty much tied to Windows at the hip, it all ties in there pretty nicely.

Last edited by Lawrence; 06-06-2014 at 07:27 AM.
Lawrence is offline   Reply With Quote
Old 06-22-2014, 07:37 PM   #19
iGerbil
Human being with feelings
 
Join Date: Jun 2014
Posts: 1
Default Swift course

Just found a nice new training about Swift. It starts from the most basic concepts and looks like ti will be extended to object-oriented programming (without the load of C as Apple says), interfacing with Cocoa and practical app samples...
http://www.udemy.com/swiftdeveloper
iGerbil is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:32 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.