forked from coalton-lang/coalton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.lisp
44 lines (31 loc) · 1.51 KB
/
settings.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;;;; settings.lisp
;;;;
;;;; This file contains variables that can be used to control how
;;;; Coalton works.
(in-package #:coalton-impl)
(defun coalton-release-p ()
"Determines how redefinable code generated by Coalton is.
In development mode (i.e. (not (coalton-release-p))), Coalton turns all declare-type forms into CLOS objects
to support a repl based workflow.
In release mode Coalton compiles declare-type forms into frozen structs or even more optimal layouts which may
not support redefinition.
Development mode is the default.
Enable release mode either by setting the UNIX environment variable COALTON_ENV to \"release\", or by pushing
`:release' into `*features*'. Either of these must be done before loading Coalton.
"
(uiop:featurep :coalton-release))
(when (string-equal (uiop:getenv "COALTON_ENV") "release")
(pushnew :coalton-release *features*))
(when (coalton-release-p)
(format t "~&;; COALTON starting in release mode~%"))
;; Configure the backend to print out the ast of toplevel forms
(declaim (type boolean *coalton-dump-ast*))
(defvar *coalton-dump-ast* nil)
;; Configure the backend to remove env updates from the generated code
(declaim (type boolean *coalton-skip-update*))
(defvar *coalton-skip-update* nil)
;; Configure the backend to remove type annotations from the generated code
(declaim (type boolean *emit-type-annotations*))
(defvar *emit-type-annotations* t)
(defvar *coalton-optimize* '(optimize (speed 3) (safety 0)))
(defvar *coalton-optimize-library* '(optimize (speed 3) (safety 1)))