             [epicea.utils.access :as access] :reload-all))
 
 (spec/def ::unspecified nil?)
-
-(spec/def ::bool boolean?)
-(spec/def ::float float?)
-(spec/def ::double double?)
-(spec/def ::long #(instance? java.lang.Long %))
-(spec/def ::int #(or (instance? java.lang.Integer %)
-                     (int? %)))
 
 (spec/def ::dynamic (partial = :dynamic))
 


(spec/def ::record-field (spec/cat 
                          :key ::key
                          :value ::sized-type))

(spec/def ::record (spec/cat
                    :type (partial = :record)
                    :fields (spec/* ::record-field)))

(spec/def ::union (spec/cat
                   :type (partial = :union)
                   :alts (spec/* ::sized-type)))

(spec/def ::vec (spec/cat
                 :type (partial = :vec)
                 :type ::sized-type
                 :count ::count))

(spec/def ::vecdata (spec/cat
                     :type (partial = :vecdata)
                     :data (spec/* ::sized-type)))

;; Compile time tagging
(spec/def ::tagged (spec/cat
                    :type (partial = :tag)
                    :tag (constantly true)
                    :data ::sized-type))

(spec/def ::primitive (spec/or :double ::double
                               :float ::float
                               :long ::long
                               :int ::int
                               :bool ::bool
                               :number ::number))

(spec/def ::sized-type (spec/or :primitive ::primitive
                                :record ::record
                                :union ::union
                                :unspecified ::unspecified ;; <-- a primitive building block
                                :tagged ::tagged
                                :vec ::vec
                                :vecdata ::vecdata))

(spec/def ::array (spec/cat
                   :type (partial = :array)
                   :header (spec/? ::sized-type)
                   :data ::sized-type))

(spec/def ::type (spec/or :sized-type ::sized-type
                          :array ::array
                          :dynamic ::dynamic))

(defn export-primitive [x]
  [:export x])

(def get-pair-value (access/getter pair-value))

;;;;;; Type properties
;; When it is stored
(declare compute-size)

(defn size-op [f]
