Questions tagged [polyml]

The Poly/ML implementation of Standard ML

Poly/ML is an advanced (but little known) implementation of Standard ML.

Some notable features:

  • Full multiprocessor (multicore) support in the thread library and garbage collector.
  • Interactive debugger.
  • Fast compiler that produces fast native code (notably x86 and x86_64).
  • Support for Linux, Windows, Mac OS X in 32bit and 64bit mode.
  • It is the preferred SML implementation for large projects including Isabelle and HOL4.

See also the development site on Github.

60 questions
12
votes
2 answers

Does Standard ML support Unicode?

Does Standard ML support Unicode? I believe it does not but cannot find any authoritative documentation for SML stating such. A yes or no is all that is needed, but you must know for a fact. No guessing or I believe answers. An authoritative link…
Guy Coder
  • 24,501
  • 8
  • 71
  • 136
10
votes
3 answers

How to convert anything to string, in SML?

I'm trying to implement a test function to compare and show error message if they are not equal: exception AssertionErrorException of string fun assert(testName, actual, expect) : bool = if actual = expect then true else raise…
Freewind
  • 193,756
  • 157
  • 432
  • 708
8
votes
1 answer

Compiling SML projects from multiple files

I've got a project with many files in it and I want it to work with most popular compilers. Unfortunately, PolyML and SML/NJ require use statements, while MosML additionally requires explicitly loading basis library structures using load, which is…
zlotnleo
  • 275
  • 2
  • 12
8
votes
3 answers

How to add readline support in polyml interpreter?

I found that polyml is the implementation of ML that can be easily installed on Ubuntu (named polyml in repository and can be executed with poly). I am following the A Gentle Introduction to ML by Andrew Cumming. After few minutes of experiment with…
Santosh Kumar
  • 26,475
  • 20
  • 67
  • 118
6
votes
1 answer

I don't know how to open and run sml files with PolyML

I'm completely new to SML and I don't understand what am I supposed to do in order to create, edit, compile and run an sml file with PolyML. I'm using Windows and I don't know if I need to download another IDE, or some developement kit like for…
5
votes
1 answer

How to access a library in Poly/ML on Windows?

I have installed Poly/ML from the "PolyML5.6-64bit.msi" installer; I can start the REPL by clicking it in the Start menu; but I don't know how to access any libraries from it? I tried doing use "something", but it results in an error like below: >…
akavel
  • 4,789
  • 1
  • 35
  • 66
5
votes
1 answer

Getting parse tree from source code string in Poly/ML

I am trying to compile a string of source code and print the parse tree using Poly/ML. The following code compiles, but the parse tree is empty: fun main () = let val stream = TextIO.openString "let val a = \"abc\"; val b = \"def\"; val…
eatonphil
  • 13,115
  • 27
  • 76
  • 133
4
votes
1 answer

Printing Unicode Characters in Poly/ML

How can I print a lowercase Greek epsilon in SML (using Poly/ML)? I've tried the following: print "ε"; (* Error-unprintable character found in file *) print "\u03B5"; (* Error-Conversion exception (Invalid string constant) raised while converting…
Alex Coplan
  • 13,211
  • 19
  • 77
  • 138
4
votes
1 answer

Check if function is defined in SML

Given an SML source file, is it possible to check (using Poly/ML) whether or not a list of function/value names are defined? If so, how? Alternatively, I've noticed that you can do the following. Suppose we have a source file to be inspected named…
Alex Coplan
  • 13,211
  • 19
  • 77
  • 138
4
votes
1 answer

Shared libraries in Poly/ML

Is it possible to build a shared library using Poly/ML? I want to be able to create a C API for a Poly/ML library, and invoke/load it from different programming languages (e.g., Python). Did anybody try to do that? I know this can be done in…
Leonardo de Moura
  • 21,065
  • 2
  • 47
  • 53
4
votes
3 answers

Running Standard ML on Windows

I have been looking for some good documentation on how to get Standard ML running on windows. Does anyone have a good guide on this? I have tried compiling sml/nj in cygwin, using this guide: http://www.smlnj.org/install/index.html $…
user833970
  • 2,729
  • 3
  • 26
  • 41
3
votes
2 answers

PolyML Functions and Types

[...] a pair of functions tofun : int -> ('a -> 'a) and fromfun : ('a -> 'a) -> int such that (fromfun o tofun) n evaluates to n for every n : int. Anyone able to explain to me what this is actually asking for? I'm looking for more of an…
3
votes
1 answer

Is this snippet legal Standard ML according to the Definition?

Is the code snippet given below legal Standard ML according to the Definition? It type-checks with Poly/ML, but not with Moscow ML: infixr 5 ::: ++ signature HEAP_ENTRY = sig type key type 'a entry = key * 'a val reorder : ('a -> key) -> 'a…
isekaijin
  • 19,076
  • 18
  • 85
  • 153
3
votes
1 answer

Inspect values in a structure in Poly/ML

In Poly/ML, names of global values can be obtained by: map #1 ((#allVal PolyML.globalNameSpace) ()); and top level strucutres can be obtained similarly using #allStruct. Now, how can I list all values inside a structure? That is, is there a way to…
tkob
  • 113
  • 6
3
votes
1 answer

Standard ML export operator from structure as infix

I would like to declare an infix operator within a structure a for use outside the structure. But I cannot seem to get the "infixness" to be recognized outside the structure even when the structure has been opened. Here is an example using…
eatonphil
  • 13,115
  • 27
  • 76
  • 133
1
2 3 4