Live data from Hacker News

Apple's new Objective-C to Javascript Bridge

steamclock.com

91–100 of 110 posts

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

#91
post #89
post #6

Earlier quoted context omitted.

Functionally, this appears to be identical to JavaScriptCore's longstanding C bridge [1]. If Objective-C isn't your preference, there's nothing stopping you from calling into the C bridge from C++ or just plain C. On iOS, developers have had to compile their own version of JavaScriptCore to use this API. That's the basis for HTML5 game engines like Impact [2], and some HTML5-to-Objective-C middleware platforms. Unfor…

You should be able to to run code downloaded as part of IAP also. But this is one of the major things I wish they would change, and also one of the major reasons I'll be switching to Android.

Which is what I meant by "within the bundle of your app." That may have been a bit too iOS developer-centric, I apologize.

In Foundation, [NSBundle mainBundle] returns a reference to an object representing your application's root directory, and the code and resources found within. Roughly the same bits that you'd find within an unpacked IAP file.

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

#92

> 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…

Personally, I'm developing a fairly advanced web app. Since I'm the only developer, I can't afford to split my time between web, iOS and android development. If a JavaScript bridge allows me to reuse all the logic from my web app, but replace the UI with a snappier native one, that would save me a buttload of time.

Maybe Apple out of the goodness in their heart decided to make this easier, but I'm skeptical.

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

#93
post #81

Earlier quoted context omitted.

Closures + Lexical Scoping + Prototypical Inheritance makes for a pretty great language IMHO.

And the global object nonsense alone is enough to make it suck. Throw in the lack of an integer type, the curious `for each' statement, and the oddities surrounding `this', and it really starts to feel like this is the sort of language that over time is going to cause you a lot of heartache. It makes me sad - seriously, do people not expect better from their tools? The maddening thing is that Javascript could so easi…

I was under the impression that javascript's strict mode already does this?

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

#94
post #32
post #26

Earlier quoted context omitted.

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…

I actually like Javascript. Sure it has some warts. But it has an elegance I've really only seen in Javascript, Lua, and Lisp.

If Javascript had a saner type system, better scoping, and a decent module system, it would easily be the best language out there. Right now, it is a diamond covered in loads of poop.

I still haven't found a language that implements events as elegantly as Javascript.

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

#95
post #48
post #44

Earlier quoted context omitted.

Those things are indeed nice, but they can't defend against the other insanities that come in the box with them.

Only a subset of Javascript is useful, just like how only a subset of C++ is useful, just like how only a subset of Objective-C is useful, just like how only a subset of Haskell is useful, ...

Wasn't there a saying: "90% of everything is crap"?

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

#96
post #86
post #39

Earlier quoted context omitted.

Enough to not want to do any more.

I take that as a "no." I grew up as a programmer through C++ and Java, and the first time I ever worked on a JavaScript project, I hated it, and I said the same thing about JavaScript as you did. That's because I was thinking like a Java programmer, and not just a programmer. As I worked more and more with JavaScript, I've grown to love. It has it's pitfalls, sure, but there's just so much flexibility in JavaScript t…

I don't write Java or C++.

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

#97
post #86
post #39

Earlier quoted context omitted.

Enough to not want to do any more.

I take that as a "no." I grew up as a programmer through C++ and Java, and the first time I ever worked on a JavaScript project, I hated it, and I said the same thing about JavaScript as you did. That's because I was thinking like a Java programmer, and not just a programmer. As I worked more and more with JavaScript, I've grown to love. It has it's pitfalls, sure, but there's just so much flexibility in JavaScript t…

It is advisable to taboo your practice of taking any thing X that differs from your viewpoint as a "no".

It is also advisable to taboo projecting your own experience/thoughts onto another, as if that is his/her experience/thoughts, as well.

That you love JavaScript, even for server-side programming, has absolutely zero significance in evaluating whether jfb (or anyone else, for that matter) knows enough to know what s/he is missing.

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

#98
post #86

Earlier quoted context omitted.

I take that as a "no." I grew up as a programmer through C++ and Java, and the first time I ever worked on a JavaScript project, I hated it, and I said the same thing about JavaScript as you did. That's because I was thinking like a Java programmer, and not just a programmer. As I worked more and more with JavaScript, I've grown to love. It has it's pitfalls, sure, but there's just so much flexibility in JavaScript t…

It is advisable to taboo your practice of taking any thing X that differs from your viewpoint as a "no". It is also advisable to taboo projecting your own experience/thoughts onto another, as if that is his/her experience/thoughts, as well. That you love JavaScript, even for server-side programming, has absolutely zero significance in evaluating whether jfb (or anyone else, for that matter) knows enough to know what…

> It is advisable to taboo your practice of taking any thing X that differs from your viewpoint as a "no".

> It is also advisable to taboo projecting your own experience/thoughts onto another, as if that is his/her experience/thoughts, as well.

I disagree with that take. Personal experiences can lend themselves to evaluating context. Humans do it all the time.

If one is going to make an argument that something is "silly", and provides barley more than nil context to that argument ("enough to know"), then a context vacuum exists. If the OP isn't going to provide it, then someone else will.

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

#99
post #96
post #86

Earlier quoted context omitted.

I take that as a "no." I grew up as a programmer through C++ and Java, and the first time I ever worked on a JavaScript project, I hated it, and I said the same thing about JavaScript as you did. That's because I was thinking like a Java programmer, and not just a programmer. As I worked more and more with JavaScript, I've grown to love. It has it's pitfalls, sure, but there's just so much flexibility in JavaScript t…

I don't write Java or C++.

[deleted]

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

#100

> 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…

> Why JavaScript?

Because websites (and thus JavaScript, in some form) are the future of programming at this point in time. JavaScript just happens to be the primary programming language for interacting with HTML5 and a lot of people happen to know it pretty well.

Plus, JavaScript is not a terrible language but it does take a lot of knowledge to work with it cross-browser and use browser APIs (these browser APIs tend to suck).

Post reply on HN