Scala come linguaggio per la programmazione generica

13

Nel documento "Uno studio comparativo esteso sul supporto linguistico per la programmazione generica" di Garcia et al. un interessante confronto tra le caratteristiche dei linguaggi di programmazione per la programmazione generica è dato:

conlabrevespiegazionedellaterminologia:

Qualcuno può testare il supporto di Scala per la programmazione generica all'interno di questo framework? Cioè aggiungi una colonna nella prima tabella con le spiegazioni possibili.

    
posta Artem Pelenitsyn 24.11.2012 - 12:00
fonte

1 risposta

7

Come menzionato in uno dei commenti dall'OP, questa è la tabella che spiega come confrontare Scala per il supporto generico alla programmazione. Link al pdf sorgente

Successivamente, viene fornito il seguente riepilogo:

Scala
Using the CONCEPT pattern we can model multi-type concepts, multiple constraints and support retroactive modeling. Furthermore, Scala’s support for implicits means that the drawbacks of the Java and C# solutions in terms of the additional overhead, do not apply to Scala. Thus, Scala scores well in both the implicit argument deduction and the retroactive modeling criteria. Section 6 shows that associated types are supported in Scala through type members and dependent method types, and type members can also be used as type aliases.
As shown in Section 3, Scala supports lexically scoped models. Furthermore type-checking is fully modular. Prioritized overlapping implicits provide some support for concept-based overloading as illustrated by the zipWithN example in Section 6.5. However, overlapping models have to be structured using a subtyping hierarchy, which may not always be desirable. Thus, the score for this feature is only sufficient. Finally, Scala has full support for first-class functions and it also supports equality constraints.
In summary Scala turns out to be a language with excellent support for generic programming features, managing to fare at the same level, or even slightly better, than G (which was specially designed as a language for generic programming in the large) or Haskell (which has been recognized has having very good support for generic programming).

E poi nel sommario:

Type members and dependent method types add extra power to the language and a combination of the two mechanisms allows associated types to be expressed. In combination with implicits, type members and dependent method types make Scala an language ready for generic programming in the large

    
risposta data 23.10.2013 - 20:59
fonte

Leggi altre domande sui tag