ML (Meta Language) is a functional programming language. It is known for its use of the polymorphic Hindley–Milner type system, which automatically assigns the types of most expressions without requiring explicit type annotations (type inference), and ensures type safety – there is a formal proof that a well-typed ML program does not cause runtime type errors.[1] ML provides pattern matching for function arguments, garbage collection, imperative programming, call-by-value and currying. While a general-purpose programming language, ML is used heavily in programming language research and is one of the few languages to be completely specified and verified using formal semantics. Its types and pattern matching make it well-suited and commonly used to operate on other formal languages, such as in compiler writing, automated theorem proving, and formal verification.
Postingan
Draft Belajar Meta Language (ML) sebagai pondasi Paradigma Functional Language: OCAML
Be-Aware: in functional language mean -> declarative.
declarative mean -> system is smart enough than you.
forely, please read those description above
reference:
1. https://en.wikipedia.org/wiki/ML_(programming_language)
2. https://en.wikibooks.org/wiki/Standard_ML_Programming/Types
3. https://cs.lmu.edu/~ray/notes/introml/
practice:
https://ocaml.org/install
➜ ~ bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)"
## Downloading opam 2.1.5 for linux on x86_64...
## Downloaded.
## Where should it be installed ? [/usr/local/bin]
Write access to /usr/local/bin required, using 'sudo'.
Command: install -m 755 /tmp/opam-2.1.5-x86_64-linux /usr/local/bin/opam
[sudo] password for dev:
## opam 2.1.5 installed to /usr/local/bin
## Run this script again with '--restore ' to revert.
➜ ~ opam
usage: opam [--version]
[--help]
<command> [<args>]
The most commonly used opam commands are:
init Initialize opam state, or set init options.
list Display the list of available packages.
show Display information about specific packages.
install Install a list of packages.
remove Remove a list of packages.
update Update the list of available packages.
upgrade Upgrade the installed package to latest version.
config Display configuration options for packages.
repository Manage opam repositories.
switch Manage multiple installation prefixes.
pin Pin a given package to a specific version or source.
admin Tools for repository administrators
See 'opam help <command>' for more information on a specific command.
➜ ~ opam init
No configuration file found, using built-in defaults.
Checking for available remotes: rsync and local, git.
- you won't be able to use mercurial repositories unless you install the hg command on your system.
- you won't be able to use darcs repositories unless you install the darcs command on your system.
<><> Fetching repository information ><><><><><><><><><><><><><><><><><><><><><>
Processing 1/1: [default: http]
[default] Initialised
<><> Required setup - please read <><><><><><><><><><><><><><><><><><><><><><><>
In normal operation, opam only alters files within ~/.opam.
However, to best integrate with your system, some environment variables
should be set. If you allow it to, this initialisation step will update
your zsh configuration by adding the following line to ~/.zshrc:
[[ ! -r /home/dev/.opam/opam-init/init.zsh ]] || source /home/dev/.opam/opam-init/init.zsh > /dev/null 2> /dev/null
Otherwise, every time you want to access your opam installation, you will
need to run:
eval $(opam env)
You can always re-run this setup with 'opam init' later.
Do you want opam to modify ~/.zshrc? [N/y/f]
(default is 'no', use 'f' to choose a different file)
<><> Creating initial switch 'default' (invariant ["ocaml" {>= "4.05.0"}] - initially with ocaml-base-compiler)
<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><><><>
Switch invariant: ["ocaml" {>= "4.05.0"}]
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
∗ installed base-bigarray.base
∗ installed base-threads.base
∗ installed base-unix.base
∗ installed ocaml-options-vanilla.1
⬇ retrieved ocaml-base-compiler.5.1.0 (https://opam.ocaml.org/cache)
Processing 18/27: [ocaml-base-compiler: make]
debug hati