scala.net 生产准备好了吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/743172/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 01:24:53  来源:igfitidea点击:

Is scala.net production ready?

.netscala

提问by CDR

Scala seems to have a .NET implementation too. I was wondering if it's a complete implementation with no loose ends or just a showcase thing.

Scala 似乎也有一个 .NET 实现。我想知道它是否是一个完整的实现,没有松散的结局,或者只是一个展示的东西。

It's important, because the app we are about to develop should have Windows GUI besides the main implementation on web. Having a language where the core code can be ported between two implementations looks like a deal maker.

这很重要,因为我们将要开发的应用程序除了 Web 上的主要实现之外还应该具有 Windows GUI。拥有一种可以在两个实现之间移植核心代码的语言看起来像一个交易者。

Anyone worked on the .NET implementation of Scala? Any feedback?

有人从事过 Scala 的 .NET 实现吗?任何反馈?

采纳答案by psp

I have heard new funding has been acquired for the .NET side, but at the moment it is a great and increasing distance from "production ready" or even "usable". There hasn't been a check-in which meaningfully touched the .NET side in a long time.

我听说 .NET 方面获得了新的资金,但目前距离“生产就绪”甚至“可用”还有很大的距离。很长一段时间以来,没有任何有意义地触及 .NET 方面的签入。

Update Jan 15 2010:A recent message to one of the scala lists.

2010 年 1 月 15 日更新:最近发送到其中一个 Scala 列表的消息。

From: Lukas Rytz

来自:卢卡斯·雷兹

On Fri, Jan 15, 2010 at 03:18, Naftoli Gugenheim wrote:

2010 年 1 月 15 日星期五 03:18,Naftoli Gugenheim 写道:

Not sure if this is what you're looking for but I think H2 can be run on
.NET, according to its documentation/website.
If you're looking for a database engine programmed in Scala, personally I
haven't heard of any but that doesn't mean anything.
If you mean an ORM etc. there are a few. You can use Lift Mapper even in a
non-Lift application (just include the webkit and util jars IIRC).
What is the status of Scala on .NET?

不确定这是否是您要查找的内容,但
根据其文档/网站,我认为 H2 可以在.NET上运行。
如果您正在寻找用 Scala 编程的数据库引擎,我个人
没有听说过,但这并不意味着什么。
如果您的意思是 ORM 等,则有几个。您甚至可以在
非 Lift 应用程序中使用 Lift Mapper (仅包含 webkit 和 util jars IIRC)。
.NET 上的 Scala 处于什么状态?

We're working on bootstrapping the compiler and we're fixing MSIL-Backend-Bugs along the way. EPFL will provide a compiler running on .NET (which uses IKVM.OpenJDK.Core.dll, at least in a first version)

我们正在努力引导编译器,并在此过程中修复 MSIL-Backend-Bugs。EPFL 将提供在 .NET 上运行的编译器(至少在第一个版本中使用 IKVM.OpenJDK.Core.dll)

Right now, we have a cross-compiler running on the JVM, and a reduced version of scala-library.jar which runs on .NET.

现在,我们有一个在 JVM 上运行的交叉编译器,以及一个在 .NET 上运行的 scala-library.jar 的简化版本。

For some parts we will rely on the community (e.g. porting more of scala-library.jar to .NET).

对于某些部分,我们将依赖社区(例如,将更多的 scala-library.jar 移植到 .NET)。

Lukas

卢卡斯

回答by Brownie

Martin Odersky says in this SE Radio interview(January 2011):

Martin Odersky 在接受 SE Radio 采访时说(2011 年 1 月):

I don't want to give you an estimated time of arrival but it should be certainly this year including visual studio support.

我不想给你估计的到达时间,但肯定应该是今年,包括视觉工作室支持。

He starts talking about .NET at the 15 minute mark.

他在第 15 分钟开始谈论 .NET。

回答by Jon Skeet

The Wikipedia entryclaims:

维基百科条目要求:

An alternative implementation exists for the .NET platform, but it has not been kept up to date. (citation needed)

.NET 平台有一个替代实现,但它没有保持最新。(需要引用)

