Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

231 lines (177 sloc) 6.312 kb
- object literals
{:m = 1; n = "abcd":} : [> `m of int; `n of string] Js.record Js.t
==> usual rule for mapping field names; check for no duplicate.
- array literals
in particular, heterogeneous arrays...
('a, 'b, 'c) t ???
module Tuple : sig
type 'a tuple
val e : unit tuple
val a : 'a tuple -> 'b -> ('a * 'b) tuple
type ('a, 'b) acc
val first : ('a * 'b, 'b) acc
val next : ('a, 'b) acc -> ('c * 'a, 'b) acc
val get : 'a tuple -> ('a, 'b) acc -> 'b
val set : 'a tuple -> ('a, 'b) acc -> 'b -> unit
end = struct
type 'a tuple = 'a
let e = ()
let a x y = (x, y)
<_0: t0; _1: t1; _n: tn> t
- polishing
- check canvas availability in examples
- finish planet (no cpu when not moving / not visible)
- take examples from
- planets (+satellites?) ===> Runge-Kutta
- 3D effects:
Compiler optimizations
- "unsafe" option: no check for division by zero / array access
- per module options: we could apply "unsafe" and "inline" options
- fix
- syntactic sugar for Javascript literal strings
+ optimization to avoid going through Caml strings
- Can we avoid spurious conversions from boolean to integers???
===> explicit conversion to boolean; specialized "if" that operates
on booleans directly
- constant hoisting (including functions, out of loops and functions)
- inline also partially applied functions
- we should check stack compatibility when parsing:
when jumping somewhere, the stack should keep the same shape
- Improved optimizations
==> cross-function optimizations
==> deadcode elimination inside blocks
(for instance, elimination of function which are defined in a
functor but are not used)
Special case for shortcut boolean operations...
| \2
| /\
|/ \
3 4
Float <-> hex
Filling a string
function stringFill3(x, n) {
var s = '';
for (;;) {
if (n & 1) s += x;
n >>= 1;
if (n) x += x;
else break;
return s;
Conversion string <-> array
Byte array ==> string
int array --map--> string array --join--> string
b[i] = toString[a[i]] where toString is a precomputed array of strings
- ISINT is compiled to "not a block"; document this deviation
(or document that we should not rely on the Obj module)
- should we rebind variables from a deeper level ?
(only if used more than once...)
var x = ...
function () {
var y = x;
... y .... y ... y ....
- be more cautious regarding how we print floats...
(is it accurate?)
==> gdtoa
- explicit conversion from int to boolean
- simplify conditional definition
should be:
Cond of Var.t * cont * cont
(we need to eliminate unnecessary conversions from bool to integer
for that)
- dynamic linking? (code generation from cmo files)
- Can we use the debugger information to generate specialized code?
(Use objects rather than arrays for tuples, ...)
- should wrap Ocaml exceptions (more robust code)...
==> use Error object as base object, special "message" method
- interprocedural analysis
==> order functions by similarity
==> 7-zip is better at compressing than gzip, with the same algorithm...
document as much as we can:
* the representation of datas, closures, ...
* the assumption we make regarding the bytecode
Inlining: see Manuel Serrano's paper
Resolving and Exploiting the k-CFA Paradox
Illuminating Functional vs. Object-Oriented Program Analysis
Matthew Might Yannis Smaragdakis David Van Horn
Use window.postMessage instead of setTimeout for yield (setTimeout
always waits a bit!)
==> but window.postMessage is synchronous in IE8
+ does not cooperate well with other users of message events
Could we generate ocaml bytecode as well? (bytecode optimizer)
LLVM code?
Targeting JAVA / .net seem harder: not type information...
Note that the OCamIL compilers and tools are currently based on OCaml
v3.06. An upgrade to the latest OCaml version is scheduled for the
next release.
[Never happened...]
ocamldefun (on ocaml_beginners)
I'd really like to play around ocamldefun, but it seems to only work
with ocaml 3.06. Has anyone had luck setting this up in more recent
versions of ocaml?
OCamlexc (on caml list)
So I was wondering if there is any current or recent projects (or interests)
to resume OCamlExc development and complete the set of handled constructs,
as I'm afraid I'll have neither the time nor the skills to do the job.
Jump to Line
Something went wrong with that request. Please try again.