Skip to content

Instantly share code, notes, and snippets.

View andrewray's full-sized avatar

Andrew Ray andrewray

View GitHub Profile
@andrewray
andrewray / install.md
Last active September 20, 2016 16:08
Install hardcaml-riscv (20 sept 2016)
@andrewray
andrewray / gist:a6e44c0ab497e8737dc2
Created March 14, 2016 12:35
Dockerfile to build iocaml and run with jupyter
FROM ocaml/opam
RUN sudo apt-get install -y \
libgmp3-dev \
libzmq3-dev \
libffi-dev \
libssl-dev \
zlib1g-dev \
pkg-config \
build-essential \
(* Extending the LEDs example with a couple of more advanced features.
1) Use interfaces to define the input and output ports of the circuit
and then use the generic functors in HardCaml.Interface to avoid
needing to explicitly define port names with the `input` and `output`
functions.
2) Implement the pictorial statemachine from the diagram in the style
we would use if writing in VHDL or Verilog
@andrewray
andrewray / gist:4f4d1949934557ca1d59
Created May 22, 2015 15:54
An example GIST for the ocaml-github javascript test application
A simple GIST created to demonstrate ocaml-github javascript integration.

To access Iocaml require the package iocaml-kernel.notebook

From a discussion on using plplot in iocaml

yes, either Iocaml.dispaly or Iocaml.send_mime could do the job in sligthly different ways:

?context:Iocaml.cell_context -> ?base64:bool -> string -> string -> unit
@andrewray
andrewray / gist:179832b0ea39481d0f2c
Last active August 29, 2015 14:17
install zmq3 (yes really 3) for ubuntu 12.04
#!/bin/sh -ex
echo 'yes' | sudo apt-add-repository ppa:lvillani/zeromq3
sudo apt-get update
sudo apt-get install --force-yes -y libzmq3=3.2.4+dfsg-1~precise1~ppa1 libzmq3-dev=3.2.4+dfsg-1~precise1~ppa1
@andrewray
andrewray / solver.ml
Created March 14, 2015 02:38
OCaml conjugate gradient solver (for positive semi-definite matrices). For use in the Coursera "VLSI CAD: Logic to Layout" mooc placement exersize.
(*
An OCaml (4.02) port of the C++ conjugate gradient solver.
Demo
----
$ ocaml
# #use "solver.ml";;
# let b, (err, x) = Demo.solve_small();;
@andrewray
andrewray / cifakiyo128.p64
Last active August 29, 2015 14:06
cifakiyo h.261 bitstream
@andrewray
andrewray / enable-easy.patch
Last active August 29, 2015 14:06
enable easy by default
diff --git a/utils/clflags.ml b/utils/clflags.ml
index 0f557a7..6cb1a76 100644
--- a/utils/clflags.ml
+++ b/utils/clflags.ml
@@ -110,4 +110,4 @@ let runtime_variant = ref "";; (* -runtime-variant *)
let keep_locs = ref false (* -keep-locs *)
let unsafe_string = ref true;; (* -safe-string / -unsafe-string *)
-let easy = ref false (* -easytype *)
+let easy = ref true (* -easytype *)
@andrewray
andrewray / improved-error.patch
Last active August 29, 2015 14:06
Improving Type Error Messages in OCaml, Arthur Charguéraud (ported to 4.02.0 release)
diff --git a/.depend b/.depend
index 9b6b9ff..c845f3e 100644
--- a/.depend
+++ b/.depend
@@ -86,7 +86,7 @@ parsing/printast.cmx : parsing/parsetree.cmi utils/misc.cmx \
parsing/syntaxerr.cmo : parsing/location.cmi parsing/syntaxerr.cmi
parsing/syntaxerr.cmx : parsing/location.cmx parsing/syntaxerr.cmi
typing/annot.cmi : parsing/location.cmi
-typing/btype.cmi : typing/types.cmi typing/path.cmi parsing/asttypes.cmi
+typing/btype.cmi : typing/types.cmi typing/path.cmi parsing/asttypes.cmi typing/typedtree.cmi