Unicode variables, I love it: let 🐶🐮 = "dogcow" Moof!
You can do this in C# (and presumably other languages). I've seen people using Greek symbols in mathy code before. It's kind of fun.
The Swift Programming Language
321–330 of 970 posts
Re: The Swift Programming Language
#322I just skimmed the tour, and my impression is: Swift is a compiled, Objective-C compatible Javascript-alike with an ObjC-like object model, generics, and string interpolation. No exceptions. Based on LLVM and appears to inherit the same data structures as Cocoa apps (Dictionaries, Arrays, &c). It feels very lightweight, sort of like an analog to what Javascript is in a browser.
Re: The Swift Programming Language
#323I'm not even an iOS developer but this is by far the most exciting thing I heard in the keynote. As an amatuer/hobbyist programmer who's self-taught with Ruby, JavaScript, etc., the one thing that was keeping me from experimenting with iOS apps was Objective-C. I know I could tackle it, but it's been hard to take the plunge. I don't know much about Swift yet, but from what I've seen it looks very exciting. So if Appl…
I don't get the hate. Yeah, syntax is unfamiliar, bu once I got used to it I began to really enjoy objective-c. Ymmv etc., but it's now one of my fav languages - though I guess this is mostly due to cocoa
Re: The Swift Programming Language
#324The Swift eBook is available at http://book.swiftlang.eu
What would you like to see there beyond reference docs, guides and examples?
Re: The Swift Programming Language
#325Earlier quoted context omitted.
Practically speaking I'd prefer to work with a language and toolchain that doesn't require me to do that kind of stuff (write my own cross compiler from a derivative of the language that has all my own preferences for syntax). I'd constantly worry about maintaining that piece and having that cut into my quality & productivity. I think applied language theory as it pertains to productivity is fair game for a good disc…
"Clueless hipsters" will attract downvotes.
It makes me sad that companies are coming up with their own language stacks. Obviously Google vis a vis Oracle makes it a good move, if a company has the scale to accomplish and maintain it. Not to be a downer on what seems like a nice language, but other than that reason I see no need for Swift.
Re: The Swift Programming Language
#326So it looks like the language isn't open source and won't target non-Apple runtimes? I'm not trying to troll, I just think that it's a pity that Apple tends to limit the ecosystem and applications of its otherwise-great languages. Building against LLVM ought to make it fairly trivial to make this cross-platform.
Re: The Swift Programming Language
#327Many web developers (like myself) have used Phonegap/Cordova in conjunction with tools like the Ionic Framework for our apps, primarily due to the nearly esoteric (for some of us) nature of Obj-C, but Swift almost looks like JS, which certainly has motivated me to learn it and use it in future apps.
I wonder if the aforementioned tools will lose market share because of that. Let's see.
Re: The Swift Programming Language
#328Looks like PHP (or any c-based lang). Exciting!
I just returned to my IM client (did miss the swift live stream announcement) and read: "Oh, cool, new language. And it has a REPL" And all I thought was: "Please let it be a Lisp".
Re: The Swift Programming Language
#329Earlier quoted context omitted.
Practically speaking I'd prefer to work with a language and toolchain that doesn't require me to do that kind of stuff (write my own cross compiler from a derivative of the language that has all my own preferences for syntax). I'd constantly worry about maintaining that piece and having that cut into my quality & productivity. I think applied language theory as it pertains to productivity is fair game for a good disc…
"Clueless hipsters" will attract downvotes.
Re: The Swift Programming Language
#330"...we wondered what we could do without the baggage of C." Is that tongue in cheek? It's not even a particularly large, encumbered language, C.
If that isn't enough, how about goto fail? All the IIS exploits in v4/5? Various Windows RPC overflows, WMF overflows, SQL Slammer, et al? How many billions in damages have been caused by stack smashing and buffer overflows? How many millions of hours of manpower wasted cleaning up after these errors? Toyota killed some people because their dumb code overwrote memory, blasting the OS task tables causing the watchdog task to stop getting CPU time, meaning nothing provided a stopgap against unintended acceleration. People are literally dying because we can't fucking let go of C.
C is like saying "forget seat belts, child seats, anti-lock breaks, and adaptive steering! How can I power-slide? I want full control; I need to pump the breaks. People should just drive better, then we'd have fewer accidents".
We've been trying to "drive better" for decades (Valgrind, lint, code reviews, static analysis tools, education, ASLR, NX protection, et al). We still regularly see massive security-smashing epic failures.
It hasn't worked. Furthermore the C standard library has been proven turing-complete for ROP gadgets in the presence of a buffer overflow. So no matter what you do, the presence of a single stack smash is enough to allow code execution, subject to payload size limits and execution time.
At some point we have to admit C is no longer acceptable. Not for libraries, not for drivers, not for operating systems. It has to go.
All the performance benefits ever derived from writing everything in C has been more than erased, by orders of magnitude, by the damage caused from even simple innocent mistakes.
Software allows us as programmers to greatly magnify our impact on the world; we like to think of that in positive ways. But the inverse is also true: thanks to the continued use of non-memory-safe languages we have the power to negatively affect the world on a massive scale.
It is unethical to continue writing code in non-memory-safe C or C-based languages, for any purpose. Period.