Hi everyone! I'm a Python app developer currently diving into C, and I'm working on creating my own programming language. So far, I've gotten the basics like printing, basic math functions, and variables up and running. Now, I'm looking to add library support so I can create libraries to integrate functions into my language. Any tips on how to get started with this?
1 Answer
That’s awesome to hear! Adding library support is definitely doable. A simple way to start is to treat each library as a separate file using your language's syntax. Then, implement an "import" command that reads those files into your main program. For now, you could just have your import functionality paste the library's code directly into your program before execution. Once you’re comfortable, you can add more advanced features like namespaces. Just keep in mind the variable scope to avoid conflicts between library variables and your main program variables. You’ve got this! Good luck with your language design journey!
Thanks a lot! I really appreciate the advice!