The "limitations" section of the FAQhas this entry:

FAQ“限制”部分有这个条目:

Does Scala work on .Net?

Yes, the current Scala distribution can compile program for the .Net platform. The .Net platform has many similarities to Java but it has also many idiosyncrasies, making maintaining this port is a complicated task. The MSIL/.Net version of Scala implements at this stage virtually the entire Scala language, and most of the standard libraries. One significant limitation is that structural types do not yet work on .NET. There may still be problems when using particularly complex exception handlers. A small number of libraries are not available due to the peculiarities of .Net, and the interaction with other .Net languages is unsupported. For further details, please refer to this (possibly a bit outdated) documentation page.

Scala 在 .Net 上工作吗?

是的,目前的Scala 发行版可以为.Net 平台编译程序。.Net 平台与 Java 有很多相似之处,但它也有很多特性,使得维护这个端口是一项复杂的任务。Scala 的 MSIL/.Net 版本在这个阶段几乎实现了整个 Scala 语言和大多数标准库。一个重要的限制是结构类型还不能在 .NET 上工作。使用特别复杂的异常处理程序时可能仍然存在问题。由于 .Net 的特殊性,少数库不可用,并且不支持与其他 .Net 语言的交互。有关更多详细信息,请参阅此(可能有点过时)文档页面。

The guide to using Scala with .NETtalks about version 1.4, which is rather old by now. On the other hand, it looks like documentation was written as recently as 2008, including the "Scala on .NET: quirks"page which sounds pretty important.

.NET 中使用 Scala指南谈到了 1.4 版,它现在已经很老了。另一方面,看起来文档是在 2008 年最近编写的,包括“Scala on .NET: quirks”页面,这听起来很重要。

Without having any experience of it myself, it sounds like support is limping along, but that the .NET port isn't really a first-class citizen. The fact that there's no "buzz" around Scala on .NET (compared with the Java version) isn't encouraging either. It doesn't sound like something I'd want to use for commercial software at the moment. Of course, it's possible that it's fine, and just not well marketed. If you're really keen on the idea, I'd ask on a mailing list.

在我自己没有任何经验的情况下,听起来似乎支持一瘸一拐,但 .NET 端口并不是真正的一等公民。.NET 上的 Scala 没有“嗡嗡声”(与 Java 版本相比)这一事实也不令人鼓舞。这听起来不像我现在想用于商业软件的东西。当然,也有可能它很好,只是没有很好地营销。如果您真的对这个想法感兴趣,我会在邮件列表中询问。

Why not either use the Eclipse RCPfor a Java/Scala-based Windows client, or use .NET for the web app?

为什么不将Eclipse RCP用于基于 Java/Scala 的 Windows 客户端,或者将 .NET 用于 Web 应用程序?

回答by Brownie

In an interview on scala-lang.org on 18th July 2011:

在 2011 年 7 月 18 日在 scala-lang.org 上的采访中:

Can I run Scala programs on .Net now?
Miguel:
The simple answer is yes, with a few limitations that will be remove by the fall.

我现在可以在 .Net 上运行 Scala 程序吗?
Miguel
简单的答案是肯定的,但有一些限制将在秋季取消。

Link: The inteview
Link: Binaries

链接:采访
链接:二进制文件

回答by Steve Gilham

At the moment -- no, not really, which is a great pity, since it's quite a fun language.

目前——不,不是真的,这是一个很大的遗憾,因为它是一种非常有趣的语言。

"Hello world" type programs, fine -- even fancy tricks like writing a simple stack where a small piece of Python (the same code under Jython or IronPython) drives the same piece of Scala.

“Hello world”类型的程序,很好——甚至是花哨的技巧,比如编写一个简单的堆栈,其中一小段 Python(在 Jython 或 IronPython 下的相同代码)驱动同一段 Scala。

Anything moderately taxing -- the scalac-net compilation can and will throw, even if the code doesn't use anything outside the scala namespace, and builds and passes a fairly exhaustive set of unit tests on the JVM. It can balk at building against even fairly simple assemblies (even if built using .net 1.0, to match the low spec of the mscorlib included in the scala-msil bundle).

