Operator overloading — development driven by demand

I would like to write the development is driven by design, but it does not happen — unfortunately I don’t have enough time to properly take care of Skila, so I already marked several things to fully resolve in undefined future, and I hope they can be resolved.

I started to port my small utility written in Ruby and right of the bat — I have plus operator on strings and iterator over strings. I didn’t intend to implement those for my minimal set, but I like comfort when programming, and both of those features add comfort to a language.

Besides, iterator reminded me the importance of type system (again). You would like to iterate over an array, no problem in C#, because array is a reference type, but in Skila (which for now has type system similar to C++) an array can be placed on stack. And iterator needs a reference/pointer to container — since you can store iterator it might be the case the array will be removed from stack, while iterator will be still in use. What now? Undefined behaviour? Crash? Added countermeasure (I think of weak pointer)?

So on one hand, such approach to implementing the language and compiler leads to mess, on the other it helps face all the problems fast, so you won’t spend a lot of time pursuing impossible.

So far, it is possible, so operator overloading is done (just a fancy name of the method), iterators are ahead of me.

Tagged , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: