• 0

Open sourcing Swift


Question

Last year, Apple introduced Swift, its very own programming language which was focused on making it easier to build apps. Now, in a bid to make it more palatable to developers, Apple is making another big move: It's making Swift open source. That'll give developers full access to all of Swift's inner workings, and it might even tempt over people who were worried about adopting a proprietary Apple language. "We think Swift is the next big programming language, the one that we'll all be doing application and system programming on for 20 years to come," Apple's SVP of software engineering, Craig Federighi, said during WWDC today. "We think Swift should be everywhere and used by everyone." The language is also getting some upgrades this year with Swift 2, which includes support for new optimization technology, protocol extensions and much shorter compile times.

 

Source: http://www.engadget.com/2015/06/08/swift-open-source/

 

User's comment:

 

I am guessing that Microsoft will port this to Windows in no time.

  • Like 2
Link to comment
Share on other sites

Recommended Posts

  • 0

It does, there are compiled programming languages (e.g. C) and there are interpreted scripting languages (e.g. JS).

 

I don't like to get into pointless distinctions here, but scripting languages are programming languages (just a smaller subset of them).

 

Languages such as Python/JS really shouldn't be though of as just for scripting purposes. A big bulk of their use cases lie in large systems where developers are using the exact same principles as your traditional compiled languages.

Link to comment
Share on other sites

  • 0

 

Should Microsoft have used Java instead of creating C# back when they did?

 Yes, that was actually the plan until Sun got all pissy at them for making the MS Java VM, because it had MS specific extensions.

Link to comment
Share on other sites

  • 0

It does, there are compiled programming languages (e.g. C) and there are interpreted scripting languages (e.g. JS).

 

I'm glad that they did make C# though, because I personally think that C# is now a better language than Java.

  • Like 1
Link to comment
Share on other sites

  • 0

It's a new language, there has been no risk analysis of it or how reliable it's output code is, therefore it is not and will not be used for anything mission critical, and it'll probably stay this way forever.

JS is a scripting language, not a true programming language, it is not compiled.

 

If you want safety with C or C++, then you'd mainly avoid mallocing - which are the rules that aviation have to abide by (and they do use C).

 

There is a place for C. You now mention aviation. Sure, if you need to be close to the hardware, use the right tool for the job. My original statement was that we'll see Swift used on the server. For higher level applications, we can, and should use languages that provide more features and safety.

 

I'm not even going to go into the "JS is not a language" thing. Seriously?

Link to comment
Share on other sites

  • 0

Remobjects has already brought it to windows and they are letting people use it for free with Remobjects Elements Silver. remobjects.com

 

