> What language could I write a script in (no graphics, simply text in, text out) that would run on all the computers used by Friam folks? Javascript! ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org |
Administrator
|
On Dec 27, 2008, at 4:04 PM, Marcus G. Daniels wrote:
> >> What language could I write a script in (no graphics, simply text >> in, text out) that would run on all the computers used by Friam >> folks? > > Javascript! Well, it is certainly lurking on all of our systems that have a browser, that's for sure! But if I just send folks a javascript file, how are they to execute it, and how are they to specify stdin/out? I really am serious here: I'd like to know which scripting language and runtime is reasonably likely to be on our systems. Its pretty grim if there's not a reasonable answer! The specific stunt I'm looking at takes a text file in, and converts it to morse code. Also the reverse, take in morse code and translate it to ascii. Dead simple and kinda fun. But to share it with others, I'd like a script that could work on most systems. -- Owen ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org |
JavaScript sure seems like a simple solution. Here's a primitive version of one possibility.
<html> <head> <script> function transform(input) { output.value = "transformed version of:\n" + input; } </script> </head> <body> Copy the text to be translated into this text area and press "Go". <br /> <textarea id = "input" cols = 100></textarea> <input type=button value="Go" onclick="transform(document.getElementById('input').value);" /> <br /> <textarea id = "output" cols = 100></textarea> </body> </html> -- Russ On Sat, Dec 27, 2008 at 5:59 PM, Owen Densmore <[hidden email]> wrote: On Dec 27, 2008, at 4:04 PM, Marcus G. Daniels wrote: ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org |
Administrator
|
I *like* it! Probably the most universal, and can even be run
locally. Possibly even as a bookmarklet. And luckily for all of us, the DOM standards let javascript access user input in a fairly elegant way. BUT: the pipe paradigm of unix shells allows you to have the input be a file and the output to be piped into a file or another program. Our browser approach only lets us use literal text in and out. No big deal, but I wonder if there's a hack to get directly at the javascript language within the browser, and to use it like a command line command. I think, however, your answer is likely the winner. -- Owen On Dec 27, 2008, at 8:01 PM, Russ Abbott wrote: > JavaScript sure seems like a simple solution. Here's a primitive > version of > one possibility. > > <html> > <head> > <script> > function transform(input) { > output.value = "transformed version of:\n" + input; > } > </script> > </head> > <body> > Copy the text to be translated into this text area and press "Go". > <br /> > <textarea id = "input" cols = 100></textarea> > <input type=button value="Go" > onclick="transform(document.getElementById('input').value);" /> > <br /> > <textarea id = "output" cols = 100></textarea> > </body> > </html> > > -- Russ > > > On Sat, Dec 27, 2008 at 5:59 PM, Owen Densmore <[hidden email]> > wrote: > >> On Dec 27, 2008, at 4:04 PM, Marcus G. Daniels wrote: >> >>> >>> What language could I write a script in (no graphics, simply text >>> in, >>>> text out) that would run on all the computers used by Friam folks? >>>> >>> >>> Javascript! >>> >> >> Well, it is certainly lurking on all of our systems that have a >> browser, >> that's for sure! But if I just send folks a javascript file, how >> are they >> to execute it, and how are they to specify stdin/out? >> >> I really am serious here: I'd like to know which scripting language >> and >> runtime is reasonably likely to be on our systems. Its pretty grim >> if >> there's not a reasonable answer! >> >> The specific stunt I'm looking at takes a text file in, and >> converts it to >> morse code. Also the reverse, take in morse code and translate it >> to ascii. >> Dead simple and kinda fun. But to share it with others, I'd like a >> script >> that could work on most systems. >> >> -- Owen >> >> >> ============================================================ >> FRIAM Applied Complexity Group listserv >> Meets Fridays 9a-11:30 at cafe at St. John's College >> lectures, archives, unsubscribe, maps at http://www.friam.org >> > ============================================================ > FRIAM Applied Complexity Group listserv > Meets Fridays 9a-11:30 at cafe at St. John's College > lectures, archives, unsubscribe, maps at http://www.friam.org ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org |
Before sending that script I looked for a way for JavaScript to access the local file system. I couldn't find one. Sorry. But that doesn't mean there isn't one.
-- Russ On Sat, Dec 27, 2008 at 7:53 PM, Owen Densmore <[hidden email]> wrote: I *like* it! Probably the most universal, and can even be run locally. Possibly even as a bookmarklet. And luckily for all of us, the DOM standards let javascript access user input in a fairly elegant way. ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org |
An interesting feature of this thread is that at first I thought you were after "the best" scripting language or something like that. When I finally understood that what you wanted really was the most widely accessible scripting language, the question took on a completely different meaning. It changed from being a discussion of scripting languages as such to the more practical question of how to distribute some functionality as widely and effortlessly as possible.
-- Russ On Sat, Dec 27, 2008 at 8:04 PM, Russ Abbott <[hidden email]> wrote: Before sending that script I looked for a way for JavaScript to access the local file system. I couldn't find one. Sorry. But that doesn't mean there isn't one. ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org |
In reply to this post by Owen Densmore
Owen Densmore wrote:
> BUT: the pipe paradigm of unix shells allows you to have the input be > a file and the output to be piped into a file or another program. The browser can be used as a hierarchical blackboard (the DOM) between a producer and a consumer while JavaScript 1.7's `yield' can switch back and forth between threads of control (like a pipe). Further, http and xml can be used to read and write objects in favor of flat files. https://developer.mozilla.org/en/New_in_JavaScript_1.7 http://en.wikipedia.org/wiki/XMLHttpRequest ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org |
In reply to this post by Russ Abbott
There is still the issue of Javascript implementation portability. You can't count on each vendor adhering to standards. If you are lucky, the code that you want to implement will run on all browsers. Worst case, you will have to sniff the OS & browser and branch accordingly. It is a lot more work, which is why you still see sites advertising "IE Explorer only". Like my company, for example. The time entry system breaks with Firefox, only works with IE. Once the maintainers of that system realized this, they put browser sniffers in which would warn the user that only IE would work. At least they didn't put in blocking code.
--Doug On Sat, Dec 27, 2008 at 9:12 PM, Russ Abbott <[hidden email]> wrote: An interesting feature of this thread is that at first I thought you were after "the best" scripting language or something like that. When I finally understood that what you wanted really was the most widely accessible scripting language, the question took on a completely different meaning. It changed from being a discussion of scripting languages as such to the more practical question of how to distribute some functionality as widely and effortlessly as possible. ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org |
Administrator
|
In reply to this post by Marcus G. Daniels
Russ, Marcus: Thanks for yet another push for me hussle javascript a
bit more. This is a good reminder as to why javascript is so cool: https://developer.mozilla.org/en/A_re-introduction_to_JavaScript I found a great book as well: "Javascript, the Good Parts" .. here's video from the author: http://video.yahoo.com/watch/630959/2974197 He's great at leading us beyond the pitfalls of js. -- Owen On Dec 27, 2008, at 9:20 PM, Marcus G. Daniels wrote: > Owen Densmore wrote: >> BUT: the pipe paradigm of unix shells allows you to have the input >> be a file and the output to be piped into a file or another program. > The browser can be used as a hierarchical blackboard (the DOM) > between a producer and a consumer while JavaScript 1.7's `yield' can > switch back and forth between threads of control (like a pipe). > Further, http and xml can be used to read and write objects in favor > of flat files. > > https://developer.mozilla.org/en/New_in_JavaScript_1.7 > http://en.wikipedia.org/wiki/XMLHttpRequest > > ============================================================ > FRIAM Applied Complexity Group listserv > Meets Fridays 9a-11:30 at cafe at St. John's College > lectures, archives, unsubscribe, maps at http://www.friam.org ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org |
I'll pitch in:
I have (but don't necessarily use): DOS 7 (with default command line enhancements it's actually useful) Kixtart Auto-Hotkey PHP NetLogo Javascript VB_ Lotus 1-2-3 macro language Q-Basic I have actually used netlogo for certain simple text-massaging problems--not the best, but easy and handy and I don't know perl. I vote for javascript... it seems that your script is not going to be doing anything that should bump up against a cross-platform issue... It's just text input, processing, text-output... what could be simpler? For any of the tricky (e.g. display, event, css box model) platform quirty stuff, use a framework like jQuery. ~~James ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org |
Administrator
|
On Dec 29, 2008, at 11:03 AM, James Steiner wrote:
> <snip> > I vote for javascript... it seems that your script is not going to be > doing anything that should bump up against a cross-platform issue... > It's just text input, processing, text-output... what could be > simpler? For any of the tricky (e.g. display, event, css box model) > platform quirty stuff, use a framework like jQuery. I'm glad I asked the question. Clearly javascript is the most ubiquitous script language, although hidden within the browser. So the browser replaces the command-line! That has the advantage of coming with a window system as well, which python, perl, ruby, .. lack unless they use the "J" versions (jython, jruby, ..) which can use Java's window system and UI toolkits. I have to say this is a surprise but obvious enough once you really consider the alternatives. I'm wondering if this really means we might as well use a hosting service or cloud system to deliver all our programs at this point. I mean its nice that you can download Russ's nifty stunt and run it locally, but would most folks prefer the web hosted solution to start with? That has the additional advantage that you can use any scripting language you'd like: Java (Either servlets or applets), Python, PHP etc .. all on the server. So from a simple scripting question we arrive at the observation that your computer is pretty useless for sharing even the simplest programs, so might as well use the browser, and just as easily, a hosted solution with all the languages you'd like. Sneaky! -- Owen PS: Steve -- This does prove the deployment problem is real and the web solution best. ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org |
Great point, Owen. Perhaps we are too old to have thought of that initially. But now that you mention it, posting your app/document/service/code/etc. is almost certainly the way to go. That's where we are all coming to live anyway. Will any future system survive if it isn't web accessible and available from anywhere? Probably not. I rarely attach my papers to messages any more. I post them on a wiki and link to them. So that's the solution. Expect that anyone will be able to access your offering as long as it's web accessible from a standard browser.
-- Russ On Mon, Dec 29, 2008 at 10:53 AM, Owen Densmore <[hidden email]> wrote: On Dec 29, 2008, at 11:03 AM, James Steiner wrote: ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org |
When I was facing a similar problem--sharing a platform neutral
program--I also turned to Javascript. In my case, we wanted a lottery number picker that could be projected from anyone's laptop during a meeting. I created a single-file HTML/Javascript application (attached) that could be simply opened from the filesystem in any browser. Normally I would put the Javascript and CSS is separate files, but it's all embedded in HTML to make the whole thing self-contained. > On Mon, Dec 29, 2008 at 10:53 AM, Owen Densmore <[hidden email]> wrote: >> On Dec 29, 2008, at 11:03 AM, James Steiner wrote: >>> I vote for javascript... it seems that your script is not going to be >>> doing anything that should bump up against a cross-platform issue... >>> It's just text input, processing, text-output... what could be >>> simpler? For any of the tricky (e.g. display, event, css box model) >>> platform quirty stuff, use a framework like jQuery. >> >> I'm glad I asked the question. Clearly javascript is the most ubiquitous >> script language, although hidden within the browser. ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org lottery.html (5K) Download Attachment |
In reply to this post by Marcus G. Daniels
For universal browser implementation one may have to check what DOM is available: getElementById and others used may not always be available. From a discussion on browser sniffing (bad) and what to do about it at: http://jibbering.com/faq/faq_notes/not_browser_detect.html#bdFD Beware of "the assumption that the browser has a fully dynamic DOM with methods such as document.createElement , replaceChild and appendChild . Browsers do not live up to that expectation, some are not that dynamic and while they may implement some of the Core DOM level 1 methods such as getElementById They do not necessarily implement large parts of the various DOM standards, including all of the dynamic Node manipulation methods."Robert C -----Original Message----- ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org |
[hidden email] wrote:
> Beware of "the assumption that the browser has a fully dynamic DOM > with methods such > as |document.createElement|, |replaceChild| and |appendChild|. > Browsers do not live up to that expectation, some are not that dynamic > and while they may implement some of the Core DOM level 1 methods such > as |getElementById| They do not necessarily implement large parts of > the various DOM standards, including all of the > dynamic |Node| manipulation methods." > Well, Firefox does, Safari does, and reasonably recent version of IE do. The only way to force others to repent (or go away quietly) is for everyone to start using the latest and greatest web standards. Not talking DOM here, I'm mean SVG, Canvas, video tags, high performance JavaScript, and the things that can make the web a decent application platform. If people won't do that, then sooner or later Microsoft .NET will rule (and in this scenario they probably should). Marcus ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org |
Administrator
|
[I realize this is a bit OT because we were targeting desktop
scripting, but given the javascript solution, drifting into the "web" with both client and server side programming, I thought it would be OK to diverge a bit.] Well, if the Browser is the Computer, one of the issues I've run into is multiple languages: one on the server, and another on the browser. Java was popular because you could use the same language on both sides: servlets and applets. But there is yet another javascript rebirth going on: server-side javascript. John Guerin pointed this out to Steve and me while we were working with the Google App Engine, and I was kvetching about having to deal with javascript in the client (google maps, primarily) and python/django on the server. Jaxer is the critter that pulls off this magic. http://www.aptana.com/jaxer http://ejohn.org/blog/server-side-javascript-with-jaxer/ I've never liked most of the server-side solutions, they were just too ugly. Php for example was really designed as a "web shell", not a full featured language (IMHO). But Javascript is a nifty enough language that having on both sides of the wire is compelling. And Aptana is another alternative to Google App Engine and Amazon EC2, and considerably cheaper than the latter. I haven't used it yet, so would love to hear of other folks' experience with jaxer and server-side javascript. -- Owen ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org |
Owen Densmore wrote:
> Jaxer is the critter that pulls off this magic. > http://www.aptana.com/jaxer I see a copy of the Mozilla source tree is in their source distribution. That worries me a little. How many modifications have they had to make and maintain? But I think the idea is right on -- the Mozilla framework as an Apache plugin. Just change the `runat' attribute to say where you want the code to run. Great. Marcus ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org |
In reply to this post by Owen Densmore
if you like javascript - check out http://research.sun.com/lively/ morphic in javascript = flash, ajax, and more - full desktop app functionality in a Web browser without additional plugins since it is all available via javascript. dave west On Thu, 1 Jan 2009 17:03:54 -0700, "Owen Densmore" <[hidden email]> said: > [I realize this is a bit OT because we were targeting desktop > scripting, but given the javascript solution, drifting into the "web" > with both client and server side programming, I thought it would be OK > to diverge a bit.] > > Well, if the Browser is the Computer, one of the issues I've run into > is multiple languages: one on the server, and another on the browser. > Java was popular because you could use the same language on both > sides: servlets and applets. > > But there is yet another javascript rebirth going on: server-side > javascript. John Guerin pointed this out to Steve and me while we > were working with the Google App Engine, and I was kvetching about > having to deal with javascript in the client (google maps, primarily) > and python/django on the server. > > Jaxer is the critter that pulls off this magic. > http://www.aptana.com/jaxer > http://ejohn.org/blog/server-side-javascript-with-jaxer/ > I've never liked most of the server-side solutions, they were just too > ugly. Php for example was really designed as a "web shell", not a > full featured language (IMHO). But Javascript is a nifty enough > language that having on both sides of the wire is compelling. > > And Aptana is another alternative to Google App Engine and Amazon EC2, > and considerably cheaper than the latter. > > I haven't used it yet, so would love to hear of other folks' > experience with jaxer and server-side javascript. > > -- Owen > > > ============================================================ > FRIAM Applied Complexity Group listserv > Meets Fridays 9a-11:30 at cafe at St. John's College > lectures, archives, unsubscribe, maps at http://www.friam.org ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org |
Did you mean http://research.sun.com/projects/lively/ ?
-- Russ On Thu, Jan 1, 2009 at 4:53 PM, Prof David West <[hidden email]> wrote:
============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org |
Free forum by Nabble | Edit this page |