Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

emoji posted:

Whatever it is, Xcode crashes very hard at the moment I attempt to package.loadlib using the raw symbol, tho not reliably.

That's LLDB being killed because it's trying to read memory it's not allowed to for code signing reasons, or something along those lines. Please file a bug.

Adbot
ADBOT LOVES YOU

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
Please file that as a bug. My guess is that something (the Lua JIT?) is producing corrupt runtime metadata for the code it's loading, but obviously LLDB shouldn't crash, and equally obviously that shouldn't bring down Xcode.

I suspect I'm going to need to design and implement the C-interface-export feature as part of landing the calling convention this summer. But that's not for certain.

It depends on what you mean by "killing". I think you're probably right in terms of shrinking the third-party ecosystem. The first-party ecosystem is committed to supporting both languages, but that probably will not last forever. But there's no plausible direction that removes binary compatibility for Objective-C applications — ever, really.

emoji
Jun 4, 2004

Subjunctive posted:

I sure hope so.

Well the way it is happening compromises new swift code because it has to work with people's existing code. Good ObjC code is still good, and ironically enough swift got me into it but I've never had to deal with terrible messes.

emoji fucked around with this message at 17:23 on May 11, 2016

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

emoji posted:

Well the way it is happening compromises new swift code because it has to work with people's existing code. Good ObjC code is still good, and ironically enough swift got me into it but I've never had to deal with terrible messes.

