What Features Should I Add to My Toy Programming Language?

0
5
Asked By CleverLlama27 On

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

Answered By InquisitiveDolphin23 On

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.

Answered By CreativePanda98 On

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.

Answered By AnalyticalBee34 On

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.

Answered By RecursiveFrog15 On

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.