samth
2017-2-20 14:10:22

@sabauma so we really do want to promote the regexp and then it would be fast


sabauma
2017-2-20 15:20:08

@samth That’s not quite what we want to do. What we want is to associate one trace tree to each regular expression. There are probably a couple ways we could accomplish that.


sabauma
2017-2-20 15:20:54
  1. We could allow the regexp library to expose each regexp as a green field to the JIT.

sabauma
2017-2-20 15:22:38
  1. Duplicate the code backing the matcher for each regular expression. Since the regexp compiler is producing closures, I think we could hack procedure-specialize to do this.

samth
2017-2-20 15:24:26

trying with procedure-specialize seems worthwhile since it already exists


sabauma
2017-2-20 15:26:28

Yes. It would require alterations to the regexp compiler to invoke procedure-specialize on every closure corresponding to a regular expression matcher.


sabauma
2017-2-20 15:27:59

That seems to be the desired behaviour you would want out of the compiler though. Have the compiler specialize the matcher on each regular expression.


samth
2017-2-20 15:28:13

right, but that seems like an easy change there, rather than something complex like exposing green fields to the racket level


sabauma
2017-2-20 15:29:30

I agree. I don’t htink making procedure speciaze work the way we want would be too hard either.


sabauma
2017-2-20 15:30:10

This might actually be a good use of the constant-folding branch, actually.


samth
2017-2-20 15:30:20

@sabauma meeting?


samth
2017-2-20 23:43:58

@mflatt somehow, extraction of arbitrary racket files is failing for me with an error about finding a linklet for read


samth
2017-2-20 23:44:02

I run this:


samth
2017-2-20 23:44:05

racket -l expander/bootstrap-run -- -c compiled/cache-src ++kot read read/api.rkt ++knot read read/primitive-parameter.rkt ++knot read read/readtable-parameter.rkt ++knot read read/readtable.rkt -s -x -o x.rkt.rktl -t x.rkt


samth
2017-2-20 23:44:19

where x.rkt is just an empty file in #lang racket/base


samth
2017-2-20 23:44:24

and it produces this error:


samth
2017-2-20 23:44:35
hash-ref: no value found for key
  key: '#s(link #<path:/home/samth/tmp/linklet/pkgs/expander/read/readtable.rkt> 0)
  context...:
   /home/samth/tmp/linklet/pkgs/expander/extract/flatten.rkt:163:0: find-knot-tying-alternate
   /home/samth/tmp/linklet/pkgs/expander/extract/flatten.rkt:92:6: for-loop
   /home/samth/tmp/linklet/pkgs/expander/extract/flatten.rkt:90:4: for-loop
   /home/samth/tmp/linklet/pkgs/expander/extract/flatten.rkt:65:2: for-loop
   /home/samth/tmp/linklet/pkgs/expander/extract/flatten.rkt:55:0: pick-variable-names21
   /home/samth/tmp/linklet/pkgs/expander/extract/flatten.rkt:13:0: flatten!12
   /home/samth/tmp/linklet/pkgs/expander/extract/main.rkt:23:0: extract11
   "/home/samth/tmp/linklet/pkgs/expander/run.rkt": [running body]
   for-loop_82
   run-module-instance!123.1
   for-loop_81
   for-loop_80
   run-module-instance!123.1
   perform-require!74.1

samth
2017-2-20 23:44:51

but extracting the expander works fine (just delete -t x.rkt)


samth
2017-2-20 23:45:08

similarly, extracting a small file that uses #%kernel also works


mflatt
2017-2-21 01:22:23

@samth use ++knot read -- insead of the other ++knots


mflatt
2017-2-21 01:23:09

I will eventually change the extraction code to delay the complaints until the reference survives simplification, and ++not read -- shouldn’t be needed after that


mflatt
2017-2-21 01:23:59

The ++knots for the expander don’t work because your module doesn’t implement the reader


samth
2017-2-21 02:45:23

@mflatt I think I’m missing something


samth
2017-2-21 02:45:40

because that doesn’t work — it complains about being unable to find --.rkt


mflatt
2017-2-21 02:46:19

I think it should be - instead of --


samth
2017-2-21 02:52:57

great, that works


samth
2017-2-21 02:53:13

I’m getting closer to automatically running a racket file via chez


samth
2017-2-21 02:54:03

still some import stuff to get working