You may have read David A. Wheeler's 6502 Language Implementation Approaches article. I recently read it but was quite underwhelmed. Although David does point out some of the limitations of the 6502 that makes high-level language implementation challenging or inefficient, he takes the approach of working around those limitations to implement features which are inefficient on the platform.
I have given considerable thought recently to the design of a language for the 6502. The approach I normally take when designing a language is to start at the bottom and work upwards, making common design patterns and idioms used in the lower-level language easier to implement in the higher-level language.
To this end I have described the function of a language for the 6502 that cleanly maps to efficient machine instruction sequences that are extremely similar to those we write by hand. Below I describe the function of the language in terms of how it differs from C without regard to syntax. I look forward to your comments.
Limitations
* Function calls may not be part of an expression, only for single-assignment
* Function calls may not be recursive.
* Arrays are limited to 256 elements, however those elements may be of any size
* No support for dynamic memory allocation
* No multiplication, division or modulus operators, rather they are implemented as built-in functions
* Pointer and string data types not supported
* Comparison operators are not considered expressions
* No support for arrays as a member of a struct
Features
* Direct segment management
* 16-, 24- and 32-bit integer support
* Read and write "files", or large arrays, using built-in functions for pointer manipulation
* Support for structs, arrays, and arrays of structs
* Inline assembly support for every language feature
Thoughts? I would also be interested in hearing what language you would like the syntax based on. I have developed a minimalist line-oriented syntax I use for my languages that lacks punctuation of almost any kind, but it can be hard for someone to pick up if they didn't write the thing
I have given considerable thought recently to the design of a language for the 6502. The approach I normally take when designing a language is to start at the bottom and work upwards, making common design patterns and idioms used in the lower-level language easier to implement in the higher-level language.
To this end I have described the function of a language for the 6502 that cleanly maps to efficient machine instruction sequences that are extremely similar to those we write by hand. Below I describe the function of the language in terms of how it differs from C without regard to syntax. I look forward to your comments.
Limitations
* Function calls may not be part of an expression, only for single-assignment
* Function calls may not be recursive.
* Arrays are limited to 256 elements, however those elements may be of any size
* No support for dynamic memory allocation
* No multiplication, division or modulus operators, rather they are implemented as built-in functions
* Pointer and string data types not supported
* Comparison operators are not considered expressions
* No support for arrays as a member of a struct
Features
* Direct segment management
* 16-, 24- and 32-bit integer support
* Read and write "files", or large arrays, using built-in functions for pointer manipulation
* Support for structs, arrays, and arrays of structs
* Inline assembly support for every language feature
Thoughts? I would also be interested in hearing what language you would like the syntax based on. I have developed a minimalist line-oriented syntax I use for my languages that lacks punctuation of almost any kind, but it can be hard for someone to pick up if they didn't write the thing