To install click the Add extension button. That's it.

The source code for the WIKI 2 extension is being checked by specialists of the Mozilla Foundation, Google, and Apple. You could also do it yourself at any point in time.

4,5
Kelly Slayton
Congratulations on this excellent venture… what a great idea!
Alexander Grigorievskiy
I use WIKI 2 every day and almost forgot how the original Wikipedia looks like.
Live Statistics
English Articles
Improved in 24 Hours
Added in 24 Hours
Languages
Recent
Show all languages
What we do. Every page goes through several hundred of perfecting techniques; in live mode. Quite the same Wikipedia. Just better.
.
Leo
Newton
Brights
Milds

From Wikipedia, the free encyclopedia

Concurrent ML
ParadigmConcurrent computing
FamilyML
First appeared1991; 33 years ago (1991)[1]
Websitehttp://cml.cs.uchicago.edu/
Major implementations
SML/NJ,[2] MLton,[3] Manticore[4]

Concurrent ML (CML) is a concurrent extension of the Standard ML programming language, characterized by its ability to allow programmers to create composable communication abstractions that are first-class rather than built into the language. The design of CML and its primitive operations have been adopted in several other programming languages, such as GNU Guile,[5] Racket,[6] and Manticore.[4]

YouTube Encyclopedic

  • 1/1
    Views:
    934
  • Functional Programming 101 with Scala and ZIO - Functional World #3

Transcription

Concepts

Many programming languages that support concurrency offer communication channels that allow the exchange of values between processes or threads running concurrently in a system. Communications established between processes may follow a specific protocol, requiring the programmer to write functions to establish the required pattern of communication. Meanwhile, a communicating system often requires establishing multiple channels, such as to multiple servers, and then choosing between the available channels when new data is available. This can be accomplished using polling, such as with the select operation on Unix systems.

Combining both application-specific protocols and multi-party communication may be complicated due to the need to introduce polling and checking for blocking within a pre-existing protocol. Concurrent ML solves this problem by reducing this coupling of programming concepts by introducing synchronizable events.[7] Events are a first-class abstraction that can be used with a synchronization operation (called sync in CML and Racket) in order to potentially block and then produce some value resulting from communication (for example, data transmitted on a channel).

In CML, events can be combined or manipulated using a number of primitive operations. Each primitive operation constructs a new event rather than modifying the event in-place, allowing for the construction of compound events that represent the desired communication pattern. For example, CML allows the programmer to combine several sub-events in order to create a compound event that can then make a non-deterministic choice of one of the sub-events. Another primitive creates a new event that will modify the value resulting from synchronization to the original event. These events embody patterns of communication that, in a non-CML language, would typically be handled using a polling loop or function with handlers for each kind of event.

Hello world

Here is a program that prints "Hello, world!" to the console. It spawns one thread with a channel for strings, and another thread which prints a string received on the channel. It uses SML/NJ and CML. (Note that the heap name will be different on non linux-x86 platforms; you may need to change the line with "cml_test.x86-linux" to something different.)

cml_test.cm
Library
    structure Hello
is
    $cml/basis.cm
    $cml/cml.cm
    cml_test.sml
cml_test.sml
structure Hello = struct
    open CML

    fun hello () = let
        val c : string chan = channel ()
        in
            spawn (fn () => TextIO.print (recv c));
            send (c, "Hello, world!\n");
            exit ()
        end

    fun main (_, argv) =
        RunCML.doit (fn () => ignore (spawn hello), NONE)
end
bash
$ ml-build cml_test.cm Hello.main
Standard ML of New Jersey v110.60 [built: Mon Nov 27 14:19:21 2006]
[scanning cml_test.cm]
[library $cml/basis.cm is stable]
[library $cml/cml.cm is stable]
[parsing (cml_test.cm):cml_test.sml]
[creating directory .cm/SKEL]
[library $cml/cml-internal.cm is stable]
[library $cml/core-cml.cm is stable]
[library $SMLNJ-BASIS/basis.cm is stable]
[compiling (cml_test.cm):cml_test.sml]
[creating directory .cm/GUID]
[creating directory .cm/x86-unix]
[code: 2170, data: 42, env: 2561 bytes]
[scanning 18518-export.cm]
[scanning (18518-export.cm):cml_test.cm]
[parsing (18518-export.cm):18518-export.sml]
[compiling (18518-export.cm):18518-export.sml]
[code: 309, data: 37, env: 42 bytes]
$ heap2exec cml_test.x86-linux cml_test
$ ./cml_test
Hello, world!

External links

References

  1. ^ Reppy, John H. (June 1991). CML: a Higher-Order Concurrent Language. PLDI.
  2. ^ "What is Standard ML of New Jersey?". Retrieved April 5, 2021.
  3. ^ "ConcurrentMLImplementation". Retrieved April 5, 2021.
  4. ^ a b Fluet, Matthew; Bergstrom, Lars; Ford, Nic; Rainey, Mike; Reppy, John; Shaw, Adam; Xiao, Yingqi (May 2009). "Programming in Manticore, a Heterogenous Parallel Functional Language" (PDF). Retrieved July 11, 2018.
  5. ^ Wingo, Andy (June 29, 2017). "A New Concurrent ML". Retrieved July 11, 2018.
  6. ^ Flatt, Matthew; Findler, Robert Bruce (2004). "Kill-safe synchronization abstractions". Proceedings of the ACM SIGPLAN 2004 conference on Programming language design and implementation. Vol. 39. pp. 47–58. doi:10.1145/996841.996849. ISBN 1581138075. S2CID 5547460.
  7. ^ Reppy, John H. (1993). "Concurrent ML: Design, application and semantics". Functional Programming, Concurrency, Simulation and Automated Reasoning. Lecture Notes in Computer Science. Vol. 693. pp. 165–198. CiteSeerX 10.1.1.50.7965. doi:10.1007/3-540-56883-2_10. ISBN 978-3-540-56883-4.
This page was last edited on 27 February 2024, at 11:04
Basis of this page is in Wikipedia. Text is available under the CC BY-SA 3.0 Unported License. Non-text media are available under their specified licenses. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. WIKI 2 is an independent company and has no affiliation with Wikimedia Foundation.