The Swift Programming Language

Apple just killed the Rust language by introducing the ownership model (aka the borrow checker from Rust) into Swift 4. Mozilla cucked again, Swift now god tier.

Other urls found in this thread:

lmgtfy.com/?q=reference counting
developer.apple.com/videos/play/wwdc2017/402/
youtube.com/watch?v=3y42Qg6MTvk
github.com/apple/swift/blob/master/docs/OwnershipManifesto.md
rust-lang.org/en-US/friends.html
code.visualstudio.com/updates/v1_11
theregister.co.uk/2016/10/18/facebook_mercurial_devs_forget_git/
twitter.com/AnonBabble

>t. mactoddler

>Has both ownership model and Garbage collection
TOP FUCKING KEK, IT'S LIKE BEING BLIND AND DEAF AT THE SAME FUCKING TIME

...

Swift does not have garbage collection.

Swift IS garbage.

Swift uses reference counting, not garbage collection for memory management. And the reference counting overhead would drop to zero with the ownership model.

Rust never had a chance. Why? Because no major OS or platform supports it.

Rust is a colossal waste of time and effort. If you're learning Rust, you're a fucking idiot because your skill will be useless. No one is hiring for Rust development.

you're a brainlet if that's what you really think. you're probably some dumb pajeet who uses winshit.

>reference counting
what's that? that any good?

Yeah, guess how that chart will look when they implement the borrow checker.

lmgtfy.com/?q=reference counting

That's pretty great. I like swift's syntax much better than rust's. If they use borrow checking instead of ARC, that should close the performance gap between the languages, since they both use LLVM.

The borrow checker in Rust also ensures deadlock safety afaik. Can Swift 4 guarantee that as well?

I have to second this. Working a year with Swift now and everything is so... sane. I don't really have anything to complain about it. Sup Forums will hate it forever, because it's from Apple, but I really enjoy it.

Didn't swift pre and post incrementation

Remove*

If you write code that increments a variable, your code is shit be default in 2017. In C yes, you need that for retarded pointer arithmetic, but in swift for example you use for-in loops or .enumerate(). If you use ++, --, += 1 etc. in a modern language you are doing it wrong.

This is some high quality bait.

>reference counting,
>Implying that shit is any better

Same?

Proof me wrong then. I use +=1 in swift maybe once in two months. In C I would have to use it everyday multiple times.

>Implying you know what you are talking about.

/thread

Checked

++ and -- (as well as += 1 and -= 1, when optimized) provide a direct abstraction for the INC and DEC instructions. There's no fucking reason to not have them, case closed.

It's slower than GC in most cases, particularly with a lot of small allocations.

Nice deflection.

Who gives a shit about this language? No one uses this shit except mactoddlers.

Your compiler is smarter than you and doesn't need special syntax to notice when you're incrementing something by 1. LIke everything else in C, all it grants you is some false sense of empowerment like you're programming to the metal when you really have no idea what's going on.

int i = 1
printf("%d%d%d%d", i++, ++i, i++, i+++++i);
If you know without compiling what this shits prints in C, you are allowed to have them. Also if you imply you can't map +=1 to INC and need ++ for that, you are retarded and deserve to die together with your deprecated pointer arithmetic feature.

In 5 years you will.

In 5 years it will die

Actually if you love them so much, you can overload the ++ and -- operators in swift to get the previous behavior.

>laughing whores

Is there anywhere to read about this? All I'm finding on the subject is some year-old mailing list post from chris lattner floating the idea

Its somewhere in the last 20 minutes of this talk:
developer.apple.com/videos/play/wwdc2017/402/

well fuck this

So is Swift the language I have to learn in order to make apps and make some serious dosh?

Swift and Obj-C are used in the apple ecosystem, so if you want in on that: yes, basically

>tabs on the side

this?
youtube.com/watch?v=3y42Qg6MTvk

Rust is one of the big boys, you do know that right? And let's see some proper source.

it's undefined by standard in which order they will execute

possible bait but

>Rust never had a chance. Why? Because no major OS or platform supports it.

Rust runs on all major platforms and OSs while Swift is crippled outside of macOS/iOS

>That's pretty great. I like swift's syntax much better than rust's

They look pretty similar to me

>Because no major OS or platform supports it.
So this is the power of Sup Forums, a bunch of dumb mactoddlers

Heh, that shit actually crashes because of an overflow. Nice try

It's wrapping up the overflow

Panics are not crashes.

