Why do built-in functions use a keyword/operator syntax for arguments, while user defined functions use parentheses? That seems confusing (and was deemed a mistake in python worthy of a decade of pain to remedy.) It would certainly make sense to special case their implementation in byte code for efficiency, but since there's a compilation step, why does the syntax need to change?
Why did you choose to go with Arduino function names? Do you like the camelCasing?
Why is there both a "next" keyword and a "continue" keyword? Don't they basically do the same thing? If the purpose of "next" specifically is to mark the end of scope of the loop, why not use the word "done" or another word that isn't synonymous with "continue"?
If space and efficiency are a priority, and there's a compiler from a higher level language, why did you go with an ASCII-code rather than a true byte-code? That gives you 95 visible characters per byte, which seems to potentially waste 18% or so of program space.
ie: sum 2, multiply 2, 2, 2
for which function is the last parameter for?
You are right about the function names, I am not forced to use the camel form which I do not love, it could be serial_write or even serial write
This is basically how concatenative stack-based languages do it, although by convention they put the arguments before the function call. (Reverse Polish Notation) In Forth, your example would be written one of the following two ways, depending on whether multiply() or sum() is consuming the extra 2:
2 2 2 * 2 + +
> 8
2 2 2 * * 2 +
> 10
Also valid would be:
2 2 2 * 2 +
> 2 6
where the left-most 2 is not consumed, but rather is left in place.
Re: naming for IO functions, it's really up to you. I personally try to avoid abbreviations for readability, except for incredibly common ones.
One idea:
init_pin(index, mode) get_pin(index) get_pin_mode(index) set_pin_mode(index, mode)
Or CamelCase, InitPin, GetPin, etc.
Mode is an enum with values for input, input_pullup, input_pulldown, output_low, output_high.
For getting timestamps:
milliseconds() microseconds()
For computing deltas in time between two timestamps correctly with rollover (Provided by the system in case the data type is unsigned. Returns 0 if t2 > t1):
time_left(t1, t2)