I'm working on a toy programming language that currently only supports basic math operations. I have a lexer that identifies numbers and the basic arithmetic symbols (like +, -, *, /, etc.), and my parser arranges them according to the BODMAS/PEMDAS rules. It outputs an intermediate representation from the abstract syntax tree, which gets converted into bytecode for a simple stack-based virtual machine. I'm thinking about implementing features like classes and multithreading, but I'm curious about what other language concepts I could incorporate to further expand my coding skills. What do you suggest?
4 Answers
You might want to check out some programming language resources for inspiration. There are a ton of great ideas out there that could help guide your development! Just browsing through r/programminglanguages could give you some interesting concepts to play with.
You should definitely consider adding functions. Variables and closures would enhance your language too! It would allow you to create more complex expressions and manage state effectively.
It sounds like your focus is really on the math side, but if you're planning to add features like classes and multithreading, make sure you have the basics down first. Think about variables for storing results, conditionals for branching logic, and loops for repetition. Also, functions that can take parameters and return results should definitely be on your list! These will make it easier to build upon as your language grows.
Instead of traditional loops, have you thought about implementing recursive functions? It could add a nice twist to your language, although it might lead to some stack overflows if you're not careful!
Related Questions
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically
[Centos] Delete All Files And Folders That Contain a String