HyperCard Mailing List

[HC] XTalk to JS translator
(Msg 1 of 12)
D <dannygelder@[redacted].com>
Tuesday, 12-Feb-2013 13:46 GMT
Hi,

Here is a more debugged version with a colorized and indenting xtalk editor.. It seems to basically work in Safari but I know there are issues with the text caret disappearing when deleting text in Firefox. Colorizing and indenting editable text on a web page is really hard, there's really no good way to do it!

It's still just a single HTML file so you can download and play with it.

http://thirdhandapp.com/xtalk/

Dan
[HC] XTalk to JS translator
(Msg 2 of 12)
Tom Fuerstner <i.script@[redacted].com>
Tuesday, 12-Feb-2013 16:38 GMT
Dan,

that's quite inspiring! Remember well, many years ago, when i read about
the HyperTalk interpreter and decided to learn about compiler design. Went
through all the dragon books and learnt an awful lot, with exactly the
right amount of fun ....

The javascript code you've delivered is such a cool starting point for
hyper-interesting explorations.

Thank you for that !

Tom

On Tue, Feb 12, 2013 at 2:46 PM, D <dannygelder@[redacted].com wrote:

> **
>
>
> Hi,
>
> Here is a more debugged version with a colorized and indenting xtalk
> editor. It seems to basically work in Safari but I know there are issues
> with the text caret disappearing when deleting text in Firefox. Colorizing
> and indenting editable text on a web page is really hard, there's really no
> good way to do it!
>
> It's still just a single HTML file so you can download and play with it.
>
> http://thirdhandapp.com/xtalk/
>
> Dan
>
>
>



--
Tom Fuerstner

-------

