2
aggelalex
85d

Nothing better than Rust and LALRPOP. I've been trying to play with Bison and C++ for the whole quarantine and nothing would compile. I just sat for two days with Rust and LALRPOP and I was able to make a small interpreter that can make new variables, calculate simple expressions and print stuff. Like this:

var = 5 + 3;
print var;
var = 2 * var + 4;
var2 = 3 * var + 3 * (var + 4);
print var2 * var;

And all this in just two days. I have no Rust experience except for toying with it on an online playground. I have no LALRPOP nor parsing experience. Two days.

Now, it's not like I wouldn't be able to do this in C++ too if somebody told me how to. But nobody has. And the documentation online is gruesome. None of the bison example I found online could compile. This is why documentation matters people! Honestly, if there's one reason I think old projects die, it's because they ether don't update themselves OR they don't update their documentations. Look at the US government now, looking for COBOL programmers.

Comments
  • 0
    2 days? And what did you do in the other 47 hours 40 minutes?
  • 1
    @yellow-dog mainly scrolling devrant and reddit, and wait for my sister to finish her job on the PC for me to take it back. I don't usually live here, this is my parent's home, but now I'm stuck here for quarantine...
  • 0
    Never touched Rust, but it should be possible to make parser combinators in that language.
  • 1
    @Oktokolo it is, there's a great library called nom for that
Add Comment