45 Commits

Author SHA1 Message Date
Gabriel Scherer
c99c947c18 compile.scm serialization: emit 32bit-format header when possible 2021-09-24 18:23:39 +02:00
Gabriel Scherer
8eb89941db compile.scm serialization: support smaller sizes, in particular 32bit compat 2021-09-24 18:23:04 +02:00
Gabriel Scherer
b103dc5241 test that we support higher-order functors 2021-09-08 18:20:54 +02:00
Nathanaël Courant
c68bec0f39 Optimize calls to primitives 2021-02-18 08:00:46 +01:00
Nathanaël Courant
9e3e03d70f Add really inefficient interval patterns 2021-02-15 11:14:52 +01:00
Nathanaël Courant
a18951cf07 Add int32, int64 and nativeint constants 2021-02-15 10:56:33 +01:00
Nathanaël Courant
e4304fc1b5 miniml: Handle 0x, 0o, 0b literals 2021-02-15 09:44:08 +01:00
Nathanaël Courant
64b1b0c402 miniml: output symbol table, handle uminus better, more primitives 2021-02-08 10:37:55 +01:00
Nathanaël Courant
b60b8bb356 Add a function executed at end of program (for flushing) 2021-01-11 12:20:11 +01:00
Nathanaël Courant
899bd1b913 Names for primitives 2021-01-11 10:20:58 +01:00
Nathanaël Courant
c80b7ee60f Fix incorrect computation of free variables for 'LLetrecfun 2021-01-08 12:35:23 +01:00
Nathanaël Courant
e1b82f9d49 Add M.(...) syntax in patterns 2021-01-06 12:25:52 +01:00
Nathanaël Courant
46b9b934a8 Add M.{ ... } syntax in both patterns and expressions 2021-01-06 12:25:52 +01:00
Nathanaël Courant
755ac6a4d4 General function application 2020-12-30 16:55:29 +01:00
Nathanaël Courant
4450a27f0f Add for and while loops 2020-12-30 16:20:24 +01:00
Nathanaël Courant
d7f4e971a4 Add 'a ref and related functions to lib.ml 2020-12-30 16:19:22 +01:00
Gabriel Scherer
7caf12247f string patterns
(I believe that the small size increase in all tests is due to the
unconditional registration of "caml_string_equal" as an additional
primitive.)
2020-12-29 20:30:22 +01:00
Gabriel Scherer
8665fbb5fa compile.scm: match .. with exception 2020-12-28 17:15:08 +01:00
Gabriel Scherer
0bf1f90c6a labels with patterns
(I wanted to use this feature in a test file.)
2020-12-28 17:15:08 +01:00
Gabriel Scherer
66d2988b37 use standard names in compiler tests 2020-12-21 17:33:37 +01:00
Gabriel Scherer
57459d078d test/lib.ml: bind more standard primitives and definitions 2020-12-21 17:33:37 +01:00
Gabriel Scherer
ef40f51bb9 support for when-guards in pattern clauses 2020-12-21 17:03:31 +01:00
Gabriel Scherer
5e52504cf9 pattern-matching: do not generate a default case when groups are complete 2020-12-21 12:44:33 +01:00
Gabriel Scherer
766606afd2
Merge pull request #37 from gasche/list-patterns
support list patterns [p1; p2; ...; pn]
2020-12-21 06:57:50 +01:00
Gabriel Scherer
bf1daa2a59 support list patterns [p1; p2; ...; pn] 2020-12-21 06:56:54 +01:00
Gabriel Scherer
68dff20576 inline records 2020-12-21 06:54:49 +01:00
Gabriel Scherer
5e8e1efc50 record field punning 2020-12-21 06:51:22 +01:00
Gabriel Scherer
d8f7ac5d24 record patterns 2020-12-20 22:21:02 +01:00
Gabriel Scherer
c93dcaac1d implement support for or-patterns 2020-12-19 10:01:21 +01:00
Gabriel Scherer
c1bdebc6c6 implement support for as-patterns 2020-12-19 10:01:21 +01:00
Gabriel Scherer
149271d65a fix a bug with irrefutable patterns in let 2020-12-19 10:01:21 +01:00
Gabriel Scherer
8b065f45ec change the pattern grammar (follow the expression grammar) to better handle nesting 2020-12-19 10:01:21 +01:00
Gabriel Scherer
95934067f5 deduplication of pattern actions 2020-12-19 10:01:21 +01:00
Gabriel Scherer
dea17c0c16 patterns.ml: use a large right-hand-side in a duplicated action 2020-12-19 10:01:21 +01:00
Gabriel Scherer
9de7a40764 compilation of nested patterns by matrix decomposition 2020-12-19 10:01:21 +01:00
Gabriel Scherer
d47ff5c47f substitution-on-the-fly as a generalization of the (let x = y in ...) optimization 2020-12-19 07:17:43 +01:00
Gabriel Scherer
5dc6313d54 opcodes arity compression 2020-12-18 23:48:14 +01:00
Gabriel Scherer
d5408c2a51 more functions.ml nitpicks 2020-12-17 14:32:13 +01:00
Gabriel Scherer
94387ffc7d test: split functions.ml into sections 2020-12-17 14:29:54 +01:00
Gabriel Scherer
97bbc9e67b surface syntax for local exits as extension points 2020-12-16 11:41:02 +01:00
Gabriel Scherer
255e342cd4 now that shapes are lowering-only, LLetOpen is not useful anymore 2020-12-14 10:52:04 +01:00
Gabriel Scherer
48c4ad41e9 track the size of the produced bytecode files 2020-12-12 13:21:50 +01:00
Gabriel Scherer
4d4f16572c test/Makefile: do not require that OCAMLRUN be explicitly set anymore
upon usage, this proved annoying
2020-12-12 12:04:37 +01:00
Gabriel Scherer
19255bce2c split the test file into several testfiles 2020-12-12 12:04:37 +01:00
Gabriel Scherer
c61d94ed0e turn hello.ml into a more convenient test
Now you can run

    make compiler-test

from the root of the repository to run hello.ml, and compare its
output to a version-controlled reference output.

If the output changes for good reasons, you can update the reference
file with

    make compiler-test-promote

Note: it may sound unpleasant to version-control program-generated
outputs, but in fact (as long as those outputs are kept
human-readable) this is an excellent idea for testing: it means that
any change to the testing output will be part of the commits/diffs,
making it easier for reviewers to understand the impact of a change.
2020-12-11 18:42:18 +01:00