Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rizo/meta
Personal hacking experiments with OCaml compiler infrastructure .
https://github.com/rizo/meta
Last synced: about 1 month ago
JSON representation
Personal hacking experiments with OCaml compiler infrastructure .
- Host: GitHub
- URL: https://github.com/rizo/meta
- Owner: rizo
- Created: 2014-09-04T20:06:52.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-16T23:57:48.000Z (over 10 years ago)
- Last Synced: 2023-03-11T03:57:00.920Z (almost 2 years ago)
- Language: OCaml
- Homepage:
- Size: 223 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
meta
====_Hackish experiments with the OCaml compiler infrastructure._
**Meta** is a custom front-end for the OCaml compiler built with the _compiler-libs_ package. It extends and simplifies the OCaml syntax but remains a superset of OCaml, which means that any valid OCaml code is also a valid Meta code.
Here is a small example of how Meta looks:
```
(* Function examples *)
(** Identity function *)
let id : 'a → 'a = λ x → x(** Function composition. *)
let compose : ('a → 'b) → ('c → 'a) → 'c → 'b =
λ f g x → f \ g x(* Type printing. *)
type person = {
name: string;
age: int
}let print_person_args : string → int → unit =
λ name age → print_endline \
"Name: " ^ name ^ "\n" ^
" Age: " ^ string_of_int age ^ "\n"let print_person_tuple : (string * int) → unit =
λ (name, age) → print_endline \
"Name: " ^ name ^ "\n" ^
" Age: " ^ string_of_int age ^ "\n"let print_person_record : person → unit =
λ {name; age} → print_endline \
"Name: " ^ name ^ "\n" ^
" Age: " ^ string_of_int age ^ "\n"let () =
print_person_record {name = "Eve"; age = 19};
print_person_args "Adam" 20;
print_person_tuple ("Eve", 19)```
### Features
- (Limited) Unicode support.
- Compact lambda syntax.
- Special _explicit application_ operator `\`.