[racket] Immutable vectors

From: Konrad Hinsen (konrad.hinsen at fastmail.net)
Date: Sat Sep 7 03:43:33 EDT 2013

David Van Horn writes:

 > Thee is also this:
 > 
 >     https://pkg.racket-lang.org/info/ralist
 > 
 > Which is not written in typed racket and has an un-contracted form for 
 > efficiency.

Installed, looks good. I'll try it in real life soon. Thanks!


Neil Toronto writes:

 > > The implementation is in Typed Racket as well, so should I expect the
 > > same performance problems as with arrays when I work in plain Racket?
 > 
 > Yes. A first-order data structure gets traversed every time it passes 
 > from untyped to typed code, to ensure its structure conforms to its 

That sounds reasonable, but in the scenario we are discussing
(accessing data structures implemented in Typed Racket from
plain Racket), the data structure never passes in that direction,
except if it's constructed from a plain Racket data structure,
and even then the border is crossed only once. So why should element
access be expensive?

Konrad.

Posted on the users mailing list.