You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to dev
After the Inside Racket Seminar with Matthew [1], I was struck by how
easy it looked to add transformations to the optimizer to turn safe
calls into the unsafe calls if they are already protected by a
predicate.
So, I made a really small commit that demonstrates this cf70c4a241.
Please look at it on Github. The commit adds a simple transform of
bytes-length to unsafe-bytes-length on (a) literal bytes and (b)
identifiers previously checked by bytes?.
The Github has comments about how each part works. This is in the
commit, rather than the source, so as to not clutter it.
"Wherefore, be not weary in well-doing,
for ye are laying the foundation of a great work.
And out of small things proceedeth that which is great."
- D&C 64:33
Gustavo Massaccesi
unread,
Apr 5, 2016, 5:49:40 PM4/5/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Jay McCarthy, dev
:) Just a few minor comments:
It's better to keep the code for strings and bytes in sync, so an
"easy" project is to add the equivalents optimizations for strings.
("easy" because I think that using this as a template, there won't be
any surprise.)
The problem with string/bytes is that too many interesting functions
return a string/bytes, and it's painful to add them to
rator_implies_predicate (
https://github.com/racket/racket/blob/cf70c4a24168643f8871d655f1700a813d68a28e/racket/src/racket/src/optimize.c#L2563 ) because they are compared to a global variable that most of the time
has to be created. But I think it should not be a problem to compare
them by name. (I actually prefer the comparison that use the global,
but the other method is used many times.)