Slashdot Mirror


Google Is Working On Fuchsia OS Support For Apple's Swift Programming Language (androidpolice.com)

An anonymous reader shares a report from Android Police: Google's in-development operating system, named "Fuchsia," first appeared over a year ago. It's quite different from Android and Chrome OS, as it runs on top of the real-time "Magenta" kernel instead of Linux. According to recent code commits, Google is working on Fuchsia OS support for the Swift programming language. If you're not familiar with it, Swift is a programming language developed by Apple, which can be used to create iOS/macOS/tvOS/watchOS applications (it can also compile to Linux). Apple calls it "Objective-C without the C," and on the company's own platforms, it can be mixed with existing C/Objective-C/C++ code (similar to how apps on Android can use both Kotlin and Java in the same codebase). We already know that Fuchsia will support apps written in Dart, a C-like language developed by Google, but it looks like Swift could also be supported. On Swift's GitHub repository, a pull request was created by a Google employee that adds Fuchsia OS support to the compiler. At the time of writing, there are discussions about splitting it into several smaller pull requests to make reviewing the code changes easier.

29 of 54 comments (clear)

  1. Isn't this backwards? by viperidaenz · · Score: 1

    Don't you just need to update a language compiler to support the OS's system call structure for the language to be supported?
    Or are they providing a runtime library to provide the appleOS API's and calling conventions so Apple's compiler/IDE can be used without modification?

    1. Re:Isn't this backwards? by Anonymous Coward · · Score: 3, Informative

      "On Swift's GitHub repository, a pull request was created by a Google employee that adds Fuchsia OS support to the compiler."

    2. Re:Isn't this backwards? by sexconker · · Score: 1

      My guesses are:

      A) He only read the headline, and improperly parsed it as Google working on supporting Swift within Fuchsia OS.

      B) He's not familiar with modern semi-open development fads and he doesn't understand that a "pull request" means Google is requesting that Apple pull Google's changes (supporting Fuchsia OS) into Apple's source code for the Swift compiler.

      C) covfefe

    3. Re:Isn't this backwards? by Dog-Cow · · Score: 1

      No version of iOS ships with the Swift runtime. You wrote a whole lot of words based on a mistake.

    4. Re:Isn't this backwards? by Anne+Thwacks · · Score: 1
      Don't you just need to update a language compiler to support the OS's system call structure for the language to be supported?

      If the language is any good, you just replace the library you use for system calls..

      OTOH, If I use any of these newfangled languages, and I need to (say) embed Postgresql, or use existing statistical libraries like TSP, how good is the support for that? (Like the equivalent of PHP-pgsql for PHP? is the support supported? (ie updated to track changes in the underlying target code/system). Like the latest php-pgsql in Linux-Mint is way behind the curve.

      And for the guy who asked about Smalltalk - the Xerox machine which first used mouse and Icons was a hardware Smalltalk machine. It is not new, and has not taken over the world yet. You probably don't want it on your servers. Better than Cobol is not a good sell.

      --
      Sent from my ASR33 using ASCII
    5. Re:Isn't this backwards? by TheRaven64 · · Score: 2

      And for the guy who asked about Smalltalk - the Xerox machine which first used mouse and Icons was a hardware Smalltalk machine.

      No it wasn't. It was a Xerox Alto. The Alto was a microcoded 16-bit system, and each language that was developed for it wrote its own microcode. The Alto processor was designed to execute bytecode, with each one being implemented by running the microcode provided for that index. Smalltalk bytecode was just one of the microcode implementations, the Algol virtual machine (for example) provided a different bytecode. This mechanism went out of fashion when people became interested in running programs written in more than one language without rebooting in between.

      --
      I am TheRaven on Soylent News
  2. Dart is back!? by lucasnate1 · · Score: 1

    To those who dont remember, dart was google's attempt to replace javascript.

  3. Objective-C without the C... by sconeu · · Score: 3, Funny

    So, SmallTalk, then?

    --
    General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    1. Re:Objective-C without the C... by kwerle · · Score: 3, Interesting

      Absolutely not. Way closer to C++ or maybe C# in that it is all about compile time. Very little about the language feels dynamic. Nearly nothing.

    2. Re:Objective-C without the C... by phantomfive · · Score: 1

      Smalltalk would have been a much better choice than Swift, but oh well, you can't have everything.

      --
      "First they came for the slanderers and i said nothing."
    3. Re:Objective-C without the C... by TheRaven64 · · Score: 1

      And this is why I don't really see the point of Swift. If you want to avoid run-time overhead from Objective-C but want to maintain compatibility with Objective-C libraries, there's already a language that lets you do this: Objective-C++. You can use C++ templates for compile-time specialisation and Objective-C for late binding. Objective-C ARC now makes this combination cleaner, because Objective-C object pointers are non-POD types in C++ and all of the memory management interoperates cleanly. It's also easy to use some simple wrappers to use C++ range-based for loops to iterate over characters in an Objective-C string or index set. Clang also handles transparently interoperating between C++ lambdas and Objective-C blocks.

      Swift feels like a vanity project. The difficult problems in language design are concurrency, error handling, and compartmentalisation. Swift didn't even try to address any of these until later revisions.

      --
      I am TheRaven on Soylent News
    4. Re:Objective-C without the C... by kwerle · · Score: 1

      Yeah, I'm not a big fan either. I keep hoping they'll add the dynamic part - but it sure doesn't seem like that's gonna happen.

      It makes me a little sad - I wanted to love swift. But I'm coding in ruby - which I think of as the ObjC of scripting languages. And I freakin' love it.

  4. I tried the beta, works as expected. by Anonymous Coward · · Score: 4, Funny

    I ran a one-line script to print "Hello world" and it uploaded 20Mb of data to Google's servers. It's almost ready for release.

  5. What color do you want that OS? by jfdavis668 · · Score: 3, Funny

    I think mauve has the most RAM.

  6. The decline of Linux by Anonymous Coward · · Score: 1

    Linux became popular because it's a free OS to embed on devices. But with Apple devices running iOS (ie. not Linux) and Google moving away from Linux for its devices and all those that depend on it, the beleaguered operating system is sure to severely decline in popularity.

    Linux, a flash in the pan!

    1. Re: The decline of Linux by Anonymous Coward · · Score: 3, Insightful

      This is a very real problem. Linux is losing the developer mindshare that it once had. Lots of developers are using macOS these days, and like you point out they aren't targeting Linux. Even if they're working on Android apps, Linux is so deeply hidden that it may as well not even be there. The BSDs are seeing a resurgence for server use, and Linux desktop use has withered with the failures of systemd and Gnome 3. I think that Linux may have plateaued, and now we are seeing the beginning of a decline.

    2. Re: The decline of Linux by Kjella · · Score: 1

      No idea why this troll is at +3, maybe the /. echo chamber have heard this crap so many times they believe it. Read the headlines for Market Share Analysis: Server Operating Systems, Worldwide, 2016 with highlights like "Linux (Server) Is the Fastest-Growing OS Segment" and "Red Hat Became the Second-Largest OS Vendor Through Linux (Server) Growth and Geographical Expansion". The major players are Windows, z/OS, HP-UX and Solaris with Canonical getting a honorable mention. BSD is not on anybody's radar except the systemd trolls.

      As for the desktop Linux has never had any significant market share so you can't lose what you never had. But by just about any possible metric BSD is worse, so the same ~1% that's been running it for the last 15 years because it's the only semi-usable open source desktop will continue to do so. As for mobile that's almost entirely up to Google, but they got a winning team with the Linux kernel here. Maybe Fuchsia is an interesting technology testbed but I fail to see the business case for switching. It's well hidden but eh, less hidden than the BSD heritage in iOS/macOS. As far as I know the Darwin kernel isn't usable anywhere else, while Google's kernel is just a few patches from mainline.

      --
      Live today, because you never know what tomorrow brings
    3. Re: The decline of Linux by ArmoredDragon · · Score: 1

      Linux is great for servers, but it doesn't make a whole lot of sense for consumer devices.

      The kernel is just too bloated to be practical for low power, low memory devices like mobile, and the API changes so much that drivers are always broken in new versions, requiring an update. Updates to drivers are expensive due to all of the certification required, which is a big reason most OEM's don't upgrade older Android phones, Google included. It also contributes to IoT's security problems.

      For desktop, Linux is too highly fragmented. Practically nobody can agree on a standard set of applications in Linux, which make all the difference in the world to end users. Take gnome vs kde, or mir vs wayland vs x11. And what might work on one distribution may not work on another. Then there's the non user visible components like init.d vs systems. With Windows and OSX, all you have to know is the name of the OS, and you can reasonably be sure that your program will not only run, but work the way that you're familiar with.

  7. Re:Swift is going strong. Rust? I think it's dying by Waffle+Iron · · Score: 1

    Multiple paragraphs discussing Rust, but not a single mention of its code of conduct?

    You must be new here.

  8. Re: Swift is going strong. Rust? I think it's dyin by Midnight+Thunder · · Score: 2

    Along those lines I like to break programming languages into two main groups: the languages that people use and the languages that will influence those languages. As an example: Java is a language that is used heavily in enterprise, while Scala influenced the direction of Java, without actually replacing it.

    Of course this is a simplification of the reality, but this perspective seems to work well enough.

    --
    Jumpstart the tartan drive.
  9. Re:Who's still going native? by Andreas+Mayer · · Score: 1

    I mean you gotta be pretty masochistic both as a developer and a company if you develop apps in a native language. There may be some reasons to write parts of the app in a native way but then go for C so these portable. For anything else use Javascript.

    Good god! Why would you torture yourself with Javascript when you could use Swift instead?

  10. Re:Swift is going strong. Rust? I think it's dying by Anonymous Coward · · Score: 1

    It's not even the technical aspects of Rust that worry me the most. The Rust community is very concerning. It's the most hypocritical, totalitarian, autistic programming language community I've ever had the displeasure of dealing with.

    In my opinion, the Rust community puts up this facade of tolerance and acceptance and positivity, but underneath there's a strong undercurrent of anti-social attitudes and behavior.

    This is just a guess, but perhaps many members of the Rust community suffer from Asperger Syndrome or a similar affliction that inhibits their ability to socialize in a normal fashion. While members of other programming language communities can just naturally act civilized with one another, it's like the Rust community needs its obtuse Code of Conduct to be a checklist that governs any and all discussion they have. It's like they have to mechanize the social interactions that would just come naturally to most other people.

    Sometimes their hypocrisy leaks through, like at sites like Reddit or Hacker News where they appear to ruthlessly downmod anyone who dares to express completely valid criticism of Rust. This inability to consider criticism makes them come off as very immature and childish, I think.

    To a great extent it's like Rust has become a religion for many of its adherents. Logic loses all meaning for such people. They internalize any criticism of Rust as being criticism of their persons, and perhaps this causes them to react in such hypocritical and totalitarian ways. Anybody who doesn't conform to their artificial idea of what a Rust community member should be is effectively crushed and destroyed, resulting in an extremely strong echo-chamber effect within the Rust community.

    I've dealt with many different programming language communities over the years, but Rust's is perhaps the first one that I've really wanted absolutely nothing to do with. I don't think it's a healthy community, and so I try to keep my distance from it.

  11. Re:Who's still going native? by angel'o'sphere · · Score: 2

    C is not that easy portable as many people think.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  12. Re:Swift is going strong. Rust? I think it's dying by IAN · · Score: 1

    Came for the Rust trolls, was not disappointed. It's fascinating to see how they incorporate the latest developments into their narrative, and drop things which started sounding ridiculous even to those who don't follow Rust closely. If you want to know more about "some Rust code [that] apparently made its way into Firefox recently", which is the new styling engine, there's a nice high-to-mid-level presentation from one of the developers.

  13. Zircon by Misagon · · Score: 2

    BTW, the microkernel at the bottom of Fuchsia has changed name from Magenta to Zircon.
    Maybe because there's a Magenta Linux... I dunno.

    Zircon has security based on capabilities (which it calls "handles", rightly so IMHO) for pretty much everything. This could support sandboxing of new sub-processes that you own, but it lacks revocation of rights from running processes that would be used as services -- which I find to be a serious omission.
    IPC is very much like Unix domain sockets: with streams and queued asynchronous message passing... which means that it is never going to be faster than Mach ... and Linux is demonstrably faster than Mach. seL4 would have been a better foundation IMHO.

    --
    "We mustn't be caught by surprise by our own advancing technology" -- Aldous Huxley
  14. Re:Swift is going strong. Rust? I think it's dying by dilvish_the_damned · · Score: 1

    Just because you don't understand how to use them now doesn't mean they're idiotic, maybe you had to work with bad projects; One common problem with all programming languages is over engineering or making things or too complex or to simple.
    In my case I have done very impressive things with C and C++, I tried Rust but I still need to find the right project to use it properly.

    In your estimation, what would you suggest as the proper Goldilocks complexity level for a VB6 project?

    --
    I think you underestimate just how much I just dont care.
  15. Re:Swift is going strong. Rust? I think it's dying by mean+pun · · Score: 1

    I highly recommend the 'rm -rf' compiler for all VB6 projects. Fast and efficient.

  16. Makes Sense by tgetzoya · · Score: 1

    Google is having a problem with Java and Oracle. Replacing it with a language that has a large user base, is mobile-first, easy to develop with and can already have IDE support (https://www.jetbrains.com/objc/features/swift.html) in their current Android Studio seems like a good idea.

    Google is also having a problem with the Linux kernel. It's unwieldy and not mobile-first. Building their own kernel designed specifically for mobile would make the entire system more CPU and battery efficient.

    All around, having complete control of both hardware and software will let Google truly compete against Apple. They can continue to develop Android for third parties (Samsung, Motorola, etc.) while keeping Fuschia as their in-house OS to put in future Pixels.

  17. Re: Swift is going strong. Rust? I think it's dyin by rjstanford · · Score: 1

    Agreed. Java is managing to incorporate some of Scala's brevity, to the point that its less compelling.

    Additionally, Scala - IMO - went too far. I absolutely loved some fo the ideas, but one benefit of Java for enterprise projects is that you can pick up a Java class written a decade ago by someone you'll never meet and can basically understand it without too much effort. Java's been removing boilerplate slowly but surely over the years in both language points and major libraries; you can write database backed RESTful API servers with 97% business logic these days, which is fine by me. You can write terrible opaque Java code but you really have to work at it.

    Scala, on the other hand, did a great job of adding functional capabilities but then also introduced shorthand and overloading to the point where someone who's simply not paying attention can create code that's as readable as high-school Perl scripts. And that's a huge problem for the enterprise.

    --
    You're special forces then? That's great! I just love your olympics!