4 ms·
Good ideas from the language(s), not the source code linked. * Coroutines, a crown jewel of Go. * Proper modules, separate files for interface and implementat
by nine_k 11y ago
Good ideas from the language(s), not the source code linked.
* Coroutines, a crown jewel of Go.
* Proper modules, separate files for interface and implementation parts.
* Nicer type system, with ranges, enumerations, ordered types and arrays indexed by any ordered type; can't remember if it ever had sum (aka variant) types.
* IIRC Oberon had an 'object system' very similar to Go's, with functions having a receiver and struct-based 'classes'.
* Obviously far fewer (if any) undefined behaviors than C.
* Low-level access; it was entirely possible to write an interrupt handler in Modula-2, access address-mapped ports, etc.
- coldtea 11y ago>Proper modules, separate files for interface and implementation parts. Proper modules are great, but I wouldn't call the "separate files for interface and implementation parts" a good feature. That's a throwback to languages like C. It's not DRY, and it's also busywork -- the interface can trivially be created/inferred from the implementation file alone.
- nine_k 11y agoIt was easy to give your customers the proper interface files (they were compilable), so they could code against your interfaces. They are much lighter than the object files (it was the time of the floppy disk and 2400 modems). One point of having interface files separate is tools like `make`. If the interface file's timestamp did not change, the interface is the same. It would probably be nicer to have two compilation artifacts, the extracted human-readable interface part and the object-file implementation part. It (in my case TopSpeed Modula-2) was waaaay faster than e.g. Borland C++ wading through endless .h files.
- coldtea 11y ago>It was easy to give your customers the proper interface files (they were compilable), so they could code against your interfaces. They are much lighter than the object files (it was the time of the floppy disk and 2400 modems). And how would they test/run their code, since the interfaces would at best link, but not run anything, being only stubs? >It would probably be nicer to have two compilation artifacts, the extracted human-readable interface part and the object-file implementation part. Yes, if interface-only coding was possible for the clients, and disk space was at a premium yes. Anything but having to manually write interface AND implementation.
- hderms 11y agoYou could generate a stubbed implementation from the header file, I guess.
- vidarh 11y ago> It would probably be nicer to have two compilation artifacts, the extracted human-readable interface part and the object-file implementation part. Oberon implementations traditionally generates symbol files, that while I believe they are usually binary tends to have tools to generate textual representations, and there are plenty of tools to generate versions of the modules with implementations stripped as well. To compile a module you should need only the symbol files of the modules you import, not the compiled modules themselves.
- MaysonL 11y agoOberon does'nt have separately written interface and implementation files, although Modula did. In Oberon, an interface file was derived from the implementation file (or from the object file), not written by the programmer.
- vidarh 11y agoIt's also a "feature" that Oberon removed.