Hacker News new | ask | show | jobs
by pjmlp 300 days ago
The class/struct approach predates C#.

For example in Eiffel by default they are references, but can also be turned into value types if the are blesses ones like numeric types, or if the developer tags them as expanded classes, either at definition or declaration type.

Delphi makes the distinction between classical object, and records from Object Pascal (both value based, and explicit pointers are required), or class types, heap only.

Modula-3 classes and records also follow similar approach, OBJECT follows the same semantic model of REF RECORDS.

For more modern examples, also D and Swift follow this approach.

And plenty of other examples for anyone wanting to dive into SIGPLAN.