You can compile for .net, java bytecode, and android (at least I think its the same as their c# and pascal products that do that) I wish their c# one was the one thats free, or at least not $799) cause thats the one I'm interested in.

Oh, I didn't know that! Cool! Thanks!

Link to comment
Share on other sites

  • 0

There is a place for C. You now mention aviation. Sure, if you need to be close to the hardware, use the right tool for the job. My original statement was that we'll see Swift used on the server. For higher level applications, we can, and should use languages that provide more features and safety.

 

I'm not even going to go into the "JS is not a language" thing. Seriously?

You haven't named any benefits of swift over any other language, simply put - there are none. There are also no optimised compilers (lets compare that to clang/llvm and gcc which have both been around for numerous years and have some amazing optimisation that they perform on code) and someone would have to create one for scratch because apple won't be making an optimised compiler for linux.

 

JS isn't a proper programming language, it's a language sure - a scripting language.

Link to comment
Share on other sites

  • 0

You haven't named any benefits of swift over any other language, simply put - there are none. There are also no optimised compilers (lets compare that to clang/llvm and gcc which have both been around for numerous years and have some amazing optimisation that they perform on code) and someone would have to create one for scratch because apple won't be making an optimised compiler for linux.

 

JS isn't a proper programming language, it's a language sure - a scripting language.

 

Okay, I'm not going to waste anymore of my time replying to you. Quite frankly, I don't think that you are qualified enough to have a meaningful conversation about programming languages in general, and about Swift in particular. I tried to engage with you over what makes a good language for building reliable software, but you were not interested in specifics. You write in nebulous terms and seem blissfully oblivious to irony that ensues when you praise llvm while dissing Swift.

 

I knew from your first quip in this thread that you'd never used Swift before, and probably didn't know jack about it, yet felt compelled to make sweeping statements about it. I was my mistake to engage in a conversation with someone who'd already made up his mind about something without actually looking into the subject matter. If you want to talk to me about Swift, go read the book, write some code with it, then come back and we'll discuss its pros and cons. In the mean time - I'm done with you.

Link to comment
Share on other sites

  • 0

Okay, I'm not going to waste anymore of my time replying to you. Quite frankly, I don't think that you are qualified enough to have a meaningful conversation about programming languages in general, and about Swift in particular. I tried to engage with you over what makes a good language for building reliable software, but you were not interested in specifics. You write in nebulous terms and seem blissfully oblivious to irony that ensues when you praise llvm while dissing Swift.

 

I knew from your first quip in this thread that you'd never used Swift before, and probably didn't know jack about it, yet felt compelled to make sweeping statements about it. I was my mistake to engage in a conversation with someone who'd already made up his mind about something without actually looking into the subject matter. If you want to talk to me about Swift, go read the book, write some code with it, then come back and we'll discuss its pros and cons. In the mean time - I'm done with you.

Come on then, throw some numbers at me; execution speed of swift programs vs objective c would be a start, number of exploits found is a good one, optimisations done on code of objective c vs swift is another...

[snipped - please avoid personal attacks - Andre S.].

 

Here's some things that matter: compilation time, http://www.phoronix.com/scan.php?page=article&item=gcc49_compiler_llvm35&num=2

Execution speed: http://www.phoronix.com/scan.php?page=article&item=gcc49_compiler_llvm35&num=3

Executable output size and execution time: http://www.hortont.com/blog/icc-and-mandelbrot/

 

You don't have any such statistics for swift - not only because no-one uses it - but because it's a new, unoptimised language, and as I said previously, it will not become mainstream on servers, there is no benefit to using swift, there are no optimised compilers. Heck, it won't even become mainstream on desktops. C# has been around for over 10 years now, it's really became quite a good language to learn and MS has optimised it well (for their own OS) and open sourced large parts of it, let's just see how it's fared: http://githut.info/ - oh look, only a FRACTION of the number of C and C++ projects hosted on github are in C#! Swift is on par with lua and haskell, and it'll remain there because it's a niche language with no real use outside of apple's OSs.

Link to comment
Share on other sites

  • 0

Chris Lattner, the guy behind Swift, was pretty open about wanting to open source Swift back when it was first introduced. So here we are, and Apple is open sourcing Swift and its standard library, and is going to support that on Linux. I think that their expressed intent and actions go counter to your lock-in argument.

Well, hopefully the future proves me wrong, but so far writing Swift code has meant Apple code. It'll require substantial effort to take the language out of this niche. Meanwhile cross-platform options abound.

 

As for why not use an existing language, I'd ask why not create a new one? What's wrong with that? Should Microsoft have used Java instead of creating C# back when they did? Should they have adopted Haskell instead of creating F#? Wouldn't the world have been poorer for it if GoLang wasn't a thing?

Actually, Microsoft didn't want to create C# originally, and simply use Java (see J++). However, that failed in good part because of MS' own attitude towards JVM compliance, so they ended up creating their own runtime and languages.

 

Haskell on .NET is not really feasible due to limitations of the runtime. Haskell only got somewhat performant when a specialized and highly optimized runtime was developed for it (GHC).

 

I welcome new languages, but due to its origins and the fact that it compiles to native code, Swift is going to have a hard time competing with the Java and .NET ecosystems, and Swift's direct competitor will be Rust which has been open and cross-platform since its inception, and is overall much more interesting esp. with its resource ownership system that solves data races and doesn't have the runtime overhead of ARC.

 

About Go, as a language it's a bit pointless as well. It's not doing anything new enough to bring C++ programmers over.

Link to comment
Share on other sites

  • 0

I would rather see an uptake to C# and F# with .NET Framework considering it is all now open source.

Link to comment
Share on other sites

  • 0

Well, hopefully the future proves me wrong, but so far writing Swift code has meant Apple code. It'll require substantial effort to take the language out of this niche. Meanwhile cross-platform options abound.

 

Sure, Swift might remain niche. That's orthogonal to server usage though. I merely said that I'm sure we'll see it on the server. Which is a no-brainer really, since I'm sure that Apple has plans to do just that. Otherwise, why support Linux at all?

 

Actually, Microsoft didn't want to create C# originally, and simply use Java (see J++). However, that failed in good part because of MS' own attitude towards JVM compliance, so they ended up creating their own runtime and languages.

 

I didn't know the about the genesis of C#. Others have also pointed this out to me.

 

 

Haskell on .NET is not really feasible due to limitations of the runtime. Haskell only got somewhat performant when a specialized and highly optimized runtime was developed for it (GHC).

 

I welcome new languages, but due to its origins and the fact that it compiles to native code, Swift is going to have a hard time competing with the Java and .NET ecosystems, and Swift's direct competitor will be Rust which has been open and cross-platform since its inception, and is overall much more interesting esp. with its resource ownership system that solves data races and doesn't have the runtime overhead of ARC.

 

 

I can't comment on Rust - I've never used it.

 

Oh, I agree with you. I doubt that Swift is going to displace the JVM and .NET. That's not what I meant when I said that we'll see Swift on the server. Why must everything be a competition? Why should a language have to justify its existence vis a vis other languages? Isn't it sufficient that it is a language that some people enjoy working with?  Ruby is one such language. Some developers enjoyed using it and wanted to build web applications with it. They built Ruby on Rails and it influenced countless other frameworks. Has Ruby made a significant dent in Java's and .NET's market shares? I don't know - probably not. Does it matter? Not one bit!

 

 

 

About Go, as a language it's a bit pointless as well. It's not doing anything new enough to bring C++ programmers over.

 

Go isn't pointless. People are building awesome things with it, e.g. Docker. Go doesn't need to displace C++ in order to be successful. This is not a popularity contest.

  • Like 2
Link to comment
Share on other sites

  • 0

 Yes, that was actually the plan until Sun got all pissy at them for making the MS Java VM, because it had MS specific extensions.

To be fair, if Sun hadn't intervened, Microsoft would have destroyed Java with its internal policy of EEE (Embrace, Extend, and Exterminate):

"Embrace, extend, and extinguish",[1] also known as "Embrace, extend, and exterminate",[2] is a phrase that the U.S. Department of Justice found[3] and was used internally by Microsoft[4] to describe its strategy for entering product categories involving widely used standards, extending those standards with proprietary capabilities, and then using those differences to disadvantage its competitors.

https://en.wikipedia.org/wiki/Embrace,_extend_and_extinguish

 

Microsoft could have supported standard Java and forgone the unnecessary step of replicating the same functionality with ,NET. Ironically, if it had done so, I think its ecosystem would be in a better position right now. As things stand, Java is the leading cross-platform development language, and .NET is mostly relegated to the decling Windows platform. It's a smart move opening up Swift as quickly as possible. Apple knows the importance of not squandering any good will a new language might garner. Unlike Microsoft, who left .NET to rot in the Windows-centric environment for too long. FOSS and Linux folks just aren't interested in it at this point.

Link to comment
Share on other sites

  • 0

^ and a wonderful thing happened because they didn't support standard Java. Things couldn't have turned out any better.

Link to comment
Share on other sites

  • 0

A lot of strange things have been posted in this discussion. FWIW here are a few notes:

 

- Microsoft is full of humans who like to make programs. When Java first came out it had many good points and huge numbers of people in Microsoft started using it for various tiny projects. At one point this resulted in one of the famous Bill Gates anger moments and led to a competing J++ Microsoft product.

 

- Programmers like to hack on stuff and so it's incorrect to say that improving Java particularly with Windows specific extensions was embrace and control. Either way that started a legal mess with Sun that birthed C#

 

- Any Turing Complete programming language can in theory run in any environment so Swift or Javascript running on a server is not odd in any way. Predicting uptake for such a usage scenario is always difficult but clearly Javascript on servers has had a huge uptake in the last few years in the form of Node.js which is promoted so much everywhere that you would need to live on another planet to have escaped the Node Army.

 

- Nobody has a working crystal ball so uptake of Swift is hard to predict other than it has a huge starting boost by being a sensible alternative to the antique Objective-C on IOS and there are a lot of IOS programmers.

 

- Both Swift and Objective-C compile to LLVM so nothing precludes their use on other platforms. Objective-C has not seen any uptake since no sane programmer (not living inside a reality distortion field) would freely choose to use it, but Swift is sufficiently modern enough to get great uptake when freely available.

 

- Javascript can certainly be compiled and essentially is compiled in any modern browser by JIT runtimes as sophisticated (almost) as the .NET JIT

 

- Anything that compiles to LLVM can in theory run inside a browser by using the OSS emscripten LLVM to Asm.js compiler.

Link to comment
Share on other sites

  • 0

Microsoft will be compiling Objective-C in Visual Studio. I suspect they will bypass LLVM and use their own C++ intermediate stage similar to how they shoehorned the C++ backend onto C# for the new .NET Native.

 

So it would be resonable to assign a high probability to Swift being added to that codebase at some point. From a marketing point of view if they expect any uptake for IOS Apps in Windows Store, they should announce the Swift option ASAP as a staement of direction to prevent it being a blocking factor since anyone using Objective-C on IOS will be giving serious thought to using Swift on their next project.

Link to comment
Share on other sites

  • 0

Why must everything be a competition? Why should a language have to justify its existence vis a vis other languages? Isn't it sufficient that it is a language that some people enjoy working with?

Sure, but all these new native languages have poor compatibility with one another so they're all their own bubble of libraries and tools - and there's only so many languages a developer can be proficient with. So there's community fragmentation and costs associated with reinventing the wheel yet again.

 

On .NET or Java it's different because each new language just builds on top of the existing ecosystem, and if someone doesn't like your language he can still re-use all your types as if they were written in his favorite language.

Link to comment
Share on other sites

  • 0

Sure, but all these new native languages have poor compatibility with one another so they're all their own bubble of libraries and tools - and there's only so many languages a developer can be proficient with. So there's community fragmentation and costs associated with reinventing the wheel yet again.

 

People have different needs and tastes. There will never be a perfect language for everybody. If people want to form their own communities and are happy to reinvent the wheel, let them. They might come up with a clever reinvention of said wheel, and gain some insights that other communities can then benefit from.

 

 

 

On .NET or Java it's different because each new language just builds on top of the existing ecosystem, and if someone doesn't like your language he can still re-use all your types as if they were written in his favorite language.

 

In practice people often end up rewriting a big chunk of the ecosystem anyway. For example, Scala has its own standard library, with its own collection classes etc. And that makes sense. If you have a more powerful language, you should make use of it to build better libraries. The same thing is already happening with Objective-C and Swift.

Link to comment
Share on other sites

  • 0

People have different needs and tastes. There will never be a perfect language for everybody. If people want to form their own communities and are happy to reinvent the wheel, let them. They might come up with a clever reinvention of said wheel, and gain some insights that other communities can then benefit from.

 

In practice people often end up rewriting a big chunk of the ecosystem anyway. For example, Scala has its own standard library, with its own collection classes etc. And that makes sense. If you have a more powerful language, you should make use of it to build better libraries. The same thing is already happening with Objective-C and Swift.

Would you want to reinvent the wheel or write in a language which offers the needed functionality in its standard library?

I am not talking about collections either - but code generators from XML, database connectors, PDF and document libraries, etc.

Link to comment
Share on other sites

  • 0

Would you want to reinvent the wheel or write in a language which offers the needed functionality in its standard library?

I am not talking about collections either - but code generators from XML, database connectors, PDF and document libraries, etc.

 

You have a few options if a language doesn't have a library that you need:

  • Write the library
  • Interface with another program that provides the functionality, e.g. a command line utility or a microservice. If none exists, you might decide to build this yourself using another language that has a library that you can use.
  • Pick another language for the project

You need to assess the needs of your project and weight the pros and cons.

 

For example, I recently assessed Elixir and OTP for a project that I'm working on. Elixir is a new language, and while you're able to use Erlang libraries in Elixir, Erlang is also a fairly niche language. Overall there aren't a whole lot of libraries in the ecosystem. However, Elixir is extremely good at the kind of application that I'm building, so in this case writing a missing library is an option that I would seriously consider. If I were building a traditional n-tier web application, I might have picked one of the dozens MVC frameworks out there and call it a day. But I'm building a distributed application, and this is what Elixir specialises in.

 

In the end I decided to build with Scala and Akka. However, if Akka didn't exist, I'd be using Elixir for sure.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.