Live data from Hacker News

JavaScript as an alternative to AppleScript on OS X Yosemite

developer.apple.com

41–50 of 126 posts

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

#41

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…

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 pretty damn simple.

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

#42
post #33

Earlier quoted context omitted.

Could not have happened to a better language! It's about time Javascript finally has its chance to shine.

That's the whole point, it could've happened to a much better language.

Really? I don't see anything particularly wrong with Javascript... I mean, sure it's no PHP, but compared to travesties like Lua (1-based, seriously? What year is it again?) and bloated, convoluted semantic messes like Python and Ruby... well there aren't many choices left!

Google, Mozilla, Microsoft, and Opera (and obviously Apple) haven't exactly been jumping at the opportunity to deprecate Javascript in or out of the web. I mean hell, now we have technologies like Node and asm.js that make Javascript the fastest dynamic language in existence! People are even using it in embedded hardware now! So it can't be nearly as bad as people say.

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

#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 "English Dialect" on the first page, e.g. http://download.info.apple.com/Apple_Support_Area/Manuals/se... )

Here's a Dijkstra rant from '77 against natural language programming: http://www.cs.utexas.edu/~EWD/transcriptions/EWD06xx/EWD667....

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

#44

A lot of people in this thread have misconceptions about what AppleScript is and what it means for JavaScript to be an alternative. I recommend watching the WWDC session [1] if you can, and skip to 16 minutes in (through minute 20) for a quick explanation of what this actually is. TL;DR shell scripting for the GUI, not a way to build Mac applications (which you can already do with JS). Edit: video link Double edit: L…

What video?

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

#45
post #42

Earlier quoted context omitted.

That's the whole point, it could've happened to a much better language.

Really? I don't see anything particularly wrong with Javascript... I mean, sure it's no PHP, but compared to travesties like Lua (1-based, seriously? What year is it again?) and bloated, convoluted semantic messes like Python and Ruby... well there aren't many choices left! Google, Mozilla, Microsoft, and Opera (and obviously Apple) haven't exactly been jumping at the opportunity to deprecate Javascript in or out of…

> I mean, sure it's no PHP

Yup, we're getting trolled...

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

#46

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…

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)

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

#47
post #44

A lot of people in this thread have misconceptions about what AppleScript is and what it means for JavaScript to be an alternative. I recommend watching the WWDC session [1] if you can, and skip to 16 minutes in (through minute 20) for a quick explanation of what this actually is. TL;DR shell scripting for the GUI, not a way to build Mac applications (which you can already do with JS). Edit: video link Double edit: L…

What video?

306 - JavaScript for Automation

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

#49
post #3

This makes me really happy. I kind've wish they'd used $ for what Application() is, though, to keep an analogous similarity with jQuery and the like.

Could there be any reasonable situation where one might want to load jQuery within this environment, though? (Although, I suppose, you could use another var for jQuery, such as, uh, 'jQuery' ...)

jQuery is a DOM manipulation library, it is not useful to script OS X apps.

...unless one of them exposes a HTML DOM to the scripting layer, now that I think of it.

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

#50
post #41

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 pretty damn simple.

Why are there no production-quality implementations of the newest standard then?
Post reply on HN