<commit_before>; front end to the bytecode compiler
; loads all the files and defines an entry function

; define the <hl> package and import functions and macros needed 
; by the compiler from <arc>v3
; TODO: move in a file conditionally loaded only when bootstrapping
;       using hl-arc-f
(in-package hl)
(using <arc>v3)
; Should really use <hl>def, not just def, because def in this
; context will be <arc>def.  Same with <hl>type etc.
; Please see http://hl.webhop.net/item?id=103 ; I recommended
; using 3 sections, and specified which ones should specify
; specific packages, and which ones just use <arc> packages.
(interface v0 def mac if and no or each load string unpkg prn = w/infile 
              let with withs fn afn require w/uniq coerce + push listtab
              givens make-br-fn ++ acons ssyntax isnt caris _ in type isa
              alist err is car cons cdr map orf awhen do trav+ when ontable
              list aif zap self rfn pos complement dotted len on
              index copy mappend cadr cddr len> it some assert given case
              >= > keep idfn rev - mem max mapeach atom bound rep apply
              ; types
              int num char table string sym bool)

(set <hl>unpkg <arc>unpkg)
(set <hl>ssyntax <arc>ssyntax)
(set <hl>pos <arc>pos)

; fix differences between the host and the target
; this is actually a superset, i.e. they do *at least* what their hl
; counterpart do
(mac <axiom>lambda (args . body)
  `(fn ,args ,@body))

(set <axiom>tag <arc>annotate)
(set <axiom>cons <arc>cons)
(set <axiom>i- -)<commit_msg>hl2b/bootstrap: Added definition for <hl>def<commit_after>; front end to the bytecode compiler
; loads all the files and defines an entry function

; define the <hl> package and import functions and macros needed 
; by the compiler from <arc>v3
; TODO: move in a file conditionally loaded only when bootstrapping
;       using hl-arc-f
(in-package hl)
(using <arc>v3)
; Should really use <hl>def, not just def, because def in this
; context will be <arc>def.  Same with <hl>type etc.
; Please see http://hl.webhop.net/item?id=103 ; I recommended
; using 3 sections, and specified which ones should specify
; specific packages, and which ones just use <arc> packages.
(interface v0 def mac if and no or each load string unpkg prn = w/infile 
              let with withs fn afn require w/uniq coerce + push listtab
              givens make-br-fn ++ acons ssyntax isnt caris _ in type isa
              alist err is car cons cdr map orf awhen do trav+ when ontable
              list aif zap self rfn pos complement dotted len on
              index copy mappend cadr cddr len> it some assert given case
              >= > keep idfn rev - mem max mapeach atom bound rep apply
              ; types
              int num char table string sym bool)

(mac <hl>def (spec . rest)
  (if
    (acons spec)
      `((<axiom>symeval '<common>call-w/gvl)
         (<axiom>lambda ()
           (<axiom>set ,(car spec)
             ; should really be <hl>fn, but for now we use
             ; <axiom>lambda
             (<axiom>lambda ,(cdr spec)
               ,@rest))))
      `((<axiom>symeval '<common>call-w/gvl)
         (<axiom>lambda ()
           (<axiom>set ,spec
             ,(car rest))))))

(def <common>call-w/gvl (f) (f))

(set <hl>unpkg <arc>unpkg)
(set <hl>ssyntax <arc>ssyntax)
(set <hl>pos <arc>pos)

; fix differences between the host and the target
; this is actually a superset, i.e. they do *at least* what their hl
; counterpart do
(mac <axiom>lambda (args . body)
  `(fn ,args ,@body))

(set <axiom>tag <arc>annotate)
(set <axiom>cons <arc>cons)
(set <axiom>i- -)
{'fraction_non_alphanumeric': 0.09445359692476661, 'fraction_numerical': 0.004118616144975288, 'mean_word_length': 2.767321613236815, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1258779', 'n_tokens_mistral': 1160, 'n_tokens_neox': 1137, 'n_words': 484}