Well, the incompatible-version churn of Swift has to stop at some point soonish, I think (I haven't kept up with published plans if any). Swift code in The Ecosystem will shed its Obj-C interoperability overhead as the set of people who need that interop declines. We're still a fair ways from adopting Swift at all, let alone replacing all of our Obj-C with it, but just as you can have extern "C" boundaries around a C++ library, I can imagine chokepoints that let the core of the app develop without worrying about Obj-C interop.

emoji
Jun 4, 2004

eschaton posted:

That's LLDB being killed because it's trying to read memory it's not allowed to for code signing reasons, or something along those lines. Please file a bug.

26224565

Doctor w-rw-rw-
Jun 24, 2008
IMO C++/Objective-C++ interop would be a big deal towards adopting it, at least in the minority (?) of shops that make extensive use of either.

ComponentKit is dependent on Objective-C++ because the initialization syntax is superior, and no inline hierarchical markup syntax exists for us to use. I imagine if this were not the case there would be a massive effort to migrate to it ASAP.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

Subjunctive posted:

Well, the incompatible-version churn of Swift has to stop at some point soonish, I think (I haven't kept up with published plans if any). Swift code in The Ecosystem will shed its Obj-C interoperability overhead as the set of people who need that interop declines. We're still a fair ways from adopting Swift at all, let alone replacing all of our Obj-C with it, but just as you can have extern "C" boundaries around a C++ library, I can imagine chokepoints that let the core of the app develop without worrying about Obj-C interop.

I did my best with SE-0058 but it got deferred. It would have made bridging to Objective-C a lot nicer. My current plan is to poke apinotes and see if there is any hope in that direction.

nah thanks
Jun 18, 2004

Take me out.

Subjunctive posted:

I sure hope so.

:agreed:

I wasn't that heavy into Swift, but as I've used it more I really, really dig it, and wish I could use it for my full stack (:rolleyes:). I can't wait for the server-side frameworks to mature - I'd love to swap out Flask for, say, Vapor.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Ender.uNF posted:

I did my best with SE-0058 but it got deferred. It would have made bridging to Objective-C a lot nicer. My current plan is to poke apinotes and see if there is any hope in that direction.

All of these questions are somewhat tied together. The interesting thing about that protocol is that it's (almost) exactly the right protocol for changing the bridging of an arbitrary C type, not just ObjC classes, and that's a pretty useful thing to consider having. It's just that there are other important questions about bridging that we have to resolve first — for example, do we need to design bridging protocols to fit into the dynamic-cast system, or are we going to just remove all of that and make dynamic cast only respect natural subtyping? And should we separate both directions of mapping?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

squidgee posted:

:agreed:

I wasn't that heavy into Swift, but as I've used it more I really, really dig it, and wish I could use it for my full stack (:rolleyes:). I can't wait for the server-side frameworks to mature - I'd love to swap out Flask for, say, Vapor.

rjmccall can you confirm or deny that the wwdc surprise will be compiling swift to js so that we never have to use any other language?

Axiem
Oct 19, 2005

I want to leave my mind blank, but I'm terrified of what will happen if I do

Plorkyeran posted:

rjmccall can you confirm or deny that the wwdc surprise will be compiling swift to js so that we never have to use any other language?

Jesus Christ don't even joke about that. The hordes of js developers might hear you and actually attempt that monstrosity!

n4
Jul 26, 2001

Poor Chu-Chu : (
Ever since I've started learning Swift I wish everyday JavaScript could just be swapped out for Swift entirely. So I'd be very excited if that happened.

On the other hand you can already use Opal to compile Ruby to JavaScript so that's a good option too I guess.

Doctor w-rw-rw-
Jun 24, 2008

n4 posted:

Ever since I've started learning Swift I wish everyday JavaScript could just be swapped out for Swift entirely. So I'd be very excited if that happened.

While that would indeed be glorious, React's popularity makes a syntax for inline component hierarchy definition a prerequisite for that. I think Apple (and others) underestimate the value in doing so.

Also, speculation - I bet if webassembly becomes a thing, we'll be seeing any number of languages finally able to script the browser. I imagine writing Swift for client-side web could be feasible in two to four years.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

quote:

Shift.JS is an open source Swift to JavaScript transpiler written in JavaScript. Full documentation can be found at shiftjs.com.

quote:

written in JavaScript.

quote:

in JavaScript.

Like it's even doing its own loving tokenization + AST generation.

Jesus Christ.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer
The Swift compiler is right loving there guys what are you doing.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



ultramiraculous posted:

The Swift compiler is right loving there guys what are you doing.

They're getting closer to the metal.

n4
Jul 26, 2001

Poor Chu-Chu : (
ES6 should just be Swift / we just need a Babel-Swift plugin for webpack. Then I can realize my fantasy of writing Swift React code.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Doctor w-rw-rw- posted:

While that would indeed be glorious, React's popularity makes a syntax for inline component hierarchy definition a prerequisite for that. I think Apple (and others) underestimate the value in doing so.

Maybe I'm misunderstanding what "a syntax for inline component hierarchy definition" is, but why don't Swift enums fit that bill?

Why do you think people are underestimating the value of a syntax for inline component hierarchy definition?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Yeah, it's been a while since I last looked at ComponentKit, but I'm pretty sure a Swift enum with defaults for the associated values is exactly what it wants.

Doctor w-rw-rw-
Jun 24, 2008

pokeyman posted:

Maybe I'm misunderstanding what "a syntax for inline component hierarchy definition" is, but why don't Swift enums fit that bill?
Am I missing something? Enums can't be subclassed, and enums can't have arrays for default values. Not to mention that components can still be kind of stateful in some corner cases. I can't envision it being cleaner than Objective-C (with the C++ part for cleaner inline syntax).

pokeyman posted:

Why do you think people are underestimating the value of a syntax for inline component hierarchy definition?

Andy Matuschak, ex-Apple (UIKit) posted:

Q: What effect do you think Swift will have on Apple’s framework APIs? Do you expect something here in the short term?
A: I don’t actually have insider knowledge here, so this is just speculation, but I think it will be a long process. At least when I was there, the teams spent the majority of their time not maintaining and improving frameworks, but really supporting market features like new screen sizes or support for new hardware. That’s what takes most of the time. So it will take a conscious decision to do anything non-trivial, and I don’t see that forthcoming.
It sounds to me like Apple teams (aside from devtools/compilers) struggle to push software meaningfully forward in a way other than line items in a slide on Apple's next hardware unveiling. Even if an engineer wanted to support a dramatically different but proven model for building UIs, they'd face a lot of institutional pressure against it. Some ex-Apple engineers I've talked to have expressed similar disappointments, though to be fair, them being ex-Apple, the likelihood of that is higher.

For others, I imagine it's lack of experience with the ideas, association with Javascript (though inline XML has been a thing in PHP for longer than it has in JS, and Scala does it too), and overinvestment in the wrong technology (i.e. autolayout).

Doctor w-rw-rw- fucked around with this message at 06:19 on May 13, 2016

chaosbreather
Dec 9, 2001

Wry and wise,
but also very sexual.

In a perfect world Swift would compile to WebAssembly, which could be shimmed with asm.js.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Doctor w-rw-rw- posted:

Am I missing something? Enums can't be subclassed, and enums can't have arrays for default values. Not to mention that components can still be kind of stateful in some corner cases. I can't envision it being cleaner than Objective-C (with the C++ part for cleaner inline syntax).

No, they can't be subclassed, but I figured one could deal with that using protocols. I don't know ComponentKit beyond page one of the tutorial though so I'm probably wrong about its suitability in Swift. And sure, without the syntax dickery possible in newer C++ it probably wouldn't be cleaner in Swift, but I bet you could get close.

quote:

It sounds to me like Apple teams (aside from devtools/compilers) struggle to push software meaningfully forward in a way other than line items in a slide on Apple's next hardware unveiling. Even if an engineer wanted to support a dramatically different but proven model for building UIs, they'd face a lot of institutional pressure against it. Some ex-Apple engineers I've talked to have expressed similar disappointments, though to be fair, them being ex-Apple, the likelihood of that is higher.

For others, I imagine it's lack of experience with the ideas, association with Javascript (though inline XML has been a thing in PHP for longer than it has in JS, and Scala does it too), and overinvestment in the wrong technology (i.e. autolayout).

Neither JS nor PHP have XML literals though? I'm not really sure what your point is here, with that or with the grousing about Apple dev teams' management. What part of ComponentKit, or React, or whatever is fundamentally untenable in Swift today?

Doctor w-rw-rw-
Jun 24, 2008

pokeyman posted:

Neither JS nor PHP have XML literals though? I'm not really sure what your point is here, with that or with the grousing about Apple dev teams' management. What part of ComponentKit, or React, or whatever is fundamentally untenable in Swift today?
XHP and JSX. The difference is that a complete component instantiation can get very deeply nested and full of parameters, so lack of a clean syntax throws readability down the drain pretty quickly.

My Apple grousing was out of line. I feel frustrated at Apple because there are a couple of chasms they could cross, technologically speaking, but aren't. But they did with Swift, so...argh.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer
XHP and JSX are both preprocessor steps, though? That's kind of the opposite of a language feature. If Facebook really wanted to they could do the same thing in Swift, or even ObjC++, with an LLVM plugin to do source code transformation.

Kallikrates
Jul 7, 2002
Pro Lurker
Or maybe at a higher level with swift gyb.

Doctor w-rw-rw-
Jun 24, 2008
FYI

http://thread.gmane.org/gmane.comp.lang.swift.evolution/17276

Chris Lattner posted:

That said, it is also clear at this point that some of the loftier goals that we started out with aren’t
going to fit into the release - including some of the most important generics features needed in order to
lock down the ABI of the standard library. As such, the generics and ABI stability goals will roll into a
future release of Swift, where I expect them to be the *highest* priority features to get done.

tl;dr: still gonna have to include the Swift runtime for a couple of years yet

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
You would have anyway unless you've got a really aggressive deployment target.

Kallikrates
Jul 7, 2002
Pro Lurker
I'd favor correctness / thoroughness (is that a thing with ABI?) and stability over a rush job. Plus still going to be targeting ios9 for awhile.

Flobbster
Feb 17, 2005

"Cadet Kirk, after the way you cheated on the Kobayashi Maru test I oughta punch you in tha face!"
Yeah, there's still a TON of stuff in the Generics Manifesto that needs to get done and would certainly have big impacts on the ABI. I'm glad they're not rushing it.

Doctor w-rw-rw-
Jun 24, 2008

rjmccall posted:

You would have anyway unless you've got a really aggressive deployment target.

Yes, of course. It just means another hypothetical year of waiting for shops that do current minus N iOS versions (or wait for % adoption to fall a sufficient amount based on that), in order to reduce app size.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

rjmccall posted:

All of these questions are somewhat tied together. The interesting thing about that protocol is that it's (almost) exactly the right protocol for changing the bridging of an arbitrary C type, not just ObjC classes, and that's a pretty useful thing to consider having. It's just that there are other important questions about bridging that we have to resolve first — for example, do we need to design bridging protocols to fit into the dynamic-cast system, or are we going to just remove all of that and make dynamic cast only respect natural subtyping? And should we separate both directions of mapping?

Oh yes, it totally makes sense for Swift as an open source project. It just sucks for me personally because now I have to write a lot more glue code. Not the end of the world by any stretch.

emoji
Jun 4, 2004

Doctor w-rw-rw- posted:

Yes, of course. It just means another hypothetical year of waiting for shops that do current minus N iOS versions (or wait for % adoption to fall a sufficient amount based on that), in order to reduce app size.

I'm sure Facebook is 123mb and Yelp is 74mb because of swift dylibs....

Doctor w-rw-rw-
Jun 24, 2008

emoji posted:

I'm sure Facebook is 123mb and Yelp is 74mb because of swift dylibs....

I know what you're trying to say but you're kind of correct, except the opposite of that.

n4
Jul 26, 2001

Poor Chu-Chu : (
Does Swift have tail-call optimization? Googling gives conflicting answers.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
It will sometimes do tail calls; it does not promise to do so.

sarehu
Apr 20, 2007

(call/cc call/cc)
So what's the point of sizeof being wrong and strideof being sizeof?

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
The size is the amount of memory it takes to store the type, and the stride is the distance between two values of the type in an array. C defines those the same way, but we don't, and the term applies better to the first.

sarehu
Apr 20, 2007

(call/cc call/cc)

rjmccall posted:

The size is the amount of memory it takes to store the type, and the stride is the distance between two values of the type in an array. C defines those the same way, but we don't, and the term applies better to the first.

I know what they do... what is the point of having sizeof as defined in Swift exposed to the user? Just to pack stuff a bit more tightly?

sarehu fucked around with this message at 21:23 on May 23, 2016

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
Neither of them is something users generally need to be using directly, but if you're going to hand-roll memory layout for some reason, you need both to get optimal packing / reproduce Swift's results.

Also, sizeof(T) is the amount of memory you're allowed to touch given an arbitrary pointer to a T; strideof(T) may affect adjacent values depending on what the pointer is to.

Adbot
ADBOT LOVES YOU

sarehu
Apr 20, 2007

(call/cc call/cc)

rjmccall posted:

Also, sizeof(T) is the amount of memory you're allowed to touch given an arbitrary pointer to a T; strideof(T) may affect adjacent values depending on what the pointer is to.

Okay on that note I'll retract calling sizeof(T) "wrong." On the other hand if you're optimizing struct packing like this, sizeof(Int) could stand to be 4 bytes to save some cache line space...

  • Locked thread