aboutsummaryrefslogtreecommitdiff
path: root/src/bootstrap/verify.bqn
blob: 88b661f3ec8cbdde98b9d084ea560195312fced3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
glyphs  •Import "../glyphs.bqn"
gl  ("⟨""⟩"«∾","¨'"'(⊣∾∾˜)¨glyphs)      # Has to replace •args in c.bqn

f  "../c.bqn"("boot"∾∾".bqn")¨'1'+↕3   # Files to test
c  (13/glyphs•Import,•Import) {𝕎𝕩}¨ f  # Resulting compilers
c  (glyphs){𝕗𝕏}¨ c
t  (∾∾(@+10)¨)¨ (¯5↓∾gl˙) •FLines¨ f # Compiler source

# Check that compiler 𝕩 compiles 𝕩-1 same as full compiler
Ver  {
  norm  {𝕎𝕏}˜´ 𝕩  
    4              # Strip source info, always
    =¨(2¨2) # Turn only-dyadic functions to ambivalent, only ≥2
    (⊢-2×34=)     # VARU to VARO, could hit non-opcode numbers, oh well
  
  ! Norm´ (0𝕩c) {𝕎𝕩}¨ (𝕩-1)t
  •Out "Boot -",'0'+𝕩," verified!"
}
Ver¨ 1+↕3

•Out ""
•Out "Compile times, in milliseconds:"
•Show 1e3÷˜1e6× ((3>)1≥-){30(𝕨c)•_timed𝕩t}⌜˜ ↕≠c