[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Where were you when c++ was kill?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 126
Thread images: 22
File: images(4).jpg (13 KB, 554x554) Image search: [Google]
images(4).jpg
13 KB, 554x554
Welcome to Swift.org

Swift is now open source!

We are excited by this new chapter in the story of Swift. After Apple unveiled the Swift programming language, it quickly became one of the fastest growing languages in history. Swift makes it easy to write software that is incredibly fast and safe by design. Now that Swift is open source, you can help make the best general purpose programming language available everywhere.
>>
so, you can make ubuntu programs in swift?
>>
File: 1406154595547.png (55 KB, 704x290) Image search: [Google]
1406154595547.png
55 KB, 704x290
>swift
>>
Swift? More like Sjwift.
>>
>>51763696
10/10

>2015
>using a language that's not cross platform
So, you're like a useful idiot or a complete shill?
>>
File: 1440629470161.jpg (14 KB, 224x220) Image search: [Google]
1440629470161.jpg
14 KB, 224x220
>>51763749
>>
>>51763749
/thread
>>
File: 1449176407528.jpg (32 KB, 600x480) Image search: [Google]
1449176407528.jpg
32 KB, 600x480
>>51763749
>swift
>>
File: 1443806267941.png (221 KB, 554x388) Image search: [Google]
1443806267941.png
221 KB, 554x388
>>51763807
Please, just stop. It hurts.
>>
File: Abdul Fattah Jandali Jr.jpg (202 KB, 1200x627) Image search: [Google]
Abdul Fattah Jandali Jr.jpg
202 KB, 1200x627
>>51763807
Someone write a function for buying a macbook in emojis.
>>
File: 1447726979473.jpg (23 KB, 554x544) Image search: [Google]
1447726979473.jpg
23 KB, 554x544
>>51763749
/g/ only dislikes this because it makes programming more accessible to people of color.
>>
Since Swift went open source it is quickly moving towards becoming a bottom tier programming language to ease people into doing Hello Worlds and not being a language that any experienced programmer would choose to use because of the amount of relearning that would be required.
>>
>>51763946
ITT Java: Electric Boogaloo
>>
File: Smash_dat_like_button.jpg (32 KB, 720x480) Image search: [Google]
Smash_dat_like_button.jpg
32 KB, 720x480
>>51763807
10/10 tbqh
>>
>>51763946
>and not being a language that any experienced programmer would choose to use because of the amount of relearning that would be required.
code monkey detected

why is it so hard for these enterprise retards to learn a new language

it's not even remotely difficult
>>
>>51763946
buttmad java monkey detected
>>
>>51763364

On a serious note, I am rather hoping it will in time come to replace c++ for anything but the most extreme and constrained embedded environments.

Its a very nice language to code in, certainly having to go back to code java after swift is like swimming thru mud.

typetypetypetypetype 10 mins later, one line of java code.
Its a draaaaaaaaaaaaaaaaaaaaaaggggggggggggggggg.
>>
>>51764304
If a GC language is going replace C++ I doubt it'll be Swift
>>
>>51764304
>Its a very nice language to code in
woman detected
>>
all memes and /g/ lunacy aside, its a really good language and if it became a main player id be happy
>>
>>51764151
To be fair, learning a new language can be hard especially if you're switching paradigms, i.e. OO to functional

Of course, a good programmer will have a firm grasp on both, but not everyone will do that if we think about it realistically

And then there's learning the new language's syntax quirks, which they all have
>>
>>51764324

Seen some reports (http://www.helptouser.com/code/24101718-swift-performance-sorting-arrays.html) that make it close to the speed of c++ in some situations already if you turn off bounds checking. Its a new language, so one can expect the compiler to improve over time.
>>
>>51764335
>its a really good language
Nice meme.
>>
apple uses red hat servers.
>>
>>51764429

Well it is. And now its open source too, so all you lovers of the dodgy norwegian unix clone get to bask in the beautiful glow of Apple too.
>>
>>51764429
what the fuck would you idiots even know? 99% of /g/ couldnt do fizzbuzz in visual basic
this is the most technologically illiterate 'tech' board there is and frankly i dont even know i bother trying to discuss this stuff
>>
>>51764429
replying meme with a meme.
>>
File: 1428645148972.png (87 KB, 591x346) Image search: [Google]
1428645148972.png
87 KB, 591x346
Literally a meme language.
>>
>>51763946
>amount of relearning that would be required

you mean 5 days if you're not an idiot?
>>
>>51764481
wow, they allow a modern object of communication be variables. such a meme.
>>
File: 1444322806269.jpg (50 KB, 616x533) Image search: [Google]
1444322806269.jpg
50 KB, 616x533
>>51764459
>VB

I automatically think less of anyone who knows that unless they learned it specifically to get a job.
>>
>>51764324
Dunno if you're trolling but ARC != garbage collection. It's the compiler inserting retain and release calls in the exact same places where a human developer would.

By having the compiler manage that bit of tedium you get the conveniences of GC and the speed of manual management.
>>
>>51764514
I automatically think less of anyone who thinks less of someone on such a shallow basis
>>
>>51764521
What exactly is so special about ARC compared to RAII?
>>
C++ has gone a long time unchallenged.

Sure, some shit has cropped up over time (go, d, rust, etc) but nothing has toppled the king.

Nothing.

And given the current trend, nothing ever will.
>>
>>51764444
WITNESSED
>>
File: a.gif (2 MB, 280x296) Image search: [Google]
a.gif
2 MB, 280x296
>>51763749
>let
>var :) = "Smiley"
>>
>>51763364
test
>>
>>51764613
test 2
>>
>>51764572
From my understanding of RAII, they're subtly different. ARC simply inserts the _swiftObjectRetain and _swiftObjectRelease calls automatically, and if the reference counter is 0 it will be immediately deallocated.
>>
File: 432974341.gif (18 KB, 1024x682) Image search: [Google]
432974341.gif
18 KB, 1024x682
>>51763364

>Where were you when c++ was kill?
I was in Mumbai, we had just partaken in our favorite Pav Bhaji. I was squatting with my brothers when suddenly I sensed a great disturbance, It felt as if millions of my countrymen suddenly cried out in terror and were suddenly silenced.
>>
>>51764690
>>51764572
>>51764521

ARC still has overhead compared to manual management, because you're making calls to methods that will check a counter and do the deallocation for you, it's just not as a harsh penalty compared to GC.

But if you really need the speed you can write unsafe Swift complete with pointer arithmetic and malloc/free
>>
>>51764748
So ARC is literally just shared_ptr?
>>
>>51764761

Yes.
>>
>>51764777
Classic Applel.
>>
C# already killed C++ years ago.
>>
>>51764748
In 99.9% of cases the overhead is barely noticeable, particularly when compared to typical GC. The convenience/speed tradeoff makes a lot more sense than it does with GC.

>>51764761
Except it just happens instead of you having to explicitly call for it. Memory management in Obj-C and Swift basically just boils down to keeping track of ownership, which is pretty simple.
>>
>>51763364
how is meme formed?
>>
>>51764818
You don't have to "call for" anything using shared_ptr. The automatic "retain" and "release" that Apple apparently invented for ARC are just the shared_ptr copy constructor and destructor, respectively.
>>
>>51763749
How do you type emoji without a phone keyboard?
>>
File: 1448703128567.jpg (67 KB, 704x368) Image search: [Google]
1448703128567.jpg
67 KB, 704x368
>>51763364
>Swift
>>
>>51764835

Do you know if the release is called immediately?
That is, once the var goes out of scope is it literally called immediately on going out of scope?

so

{
var a
var b
var c
}

once that } is hit does release get called on a then b then c?
>>
>>51764835
What I'm saying is that you have to explicitly specify that your pointers are shared pointers; in C++, not all pointers are shared pointers. ARC just applies to everything - instead, you have to explicitly specify for a pointer to not be managed.
>>
>>51764838
with a mac
>>
>>51764887
Opposite order. c, then b, then a.

