Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
breuleux
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
45 ms
·
541.
▲
by
breuleux
12y ago
Sure, but the same principles that justify this grammatical precedence could be used to justify arithmetic precedence. I mean, why does assignment have lower priority? It could be left associative with arithmetic. Presumably it has low pr
542.
▲
by
breuleux
12y ago
SmallTalk does have some operator precedence: unary operators bind tightest, followed by binary, keyword, and assignment. In general, what precedence buys you is that it lets you omit grouping brackets in situations where you would almost a
543.
▲
by
breuleux
12y ago
That's more or less what I meant by "priority graph" in the article: priority is defined using a directed acyclic graph. In principle, yes, you could have a way to add new nodes in the graph; you don't really expect n to
544.
▲
by
breuleux
12y ago
Didn't expect to see this here (I am the author). For the record, I implemented this syntax as a Racket #lang called LISO[1], and I also used a variant of that syntax for a language that compiles to JavaScript, Earl Grey[2]. It's
545.
▲
by
breuleux
12y ago
I just want to preempt one criticism here. The reason why EG uses f{...} for function calls and [...] for grouping instead of parentheses is that it makes for simpler syntax. Conventional languages overload () for arguments and grouping, bu
546.
▲
Show HN: The Earl Grey language – pattern matching, macros, compiles to JS
(breuleux.github.io)
5 points
by
breuleux
12y ago
|
1 comments
547.
▲
by
breuleux
12y ago
Good questions. Let me try to answer them. > Imagine the human-level ai had resources to run hundreds of variants of itself. The first human-level AI will probably be hosted on cutting-edge hardware that costs billions of dollars. So no,
548.
▲
by
breuleux
12y ago
In my opinion, there are a few things that make it improbable that a runaway intelligent entity would arise. First, for the most part, we expect that AI trained to do X is going to do X. Insofar that doing X is an AI's "survival c
549.
▲
by
breuleux
13y ago
One argument for infix is that it minimizes the distance between the salient token (the verb) and its arguments. When you see "a := b", the ":=" serves as a convenient visual anchor to check the variable name (to its lef
550.
▲
by
breuleux
13y ago
Top down operator parsing ( http://javascript.crockford.com/tdop/tdop.html ) is pretty easy to implement, is inherently efficient, and trivial to extend. Even that might be overkill, though: a generic operator parser for
551.
▲
by
breuleux
13y ago
You could also say that newlines always terminate statements unless a continuation character is used. That's a trivial policy that works very well in practice.
552.
▲
by
breuleux
13y ago
I made my own markup language (post: http://breuleux.net/blog/quaint.html , docs: http://breuleux.net/quaint/ , source: https://github.com/breuleux/quaint ) and I think it could
553.
▲
by
breuleux
13y ago
JS isn't particularly slow any more, thanks to the massive efforts invested in the optimization of the various competing JS engines. It is generally faster than Python 3 ( http://benchmarksgame.alioth.debian.org/u64/
554.
▲
by
breuleux
13y ago
Funny you should say that, because I've been working on my own approach this month: https://github.com/breuleux/liso I'm probably going to post about it soon in more detail, if people are interested.
555.
▲
by
breuleux
13y ago
Significant whitespace kind of makes sense in general: humans make heavy use of whitespace to parse code visually, which means that when it isn't significant, the machine and the human are essentially using different parsing algorithms
556.
▲
by
breuleux
13y ago
Yeah, I won't dispute that Markdown's emphasis syntax is a bit more layman-friendly than Quaint's (though there might be a way to hack it in anyway). One important goal with Quaint is syntactic consistency, though, which mean
557.
▲
by
breuleux
13y ago
I am the author. Plain .q is supposed to be language agnostic (and I'd say it's relatively featureful), whereas .py.q, .js.q, etc. would be used if you wanted to embed some other language (though there's only a Python impleme