Original Post
I've been lightly looking into programming language design and when looking at the subject of pointers and manual memory management I became curious about something. Namely, if you had free reign, and were tasked with designing the syntax used for pointer operations ((de)allocation, (de)referencing, arithmetic and so on), what syntax would you settle on and why? Feel free to make up your own syntax if you feel that whatever is currently out there is lacking.
When replying, please supply examples of your syntax as well as the good points and bad points from your perspective regarding it.
EDIT:
Yes, maybe I should have made this clear to begin with.
In reality, it's more me building a compiler (src->asm), the language design interest part is something that has been growing slowly while thinking about how stuff could be implemented and supported by the compiler (makes sense?).
In essence, with my compiler, and language, I'm aiming for a systems programming language with a somewhat better/nicer (subjective?) syntax then C. With support for OOP as far as what can be resolved at compile time. I intend to shy away from constructs that require additional run-time support (meaning, I'd like to be able to generate the least amount of CPU operations from a given set of code, this might be more of a compiler optimization issue though, rather then a language issue). Other then this, I don't have much of a plan for the language, features will be added ad-hoc if I deem them necessary/useful in the domain of system programming, or can be talked into implementing by other more experiences people.
[Edited by - nem123 on July 18, 2010 4:10:38 AM]
When replying, please supply examples of your syntax as well as the good points and bad points from your perspective regarding it.
EDIT:
Quote:
Original post by rip-off
I agree entirely. I am curious about what nem123's language design goals are. Without knowing that it is hard to make any real comments on the apparent choice to include pointers in it.
Yes, maybe I should have made this clear to begin with.
In reality, it's more me building a compiler (src->asm), the language design interest part is something that has been growing slowly while thinking about how stuff could be implemented and supported by the compiler (makes sense?).
In essence, with my compiler, and language, I'm aiming for a systems programming language with a somewhat better/nicer (subjective?) syntax then C. With support for OOP as far as what can be resolved at compile time. I intend to shy away from constructs that require additional run-time support (meaning, I'd like to be able to generate the least amount of CPU operations from a given set of code, this might be more of a compiler optimization issue though, rather then a language issue). Other then this, I don't have much of a plan for the language, features will be added ad-hoc if I deem them necessary/useful in the domain of system programming, or can be talked into implementing by other more experiences people.
[Edited by - nem123 on July 18, 2010 4:10:38 AM]