Also release build won't check for overflows.

>Also release build won't check for overflows.
no shit

Thanks. The video doesn't actually have much to say about it but they reference this:

github.com/apple/swift/blob/master/docs/OwnershipManifesto.md

I'll probably never use Swift but it's cool to see compiler-supported ownership semantics become popular in newer languages.

Can you explain to a retard what is this code doing?

It's basically iterating through some numbers and when the numbers get to a certain number it's starting from zero, and then adding them up

Overflowing memory

>possible bait but
it's not.

>Rust runs on all major platforms and OSs while Swift is crippled outside of macOS/iOS
who gives a shit what Rust runs on? You misunderstood my point completely. Rust is doomed for failure because no OS or PLATFORM requires is and NOTHING is built with it. There's no MS, Apple, Google that's created something huge that will make all developers use it.

Rust is fucking dead and that "MUH SYSTEMS PROG LANG" meme doesn't have any legs.

1. Claim Rust doesn't run on all platforms
2. Get BTFO
3. "Just because I said so doesn't imply I meant it"
Fuck off idiot mactoddler

Is that why Objective-C/C++ died?

Swift seems like a cool language but it's probably not worth learning unless you work on Apple platforms and don't care about portability.

Nothing "requires" Swift either. AFAIK most Apple software still uses Objective C.

>it's probably not worth learning unless you work on Apple platforms
Yeah, it's (current) uses outside of the Apple ecosystem is rather limited.

Rust is not C++. C++ has huge momentum and was the prog lang of choice for many platforms (including WIndows). Windows itself has tons of C++ code and whole of MS Office is written in C++. C++ will endure forever. Obj-C was the only way to program Macs and iOS and iOS is huge. Obj-C will live on for a very long time.

Rust is fuckign dead. Only retards don't see how pointless it is.

>Swift seems like a cool language but it's probably not worth learning unless you work on Apple platforms and don't care about portability.
IBM is pushing it heavily for enterprises.

>Nothing "requires" Swift either. AFAIK most Apple software still uses Objective C.
Retard, iOS supports it. It's the recommended language for iOS development.

What platform requires or recommends Rust? Which billion dollar company is pushing Rust and is releasing tons of code and examples for their platforms in Rust? That's right: NONE!

RUST IS DEAD.

>killed the Rust language
lol these script kiddies

>Rust is fuckign dead
It's more alive than your git activities

I used Rust for a small side project and the borrow checker is an outstanding feature that guaranties security. I would say Rust is directly responsible that this feature was added to Swift 4. So Rust served it's purpose well and can now go down the same rode as the D programming language.

Are you upset right now?
$ rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: checking for self-updates

stable-x86_64-unknown-linux-gnu unchanged - rustc 1.18.0 (03fc9d622 2017-06-06)

>Rust is dead
>C++ rushes to add a half assed borrow checker into the langauge
>Swift rushes to add another implementation of half assed borrow checker to them
>random basement dweller of Sup Forums gets autistic meltdown

It's all happening guys!

>in 5 years the richest tech company in the world's programming language will die
do you people even try

Servo is a fantastic example of Rust's production usage. Servo is much more GPU aware and uses way more GPU resources unlike other web rendering engines. Samsung is actually sponsoring servo

Yes, learn from Obj-C/C++.

>It's more alive than your git activities
haha... I see you've run out of arguments and now you're resorted to personal insults. we're done arguing kiddo.

