Live data from Hacker News

IBM says Swift is ready for the enterprise

computerworld.com

201–210 of 235 posts

Re: IBM says Swift is ready for the enterprise

#201

Earlier quoted context omitted.

Well, technically Swift's memory management is the same as what C++ offers via smart pointers, the only difference is that in C++ it is opt-in (and still very popular). Swift is quite unlike Go or Java's memory management; it is not a GC in the sense that they use it.

Swift memory management isn't nearly as expressive as C++ when it comes to references (i.e. unmanaged pointers). You can use in/out/inout parameters on functions and that's about it. I agree with the parent that Swift memory management is basically like Go or Java: everything is GC'd (reference counting being a form of GC).

You don't need in/out params to get references; in Swift, anything defined with "class" is always passed by reference.

Re: IBM says Swift is ready for the enterprise

#202
post #42
post #22

Hilarious that IBM still thinks of the enterprise as the arbiter of quality. Consumer is now setting the defacto standards, including on things like information security. IBM's days of having a voice in that conversation are probably more limited than they realize.

IBM have had some high-profile stuff-ups in Australia. Good luck to them being taken seriously over here with almost anything they say nowadays.

My experience is that managers don't care.

Re: IBM says Swift is ready for the enterprise

#203
post #20

So... what's the "elevator pitch" for Swift? It has anything interesting over Elixir or Go (well, go's feature is "lack of feature" but you know what I mean) or Scala or Kotlin? I know that iOS and MacOS desperately needed a modern language, and great for them that they have it now, but does the rest of the world need it?

For IBM, part of the lure probably is "the enemy of my enemy is my friend". It's not running on a VM that Oracle or Microsoft control, and not a language Google controls. Yes, it is Apple's language, but IBM apparently thinks it will become more popular than one they would control on their own, and picking Apple's language then is, for them, the least risky, as Apple isn't a company focusing on servers.

Other than Swift being a great language this is certainly at the top of the list. If not on a management level then on a developer POV level. Plus in some way they associate Apple with themselves, they become (in some weird way) the Apple of enterprise.

Re: IBM says Swift is ready for the enterprise

#204
post #183

Earlier quoted context omitted.

I wouldn't use Swift anywhere that I didn't have to until the terribly klunky and overly verbose Strings API is fixed - https://news.ycombinator.com/item?id=10519711 This is a typical Apple product to me - they obsessed over their idea of correctness and ended up with something that is difficult to use and completely alien. Meanwhile every other language offers convenience without even stopping you from doing anythin…

To me, the Strings API is one of the best things about Swift. Strings are complicated and as Mike Ash says in that very article, "Swift doesn't sugar-coat it, but instead shows you the reality of what's going on. This can be difficult, but it's no more difficult than it needs to be."

Assembly is complicated too. I want it sugarcoated most of the time though. There are very few times when I need to drop down into assembly.

Re: IBM says Swift is ready for the enterprise

#205

When I recently interviewed at Apple I was told my position would primarily be coding in Java, but the team would be open to other languages as the project progressed and needs changed. I asked if they would consider Swift. Then was told that Swift wasn't production ready in their eyes. (I didn't get the job) I guess every team is different, but this attitude to dog fooding isn't great.

I worked at Apple for severals years in engineering until 5 months ago leaving for a very small business which interested me more. Swift was being extensively used internally for a long time, including by me.

Re: IBM says Swift is ready for the enterprise

#206
post #139

How is it going with Linux, Windows, BSD, etc. platforms? Anyone with experience using Swift on something other than an Apple product have a story?

I'm pretty sure I saw a port for Arch as well.

I wouldn't call it a "port", but basically the Ubuntu binaries are universal enough that you can unpack the .deb, symlink a few things to match Ubuntu naming and run the binaries on Arch.

Re: IBM says Swift is ready for the enterprise

#207

Earlier quoted context omitted.

Swift can't do realtime. It has automatic memory management. How do you replace C or C++ with Swift for that? What they mean is that Swift replaces Objective-C on user facing apps(on Apple devices) but I doubt you will see the critical parts of the OS (kernel, drivers, etc) written in Swift. It's almost like saying javascript will replace C/C++. I want a nice language like Swift (or Go) to replace C but there is none…

You can essentially write C in Swift by using UnsafePointer and such. If you avoid using reference types then you won't get any automatic memory management. I don't think it's quite ready to replace C as a kernel or driver language, but it's not that far off.

Is there any open source library that does that? I know in theory many things are possible but it would be great to actually test it/see it in action. I never thought of Swift as a language with zero cost abstractions and deterministic performance. If it works I think it really gives it a leg up.

Re: IBM says Swift is ready for the enterprise

#208
post #200

Earlier quoted context omitted.

What sort of guidance does Swift provide here? And nothing prevents Rust or C++ compilers from becoming aware of these types and providing specialized diagnostics for them.

I said it can, not that it does it already. My Swift experience is constrained to the GNU/Linux version, so I don't know if XCode is already doing something in this direction. Sure one can have blessed library types that the compiler knows about, but then from language design point of view it creates a decision between those types and others written by developers, but with similar semantics.

Since you said it's easier than these other languages, I thought you were referring to how the languages work now.

There's nothing wrong with special treatment for stuff in the standard library. C and C++ already do this with many things (e.g. many compilers understand calls like memcpy and will emit optimized code based on the standard library semantics) and Swift gives special treatment to built-in types like Optional.

The distinction here is fairly blurred. The Swift implementation of weak pointers is mostly in the runtime library already, it's just that the compiler hides it a bit so you don't write the names of the calls directly.

Re: IBM says Swift is ready for the enterprise

#209

Earlier quoted context omitted.

You can essentially write C in Swift by using UnsafePointer and such. If you avoid using reference types then you won't get any automatic memory management. I don't think it's quite ready to replace C as a kernel or driver language, but it's not that far off.

Is there any open source library that does that? I know in theory many things are possible but it would be great to actually test it/see it in action. I never thought of Swift as a language with zero cost abstractions and deterministic performance. If it works I think it really gives it a leg up.

It's pretty uncommon, so I'm not sure. If I may toot my own horn a bit, you may find the code to my memory dumper interesting:

https://github.com/mikeash/memorydumper2

I also gave a talk on this subject a couple of years ago. It's out of date by now, but the basics are still more or less intact:

https://vimeo.com/107707576

Or peruse the standard library documentation for UnsafePointer, UnsafeRawPointer, UnsafeMutablePointer, and UnsafeRawMutablePointer. These are built-in types that the compiler knows about, and code that uses them should compile down to essentially the same stuff as C pointer code would.

Re: IBM says Swift is ready for the enterprise

#210
post #86

Earlier quoted context omitted.

On the contrary - they've usually raced headfirst into abandoning old technologies for the hot new thing (early to have only CD and no floppy, early to get rid of CD drive altogether, early to go to USB-C, early to go to 802.11ac, etc.) They've used their weight to create a one-company network effect for up-and-coming standards and technology.

Using their weight, huh. Apple hit 10% market share with the Mac for the first time in 2012. I think it's something like 15% now.

The last time I looked, the market share leader for desktop/laptop computers held just over 20%. Apple is a top-5 computer supplier in the U.S., top-10 worldwide.
Post reply on HN