Asterisk007 / prse

A C-like language with modern and novel conventions
Other
1 stars 0 forks source link

Implement Pointers #1

Open Axanimander opened 6 months ago

Axanimander commented 6 months ago

This is an issue for implementing pointers, so that in the future we can implement a void* type, greatly increasing the flexibility of the language.

Asterisk007 commented 2 months ago

No idea if this will be implemented at all (last commit updated README with no functional changes), but I'm willing to humor this maybe as an exercise in syntax design. Let's look at how variables are currently initialized:

let foo: int = 42;

I could go the C-style route like a lot of this language does and just throw a '*' character on the end:

let foo: int* = 42;

This is probably the easiest way to get pointers in, because we can just transpile directly to C++ syntax and be on our way.