I would like to draw your attention to a new feature announced on the FPC mailing list: Dynamic array extensions. In short:
- support for array constructors using "[...]" syntax
- support for Insert(), Delete() and Concat()
- support for "+" operator
- support for dynamic array constants (and variable initializations)
What is your opinion on that ?
Sounds like Pascal array syntax is getting dragged into the 21st century so it's more like other languages. Take the Swift MLPClassifier example givenhere (under Interpreter):
https://github.com/tensorflow/swift/blob/master/Usage.mdThat gives several examples of constant arrays being declared within the code that uses the arrays. I assume something like that will be available in Pascal. If so, that should make for cleaner code, less code.
I'm kind of indifferent to operator overloading. Since you already have to declare a function that gets called when you use the overloaded operator, maybe just make that function available in the interface section so it can be used in case "+" is lost.
The Swift example also uses operator overloading for tensor arithmetic. So something like this:
tanh(matmul(x, w1) + b1)
Could be written without operator overloading like this:
tanh(add(matmul(x, w1), b1))
That still seems pretty clear. After all, you can't get away completely from calling functions when you're doing this kind of stuff. I suppose you could overload operators for both tanh and matmul if there were obvious math symbols that made sense. Are there limitations on what characters you can overload? In Swift, I believe you can use any Unicode character as an overloaded operator. In fact, they actually overload ⊗ for matrix multiplication, so you could write this:
tanh(x ⊗ w1 + b1)
Interesting that they don't use that overloaded operator in their own example. Perhaps cooler heads prevailed.
In my Pascal interface to TensorFlow I overloaded the arithmetic operators too, per Swift, but I don't think I would miss them if they weren't available.
Perhaps just rejoice in the "lower-ceremony" syntax for arrays and make peace with the loss of an overloaded "+" in this one case.