Fundamental differences with C
This is a short summary of differences between the C language and
Ocean. Note that this is a wish list. All features here are
currently percieved to be attainable, but that may change.
Safety
Thread support
- Thread unique variables
- Simple mutex support on functions (making them ...) and variables
- Co-Routines, most of the power of threads with none of the overhad.
- Allows libraries to be written in thread-safe mode
Exception support
- Use try-catch-finally
- Exceptions are part of the 'contract', so you never get any unexpected
ones
- All exceptions have to be caught, so if you do not use them, you do not get
the overhead
Extended sequence control
- Use with-repeat-continue-else-finally with
next-leave-bounce for total loop control
- Simple aliasses 'for', 'while' etc... for easy
programming
- If-elsif-else with leave-bounce for condition control
- Assume, an if which assumes it will succeed
- Unless, an if not
OOPS: Multiple inheritance with interfaces, and delegation
No fixed literal meaning: types can extend the compiler
- Use: regexp engines, SQL and others
Validation
- Controlled boundary and wrapping checks
- Compile time ortogonal unit checks and conversions
Data conversion
First class code object
- Closures and Delegates
- 'Default' parameters, usable for automatic iterator objects
- Variadic fn support for repeated identical types (eg. string concat on 2+ strings)
No preprocessor