4 ms·
C++ Parser in Forth?
- MaxBarraclough 8y agoThe unholy union of all my favourite programming nightmares. I wish this adventurer luck.
- nly 8y agoSomewhat related: 6 minute WTF video on the C++ grammar https://www.youtube.com/watch?v=tsG95Y-C14k https://www.youtube.com/watch?v=tsG95Y-C14k
- chubot 8y agoYeah this is a good one. I've been programming C++ for a long time and it does give you a sense of how hopeless this task is :)
- bjoli 8y agoJesus christ I love being a scheme weenie.
- MaxBarraclough 8y agoGreat video! But what sick and twisted mind would think of doing this? https://youtu.be/tsG95Y-C14k?t=277 https://youtu.be/tsG95Y-C14k?t=277
- linuxlizard 8y agoC++ is a little like the English language: a bunch of different pieces gathered together over a period of time, new features added to replace/fix old. I like it.
- MaxBarraclough 8y agoI like the comparison to steampunk: modern ideas bolted on to antique technology.
- mhd 8y agoIt also dropped some letters (æ, þ) and pronouns (thou, thee). Most of what was added was vocabulary, to be comparable to C++ one would probably have to add all the Finnish cases, Japanese gendered language and all the Vietnamese accents. And then have some people who mostly communicate by yodeling or Mongolian throat singing.
- foota 8y agoWhat? Did this item change url and title? Earlier it was an article about initialization in c++?
- Buge 8y agoAre you sure you're not thinking about this? https://news.ycombinator.com/item?id=18832311 https://news.ycombinator.com/item?id=18832311
- foota 8y agoThat's what I thought this article was... Maybe I opened both of them, read the other one and closed it, then came back surprised to find this one.
- UncleEntity 8y agoI was toying around with a C++ parser in python (using the earley parser spark.py) a while back and it wasn't all that difficult, couple conflicts that can't be solved without knowing the type of something in the lexer which can be sorted out in later stages (methinks?) and (IIRC from looking at the code) a shift/reduce conflict in declarator-id, but all in all I got it to pass all the tests I found from some advanced compiler course. Never went past getting it into a AST because I tend to find some other shiny thing to play with before I finish things but I'd imagine the implementation language wouldn't be a serious impediment...saying as someone never having written a single line of Forth. --edit-- C++11 I should say since C++14 added things like >> conflict between the shift operator and nested templates that I didn't even get around to trying to solve.