Live data from Hacker News

Apple's new Objective-C to Javascript Bridge

steamclock.com

61–70 of 110 posts

Re: Apple's new Objective-C to Javascript Bridge

#61

So with this marriage of Objective-C and JavaScript: How much longer until we can develop native applications without Objective-C entirely? A polygot/trans compiler for xcode would make me melt.

> How much longer until we can develop native applications without Objective-C entirely? You already can -- Lisp: Nu Ruby: MacRuby/RubyMotion Basic: Objective-Basic

Python: PyObjC

Lua: LuaCocoa, LuaWax, TLC

JavaScript: JSCocoa

Perl: CamelBones

More: http://cocoadev.com/wiki/CocoaBridges

Re: Apple's new Objective-C to Javascript Bridge

#62
This will probably be Mac-only. It will not appear on iOS unless Apple also ships BridgeSupport on iOS. BridgeSupport is needed for binding all the Obj-C parts that don't have introspection capabilities (like the C parts).

This is how most of the other full feature bridges work, PyObjC, RubyCocoa/MacRuby, LuaCocoa. Otherwise you are hamstrung anytime you need to deal with something like a C struct (e.g. NSPoint).

Re: Apple's new Objective-C to Javascript Bridge

#63

> The most interesting possiblility would be that this is the start of Apple’s evolution away from Objective-C into promoting a higher-level language for their platform The thing is: Why would they want to transform away? As it is now Obj-C is pretty sane. The memory management is now a non-brainer so that even people who come from managed languages can grasp it. GCD is great for concurrency. And using C and C++ base…

Probably the same reason Microsoft is also promoting C++ and JavaScript (both are utterly ugly when compared to C#/F#) for Windows 8 - to expand developer base.

Re: Apple's new Objective-C to Javascript Bridge

#64
post #42
post #40

Earlier quoted context omitted.

Wait, don't you remember Steve's original announcement about the great development opportunities on iPhone, where you could use HTML and Javascript? You won't be able to use undocumented APIs because you won't be able to get to them.

I was working on software for the phone at the time, so, yeah.

whoosh.

Re: Apple's new Objective-C to Javascript Bridge

#65
post #58
post #56

Earlier quoted context omitted.

Also, people at Apple like Objective-C and its Smalltalk influences. For those of us who've been in the NeXT/Apple ecosystem a long time, it's clear that employees at Apple see Ruby as more interesting than say Javascript because of the Smalltalk influences. If any shift were to occur, money is on Ruby. But Apple likes Objective-C and no shift seems likely and we also saw what happened with MacRuby and the author lea…

And they've invested a lot in the tooling and environment. It's not like they're just running a stock gcc toolchain; they've put a lot of very smart people on very hard problems in the language space.

Agreed. And another problem is that all these interpreted languages are terrible at exploiting parallelism which is a problem as we get more processor cores.

They were able to solve this in C by inventing Blocks and GCD.

Re: Apple's new Objective-C to Javascript Bridge

#67
post #26

> The most interesting possiblility would be that this is the start of Apple’s evolution away from Objective-C into promoting a higher-level language for their platform The thing is: Why would they want to transform away? As it is now Obj-C is pretty sane. The memory management is now a non-brainer so that even people who come from managed languages can grasp it. GCD is great for concurrency. And using C and C++ base…

Maybe I've just swallowed the Kool-Aid, but I don't see the putative benefits of Apple's switching platforms. I'm also not clear on how many people there are who a) can write non-trivial software and b) can't learn a C derivative language who c) would actually write software for Apple's platforms. It just seems like a pretty small set. And, if Apple were to switch, why would they pick a language as shitty as Javascri…

last time I check a) javascript is a c derivative language and b) it is used for "non-trivial software" c) there will be developers believe it or not that would be able to create maintainable apps that maybe won't be good enough to your standards but I have a small feeling the average consumer will not care, my advice: http://alwaysbetonjs.com/ Apple's on board

Re: Apple's new Objective-C to Javascript Bridge

#68

So with this marriage of Objective-C and JavaScript: How much longer until we can develop native applications without Objective-C entirely? A polygot/trans compiler for xcode would make me melt.

I don't understand the recurring drive people have for trying to write native applications without Objective-C. The various bridges and other glue projects never feel complete or as well-integrated with the system frameworks.

Re: Apple's new Objective-C to Javascript Bridge

#69
post #2

My guess is that this would be fast enough to build almost any Mac app and many iOS apps. The bigger question for me is, how gross would it be to deal with the "Objective-C-ness" of the Cocoa APIs through JavaScript?

That depends on the state of the bridge. Previous language bridges by Apple have generally bridged the gaps pretty well, with the main "Objective-C" relic being really, really long method names. That said, all of the bridges I've seen were to classical-OO languages. It is possible that Cocoa won't translate as well to prototypal-OO languages like JavaScript. It will be interesting to see how Apple navigates that para…

JSCocoa has been there, done that. They even have optional Objective-J support.

Re: Apple's new Objective-C to Javascript Bridge

#70
post #26

> The most interesting possiblility would be that this is the start of Apple’s evolution away from Objective-C into promoting a higher-level language for their platform The thing is: Why would they want to transform away? As it is now Obj-C is pretty sane. The memory management is now a non-brainer so that even people who come from managed languages can grasp it. GCD is great for concurrency. And using C and C++ base…

Maybe I've just swallowed the Kool-Aid, but I don't see the putative benefits of Apple's switching platforms. I'm also not clear on how many people there are who a) can write non-trivial software and b) can't learn a C derivative language who c) would actually write software for Apple's platforms. It just seems like a pretty small set. And, if Apple were to switch, why would they pick a language as shitty as Javascri…

> a) can write non-trivial software and b) can't learn a C derivative language who c) would actually write software for Apple's platforms. It just seems like a pretty small set.

Funny. I've sometimes similarly speculated in the past that the set of developers who (a) struggle with JavaScript as a tool for in-browser apps and (b) would actually be genuinely productive with some other dynamic scripting language (Ruby, Python, CoffeeScript) in the same context is pretty small too.

But the truth is probably that whether or not someone can develop non-trivial software with any roughly equivalent language is mostly a function of available time to ramp up vs spend on other things. So, sure, Obj C and JS are close enough that anybody who can develop non-trivial software in one can probably do it in the other... but it's still going to be a time investment while you learn how things are done in the language and various associated APIs.

I don't know if Apple particularly cares if they're pulling in more developers. If they do, though, adding another language that many developers already know makes sense. It reduces the friction involved.

> And, if Apple were to switch, why would they pick a language as shitty as Javascript?

On top of the widespread at-least-shallow familiarity, not everyone shares this opinion.

Also, this is unlikely to be a "switch." It's more likely to be a gateway.

Post reply on HN