Ocaml FTW!

This commit is contained in:
Simon Forman
2022-09-23 08:37:04 -07:00
parent 8cb04fc72d
commit c76ae9979d
63 changed files with 324 additions and 0 deletions
@@ -0,0 +1,2 @@
(ocamlc /usr/home/sforman/.opam/default/bin/ocamlc.opt)
(ocaml_config_vars (afl_instrument false) (architecture amd64) (asm "cc -c") (asm_cfi_supported true) (ast_impl_magic_number Caml1999M031) (ast_intf_magic_number Caml1999N031) (bytecomp_c_compiler "cc -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -D_FILE_OFFSET_BITS=64 ") (bytecomp_c_libraries "-lm -lpthread") (c_compiler cc) (ccomp_type cc) (cma_magic_number Caml1999A031) (cmi_magic_number Caml1999I031) (cmo_magic_number Caml1999O031) (cmt_magic_number Caml1999T031) (cmx_magic_number Caml1999Y031) (cmxa_magic_number Caml1999Z031) (cmxs_magic_number Caml1999D031) (default_executable_name a.out) (default_safe_string true) (exec_magic_number Caml1999X031) (ext_asm .s) (ext_dll .so) (ext_exe "") (ext_lib .a) (ext_obj .o) (flambda false) (flat_float_array true) (function_sections true) (host x86_64-unknown-freebsd12.3) (int_size 63) (linear_magic_number Caml1999L031) (model default) (naked_pointers true) (native_c_compiler "cc -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -D_FILE_OFFSET_BITS=64 ") (native_c_libraries "-lm ") (native_pack_linker "ld -r -o ") (ocamlc_cflags "-O2 -fno-strict-aliasing -fwrapv -pthread -fPIC ") (ocamlc_cppflags "-D_FILE_OFFSET_BITS=64 ") (ocamlopt_cflags "-O2 -fno-strict-aliasing -fwrapv -pthread -fPIC ") (ocamlopt_cppflags "-D_FILE_OFFSET_BITS=64 ") (os_type Unix) (ranlib ranlib) (safe_string true) (standard_library /usr/home/sforman/.opam/default/lib/ocaml) (standard_library_default /usr/home/sforman/.opam/default/lib/ocaml) (supports_shared_libraries true) (system freebsd) (systhread_supported true) (target x86_64-unknown-freebsd12.3) (version 4.14.0) (windows_unicode false) (with_frame_pointers false) (word_size 64))
@@ -0,0 +1 @@
((6:ocamlc46:/usr/home/sforman/.opam/default/bin/ocamlc.opt)(17:ocaml_config_vars((14:afl_instrument5:false)(12:architecture5:amd64)(3:asm5:cc -c)(17:asm_cfi_supported4:true)(21:ast_impl_magic_number12:Caml1999M031)(21:ast_intf_magic_number12:Caml1999N031)(19:bytecomp_c_compiler75:cc -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -D_FILE_OFFSET_BITS=64 )(20:bytecomp_c_libraries14:-lm -lpthread)(10:c_compiler2:cc)(10:ccomp_type2:cc)(16:cma_magic_number12:Caml1999A031)(16:cmi_magic_number12:Caml1999I031)(16:cmo_magic_number12:Caml1999O031)(16:cmt_magic_number12:Caml1999T031)(16:cmx_magic_number12:Caml1999Y031)(17:cmxa_magic_number12:Caml1999Z031)(17:cmxs_magic_number12:Caml1999D031)(23:default_executable_name5:a.out)(19:default_safe_string4:true)(17:exec_magic_number12:Caml1999X031)(7:ext_asm2:.s)(7:ext_dll3:.so)(7:ext_exe0:)(7:ext_lib2:.a)(7:ext_obj2:.o)(7:flambda5:false)(16:flat_float_array4:true)(17:function_sections4:true)(4:host26:x86_64-unknown-freebsd12.3)(8:int_size2:63)(19:linear_magic_number12:Caml1999L031)(5:model7:default)(14:naked_pointers4:true)(17:native_c_compiler75:cc -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -D_FILE_OFFSET_BITS=64 )(18:native_c_libraries4:-lm )(18:native_pack_linker9:ld -r -o )(13:ocamlc_cflags48:-O2 -fno-strict-aliasing -fwrapv -pthread -fPIC )(15:ocamlc_cppflags23:-D_FILE_OFFSET_BITS=64 )(15:ocamlopt_cflags48:-O2 -fno-strict-aliasing -fwrapv -pthread -fPIC )(17:ocamlopt_cppflags23:-D_FILE_OFFSET_BITS=64 )(7:os_type4:Unix)(6:ranlib6:ranlib)(11:safe_string4:true)(16:standard_library41:/usr/home/sforman/.opam/default/lib/ocaml)(24:standard_library_default41:/usr/home/sforman/.opam/default/lib/ocaml)(25:supports_shared_libraries4:true)(6:system7:freebsd)(19:systhread_supported4:true)(6:target26:x86_64-unknown-freebsd12.3)(7:version6:4.14.0)(15:windows_unicode5:false)(19:with_frame_pointers5:false)(9:word_size2:64))))
@@ -0,0 +1 @@
version = 0.23.0
@@ -0,0 +1,4 @@
(executable
(public_name helloworld)
(name main)
(libraries helloworld))
@@ -0,0 +1,17 @@
type joy_type =
| JoySymbol of string
| JoyTrue
| JoyFalse
| JoyInt of int
| JoyList of joy_type list
type joy_list = joy_type list
let joy_true = JoyTrue
let joy_false = JoyFalse
let j_loop = JoySymbol "loop"
let empty_list = JoyList []
let zero = JoyInt 0
let dummy = [ joy_true; joy_false; j_loop; zero ]
let list_get jt = match jt with JoyList el -> el | _ -> []
let () = print_endline "Hello, World!"
@@ -0,0 +1,4 @@
(executable
(public_name helloworld)
(name main)
(libraries helloworld))
Binary file not shown.
@@ -0,0 +1,24 @@
type joy_type =
| JoySymbol of string
| JoyTrue
| JoyFalse
| JoyInt of int
| JoyList of joy_type list
(* type joy_list = joy_type list *)
let joy_true = JoyTrue
let joy_false = JoyFalse
let j_loop = JoySymbol "loop"
let zero = JoyInt 0
let dummy = JoyList [ joy_true; joy_false; j_loop; zero ]
let rec joy_to_string jt =
match jt with
| JoySymbol sym -> sym
| JoyTrue -> "true"
| JoyFalse -> "false"
| JoyInt i -> string_of_int i
| JoyList el -> "[" ^ (String.concat " " (List.map joy_to_string el)) ^ "]";;
let () = print_endline (joy_to_string dummy)
@@ -0,0 +1 @@
(* Auto-generated by Dune *)
@@ -0,0 +1,4 @@
(lang dune 3.4)
(name helloworld)
(sections (lib .) (bin ../../bin))
(files (lib (META dune-package opam)) (bin (helloworld)))
@@ -0,0 +1,8 @@
lib: [
"_build/install/default/lib/helloworld/META"
"_build/install/default/lib/helloworld/dune-package"
"_build/install/default/lib/helloworld/opam"
]
bin: [
"_build/install/default/bin/helloworld"
]
@@ -0,0 +1,31 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "A short synopsis"
description: "A longer description"
maintainer: ["Maintainer Name"]
authors: ["Author Name"]
license: "LICENSE"
tags: ["topics" "to describe" "your" "project"]
homepage: "https://github.com/username/reponame"
doc: "https://url/to/documentation"
bug-reports: "https://github.com/username/reponame/issues"
depends: [
"ocaml"
"dune" {>= "3.4"}
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/username/reponame.git"
@@ -0,0 +1,2 @@
(library
(name helloworld))
@@ -0,0 +1,2 @@
(library
(name helloworld))
Binary file not shown.
@@ -0,0 +1,2 @@
(test
(name helloworld))
@@ -0,0 +1,2 @@
(test
(name helloworld))
Binary file not shown.
@@ -0,0 +1 @@
(* Auto-generated by Dune *)