sure. and Rust took some stuff from Swift too (C# is similar and ideas went both ways too). but that doesn't really change the fact that Rust will go nowhere. it's just another of the multitude of dead languages that people still hack with. Lisp, Scheme, etc etc... Rust will join that group.

Not at all. There was some guy who did conversions of piece of kernel into Rust. Who cares. Linus won't support that shit.

Well, it is dead. If other languages keep on improving, you'll have ZERO incentives to move over to Rust.

>Servo is a fantastic example of Rust's production usage
Hahahah... WHAT THE FUCK ARE YOU SMOKING? Servo won't replace FF engine for a year. And by that time, FF will be down to 8% and will be dead as well.

>actually being this mad

Linus won't support it because it's philosophically a C only project, you underage toddler

>haha
Did that strike your nerves?

>no arguments
>personal insults
>thinks I'm mad when I'm laughing at his face at how stupid he is
I'm sure you'll land that 6 figure salary programming Rust eventually.

All it takes is one (ONE) clueless shit poster to derail the thread.

Chillax, son

>If other languages keep on improving, you'll have ZERO incentives to move over to Rust.

Swift won't ever be as fast as Rust.

C++ won't ever be as safe as Rust.

Rust is as fast as C++.

Rust is safer than Swift

None of those matter. No manager will pick Rust for some big project based on the bullet points you indicated.

Rust's biggest barrier is that no multinational, billion dollar company that has a computing platform supports it and pushes it. Rust is basically a Mozilla project and Mozilla's extremely weak, cannot offer support to other companies and is pretty much dead. Rust has no future.

C++ is good enough.
C# is good enough.
Swift is good enough.
Rust is dead.

This

Nobody uses Rust for enterprise level applications

>Nobody uses Rust for enterprise level applications

Dropbox, npm, Samsung to name a few are listed on the official website
rust-lang.org/en-US/friends.html

Visual Studio Code uses ripgrep for searches
code.visualstudio.com/updates/v1_11

even Facebook uses it, it seems
theregister.co.uk/2016/10/18/facebook_mercurial_devs_forget_git/

First what and said

>Swift won't ever be as fast as Rust.
Swift is already very close and it has no limitations that would prevent that gap from shrinking further. I would be careful with that assumption.

>it has no limitations that would prevent that gap from shrinking further

It has garbage collection you retard

For the 100th time now, SWIFT DOES NO USE GARBAGE COLLECTION! Swift uses reference counting which overhead will be reduced to literally nothing when the ownership model gets implemented.

ARC is a form of garbage collection

>overhead will be reduced to literally nothing when the ownership model gets implemented.

That does not come for free. You need Rust's semantics. Either they keep ARC around and add some form of ownership for certain things or they drop ARC altogether and all Swift devs start "fighting the borrow checker" like in Rust.

>ARC is a form of garbage collection
Ahaha

No matter what you call it or don't call it, it is automatic memory management. It can't magically from a language and converted to manual memory management with backwards compatibility.

then just use 64-bit ints, retard.

> It can't magically from a language and converted to manual memory management with backwards compatibility.

fuck my typing:

It can't magically BE REMOVED from a language and converted to manual memory management with backwards compatibility.

>Implying arc is the same as literally stopping all threads of the program, going trough all allocation tables of all threads and check what is not needed anymore every x milliseconds.
>Implying you can't call malloc and free in swift if you want manual memory management.

Imagine being this retarded.

>>Implying you can't call malloc and free in swift if you want manual memory management.

Then it's not the same language anymore. You reinvented C. Good job.

>++ and -- (as well as += 1 and -= 1, when optimized) provide a direct abstraction for the INC and DEC instructions

No. Only whne you use it to increment numbers. In most cases, you use them to increment pointers and there it doesn't map to inc or dec anymore.

There's no need to have dedicated syntax for this in Rust at all.

>C++ is good enough.
>C# is good enough.
Spotted the fizzbuzz artist

>when you really have no idea what's going on

>It has garbage collection you retard
>I have no clue but I'll still give my input
Garbage collection doesn't affect overall performance, only pauses. If anything icaching the cleanup code makes it more efficient than RAII.

Swift is more beautiful.

I was learning chapel, the only language that is bringing something new to the board with it's locality-oriented features for distributed systems and parallelism.
But currently it can't use libraries compiled with it, should be fixed in the future but idea when.

Swift seems to be decent alternative for chapel for the moment.
How good is the platform support and operating system support? Kind of afraid because it's apple's product and I doubt they give shit about supporting windows for example.
It's new language so there's not many libraries. How easy is the foreing function interface?

Any systems language can do that, retard

lel, you are free to try, Rust will still be at least twice as fast than s*ift. Fuck off, mac toddler

>Garbage collection doesn't affect overall performance, only pauses.
Garbage collection isn't a magic pause. Tracking the memory has a cost. It doesn't come out of thin air.

Swift has ARC that doesn't pause. Still it adds runtime costs.

> If anything icaching the cleanup code makes it more efficient than RAII.
Nice meme. Show me an example where the same implementation of an algorithm is faster on a language with automatic memory management is faster than the C++/Rust implementations

Recently I often see people claim that garbage collection is now faster then reference counting. They then continue linking +100 page scientific papers which I have to admit I'm too lazy to read. But seriously how can that be true? The overhead from +1 and -1 for the reference counter can't be that much. I assume it can be heavily optimized by the compiler as well, even without borrow checking.

>removing ++ and -- operators because mac users are too retarded to commit it to memory