Apple wants Xcode to write apps for you, automatically

Posted:
in General Discussion edited June 2023

Apple has said for years that everyone should be able to code, and its been working since 2016 to get Machine Learning up to speed to make it easier to write apps -- or to even code for us.




One of the less talked about yet more successful uses of ChatGPT has been in the generation of code for app developers. It's never a complete solution, and it can still be that the code simply doesn't work, but in practice it's a conveniently quick tool to help with development.

Apple has eschewed jumping on the ChatGPT bandwagon in favor of its years of Machine Learning work, and now in a newly-granted patent, it is putting ML to work for developers. "Integration Of Learning Models Into A Software Development System," describes how at the very least, Xcode could do more auto-completion of lines, and syntax checking, but then potentially much more.

"Software development environments can be used to create a software program in a given programming language on different computing platforms," says the patent. "Existing approaches for enabling software developers to utilize machine learning models in software development environments may require a significant amount of configuration."

The implication of the patent is that Apple wants to use ML models to take away barriers to development -- whether that means creating most of the code, or just helping developers.

"A software developer working with such a model can then take advantage of productivity features of the IDE [Integrated Development Environment] such as syntax checking while typing, auto-completion, detection of name or type errors in parameter lists, etc.," continues Apple.

"In an example, [the] code generator creates a subroutine that facilitates accessing values of the existing ML data," says Apple, "via the particular data type supported in the particular programming language"

Apple stresses that the proposal is intended to work with "Swift, Objective C, C++, Python, Java," or any language. Just as you can now ask ChatGPT to write an app in, say, AppleScript or SwiftUI, so Apple's ML system can be used regardless of which language the developer chooses.

"The code interface of the transformed ML model... therefore provides functions and data types,' continues the patent, "that are compatible with the particular programming language, as used in the current project."

At the very least, Apple's ML proposal could cut down on how often developers see this disheartening error message
At the very least, Apple's ML proposal could cut down on how often developers see this disheartening error message



Overall, Apple's patent describes how separate subroutines can be created as objects that a developer then adopts in his or her app. Apple assumes that a developer will want to edit the ML-generated code, too, so the patent also details how that might happen.

So as described, the ML technology is intended first to be a professional tool for speeding up coding for developers. But removing barriers to coding will also see Xcode potentially doing most of the work that new or less experienced developers need.

The patent is credited to six inventors. They include a Michael Ryan Brennan of San Francisco, and previously, Apple has related patents from 2016 listing a Michael R. Brennan of Cupertino.

Whether this is the same inventor or not, those related patents concern what Apple specifically calls "training an artificial intelligence." So while Apple has been criticized for not mimicking Google and others for announcing ChatGPT-like systems this year, it's actually been quietly working on this for at least seven years.

Read on AppleInsider

