If JavaScript represents its source as a string, and a string is a primitive data type in JS, and eval(string) evaluates a program... 1/
-
-
@wycats Given a JS, I would like a JS function that adds 'a' in the middle of its argument list. No cheating with strings. :) -
@wycats The awkwardness of this function is inversely proportional to the homoiconicity of JavaScript. -
@deech if I'm allowed to use the parseToSexp(source) and sexpToSource(sexp) functions (which are clearly possible) no problem! -
@deech "no cheating with strings" is begging the question! I'm saying strings satisfy the eval(source) requirement. -
@wycats I think I get your point that homoiconic is fuzzy. Clearly there's a spectrum between "I look like myself" and "I can eval myself". -
@deech yeah I think the term adds more heat than light. -
@deech it also doesn't provide a good framework for understanding the importance of http://dl.acm.org/citation.cfm?id=2371420 …, which is sad. -
@deech but "to make macros, I need read(JS) but it's hard" does.
End of conversation
New conversation -
-
-
@wycats The syntax doesn't mirror the AST like e.g. lisps do. A lisp basically encodes the tree structure in text, but JS does not. -
@knardi Shouldn't the AST be defined by what's passed to `(eval source)`? The JS source format is `string` -
@wycats I see what you're saying, but I feel like the important part is the ability to directly manipulate programs at the semantic level. -
@knardi seems like as long as there's read(#<source>) -> #<sexp>, serialize(#<sexp>) -> #<source> and eval(#<source>), same expressiveness -
@wycats I would add one more requirement—that one can easily manipulate #<sexp> to change its semantics -
@knardi sounds fine. It's clearly possible to write that read() function for JS source :)
End of conversation
New conversation -
-
-
@wycats Presumably, a string of JS source does not resemble its AST. -
@myronmarston the JavaScript spec does not define an AST, but it does define the processing model of primitive source. The string is the AST -
@wycats because you still have to parse the string and then interpret it. In lisp you can interpret the already parsed S-expression -
@_Felipe you interpret a JS source by evalling the source string. No intermediate steps. -
@wycats I see what you mean. But how can I have access to the objects defined by the syntax?
End of conversation
New conversation -
-
-
-
@djspiewak@bodil I think it's more useful to talk about the primitive functions and how hard they are to write than the term :) -
@djspiewak@bodil read(lispSource) is very easy; read(jsSource) is harder -
@wycats@djspiewak@bodil JavaScript is like a drag queen - beautiful, even though you're not 100% sure in which category to frame him/her. -
@schrepfler that's not cool, buddy
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.