It works with exceptions, too:
{
var a;
var b;
throw;
var c;
} // b, then a (c was never allocated)


>>51764896
Okay. Still don't see why it's such a big deal.
>>
>>51763364
I will be dead of old age and buried before C++ will die
>>
>>51764922

Thanks. Appreciate it.
>>
>>51764941

Thats true for cobol too.
>>
File: 1p1rV95.png (279 KB, 2144x1466) Image search: [Google]
1p1rV95.png
279 KB, 2144x1466
>>51764947
>>51764922
>>
>>51764947
RAII basically follows the stack. So whenever you return from a scope or unwind due to an exception, everything is destructed immediately, in reverse order. I mean, it only makes sense, since the memory for the objects is on the stack.

>>51764994
Alright.
>>
>>51764994

Got it. Thanks.
>>
>>51765005

Yes, it was the "immediately" I was wondering about. Cos GC can happen any time so I was wondering if ARC was deterministic which you're saying it is.
>>
>>51765047
Yeah, ARC is the exact same thing as shared_ptr. Apple just branded it to appeal to "that crowd" and simultaneously made it more confusing for actual programmers.
>>
>>51765065
>made it more confusing for actual programmers
How is ARC anymore confusing than shared_ptr? The only time you have to be careful in ARC is when you have a retain cycle, which ARC can't help you So you have to tell the compiler which reference is weak or unowned
>>
>>51765099
Oh, I don't think the concept is confusing. But the way they make it sound so revolutionary and special, and never refer to shared_ptr, is ridiculous.
>>
>>51765107
>and never refer to shared_ptr
I think that's because shared_ptr is a C++ thing. ARC was created to make it easier to write Objective-C code. Apple just chose to add it to Swift. And since most early Swift developers were most familiar with Objective-C it make sense that they wouldn't refer to shared_ptr
>>
is apple trying to make a swift a go-to language? not in-house, like objective c
>>
>>51765144
Yes exactly, and Objective-C is far more C-ish than C++ is (it's a proper superset). In plain C land shared_ptr isn't even remotely a thing.
>>
>>51765194

Looks that way. Its open source.
>>
Anyone tried the linux version? I'd be interested to know how hard it is to install, use etc.
>>
>>51765194
One of the big hopes is the ability to write the entire stack in Swift, all the way from daemons/services to servers to client app, so yes. It'd be the first language that's compiled (no interpreters or JIT or VMs or any of that shit) and not a PITA to work with to be able to do that.
>>
>>51765227
no. i have a mac, but I'm debating dual booting linux.
it looks easy enough to install tho.
I want to see some linux programs made in swift.
>>
>>51764481
It's Unicode dipshit. Nobody is writing serious code but why would they not allow it.
>>
>>51765144
>>51765199
Side note: I tried to look for some shared_ptr in their ARC code, couldn't find any. I thought it would be funny if they did though. They use some in their abstract syntax tree code though.
>>
>>51765284
exactly. it's just variables. it's not like it's a functional part of the language, and being the proprietor of emoji's, why wouldn't they allow it?
that said, no serious code is going to have it.
>>
>>51765284
I've actually found dropping alert icons (️) in comments about things that need to fixed or changed some time soon to be useful. It brings the issue back to mind in any frequently read code and gives them better chances of being fixed.
>>
>>51764908
Oh they can't do that on Windows?
>>
>>51764696
He asked were you were when c++ was killed, not Java.
>>
what language is this swift.org site made in?
>>
>>51764416
to be fair, swift is a multiparadigm language, so you learn OOP: The good parts, and Functional: the good parts at the same damn time

>>51764429
NEET detected. you're just too lazy and stupid to learn any kind of programming at all
>>
>>51764481
it's abstraction. it's just an extra thing that's not required. remember when people did things just for lulz?
>>
>>51764557
i automatically assume you're a NEET who think's he's SO DEEP and ALTRUISTIC for "giving up a potential job so someone more NEETY could have it" while you mooch off your family like tumor that is slowly killing them and dragging down their quality of life because you can't overcome some mental issues that everyone gets over by the time they are 10.
>>
>>51763768
Well C++can do that and if Swift can't, it won't be replacing C++anytime soon
>>
>>51766491
C++ had more cross platform libraries than any other language, swift from first glance is only Apple hardware.
>>
>>51764514
VB 6 was my first language that I learned when I was 15. It's absolutely amazing for making quick and dirty GUI based programs, a big leap for me from C
>>
File: 1446999757764.png (121 KB, 258x245) Image search: [Google]
1446999757764.png
121 KB, 258x245
>>51763749
>>51763807
>>
>>51764426
But we can't expect the C++ compilers to improve over time?
>>
>>51768267

Well sure, but swift is brand new so theres probably more room for improvement.
>>
>>51764802
I don't see any video games made in C#.
>>
File: 1401739698270.jpg (44 KB, 618x437) Image search: [Google]
1401739698270.jpg
44 KB, 618x437
>>51768364
You don't see fart apps being made by wymen "programmers" in C# either.
>>
>>51768364
Like.... So many Xbox games.
>>
>>51763364
Swift isn't competing with C++ precisely though.
You better off comparing Rust or D to C++.

OP I fail to see how you got to your conclusion that swift success is somehow related to C++ decline
>>
>>51766528
There is talk about swift on linux, but I'm yet to see anything concrete
>>
>>51768654

Fuck me, they literally just released the linux compiler for it. ffs.
>>
This thread smells of samefag shills, like some of these responses are following each other like some written Socratic dialogue advertising Swift features. I'm at a university right now and I haven't met one person who prefers Swift over anything, they typically prefer C/C++ for low level and Python for high level. Most people I knew took the iOS class where Swift was used and had a lot of complaints.
>>
>>51763749
God damn do faggots actually do that? Why the fuck would they let that happen?
>>
>>51768364
then you're not looking.
>>
>>51768691
>I'm at a university right now

Oh well, clearly you're the expert then.
>>
>>51768691
>Most people I knew took the iOS class where Swift was used and had a lot of complaints.

Students know nothing. Wait till you have at least 10years professional programming experience before you venture to have an opinion.
>>
>>51768737
>>51768749

Isn't a big argument about Swift how easy it is to pick up, and aren't they trying to hook into the next generation of programmers? Those of us here had no problem learning C++ or Python but tripped over annoying mandatory shortcuts in Swift. Sure, Python has shortcuts too but Swift's don't seem as elegant or intuitive.

Beyond that, Swift suffers the same limit of early C# with platform limitations. There is no way to use Swift to build a server backend or a gtk app, let alone anything on windows. Languages survive by being cross-platform and having libraries in all of them.
>>
>>51763749
>letting unicode characters into a language
It's only acceptable in unicode string literals.
>>
>>51768796
>annoying mandatory shortcuts in Swift
   var i = s.startIndex
- ++i
- ++i
- ++i
+ i = i.successor()
+ i = i.successor()
+ i = i.successor()

>Maybe I'm missing something, but why not use i += 3? Seems more succinct.
>i += 3 does not work with an Index
>i = i.advancedBy(3) could be used but maybe whoever originally wrote that code wanted to use 3 statements for whatever reason.
>>
File: 1363590931542.gif (25 KB, 624x525) Image search: [Google]
1363590931542.gif
25 KB, 624x525
>>51763749
>>
>>51763364
>it quickly became one of the fastest growing languages in history
Says who?

Also the plant near my screen grows faster than my list of tickets, but it sure as hell is more stable than a Cisco router.

Fastest growing doesn't mean shit.
>>
>>51769313
Github
>>
File: 874.jpg (83 KB, 234x226) Image search: [Google]
874.jpg
83 KB, 234x226
so how this arc works with cyclic data structures? im taliing about weak ptr counterpart
>>
>>51763767
gg Sjwift
https://github.com/pcbro/swift/commit/8bda440bb919b6b59ce24de8f077dc31211e3f5a
>>
File: sjwift.png (61 KB, 620x896) Image search: [Google]
sjwift.png
61 KB, 620x896
>>51769547
>>
>>51764444
nice quads desu baka senpai
>>
File: 2085.png (7 KB, 258x253) Image search: [Google]
2085.png
7 KB, 258x253
>>51769561
lel, they are everywhere, this truly is the end for white male man
>>
The future is closed source
>>
>>51763774
>>51763788
>>51763807
>>51763851
>>51764603
>>51764838
>>51766589
>proper unicode support is bad
I bet you enjoy using PHP.
>>
>>51769913
your mom is open for everyone
>>
>>51764444

WITNESSED
>>
>>51769939
So edgy
>>
>unicode shouldn't e allowed in programming

/g/ ladies and gents.
>>
>>51772235
There's no reason to allow anything but ASCII in identifiers.
>>
>>51763749
Protip: this works in C++ as well.
>>
>>51763749
kek
>>
>>51768364
unity uses c# as a scripting language
>>
>>51772235
why on gods earth would you need it?
>>
File: Untitled.png (32 KB, 996x436) Image search: [Google]
Untitled.png
32 KB, 996x436
>>51765389
>>
'sees thread'
'enters curious as to dafug a "swift" '
...."KILL IT WITH FIRE" https://www.youtube.com/watch?v=cDfqwHck2Qg
>>
>>51768393
that dude is still around? is he still makibg jailbreak tweaks?
>>
>>51764592
I agree with this.
Thread replies: 126
Thread images: 22

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.