Live data from Hacker News

JavaScript as an alternative to AppleScript on OS X Yosemite

developer.apple.com

91–100 of 126 posts

Re: JavaScript as an alternative to AppleScript on OS X Yosemite

#91

Oh Javascript. This has been said so many times before, but why, oh why, has the world converged on this particular language? Why aren't there saner alternatives to Javascript in browsers? We have so many languages at our disposal, why choose Javascript? Why don't people realize that web programming is not great because of Javascript but despite Javascript? We are bound to Javascript on the web because browsers, for…

JavaScript isn't that bad. It certainly has it's faults but there are much worse languages that could have become ubiquitous than JavaScript.

Honestly, I find web programming to be generally terrible. JavaScript is actually one of the better parts of it.

Most of the time I work in C++ these days though.

Re: JavaScript as an alternative to AppleScript on OS X Yosemite

#92

so, I'm a little confused here - more than a year ago, the Gnome Project picked Javascript as its primary dev language and it was linked here on HN ( https://news.ycombinator.com/item?id=5169599 ) That entire thread is around how Javascript is a bad paradigm for desktop. But, this entire thread is how amazing javascript is going to be for OSX. Let me add that the JS programming model of Gnome is what powers http://ex…

They're very different use cases.

Applescript is used for automation of already existing applications which will still be written in C++ or Objective C. Applescript, a proprietary language with no other uses, is just being replaced by a much more common language in Javascript so people won't need to learn a new one to automate apps. People don't generally write applications using Applescript and they probably won't be using Javascript, so there's little overlap.

In GNOME Javascript is being used to write the applications in the first place. There is total overlap between Javascript and C/C++.

People see the GNOME choice as both redundant and reducing performance of desktop apps while people see the Apple choice as simply using a common language instead of a proprietary one for scripting.

Re: JavaScript as an alternative to AppleScript on OS X Yosemite

#94
As an aside: if you want to use JS /today/ as an OSX Window Manager (hotkeys, resizing, switch screen etc), you should check out: https://github.com/sdegutis/Phoenix

I've been using it for a couple of months now, and it's been glorious! So being able to do more things in JS makes me very excited.

Re: JavaScript as an alternative to AppleScript on OS X Yosemite

#96
post #62

Earlier quoted context omitted.

is this going to be solved by writing it in javascript though? Looking at the sample code in this page: Mail.outgoingMessages.whose({subject:'JavaScript'}) is doesn't look much better.

This is about as simple as an API goes. What did you expect to see exactly? doWhatImThinking();

It's not ease of use I'm talking about, I was referring to API discoverability/ease of finding what you need.

Since the javascript code looks isomorphic to

   outgoing messages whose subject is "JavaScript"
I'd think that the issue is not mitigated by a different syntax.

Re: JavaScript as an alternative to AppleScript on OS X Yosemite

#97
This means I may actually start scripting apps again. Applescript is a bit of a mess, at least I'm experienced with Javascript.

I wonder if this will imply (significantly) better debugging tools? Like a way to debug a javascript-script in Safari, sorta like iOS webviews?

Re: JavaScript as an alternative to AppleScript on OS X Yosemite

#98

Earlier quoted context omitted.

You show them AppleScript and SQL and they say "Wow, what was I thinking, english is a terrible basis for a programming language."

SQL is fantastic for relational data - it maps pretty closely to relational algebra. About all I'd change is placing the column names after the table/object names - "FROM table1 SELECT col1, col2" instead of "SELECT col1, col2 FROM table" because it makes code assist features easier. (Microsoft did this with LINQ)

I guess the reasoning for the 'SELECT ... FROM' is that the FROM part is optional, for example you can do stuff like 'SELECT 40+2 AS the_answer' .

Re: JavaScript as an alternative to AppleScript on OS X Yosemite

#99

so, I'm a little confused here - more than a year ago, the Gnome Project picked Javascript as its primary dev language and it was linked here on HN ( https://news.ycombinator.com/item?id=5169599 ) That entire thread is around how Javascript is a bad paradigm for desktop. But, this entire thread is how amazing javascript is going to be for OSX. Let me add that the JS programming model of Gnome is what powers http://ex…

They're very different use cases. Applescript is used for automation of already existing applications which will still be written in C++ or Objective C. Applescript, a proprietary language with no other uses, is just being replaced by a much more common language in Javascript so people won't need to learn a new one to automate apps. People don't generally write applications using Applescript and they probably won't b…

not entirely true. Gnome has a first class language - Vala [1] - that is for writing performant system level applications. And the community is quite active as well - https://github.com/trending?l=vala

If you think of automation, there have been attempts at bringing flow based programming to the Gnome-JS engine (think of it as Quartz Composer integrated into the desktop) [3] - plus the fact that http://extensions.gnome.org is about as automatic as you can get to customize the desktop.

Is it a difference in positioning ? Because honestly I'm a little befuddled on why all the developers on HN get supremely excited about JS on OSX... and not something like NoFlo.js integrated into Gnome.

[1] https://github.com/GNOME/vala [2] http://lethalman.hostei.com/maja/index.html [3] http://bergie.iki.fi/blog/noflo-and-gnome/

Re: JavaScript as an alternative to AppleScript on OS X Yosemite

#100
post #43

I love AppleScript because whenever somebody asks, "Why don't they make programming languages more like English?" all you need to do is show them AppleScript. The functionality exposed by OSX apps via AppleScript is often incredible, but the language itself is annoying. The question is whether or not applications will support it. With the emphasis shifting away from OSX desktop applications to cross-platform and clou…

> I love AppleScript because whenever somebody asks, "Why don't they make programming languages more like English?" all you need to do is show them AppleScript. Yup :-) AppleScript has an interesting history, it used to support multiple "natural languages" (such as French, ...) in addition to English: http://www.cs.utexas.edu/~wcook/Drafts/2006/ashopl.pdf (This is probably why many AppleScript Guides still say "Engli…

Wow! That dissertation is so interesting.
Post reply on HN