4 ms·
It’ll help people understand the language if you remove optional words tbh. Hypertalk is HyperTalk, but the world isn’t written in it for a reason. Good luck. B
by slver 5y ago
It’ll help people understand the language if you remove optional words tbh. Hypertalk is HyperTalk, but the world isn’t written in it for a reason. Good luck. Btw Lua is also implicitly async like this as well.
- recursivedoubts 5y agooh, it gets worse: not only is "then" optional, but "the" is also optional in many places: set the window's location to the target's href and note the "'s" possessive expression hyperscript is a funky language, for sure :) Can you link me to some docs on the lua's transparent concurrency model? All my searches are turning up explicit concurrency stuff. Hyperscript is unique (as far as I know) in that it resolves asynchronicity (Promises) at the expression level, without explicit syntax.
- slver 5y agoI could guess about "the". But seriously, this is much clearer: "set window location to target href" And this is even clearer: "window.location = target.href" Adding the flourishes of human language is kinda cute, It can also be useful in speech recognition when we can't help but speak like we normallt speak. But code is a written specification, and specifications benefit from being clear, succinct, and for there to be "one clear & right way" of doing something. Just my take.
- slver 5y agoRegarding Lua async-by-default execution: https://stackoverflow.com/questions/49764681/how-exactly-does-lua-asynchronous-calls-in-roblox-work https://stackoverflow.com/questions/49764681/how-exactly-doe...
- recursivedoubts 5y agohmm, the responses there make it look like lua has co-routines (which are explicit) and are async-transparent when calling C++ functions, but not generally implicit like hyperscript so, a step in the right direction, but not a fully async-transparent runtime like hyperscript thank you for the link
- slver 5y agoOf course at the lowest level it's "explicit" as in you see the API used to implement it. But in practice there's nothing explicit about it, because any function can yield and you don't have to explicitly know it did. Lua is heavily used to script games, and you can see scripts like this there: walkTo(desk) pause(3); turn(180); say("I changed my mind, can I come with you?") response = promptPlayer("OK, come", "No, stay"); ... ... Notice that every single one of those commands is not instant. It takes some time for it to happen, there's animation, user prompts, and so on. All of this is happening async. But you don't have to do anything about it. You're writing a function, and the API for it yields where it has to. For you, all that's implicit. It's literally identical to yours in practice, but it doesn't return promises. It yields natively.