Scala中的哪些功能/功能仅作为对基础平台的让步而存在,如果针对其他功能,则应将其删除? [英] Which functionality/feature in Scala only exists as a concession to the underlying platform and should be removed if targeting something else?

查看:49
本文介绍了Scala中的哪些功能/功能仅作为对基础平台的让步而存在,如果针对其他功能,则应将其删除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

前一段时间,我读到有关用于LLVM的Scala ,我一直想知道Scala语言/规范/库中只有哪些东西能够使JVM满意或改善与Java的互操作.

A while ago I read about Scala for LLVM and I kept wondering which things in the Scala language/specification/library) only exist to make the JVM happy or improve interop with Java.

考虑到在LLVM上运行Scala可以提供更多的自由度,并且计划是移植该语言(而不是围绕它的整个Java生态系统),而在那里没有什么功能呢?

Considering that running Scala on the LLVM provides much more freedoms and the plan is port the language (and not the whole Java ecosystem around it) which features won't make sense there?

指导:我想知道诸如Object#finalize,监视器内容(notifywait),cloneCloneable之类的东西,没有64位数组索引,集合大小限制为32位,java.lang.String,Java反射,...

Guidance: I'm wondering about things like Object#finalize, the monitor stuff (notify, wait), clone vs. Cloneable, no 64-bit array indices, collection sizes limited to 32-bit, java.lang.String, Java reflection, ...

推荐答案

AnyVal类型分支可能在永恒的地狱之火中燃烧.数组可以以理智的方式实现(好吧,丑陋现在已经很好地隐藏了),与类型化的类型相同.方法clonehashCodetoString可以进入它们所属的类型类.可以在没有多个arg列表的情况下实现咖喱.类型推断和类型级别编程可以得到改善.

The AnyVal type branch could burn in eternal hell fire. Arrays could be implemented in a sane way (okay, the ugliness is hidden pretty well now), same for reified types. The methods clone, hashCode and toString could go into type classes where they belong. Currying could be implemented without multiple arg lists. Type inference and type level programming could be improved.

这篇关于Scala中的哪些功能/功能仅作为对基础平台的让步而存在,如果针对其他功能,则应将其删除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