https://github.com/Lupus/ocaml2go
OCaml to Golang compiler
https://github.com/Lupus/ocaml2go
Last synced: 8 months ago
JSON representation
OCaml to Golang compiler
- Host: GitHub
- URL: https://github.com/Lupus/ocaml2go
- Owner: Lupus
- License: mit
- Created: 2020-09-15T08:12:23.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-12T19:35:16.000Z (about 5 years ago)
- Last Synced: 2024-08-03T01:29:12.057Z (over 1 year ago)
- Language: Reason
- Size: 389 KB
- Stars: 37
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - ocaml2go
README
# OCaml2Go
OCaml2Go is a transpiler from OCaml bytecode to Golang. Although it can compile
considerably complex OCaml code, project is in early stages of development, I
would say proof of concept so far.
## Known limitations
* resulting code is very slow (OCaml works with dynamic value representation, a
lot of `interface{}` to get it working in Go)
* large monolithic output takes long time to compile
* no OCaml or Go build system integration
## How it works
OCaml2Go is build on top of [Rehp](https://github.com/jordwalke/rehp), a fork
of js_of_ocaml that supports pluggable backends.
Rehp produces intermediate representation, not specific to JavaScript backend,
OCaml2Go takes it from there and produces Golang code.
## Building and running tests
OCaml2Go depends on some pending PRs to Rehp, so to build it you need to pin
the following branch for now:
```
opam pin js_of_ocaml-compiler git+https://github.com/Lupus/rehp.git#ocaml2go
opam pin js_of_ocaml git+https://github.com/Lupus/rehp.git#ocaml2go
```
After that tests should be runnable with this script (from opam switch with all
dependencies installed):
```
./testGo.sh
```