(c)2010 ><{{{{{{> tom surfs along!

-------

Keep it private! So, please use my PGP public key for important messages!

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)

mQENBE0AguYBCACs8I7yPOBywdSD/NK6egvugcPv4uRMdcA2rpKOfJpLAVJRE7gj
RYiV/kujaO/vXylBekzwVP18S1RiCDVWpvlBDhpINX4ot25Uylg0GGReASNTqEC5
hadf78E3opU8KryPPb6LTZCjfNrvUjbDB+FyLAWbFbIjrPE1hLVwBl6ScYWmYytt
ZRYYe6x3J6pJ8rNP5HDv/9hCxlysayQkqvNwaL7H6OlzehD1GozDEldX53lkD5Nv
pajk7SnJAWIFigi+b+jd2YkXAb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Hn4gaBEjItkU6FP7ExZeStSL45htjwbmAn1pqrQQRSdf9ZR9/
AR+YZdFtESuYW2n6T39pkTDIVh9RPTCGD7ue+akCJJ2MlLhRU1jzk64T5Q7Q0cLV
n9AieP5abgR1A6IHTbcWiNcHwuD56zDG+WT8vJ1Lf/WD2LwVsoihDyAWvpMxM7i/
JI1J+QckaO83OMqcVikpBgV9e9cAACJOiIvv8VauFxAh89kaT4DWByasFh+FFGXa
0zR2xQ/aCyKkr522B/92Dmus6eFC2jLr/aF1MyRlX7lqR5UTT/pLp2WaJQKtlnA4
WRfHksK3SYjSLfiaJStbQNW644WcJNcMB0n8L4GCmvhxezBORXKmvhjgu6GkhsWA
Jtu0edRs8hixA2vZCyPHXNu5OqIJQ1V3v8HTswC1mWLX7gvMF1NgIn1Cfo46cYVP
piafgtN1XYBI9oY0VpuIra1jJJmunamJhCMxKFIhPSs3VVUs1gjaK8qGhxWApxyn
nAMbTzyeVoIdeDvm8E9j0hfJ0UqpSIfJy/W6MJ3bp7+5CuJlDEZz0nRQfKsHo2EM
fW9k6abAY/0+HGyGu5c7RjqDWOdXIvvfLC5792kr
=aiEC
-----END PGP PUBLIC KEY BLOCK-----


[Non-text portions of this message have been removed]



[HC] XTalk to JS translator
(Msg 3 of 12)
Eric Engle <eric.engle@[redacted].com>
Wednesday, 13-Feb-2013 09:13 GMT
It doesn't seem to have "repeat" or "repeat for" "repeat with" implemented

It's still really impressive!



--- On Tue, 2/12/13, Tom Fuerstner <i.script@[redacted].com wrote:

> From: Tom Fuerstner <i.script@[redacted].com
> Subject: Re: [HC] XTalk to JS translator
> To: HyperCard-Mailing-List
> Date: Tuesday, February 12, 2013, 11:38 AM
> Dan,
>
> that's quite inspiring! Remember well, many years ago, when
> i read about
> the HyperTalk interpreter and decided to learn about
> compiler design. Went
> through all the dragon books and learnt an awful lot, with
> exactly the
> right amount of fun ....
>
> The javascript code you've delivered is such a cool starting
> point for
> hyper-interesting explorations.
>
> Thank you for that !
>
> Tom
>
> On Tue, Feb 12, 2013 at 2:46 PM, D <dannygelder@[redacted].com
> wrote:
>
> > **
> >
> >
> > Hi,
> >
> > Here is a more debugged version with a colorized and
> indenting xtalk
> > editor. It seems to basically work in Safari but I know
> there are issues
> > with the text caret disappearing when deleting text in
> Firefox. Colorizing
> > and indenting editable text on a web page is really
> hard, there's really no
> > good way to do it!
> >
> > It's still just a single HTML file so you can download
> and play with it.
> >
> > http://thirdhandapp.com/xtalk/
> >
> > Dan
> >
> > 
> >
>
>
>
> --
> Tom Fuerstner
>
> -------
>
> (c)2010  ><{{{{{{°> tom surfs along!
>
> -------
>
> Keep it private!  So, please use my PGP public key for
> important messages!
>
> -----BEGIN PGP PUBLIC KEY BLOCK-----
> Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
>
> mQENBE0AguYBCACs8I7yPOBywdSD/NK6egvugcPv4uRMdcA2rpKOfJpLAVJRE7gj
> RYiV/kujaO/vXylBekzwVP18S1RiCDVWpvlBDhpINX4ot25Uylg0GGReASNTqEC5
> hadf78E3opU8KryPPb6LTZCjfNrvUjbDB+FyLAWbFbIjrPE1hLVwBl6ScYWmYytt
> ZRYYe6x3J6pJ8rNP5HDv/9hCxlysayQkqvNwaL7H6OlzehD1GozDEldX53lkD5Nv
> pajk7SnJAWIFigi+b+jd2YkXAbckMPxKngbqYs16xbBcDLjIQEFjIehiLEG+792p
> 8rFlOnVRLES5IIrL7IPgmoXkXzX9/DvAy5erABEBAAG0IE5lc3RvciBTaWxrIDxp
> LnNjcmlwdEBnbWFpbC5jb20+iQE4BBMBAgAiBQJNAILmAhsvBgsJCAcDAgYVCAIJ
> CgsEFgIDAQIeAQIXgAAKCRC4if464wm3EFo3B/sGCAsh60b+xv/CJ3rsvlIXMlXU
> mUblS24cPxo87z7sli+y8w30NIHpvUOXZNgxBeLIYeSajcefpP73RKJNz1RG48iH
> yUUkHTApfvP3ELXyNC5AmGfUYJpbXJqNtm+KL/48/QKfNpszvYuVGn3Om4AuIqXt
> Oh//LJ+Z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mvhxezBORXKmvhjgu6GkhsWA
> Jtu0edRs8hixA2vZCyPHXNu5OqIJQ1V3v8HTswC1mWLX7gvMF1NgIn1Cfo46cYVP
> piafgtN1XYBI9oY0VpuIra1jJJmunamJhCMxKFIhPSs3VVUs1gjaK8qGhxWApxyn
> nAMbTzyeVoIdeDvm8E9j0hfJ0UqpSIfJy/W6MJ3bp7+5CuJlDEZz0nRQfKsHo2EM
> fW9k6abAY/0+HGyGu5c7RjqDWOdXIvvfLC5792kr
> =aiEC
> -----END PGP PUBLIC KEY BLOCK-----
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
[HC] XTalk to JS translator
(Msg 4 of 12)
D <dannygelder@[redacted].com>
Wednesday, 13-Feb-2013 13:01 GMT


--- In HyperCard-Mailing-List, Eric Engle wrote:
>
> It doesn't seem to have "repeat" or "repeat for" "repeat with" implemented
>
> It's still really impressive!
>

I'm curious about something before I push that update. Please fix my xtalk syntax if I don't have it matching yours exactly. In the Chrome browser on a 1.6Ghz processor I get "busyWork: 133 elapsedMS: 67" What kind of speed do you see?

get the ticks
put 10 into busywork
repeat with index = 1 to 10^7
put (busywork*2 + 9) into busywork
put busywork mod 369 into busywork
end repeat
put (the ticks - it)*1000/60.5 into elapsedMs
answer "busyWork:" && busyWork && "elapsedMs:" && elapsedMS


Dan
[HC] XTalk to JS translator
(Msg 5 of 12)
Eric Engle <eric.engle@[redacted].com>
Wednesday, 13-Feb-2013 15:19 GMT
On seamonkey it does not parse and returns this:

it_var = user_variable_the;
user_variable_busywork = 10 ;
alert("sending user message repeat");
document.getElementById('output').innerHTML = (unknown_xtalk["(busywork*2"]+9)
document.getElementById('output').innerHTML = user_variable_busywork
alert("sending user message end");
document.getElementById('output').innerHTML = unknown_xtalk["(the"]
alert( (new String((new String((new String("busyWork:")+" "+user_variable_busywork))+" "+"elapsedMs:"))+" "+user_variable_elapsedms) );
[HC] XTalk to JS translator
(Msg 6 of 12)
D <dannygelder@[redacted].com>
Wednesday, 13-Feb-2013 17:39 GMT
It doesn't parse because I haven't pushed the update with repeat statements yet. I was just hoping someone would try it in Livecode or something and find out what kind of speed I'm trying to beat here.

--- In HyperCard-Mailing-List, Eric Engle wrote:
>
> On seamonkey it does not parse and returns this:
>
> it_var = user_variable_the;
> user_variable_busywork = 10 ;
> alert("sending user message repeat");
> document.getElementById('output').innerHTML = (unknown_xtalk["(busywork*2"]+9)
> document.getElementById('output').innerHTML = user_variable_busywork
> alert("sending user message end");
> document.getElementById('output').innerHTML = unknown_xtalk["(the"]
> alert( (new String((new String((new String("busyWork:")+" "+user_variable_busywork))+" "+"elapsedMs:"))+" "+user_variable_elapsedms) );
>
>
>
>
>
> --- On Wed, 2/13/13, D wrote:
>
> From: D
> Subject: Re: [HC] XTalk to JS translator
> To: HyperCard-Mailing-List
> Date: Wednesday, February 13, 2013, 8:01 AM
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>  
>
>
>
>
>
>
>
>
>
>
>
>
>
> --- In HyperCard-Mailing-List, Eric Engle wrote:
>
> >
>
> > It doesn't seem to have "repeat" or "repeat for" "repeat with" implemented
>
> >
>
> > It's still really impressive!
>
> >
>
>
>
> I'm curious about something before I push that update. Please fix my xtalk syntax if I don't have it matching yours exactly. In the Chrome browser on a 1.6Ghz processor I get "busyWork: 133 elapsedMS: 67" What kind of speed do you see?
>
>
>
> get the ticks
>
> put 10 into busywork
>
> repeat with index = 1 to 10^7
>
> put (busywork*2 + 9) into busywork
>
> put busywork mod 369 into busywork
>
> end repeat
>
> put (the ticks - it)*1000/60.5 into elapsedMs
>
> answer "busyWork:" && busyWork && "elapsedMs:" && elapsedMS
>
>
>
> Dan
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
[HC] XTalk to JS translator
(Msg 7 of 12)
Colin Holgate <coiin@[redacted].net>
Wednesday, 13-Feb-2013 17:48 GMT
On my 13 inch MacBook Pro Retina:

busyWork: 133 elapsedMs: 3239.669421


On Feb 13, 2013, at 12:39 PM, "D" <dannygelder@[redacted].com wrote:

> It doesn't parse because I haven't pushed the update with repeat statements yet. I was just hoping someone would try it in Livecode or something and find out what kind of speed I'm trying to beat here.


[Non-text portions of this message have been removed]
[HC] XTalk to JS translator
(Msg 8 of 12)
andrew123ferguson <andrewferguson500@[redacted].com>
Thursday, 14-Feb-2013 15:50 GMT
On a iMac Intel i3 4GB Ram:
busyWork: 133 elapsedMs: 1190.082645



--- In HyperCard-Mailing-List, Colin Holgate wrote:
>
> On my 13 inch MacBook Pro Retina:
>
> busyWork: 133 elapsedMs: 3239.669421
>
>
> On Feb 13, 2013, at 12:39 PM, "D" wrote:
>
> > It doesn't parse because I haven't pushed the update with repeat statements yet. I was just hoping someone would try it in Livecode or something and find out what kind of speed I'm trying to beat here.
>
>
> [Non-text portions of this message have been removed]
>
[HC] XTalk to JS translator
(Msg 9 of 12)
Alain Farmer <alain_farmer@[redacted].com>
Thursday, 14-Feb-2013 16:35 GMT
Interesting prototype, what is it coded in ? Javascript ?
[HC] XTalk to JS translator
(Msg 10 of 12)
D <dannygelder@[redacted].com>
Friday, 15-Feb-2013 10:29 GMT


--- In HyperCard-Mailing-List, Alain Farmer wrote:
>
> Interesting prototype, what is it coded in ? Javascript ?
>
>

Yes, as are 99.9999% of web pages. Here is a link to some more information about the JavaScript language:
http://en.wikipedia.org/wiki/JavaScript

Paging through Wikipedia's excellent summary, I see the continuation of many HyperTalk features, such as dynamic typing, runtime evaluation, and close binding with a hierarchical document object model. In general, you can think of it as an xTalk by alien nerds.

It's gone through a fair amount of forced evolution over the years and can be considered battle-hardened. One particular book that I own, called JavaScript: The Good Parts, was really helpful in my developing good technique; it is (or is about) a strictly defined, useful subset that is compatible with nearly all implementations.

In general, I'd have to say that the odds of JavaScript disappearing in the future, or at least being forced to change so radically that pages break, is 0%. It's too fundamental to the Internet as we know it and there is too much money. There are a number of interesting projects meant to extend it. One is Microsoft's TypeScript which is nothing more than a set of syntax sugars. Sadly it's Microsoft so it cannot be trusted.
http://www.typescriptlang.org

I'm excited about using it as an execution layer for xTalk and don't anticipate any kind of major problems. I guess I'll just bop along adding things when I'm not momentarily busy with work, school or life.

Dan
[HC] XTalk to JS translator
(Msg 11 of 12)
Alain Farmer <alain_farmer@[redacted].com>
Friday, 15-Feb-2013 10:43 GMT
I am already sold on the merits of Javascript. It's a SOLID choice, bar none given its ubiquity. Let's make it happen. :-)



________________________________
From: D <dannygelder@[redacted].com
To: HyperCard-Mailing-List
Sent: Friday, February 15, 2013 5:29:28 AM
Subject: Re: [HC] XTalk to JS translator


 


--- In HyperCard-Mailing-List, Alain Farmer wrote:
>
> Interesting prototype, what is it coded in ? Javascript ?
>
>

Yes, as are 99.9999% of web pages. Here is a link to some more information about the JavaScript language:
http://en.wikipedia.org/wiki/JavaScript

Paging through Wikipedia's excellent summary, I see the continuation of many HyperTalk features, such as dynamic typing, runtime evaluation, and close binding with a hierarchical document object model. In general, you can think of it as an xTalk by alien nerds.

It's gone through a fair amount of forced evolution over the years and can be considered battle-hardened. One particular book that I own, called JavaScript: The Good Parts, was really helpful in my developing good technique; it is (or is about) a strictly defined, useful subset that is compatible with nearly all implementations.

In general, I'd have to say that the odds of JavaScript disappearing in the future, or at least being forced to change so radically that pages break, is 0%. It's too fundamental to the Internet as we know it and there is too much money. There are a number of interesting projects meant to extend it. One is Microsoft's TypeScript which is nothing more than a set of syntax sugars. Sadly it's Microsoft so it cannot be trusted.
http://www.typescriptlang.org

I'm excited about using it as an execution layer for xTalk and don't anticipate any kind of major problems. I guess I'll just bop along adding things when I'm not momentarily busy with work, school or life.

Dan




[Non-text portions of this message have been removed]
[HC] XTalk to JS translator
(Msg 12 of 12)
richard g <Ambassador@[redacted].com>
Friday, 15-Feb-2013 14:51 GMT
--- In HyperCard-Mailing-List, "D" <dannygelder@...> wrote:
> In general, I'd have to say that the odds of JavaScript disappearing
> in the future, or at least being forced to change so radically that
> pages break, is 0%. It's too fundamental to the Internet as we know
> it and there is too much money.

JavaScript is definitely well worth learning, and with so many great resources around there's hardly any reason not to. Given the role of the browser in modern workflows, I would consider it the essential second language.

I still prefer xTalks for desktop and mobile, and often use xTalks to generate HTML/CSS/JS for web ports and production workflows, but JS is a wonderful thing in browsers, well worth the time to learn.


> There are a number of interesting projects meant to extend it. One
> is Microsoft's TypeScript which is nothing more than a set of syntax
> sugars. Sadly it's Microsoft so it cannot be trusted.
> http://www.typescriptlang.org

Agreed. Until we see some radical change of direction from Microsoft that's completely unlike anything we've ever seen from them before, we already know their general disdain for standards and they've provided no evidence that they're interested in doing anything beyond attempting vendor lock-in.

Given their market share I'd love to be wrong, but given their history I don't think it's likely.
HyperCard® and HyperTalk™ remain trademarks of Apple, Inc.; other trademarked products and terms mentioned in this archive are the property of their respective trademark holders. Individual messages remain the intellectual property of their respective authors.