Live data from Hacker News

The naked truth about writing a programming language (2014)

digitalmars.com

211–212 of 212 posts

Re: The naked truth about writing a programming language (2014)

#211
post #183

Earlier quoted context omitted.

so we agree about single-return-pop – it just wouldn't be very useful. what i tried to say is that it's a bit of a strawman – single-return-pop is pretty obviously useless, so no one would design a pure API like that. so there's no point arguing against it :) if you want `pop`-like semantics, but also want your operations to be pure, tuples are the only real way to do it. for a real example, see this Haskell implemen…

> so we agree about single-return-pop – it just wouldn't be very useful. what i tried to say is that it's a bit of a strawman – single-return-pop is pretty obviously useless, so no one would design a pure API like that. so there's no point arguing against it :) Remember where the conversation started :) It's not a strawman because it's what confused macintux in the first place! I was saying that the thing they expect…

good point, i got a little bit caught up in the argument there :)

Re: The naked truth about writing a programming language (2014)

#212

I want to implement a toy programming language, but I have questions regarding the following in that article: > Context free grammars. What this really means is the code should be parseable without having to look things up in a symbol table. C++ is famously not a context free grammar. A context free grammar, besides making things a lot simpler, means that IDEs can do syntax highlighting without integrating in most of…

This point in the article is pretty weird (the rest is good). I don't think IDEs do a lot of parsing to do syntax highlighting, isn't it all just regex matching to identify the types of tokens? I'd be interested in real-world examples of IDEs doing something more complex to achieve syntax highlighting. And conversely, examples of imperfect syntax highlighting of C++ due to the undecidability of its input language. I…

Many syntax highlighters actually interpret the language to some extent. For example, Atom: https://github.blog/2018-10-31-atoms-new-parsing-system/

Anyway I'm just posting now as I first read this comment when you posted it and tried to recall this blog post by the infamous Steve Yegge, and just finally did: http://steve-yegge.blogspot.com/2007/06/rich-programmer-food...

Post reply on HN