I'd like to write an interpreter, and thought it would be nice to write one without learning/reading about them and then once it's done, read a book about it to see what I should have done differently. One of the appeal for me is that many things I read these days solve problems I haven't encountered which makes me sometimes wonder If I'm not just doing certain things because I read about them rather than because they actually are useful/solve an issue.<p>However, a downside, is that it may be an enormous waste of time and be almost impossible with little to no benefit. What do you think?<p>And do you believe there is a threshold (in difficulty, complexity...) at which point it isn't advisable? (An interpreter could be before or after that threshold)
If your goal is to learn, I believe this is THE way to do it. My experience has been that reading about something complex without attempting it first isn't effective. If you are not familiar with the problems you won't understand or appreciate the solutions. It's like listening to a lecture about rocket science without a background in Physics - there is useful information, but you won't be able to process or connect them to anything you know. And that also means you won't retain the information.<p>Of course there is a limit to this. It wouldn't make sense to intentionally avoid looking up solutions if you are stuck on a specific problem for several hours or days. But IMO it also doesn't make sense to read a whole textbook without trying to implement anything. What has worked well for me is to do it in an iterative fashion. Read when necessary.
> be almost impossible<p>Just for this reason, I'd say no. You won't learn much from something that feels impossible, because it's too complex to analyze your findings.<p>What you should do is rephrase the problem into something that is possible... I'd say with about 50% chance of failure. Instead of a full interpreter, write a component of one maybe. Or try reverse engineering a simple one. Maybe try cloning an existing one so you can see where problems lie.<p>Just the act of breaking down an impossible problem into a possible one is a major skill.
Go for it! You won't know until you try and so long as it's not 'mission critical' or anything you'll have a lot of fun!<p>And ignore 'threshold', often it's an imagined difficulty, check out George Dantzig[0], he mistook two unsolved maths problems for homework and solved them both!<p>[0] <a href="https://math.stackexchange.com/questions/533146/dantzigs-unsolved-homework-problems" rel="nofollow">https://math.stackexchange.com/questions/533146/dantzigs-uns...</a>
For hobby and learning? If you have time to write it blindly and then review the literature afterward, go for it. It's a fun and enlightening experience. The only real tradeoff is that you might have been able to learn about two different topics in the time it takes you to start from scratch and then rewrite after a review of the state of the art.<p>For job-related work? Definitely not. Always survey the state of the art first.
I think definitely go for it. Once you've experience problems firsthand you'll have created little questions in your mind that the reading will help you answer.