Skip to content

Instantly share code, notes, and snippets.

View andrewray's full-sized avatar

Andrew Ray andrewray

View GitHub Profile
@andrewray
andrewray / gist:9488227
Created March 11, 2014 15:33
iocamljs session trying to load js_of_ocaml
{"worksheets":[{"cells":[{"metadata":{},"cell_type":"markdown","source":"This is a very bare version of iocamljs with nothing except the standard libraries."},{"metadata":{},"input":"Js.string","cell_type":"code","prompt_number":1,"outputs":[{"output_type":"pyout","prompt_number":1,"html":"<b><pre style=\"color:red\">File \"[1]\", line 1, characters 0-9:\nError: Unbound module Js\nCharacters 0-9:\n Js.string\n ^^^^^^^^^\n</pre></b>","metadata":{}}],"language":"python","collapsed":false},{"metadata":{},"cell_type":"markdown","source":"Load topfind"},{"metadata":{},"input":"#use \"topfind\"","cell_type":"code","prompt_number":2,"outputs":[{"output_type":"stream","text":"- : unit = ()\n","stream":"stdout"},{"output_type":"stream","text":"Findlib has been successfully loaded. Additional directives:\n #require \"package\";; to load a package\n #list;; to list the available packages\n #camlp4o;; to load camlp4 (standard syntax)\n #camlp4r;; to load camlp4 (
@andrewray
andrewray / gist:9952818
Created April 3, 2014 11:38
Tests for new js_of_ocaml bigarray implementations
{"metadata":{"name":"","language":"ocaml"},"worksheets":[{"cells":[{"metadata":{},"input":"#use \"topfind\";;\n#require \"bigarray\";;\nopen Bigarray;;","cell_type":"code","prompt_number":1,"outputs":[{"output_type":"stream","text":"- : unit = ()\n","stream":"stdout"},{"output_type":"stream","text":"Findlib has been successfully loaded. Additional directives:\n #require \"package\";; to load a package\n #list;; to list the available packages\n #camlp4o;; to load camlp4 (standard syntax)\n #camlp4r;; to load camlp4 (revised syntax)\n #predicates \"p,q,...\";; to set these predicates\n Topfind.reset();; to force that packages will be reloaded\n #thread;; to enable threads\n","stream":"stdout"},{"output_type":"stream","text":"\n","stream":"stdout"},{"output_type":"stream","text":"- : unit = ()\n","stream":"stdout"},{"output_type":"stream","text":"/home/andyman/.opam/4.01.0-test/lib/ocaml/unix.cma: loaded\n","stream":"stderr"},{
@andrewray
andrewray / gist:9980135
Last active August 29, 2015 13:58
Loading core_kernel in js_of_ocaml
{"metadata":{"name":"","language":"ocaml"},"worksheets":[{"cells":[{"metadata":{},"cell_type":"markdown","source":"# Loading core_kernel with js_of_ocaml\n\nThe following session is run using the iocamljs `min` kernel compiled using a 32 bit OCaml toolchain on a 64 bit host given [here](https://github.com/andrewray/opam/tree/master/compilers/4.01.0/4.01.0%2B32bit). The final `js_of_ocaml` compilation step is done with a 64 bit version of the `js_of_ocaml` compiler due to a [problem](https://github.com/ocsigen/js_of_ocaml/issues/133) with the 32 bit version.\n\nI have also been able to run the following to the same extent with a full 64 bit build, however, that requires various patches to bin_prot (32 bit bit patterns like `0x8000_0000` get marshalled in the `.cmo/a` files as 64 bit constants, which cannot be unmarshalled by js_of_ocaml - replacing them with code like `1 lsl 31` fixes it but it's a kludge)."},{"metadata":{},"input":"#use \"topfind\"","cell_type":"code","prompt_number":1,"outputs":[{"text":"-
@andrewray
andrewray / gist:10132427
Last active August 29, 2015 13:58
iocaml svg logo bodge
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
#aspcud_farm $in $out $pref -removed,-changed,-notuptodate
preamble:
property: criteria: string, pinned: bool = [false], build-dep: bool = [false], installed-root: bool = [false], reinstall: bool = [false], opam-version: string, opam-name: string
package: herelib
version: 3
depends: ocamlfind
conflicts: herelib
opam-name: herelib
opam-version: 109.10.00
@andrewray
andrewray / gist:f53c4545c004c89d06d1
Created June 5, 2014 11:40
opam patch for mikmatch - mikmatch_str depends on str not pcre
diff --git a/str/META.template b/str/META.template
index b692995..961e89b 100644
--- a/str/META.template
+++ b/str/META.template
@@ -2,7 +2,7 @@ name = "mikmatch_str"
version = "VERSION"
description = "Pattern matching extended with regexps in Ocamllex syntax"
-requires = "camlp4 pcre unix"
+requires = "camlp4 str unix"
@andrewray
andrewray / gist:b9091d1d36d2b9546549
Created July 16, 2014 11:39
configure-amd64-freebsd.patch
diff -rupN ocaml-4.01/configure ocaml-4.01-fix/configure
--- ocaml-4.01/configure 2014-04-03 17:16:33.000000000 +0100
+++ ocaml-4.01-fix/configure 2014-07-10 12:38:55.000000000 +0100
@@ -769,6 +769,8 @@ case "$arch,$model,$system" in
fi;;
amd64,*,solaris) as='as --64'
aspp='gcc -m64 -c';;
+ amd64,*,freebsd) as='as'
+ aspp='cc -c';;
amd64,*,*) as='as'
@andrewray
andrewray / gist:572ad71a051d2aa995c8
Created September 2, 2014 18:17
opam-improved-error depends patch
diff --git a/.depend b/.depend
index 8d35f6c..9e67499 100644
--- a/.depend
+++ b/.depend
@@ -80,7 +80,7 @@ parsing/printast.cmx : parsing/parsetree.cmi parsing/longident.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
@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
@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 *)