caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Jon Harrop" <jdh302@jdh302.plus.com>
To: <caml-list@inria.fr>
Subject: [Caml-list] 100-line compiler written in OCaml using LLVM reloaded
Date: Wed, 5 Apr 2017 00:42:45 +0100	[thread overview]
Message-ID: <023a01d2ad9d$295a4c20$7c0ee460$@jdh302.plus.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1586 bytes --]

About 10 years ago I wrote this 100-line compiler for fun:

 

https://groups.google.com/forum/#!msg/fa.caml/i6IgSFX8XkY/4khF8z1V7loJ

 

I thought it would be cool to bring it back from the dead but I quickly got
stuck. I now have Opam, OCaml 4.03 and LLVM 4.0 installed on an Ubuntu box
and (I assume) running.

 

The first problem I hit is how I am supposed to build such things these
days. I tried to look it up on the developer tools page:

 

https://ocaml.org/learn/tutorials/dev_tools.html

 

But I immediately hit a bug on that page: The "under construction" gif isn't
properly animated. It should look like this, of course:

 

https://camo.githubusercontent.com/4a7cf94aedbd23c13cc2d75fdc3b2af5c816c208/
687474703a2f2f7374617469632e646967672e636f6d2f7374617469632f696d616765732f64
69676765722e676966

 

After the GIF I must say I found type is text data matches file from the
section on Plumbimg really useful.

 

Someone should really add an obituary for the author of the "Compilation
tools" section who sadly passed away before completing it. I leafed through
the section headings there, noted that Oasis is inspired by Cabal and
quickly crossed it off my list and decided to go with "ocamlbuild" instead.

 

If I do:

 

ocamlbuild miniml.byte

 

Then I get an error about my parser. I'm guessing this is because I used an
inline parser courtesy of camlp4 (or camlp5, I forget which) which has been
replaced with PPX which, I'm guessing, cannot do this. If so, what is the
easiest way to get this code running and how should I be building it?

 

Cheers,

Jon.

 


[-- Attachment #2: Type: text/html, Size: 4553 bytes --]

             reply	other threads:[~2017-04-04 23:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04 23:42 Jon Harrop [this message]
2017-04-05  2:24 ` Emilio Jesús Gallego Arias
2017-04-26 11:58   ` Jacques-Pascal Deplaix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='023a01d2ad9d$295a4c20$7c0ee460$@jdh302.plus.com' \
    --to=jdh302@jdh302.plus.com \
    --cc=caml-list@inria.fr \
    --cc=jon@ffconsultancy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).