Hacker News new | past | comments | ask | show | jobs | submit login

I wonder if it could have been more Logo/Rebol inspired instead of Hypertalk. I guess that would be like:

    put new date next <output/>
Assuming in that "then" is superfluous since there's nothing async about making a date. Though because "new Date()" can take arguments it's perhaps unclear how to parse this.

For events:

    on click [toggle .clicked]
That would imply that "click" is a defined object/variable. I'm not sure how _hyperscript is evaluated, maybe "on" gets to decide how to evaluate its arguments. You can also imagine "onclick" as a command.

Using another example from the page:

    on click [call aJavascriptFunction()
              then [wait 10s]
              then [call anotherJavascriptFunction()]]
"then" would be a reasonable command, though making it a special form is also reasonable. Though maybe "then" just means ";" – a statement terminator? And everything is async. That would be reasonable, the only trick is when you have a promise as an argument to a function, do you resolve the promise first or not? There are use cases for both.

Thinking through some other examples, I think _hyperscript syntax does make it easier to handle optional arguments. Like "on every click" or "on click queue all"... where these are kind of like flags. Logo-style syntax doesn't handle that well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: