Skip to content
Proyek

Tentang

Haskell yang diimplementasikan dengan kombinator

Bahasa pemrograman dan runtime

Cara angka ini diukur

Pertumbuhan bintang terukur

dalam 24 jam
0
dalam 7 hari
+2
dalam 15 hari
+4
dalam 1 bulan
Mengumpulkan riwayat

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli
MicroHs

Micro Haskell

MicroHs (mhs) is a compiler for an extended subset of Haskell 2010, with many GHC extensions. It compiles to combinators that are executed by a small, portable runtime system written in C. The compiler can compile itself, and all you need to build it is a C compiler; no Haskell compiler is required. The runtime is small enough to run on micro-controllers.

Try it in your browser.

Installing

git clone --depth=1 https://github.com/augustss/MicroHs.git
cd MicroHs
make install

This installs mhs, cpphs, and mcabal (for installing packages) in ~/.mcabal/bin, together with the compiled base package. Add ~/.mcabal/bin to your PATH.

On Windows, make sure cl is in the path and use nmake -f Makefile.windows install.

Example

The file Example.hs contains:

module Example(fac, main) where

fac :: Integer -> Integer
fac 0 = 1
fac n = n * fac(n - 1)

main :: IO ()
main = do
  let rs = map fac [1,2,3,10,52]
  putStrLn "Some factorials"
  print rs

Compile and run it:

$ mhs Example -oEx
$ ./Ex
Some factorials
[1,2,6,3628800,80658175170943878571660636856403766975289505440883277824000000000000]

Running mhs with no arguments starts an interactive session.

Documentation

The full documentation is in doc/MicroHs.md.

There are some slides with a general presentation of MicroHs.

There is also a presentation from the Haskell Symposium 2024 (video) and a short paper, doc/hs2024.pdf.

Jelajahi proyek terkait

Memuat…