lang-party / Summer2022

Lang Party 2022
24 stars 1 forks source link

Standard ML, a statically typed, polymorphic, modular, strict, functional language #10

Open dmacqueen opened 2 years ago

dmacqueen commented 2 years ago

Entry

https://www.smlfamily.org

Used for general-purpose programming, research, and education, particularly in the areas of symbolic computing, compiling, formal methods, applied logic.

An example compiler written in Standard ML: Standard ML of New Jersey (https://www.smlnj.org).

Licence

The language per se is not licensed. Its formal definition has been published by MIT Press: The Definition of Standard ML (Revised), Milner, Tofte, Harper, MacQueen, 1997. Further information is available at smlfamily.org.

The SML/NJ compiler is licensed under a BSD 3-clause open source license.

This submission is licensed under Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/).

Contact

See www.smlnj.org.

stchang commented 2 years ago

Hi, not sure if this is applicable, but you may be interested in our "mlish" #lang: https://github.com/stchang/mlish

It is an SML-inspired typed language that attempts to demonstrate that Racket-style extension capabilities can work in the typed world as well. Some features we've implemented, as libraries, are type classes and GADTs.

While it is very much a research prototype, we have spent a decent amount of time trying to build a small mlish code base that includes some Language Shootout Benchmarks, Okasaki's functional data structures, and even some Cornell FP course HW.

Feedback welcome.

spdegabrielle commented 2 years ago

Hi @dmacqueen

I was excited to see this submission for Standard ML

Do you think the subset of SML used in ‘The Little MLer’ would be an suitable & achievable challenge for the time remaining in the Summer lang party event? [1]

I suspect it would be a valuable artefact for learning the basics of a Standard ML implementation. (And I’d love to see support for Standard ML in the DrRacket IDE [2])

If an individual or small group were to attempt an implementation - would you be willing to participate or mentor?

Best wishes

Stephen

[1] https://github.com/lang-party/Summer2022#lang-party-summer-2022 [2] https://docs.racket-lang.org/tools/lang-languages-customization.html

Possible supporting resources: https://emina.github.io/rosette/ - verification!

spdegabrielle commented 2 years ago

@dmacqueen i also need to ask - how did you find out about the Summer lang party event?

dmacqueen commented 2 years ago

That sounds like an interesting project, and I myself have though from time to time that it might be useful, pedagogically, to have a small, or “mini” Standard ML that would be very easy to digest. [Although in practice, I have used Standard ML in courses (on e.g. programming languages), where I have introduced enough of Standard ML in a two-hour tutorial to students who were new to the language to suffice for the purposes of the course.]

The "Little MLer” book seems to include most of the main elements of Standard ML (algebraic datatypes, polymorphism, modules (both structures and functors), pattern matching, exceptions), but it is a bit hard to tell given the style in which the book is written, conveying everything via examples or sequences of examples. I could not find references or arrays, so it looks like stateful data structures are not included, but given that it supports exceptions and their handlers, the language does include “effects”, which has an impact on type inference, leading to the “value restriction” complication that is not necessary in a purely functional, effect-free language.

If performance is not a major issue, pattern matching can be handled naively (I’ve recently written a new optimizing “match compiler” for SML/NJ). The type inference and type checking would be a little challenging, as would the module system, though there are ways to simplify that. There is also the issue of the runtime system, gc, etc., though if you are building the implementation within a host language like Racket you can avoid all that.

Over the next few months I plan to rewrite both the type checker and module system of SML/NJ, so I will be immersed in the details of these parts of the language. I’d be glad to answer your questions.

Best,

Dave MacQueen

On Aug 4, 2022, at 1:13 PM, Stephen De Gabrielle @.***> wrote:

Hi @dmacqueen https://github.com/dmacqueen I was excited to see this submission for Standard ML

Do you think the subset of SML used in ‘The Little MLer’ would be an suitable & achievable challenge for the time remaining in the Summer lang party event? [1]

I suspect it would be a valuable artefact for learning the basics of a Standard ML implementation. (And I’d love to see support for Standard ML in the DrRacket IDE [2])

If an individual or small group were to attempt an implementation - would you be willing to participate or mentor?

Best wishes

Stephen

[1] https://github.com/lang-party/Summer2022#lang-party-summer-2022 https://github.com/lang-party/Summer2022#lang-party-summer-2022 [2] https://docs.racket-lang.org/tools/lang-languages-customization.html https://docs.racket-lang.org/tools/lang-languages-customization.html Possible supporting resources: https://emina.github.io/rosette/ https://emina.github.io/rosette/ - verification!

— Reply to this email directly, view it on GitHub https://github.com/lang-party/Summer2022/issues/10#issuecomment-1205721698, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGXNPK7KN5ZXGFJ4PCFRSTVXQP6RANCNFSM55D2TSMQ. You are receiving this because you were mentioned.

David MacQueen @.***

dmacqueen commented 2 years ago

I saw a reference to the Summer lang party in a tweet, but I can’t remember whose tweet.

On Aug 4, 2022, at 1:14 PM, Stephen De Gabrielle @.***> wrote:

@dmacqueen https://github.com/dmacqueen i also need to ask - how did you find out about the Summer lang party event?

— Reply to this email directly, view it on GitHub https://github.com/lang-party/Summer2022/issues/10#issuecomment-1205722562, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGXNPIYORG7W2HKTH7BWMTVXQQCLANCNFSM55D2TSMQ. You are receiving this because you were mentioned.

David MacQueen @.***