9 ms·
Swift Playgrounds 4
- garmaine 5y agoMy kids love Swift Playgrounds. It is a wonderful way to introduce young kids to programming, in a safe and exciting environment.
- gjsman-1000 5y agoThe biggest new features with version 4 are (according to Apple): - Build iPhone and iPad apps with SwiftUI right on your iPad (requires iPadOS 15.2 or later) - App Store Connect integration lets you upload your finished app to the App Store - App Preview shows live updates as you make changes to your app - Full-screen preview lets you see your app edge-to-edge - Smart, inline code suggestions help you write code quickly and accurately - App Projects make it easy to move projects to Xcode and back - Project-wide search finds results across multiple files - Snippets Library provides hundreds of SwiftUI controls, symbols, and colors - Swift Package support lets you include publicly-available code to enhance your apps
- fedorareis 5y agoI was hoping to see support for adding shader files. There are some workarounds I’ve seen for being able to test shader code in playgrounds, but it would be nice to have native support that doesn’t require a workaround and allows for syntax highlighting.
- musicale 5y ago> Build iPhone and iPad apps with SwiftUI right on your iPad (requires iPadOS 15.2 or later) Maybe it's no Xcode, but you can actually build "real" apps! I still wish we had a full version of Logic for the iPad (though there are lots of iPad DAWs and some of them are pretty good.)
- PostThisTooFast 5y agoI remember when Apple bought eMagic, and I tried Logic. After Logic told me to "reboot" a DIALOG, I determined that the software was right in line with the rest of Apple's amateur-hour acquisitions and went back to something competent.
- duxup 5y agoSo Roblox… but Swift… This is really cool.
- tosh 5y agofirst impressions by Steve Troughton-Smith: > I can already tell that Swift Playgrounds 4 is a big deal. It is pretty much exactly what I was hoping for from an ‘Xcode for iPad’, more than just an upgrade to previously slow & clunky Playgrounds app. It dramatically reframes what iPad is capable of even in this first offering https://twitter.com/stroughtonsmith/status/1471216682807050251?s=20 https://twitter.com/stroughtonsmith/status/14712166828070502... https://twitter.com/stroughtonsmith/status/1471196573417758724?s=20 https://twitter.com/stroughtonsmith/status/14711965734177587...
- ryeights 5y agoWhy drop the ‘the’ before iPad? Sounds like someone’s drank the marketing Kool-Aid
- gjsman-1000 5y agoTwitter limits; and also because it's not just marketing Kool-Aid. It's "Word for iPad," "Angry Birds for Android," "Kindle for Windows" and so forth. Not "Word for the iPad," "Angry Birds for the Android," or "Kindle for the Windows."
- Engineering-MD 5y agoFor iPadOS makes sense. For iPad less so.
- throwaway946513 5y agoUnfortunately or fortunately depending on your perspective, the only method to acquire iPadOS is to use an iPad - so the designation seems fitting.
- mcphage 5y agoTwitter character limits
- deleted 5y ago[deleted]
- gjsman-1000 5y agoI've messed with it and my initial impressions are very positive... except that I've managed to find one bug, and that's that my experimental app appears in Siri App Suggestions and can't open because, well, that app isn't actually installed. Maybe for iPadOS 15.2.1?
- slmjkdbtl 5y agoDoes anyone have personal experiences of seeing beginner using Swift Playground to learn to code and understanding programming ideas? How effect is it? How ready are they to enter "actual programming" after completing the playground?
- KarlKemp 5y agoAt least the previous iteration so much about “completing” anything. It didn’t use the gamification-like mechanisms (“challenges”). And it was not “not real” programming. It left out a lot of the complexity of a project and focused on writing source code, the very heart of the definition of programming. I use them the way I use the REPL in languages that have it: to quickly try out an idea, or to improvise some single-purpose one-off data munging.
- mattcwilson 5y agoI worked for an edu tech startup that built a series of playgroundbooks for learning robotics programming. It is a solid, top-tier learning environment for kids and beginners. Apple has high standards for content you produce in a playgroundbook if you want to be in the main subscription set. And that pays off big time in the lesson sizes, the consistency, and the accessibility of the material no matter which publisher
- marstall 5y agomy 9 year old son loves it - he's learned basic programming ideas in it for sure - loops, functions, etc. gives him a sense of accomplishment and we do it together which is nice.
- edge17 5y agoI tried to use it during development to test code in a sandbox but it always felt unstable and unnatural.
- spaceisballer 5y agoLegit beginner here, I only read a little of some beginner python books but never got far. It was more fun than working through a book, more engaging. I think I may go back to it after seeing some of these updates. There is also a decent variety of options beside just going through the tutorials.
- haunter 5y agoUnfortunately Google shelved it but they had a very similar project called Game Builder for Windows Here is the original introduction video https://www.youtube.com/watch?v=l9Mf_XEZq-A https://www.youtube.com/watch?v=l9Mf_XEZq-A And a tutorial https://www.youtube.com/watch?v=L1hpFRztQGY https://www.youtube.com/watch?v=L1hpFRztQGY Got open sourced so you can still download it https://github.com/googlearchive/gamebuilder https://github.com/googlearchive/gamebuilder Works perfectly under Linux with Wine or Proton. The last full Steam release is also included if you don't want to compile it (7z.001-7z.002-7z.003) https://github.com/googlearchive/gamebuilder/tree/master/builds https://github.com/googlearchive/gamebuilder/tree/master/bui... It's really fun and worth a try if you are looking for something similar not on Mac
- TulliusCicero 5y agoUsed Swift Playgrounds with my then 8 year old, it was neat except that it was actually pretty buggy. The game would get into a bad state somewhat often.
- mhh__ 5y agoSwift playgrounds is really cool and all (I really want to copy it for D!) but when can I build GCC on my iPad. The things so fucking fast but I basically only watch movies and read pdfs.
- klabb3 5y agoOftentimes the answer to "when can I do X on Apple hardware?" is "when it's ready". I'm far from an apple fanboy, but I strongly respect and appreciate that stance, especially in a culture that promotes its antithesis.
- et1337 5y agoOn the other hand, the answer to "when can I run a compiler or JIT runtime on iDevices" has historically been "never", and I wouldn't be surprised if that answer eventually applies to Mac devices too.
- smoldesu 5y agoXcode Cloud[0] feels like a manifestation of everything Stallman warned us about... [0] https://developer.apple.com/xcode-cloud/ https://developer.apple.com/xcode-cloud/
- Kon-Peki 5y agoOne feature of Swift Playgrounds that really doesn't get as much attention as it deserves is the Swift Playground Book [1] subscription: > You create content for the Swift Playgrounds app by writing playground books. Like traditional books, playground books are made up of chapters and pages. Unlike traditional books, they include executable Swift code that displays the results live, right on the page. > Swift Playgrounds subscriptions, like podcasts, are a sequence of episodic content arranged in an order that builds knowledge while allowing more advanced learners to skip content. Subscriptions exist on the internet as feeds—downloadable lists of items that apps and websites can deal with. You publish a set of playgrounds as a feed that the Swift Playgrounds app can download, process, and display. You publish them on your own website, via a JSON feed. No App Store review needed. You could treat it like a Jupyter Notebook, or an interactive story world - whatever you want. [1] https://developer.apple.com/documentation/swift_playgrounds https://developer.apple.com/documentation/swift_playgrounds
- drusepth 5y agoThis sounds interesting! I didn't know browsers could execute Swift. Do you have any links to share of examples? (I don't see any examples in the documentation)
- andreasley 5y agoBrowsers can't execute Swift code. The books are loaded directly into the Swift Playgrounds app. As for links, there are very few subscriptions published – and probably none yet that work with Swift Playgrounds 4.0.
- nexuist 5y agoIt's not executed in-browser, it runs in the Swift Playgrounds app. Think of it like an RSS feed that you can add to the app, and it'll show you new chapters of the book once they're published.
- nikooellegaard 5y agoIf you're interested in it you can compile swift to wasm (webassembly) which can run in the browser natively https://swiftwasm.org/ https://swiftwasm.org/ This won't be it executing editable Swift like on the website and it'll require some binding to send and receive data to the website but it will indeed be swift being executed on the website
- ChrisMarshallNY 5y agoI think that Swift Playgrounds is a really neat idea (especially the books thing). That said, I don't really have much interest in it, for myself. I am stuck in the dark world of Xcode. What I would like (and have submitted the idea to Apple as a feature request), is to have a playground as an Xcode project target. I want to be able to link in modules and resources, without editing the playground file by hand.
- andreasley 5y agoXcode 13.2 (and maybe earlier) contains a project template for a "Swift Playgrounds App" in the iOS category.
- ChrisMarshallNY 5y agoAwesome! I’ll check it out! Thanks! I would use it for prototypes and in-place testing.
- ChrisMarshallNY 5y agoFound it, but it's not what I need. I need a target to be a playground; not a project. The idea is to be able to assign resources, files, and SPM modules to a playground, so they are available to the code running in the playground (an example might be an SPM module like my Generic Swift Toolbox Module[0]). I can then work with the code I'm prototyping in a lightweight text file. [0] https://github.com/RiftValleySoftware/RVS_Generic_Swift_Toolbox https://github.com/RiftValleySoftware/RVS_Generic_Swift_Tool...
- PhilipVinc 5y agoSo now we can program on the iPad, but only with Apple’s approved language, on its approved ide. Can’t a government go there and knock the wall down?
- Koshkin 5y agoApple has a natural monopoly on Apple's products.
- mattcwilson 5y agoSwift Playgrounds has been around for quite some time. I’d also hesitate to think of it as a way to “program on an iPad.” It’s a slimmed down IDE + visualization pane intended to be an educational environment for people wanting to learn programming fundamentals, Swift specifically, or how to program one of the robots/drones/programmable devices that have a companion lessonbook.
- zepto 5y agoThat’s what it was before this update. Now it is a full development tool that lets you release commercial apps.
- dangoor 5y agohttps://codea.io https://codea.io and others have been around longer than Swift Playgrounds.
- kmeisthax 5y agoThere's actually a whole host of iPad apps that will give you programming environments for Python, JavaScript, and so on. iSH will give you a full x86 Linux box and a-Shell supports compiling and running WASM/WASI binaries in a simulated shell environment. They've been around for some time, too; Apple really does not give these things the fanfare they deserve. The main wall that I can see needing to be knocked down would actually be technical, not political. Something like OAMA[0] absolutely would not fix the lack of JIT entitlements or virtualization support accessible to third-party developers in iPadOS. I would not be surprised if Swift Playgrounds is either relying on lots of Apple-only entitlements or compromising on performance[1]. If we had proper virtualization, then we wouldn't need iSH; we could load up a real Linux distro and run a LAMP stack or Docker containers on iPads. [0] Open App Markets Act; similar provisions were in the EU Digital Markets Act at one point [1] The screenshots I'm seeing suggest that, at a minimum, your code runs in the same sandbox as the editor. Which means Apple hasn't added any sort of private API that would let Swift Playgrounds properly provision your app. Without a JIT entitlement, the editor would also need to include an AArch64 emulator inside itself in order to provide the App Preview feature. These sorts of things won't matter to casual programming use-cases but would kill a lot of the benefits of an on-device development environment.
- m12k 5y agoThat gem collection game looks like a fairly direct rip-off of https://lightbot.com/ https://lightbot.com/ If you have kids that you'd like to introduce to some programming concepts in a fun way, I highly recommend it.
- zamalek 5y ago> [Apple's Website] revolutionary app I thought that the Apple "claiming inventorship of unoriginal ideas" meme was over.
- ballenf 5y agoThe copying may not be in the direction you believe. The Playgrounds app was released in 2016 and that game looks like it came 2017. I was on the beta of the first Playgrounds release and seem to recall that the gem game was there from the beginning or at least very early on. But my memory may be fuzzy. Regardless, the mechanic of the game is one that has existed since the earliest programming tutorials.
- neals 5y agoHow's swift doing as a language? Is it being adopted by developers in a way Apple was hoping?
- chunkyguy 5y ago> How's swift doing as a language? It's okay. It's just a programming language like million others. Gets the job done. > Is it being adopted by developers in a way Apple was hoping? Apple does not negotiate, when they make up their mind you have to either adopt or die.
- spyremeown 5y agoNo idea, but the compiler engineers are wizards.
- mrtksn 5y agoNot too much seems to be happening outside of Apple ecosystem but it should because it's brilliant. I don't want to write in any other language.
- lovelyviking 5y ago> it's brilliant can you share what you find 'brilliant' about it?
- mrtksn 5y agoI'm not an expert on programming languages and for me they are the format that I obey to express myself to the computer to make it do things, Therefore I won't be able to tell you what are the strong points and advantages of Swift over other alternatives. What I can tell you though, is that the language is easy to read thanks to the choices they made in the way the syntax is and the language has enough abstraction tools to let me keep the parts of the code that I'm not actively working on away. For example, I like to use the property wrappers and extensions to put away the code that I'm done working on. I also like that its strongly typed but also gives me enough wiggle room with generics. I like the concept of protocols to vaguely define the basics of some kind of data structure and be able to pass around different flavours of it as if I'm on a weakly typed language where functions can take whatever you throw at them. Another thing that I like about swift is that the toolset Apple provides. I used to do JavaScript as my main language but I got sick and tired of the amount of effort to keep the stack together. Endless number of tools that have many alternatives that do the same thing in a slightly different way, hours and days spent in configuring them is something that I don't want to go through anymore. With Swift and the tools that Apple provide(various frameworks and xCode) starting something new to thinker on is as simple as creating a new Word document. It reminds me of the PHP workflows a bit, where you type your code in a text fil, put it in a folder and see the results immediately. Essentially, I like the comfort of using Swift.
- qwertyuiop_ 5y agoWhat happened to Swift on sever ? Looks like Rust sucked the air out of Swift in recent years.
- favorited 5y agoApple is investing a lot in it, but Swift is much younger than Rust (especially as an open source project). There is a working group that meets every few weeks to shepherd the various projects. Most of the recent activity has been (AFAICT) about orchestration. Well, that and transitioning projects to use async/await and structured concurrency. Here's some recent activity in the Swift on server space: - the proposal for distributed actors is currently in-review (https://github.com/apple/swift-evolution/blob/main/proposals/0336-distributed-actor-isolation.md https://github.com/apple/swift-evolution/blob/main/proposals...) - a metrics API for backends like Graphite, Prometheus, etc. (https://github.com/apple/swift-metrics https://github.com/apple/swift-metrics) - HTTP/2 support for SwiftNIO (https://github.com/apple/swift-nio-http2 https://github.com/apple/swift-nio-http2) - a new service discovery API (https://github.com/apple/swift-service-discovery https://github.com/apple/swift-service-discovery) - a new distributed tracing API (https://github.com/apple/swift-distributed-tracing https://github.com/apple/swift-distributed-tracing) - a Linux implementation of Apple's CryptoKit API on top of BoringSSL (https://github.com/apple/swift-crypto https://github.com/apple/swift-crypto) I'm not pretending that it's taking the server-side world by storm, but there is a fair amount of ongoing activity Personally, I'm using it for a couple personal projects and it's been solid, but I'm already a macOS developer, so it wasn't a big stretch for me to reach for it.
- dagmx 5y agoSwift predates Rust by a year (2014 for 1.0 of Swift vs 2015 for 1.0 of Rust)
- favorited 5y agoThat's just a version number. It's like saying Gmail launched in 2009, because that's when they removed the "beta" label, when people had actually been using it since 2004. Rust was available in 2012[0], and Swift wasn't until 2014. In reality, since we're talking about using it on the server, Swift wasn't available until almost 2016[1]. [0]https://mail.mozilla.org/pipermail/rust-dev/2012-January/001256.html https://mail.mozilla.org/pipermail/rust-dev/2012-January/001... [1]https://www.swift.org/blog/swift-linux-port/ https://www.swift.org/blog/swift-linux-port/
- iainmerrick 5y agoI’m curious enough to give this a try, but can it really be good when Xcode is so bad? Are they written by different teams?
- nielsbot 5y agoWhat's so bad about Xcode? I use Xcode for my day job--honestly curious which parts people don't like.
- porcoda 5y agoIt’s the Internet - if someone says “I use <X>”, then inevitably you’ll see a handful of passionate comments along the lines of “<X> is the worst technology created since the dawn of man, and <creator of X> really should admit failure and redo it from scratch to make ME, an Internet Commenter, happy”. I’ve learned to just tune them out and use my own judgement and preferences to decide if a tool is effective for me.
- nielsbot 5y agoThanks. I like Xcode even if others don't. And I have used many other IDEs (IntelliJ, VS Code, even NetBeans). I'm honestly curious what the sore points are.
- iainmerrick 5y agoI do use it in my day job, so I'm not saying it's the worst, but I have been pretty frustrated with it for some time now! Very happy to share :) This is from my experience working with a couple of large iOS team projects written in Swift, with CocoaPods dependencies. YMMV for other setups. I've hit a bunch of problems in the IDE itself, the Swift toolchain, the iOS Simulator, and in the integration between them. First, it's slow: compilation is slow, running tests is slow, starting the app is slow, debugging is slow (generally tens of seconds to attach when it hits a breakpoint), inspecting the view hierarchy is slow (and often just doesn't work). Code completion is slow and unreliable (and currently doesn't work at all for third-party frameworks in Xcode 13). Besides the slowness, things get out of sync a lot, I think because it's doing tasks in parallel in an attempt to do them faster. I frequently see out-of-date compile errors and warnings highlighted in the IDE, because it hasn't finished the appropriate bit of the build yet, or because you're currently working in another target. Production code and unit tests are in different targets because that's how Xcode wants it, but because they drift out of sync so much and the tooling is slow, test-driven development is really tedious and slow. It's usually easier just to build and run the whole app. The UI is usable, but tabs are very clunky and limited compared to other popular IDEs (e.g., you can't just drag to create a new split in any direction). The "assistant editor" for things like associated header files isn't necessarily a bad idea, but again it's clunky and limited. There are too many "mystery meat" icons with no labels attached -- I constantly get mixed up between Issues, Test and Debug. The monolithic project file format is really awful, especially if you're working in a team. It's not usefully human-readable or editable, and every so often Xcode will make random changes to random GUIDs; you just have to shrug and check it in and hope that nobody else gets a merge conflict. The same applies to Interface Builder and all the other embedded rich editors. Just opening an icon or color resource will likely make some random meaningless edit -- why? Adding a file to the project takes an age. "New File...", wait several seconds, "Choose a template for your new file", I don't care, type a filename, delete it again because that's actually the search field for templates, press Next, wait a few more seconds, and finally you're at the file dialog. Why do files even need to be added? It would be so much better if it just reflected the file system. As it stands, files can be reordered (does anyone take the trouble to arrange them in a sensible order? if so, how on earth do you maintain that in a team project?), accidentally omitted from the project, in a different group than its actual position on disk... why? Finally, some of this stuff might get better with more familiarity (e.g., if you set up keybindings) except that the UI tends to change substantially on each release! If you look for advice on StackOverflow on fixing some obscure problem with certificates (and I bet at least 90% of iOS developers have done this) you'll find five completely different solutions for five different versions of Xcode. Oh, and each new release is ~10GB and takes hours to install, literally hours of Archive Tool opening and verifying something called a .xip file. There's no perfect IDE, and I'm not even saying Xcode is uniquely bad, but for each of my complaints here there's another tool that does it better. VS Code is really fast (I'm increasingly using it as a companion editor for everything other than .swift files); Android Studio for all its flaws has nicer tab management, and its interface builder equivalent works really well.
- aerovistae 5y agoThe app is probably great but I hate how Apple calls everything they do revolutionary. Calm down, it's okay to just be great.
- filoeleven 5y agoHas anyone used AudioKit in a playground? I’ve had some ideas kicking around for ages about what I want from a live looper. Since I’d run it on an iPad it seems like a good place to try building it, if it has enough access to the microphone/file system.
- csande17 5y agoSomeone on Twitter points out that the interface has been localized into, among other languages, French: https://www.twitter.com/twostraws/status/1471257758666211328 https://www.twitter.com/twostraws/status/1471257758666211328 But is it just me or is the translation of "Comment selection" into "Sélection de commentaire" faulty? The English version uses "comment" as a verb, like as in "take the selection and comment it out", not "here you can find a selection of comments".
- homarp 5y agoSpanish has same bug
- boxed 5y agoWhen will it come to iPhone though? It's crazy that the far and away best programming experience on iPhone is Python!