質問

私は大学でMLを学ぶのが本当に好きでした。機能的なプログラミングは、特定のアルゴリズムを書くためのさわやかなエレガントな方法であることがよくあります。私はF#のことを聞いて、それを少し遊んだことがあります。それでも、MLでいくつかの興味深い機能を書きましたが、他のアプリケーションで使用できるライブラリとしてそれらを統合したいと考えています。

通常、機能をSMLNJインタープリターに貼り付けます。それらをコンパイルできる方法はありますか?

役に立ちましたか?

解決

のようなものを使用する必要があります MLJコンパイラ. 。 Java Byteコードにコンパイルします。または、を使用できます sml.net .NET ILにコンパイルするコンパイラ。

他のヒント

その中で一般的です ml 双方がCにエクスポートし、次のc関数を呼び出すために。ほぼすべてがCに「簡単に」エクスポートするためのFFIライブラリがあります

http://www.smlnj.org/doc/smlnj-c/index.html

したがって、外の世界には、SMLライブラリがCのように振る舞います。

*保証ではありません

Projects popularize languages. Do the ground work for an interesting and undeniably 'cool' project using ML, and people will flock to the language. For instance,look at Erlang with ejabberd and mochiweb - both cool projects that have done wonders for a one-time-diamond-in-the-rough language like erlang (which is, btw, my development language of choice lately). I for one, would love to see somebody make something rad with ML, the language is a joy to think with.

There are several Standard ML compilers. The MLton wiki also contains a benchmark.

I used Moscow ML which compiles Standard ML into bytecode. It's not fast, but it works. MLton is often cited to be the best Standard ML compiler with regard to efficiency.

Note that Poly/ML version 5 or later supports both the traditional "heap dump" model, and C-style standalone executables. The documentation on the Poly/ML website is spread over many different spots, some of them with really old dates in the title -- but the system is alive and kicking.

The object-code generation is explained in passing in release notes for the version 5.0 release (we are presently at 5.5): see PolyML.export there.

There is also some Poly/ML C interface, which has been renovated as used for some GUI projects recently. You should ask at the polyml mailing list.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top