任何适度繁重的事情——scalac-net 编译可以并且将会抛出,即使代码不使用 scala 命名空间之外的任何东西,并且在 JVM 上构建并通过了一组相当详尽的单元测试。它甚至可以拒绝针对相当简单的程序集进行构建(即使使用 .net 1.0 构建,以匹配 scala-msil 包中包含的 mscorlib 的低规格)。

My test-sets for "moderately taxing" have included the following implementations intended to compensate for current lacks on .net

我的“适度征税”测试集包括以下实现,旨在弥补 .net 当前的不足

  • a port to Scala of a C# library for BigInteger (from codeplex, with my own unit tests)
  • a port to Scala of the Java code in scala.actors
  • BigInteger 的 C# 库的 Scala 端口(来自 codeplex,带有我自己的单元测试)
  • scala.actors 中 Java 代码的 Scala 端口

回答by jsuereth

As of Scala Days 2010 in April, Miguel Garcia was working on Scala.NET. I believe he's working on a visual studio plugin and I'm not sure how far along things are, however you can find evidence of his work here:

在 2010 年 4 月的 Scala Days 上,Miguel Garcia 正在研究 Scala.NET。我相信他正在开发一个视觉工作室插件,我不确定事情进展了多远,但是你可以在这里找到他工作的证据:

http://lamp.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/http://www.sts.tu-harburg.de/people/mi.garcia/ScalaCompilerCorner/MixedSourceScalaCSharp.pdfhttp://www.sts.tu-harburg.de/people/mi.garcia/ScalaCompilerCorner/ScalaNetLearnsLINQTricks.pdf

http://lamp.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/ http://www.sts.tu-harburg.de/people/mi.garcia/ScalaCompilerCorner/MixedSourceScalaCSharp.pdf http://www.sts.tu- harburg.de/people/mi.garcia/ScalaCompilerCorner/ScalaNetLearnsLINQTricks.pdf

Miguel is now doing his postdoc at EPFL: http://lamp.epfl.ch/~magarcia/

Miguel 现在在 EPFL 做他的博士后:http: //lamp.epfl.ch/~magarcia/

Paul (extempore)'s answer probably has more up-to-date information, but if I were curious I might ask Miguel directly.

保罗(即席)的回答可能有更多的最新信息,但如果我很好奇,我可能会直接问米格尔。

回答by QrystaL

DDJ: Is there a .NET version of Scala planned?

MO: Yes. We announced it in July. We have a project, which is actually funded by Microsoft, to build a .NET version of Scala. And we have the first bootstrap version of the compiler compiling itself on .NET. There is still work to do, especially on Visual Studio integration.

DDJ:是否有 .NET 版本的 Scala 计划?

莫:是的。我们在 7 月宣布了它。我们有一个项目,实际上是由 Microsoft 资助的,用于构建 .NET 版本的 Scala。我们有编译器的第一个引导版本,可以在 .NET 上自行编译。还有很多工作要做,尤其是在 Visual Studio 集成方面。

Interview with Scala's Martin Odersky - July 14, 2011

Scala 的 Martin Odersky 专访 - 2011 年 7 月 14 日

回答by t0rx

Looking in the SVN repo, there's definitely some activity going on in the .net space. In 2.7.xthere was a dotnet-librarydirectory, but that's gone in 2.8.xand trunk. Instead there is a msildirectory which has had some non-trivial things going on as recently as 4 months ago by rytz.

查看 SVN 存储库,.net 空间中肯定有一些活动正在进行。在2.7.x有一个dotnet-library目录,但走了的2.8.xtrunk。取而代之的是msil,有一个目录在最近4 个月前由 rytz 进行了一些重要的事情。

All the documentation available seems to be way out of date, but maybe it's worth asking one of the main contributors what the current status is. Note that extempore (who as already answered this over a year ago) seems to be one of them.

所有可用的文档似乎都过时了,但也许值得向主要贡献者之一询问当前的状态。请注意,即席(一年多前已经回答了这个问题)似乎是其中之一。