Comments

  • Reply 1 of 8
    chutzpahchutzpah Posts: 392member
    If it can help me make an app that makes other apps we’re heading straight to singularity town.
    muthuk_vanalingamwilliamlondon
  • Reply 2 of 8
    anonymouseanonymouse Posts: 6,860member
    The Ratatouille model of programming, although, in this case, I guess Xcode plays the part of Remy while the "developer" is Linguini.
    williamlondon
  • Reply 3 of 8
    I have used ChatGPT for development (usually creating boilerplate code or just asking it a question that I would normally Google). I would say its current accuracy is about 50%. So it is truly hit or miss. If Apple could get that to where it is closer to 80 - 90% they would have a major contender there. AI by itself isn't going to be able to be creative; that is the role of the programmer. However, if the nuance, boilerplate, and simple syntax correction can be dealt by AI, that would improve my productivity by leaps and bounds!
    Meteorwatto_cobra
  • Reply 4 of 8
    anonymouseanonymouse Posts: 6,860member
    I have used ChatGPT for development (usually creating boilerplate code or just asking it a question that I would normally Google). I would say its current accuracy is about 50%. So it is truly hit or miss. If Apple could get that to where it is closer to 80 - 90% they would have a major contender there. AI by itself isn't going to be able to be creative; that is the role of the programmer. However, if the nuance, boilerplate, and simple syntax correction can be dealt by AI, that would improve my productivity by leaps and bounds!
    It should easily be possible to create a specialized AI for this narrow purpose with a very high level of "correctness".
    watto_cobra
  • Reply 5 of 8
    How does Apple's plan differ from the already-available GitHub option?
  • Reply 6 of 8
    mattinozmattinoz Posts: 2,323member
    How does Apple's plan differ from the already-available GitHub option?
    I'd assume it would be tuned to Swift and Apple platform conventions in a way an AI training across many languages and platforms cna't be. 

    Also if braked into xCode could re-evaluate the results on a regular basis to improve speed and efficiency of the code, even automatically version code to make use of OS improvements. 

    That would be amazing for pros who want to casual code and make useful things for themselves. An AI that can take the thing useful to me and reduce the big step to make it useful for others like me even just in the office would be a big win. 

    First thing I'd really like is an AI Macro that takes one type safe value and lets me throw it at similar type that another function might want. 
    watto_cobra
  • Reply 7 of 8
    michelb76michelb76 Posts: 621member
    How does Apple's plan differ from the already-available GitHub option?
    I would assume it also creates the xcode project, settings, screens etc.
    watto_cobra
  • Reply 8 of 8
    dewmedewme Posts: 5,376member
    Interesting.

    I’m waiting to see how this is implemented in terms of the developer identifying the “what” part of the problem to be solved. There have been many previous implementations of code generation tools and “wizards” to generate boilerplate code for the basic underpinnings of certain application types. XCode and Visual Studio have used this approach for a very long time. These tools are a great way to get the basic application framework established but have typically provided very little in terms of generating much of anything that is problem domain specific, i.e., generating business logic relevant to the problem you are trying to solve - which is very reasonable considering the unlimited number of possibilities.

    If AI and ML are primed and trained by observing a large number of instances of certain types of business logic and application structure/architecture within certain problem domains, e.g., network management, device management, realtime data acquisition, I can definitely see where it may be able to take developers a step or two beyond what the current framework based tools go.   

    There have also been several code generation tools based on defining certain application constructs in a design meta language like UML and then having the code generator spit out the language-specific constructs for the implementations of the design elements. The better tools in this category are two-way tools in terms of keeping the design and implementation synchronized in both directions.

    I think AI/ML can be “helpers” in terms of software development as long as the human developers maintain a high level of caution and always verify that the generated code is correct and makes sense. If the human cannot critically look at the generated code and say “nice try, but that’s not correct” we will have serious problems. I also think that AI/ML based code generation will not necessarily make the overall software development challenges easier. I think it may make the easier parts even easier, but with steadily increasing size and complexity in software projects the hard parts will still be hard and we’ll continue to ask for even more from the software, meaning more hard parts to solve.

    One thing that’s been sorely falling behind in the software development community (in my opinion) since the advent of agile development methodologies is a steadily decreasing emphasis on good design and architecture. In our quest to provide more schedule predictability and treat individual software developers as factory machines and fungible “human capital,” too little “thinking time” is allowed. The kind of software developers and programmers Steve Jobs sought to hire and the ones he talks about in “The Lost Interview” with Robert Cringely (excerpt- https://www.newschools.org/blog/programming-greatness/) are totally turned off by the practices that agile promotes. It’s not just important to write code correctly, it’s just as important to write the right code, which may mean writing a lot less code by thinking more about the problem.

    If AI/ML code generation tools can free up designer and architect bandwidth so they can focus on designing and building the right things while allocating more of the implementation and testing to human-plus-AI pair programming perhaps we’ll see a substantial improvement. But my realistic expectation is that offloading some of the tasks to human-plus-AI and AI alone will merely result in software developments teams being able to continue to tread water because the software component of products and systems will always be asked to do more and more and more of the required functionality. 
    watto_cobra
Sign In or Register to comment.