52 karma · joined Apr 16, 2015 (11y ago) · 21 submissions
comment 5y ago · link · parent
comment 5y ago · link · parent
There are a bunch of little things that would improve the epub experience, like improved navigation and bookmarks (never really made use of these on my Kindle though). The biggest missing feature IMO as a Kindle replacement is the lack of builtin lighting.
comment 8y ago · link · parent
When you manually write a loop, there is only one 'body', so a tracing JIT turns that into a single or small number of traces.
For the loop inside of map, you need to produce side exits and new traces for each function passed in. The more times map is used, the slower it gets. This is made worse by the fact that traces out of side exits tend to not be optimized nearly as well.
Pycket has this same issue with its builtin (or hand written) looping _functions_ like map. Fortunately, Racket provides many useful looping macros which allows Pycket to generate unique traces for each loop, ameliorating this problem somewhat in Pycket.
comment 8y ago · link · parent
There are some benchmarks which evaluate Pycket's performance when applied to gradual typing [1]. Pycket does a pretty good job of optimizing the overheads of gradual typing (or at least Racket's implementation strategy), though it by no means eliminates the performance costs.
comment 9y ago · link · parent
def main():
a = 1
d = locals()
print d
d['b'] = 123
print b
print d
print d is locals()
main()
Which prints {'a': 1}
Traceback (most recent call last):
File "test.py", line 23, in <module>
main()
File "test.py", line 19, in main
print b
NameError: global name 'b' is not definedcomment 9y ago · link · parent
comment 9y ago · link · parent
comment 9y ago · link · parent
comment 9y ago · link · parent
1. Run Pixie atop the Python VM: this is quite slow as there are 2 levels of interpretation. This is mostly used for testing.
2. As a standalone binary: The RPython language includes a translator which targets C. The generated code is reasonably fast (I think the PyPy interpreter without the JIT is within a factor of 2 the CPython VM). The translator is also responsible for generating the JIT compiler for your interpreter, so a well written interpreter can indeed be quite fast, post translation.
comment 9y ago · link · parent
I completely agree, but there is also no need to perform TCO to make code like this safely runnable. TCO only becomes necessary/useful when implementing an iterative process where we can't statically know that the call stack won't be exhausted. That said, TCO is usually an all or nothing transformation, and it would be difficult to accurately avoid eliminating trivial tail calls like in your example.
A reasonable compromise might be for the Python VM to implement a TAIL_CALL bytecode op and require the programmer to decorate functions which rely on TCO. This wouldn't be any more onerous than manually trampolining large portions of code, which is the current method of getting around the lack of TCO.
comment 9y ago · link · parent
comment 9y ago · link · parent
comment 9y ago · link · parent
As for libraries, the only major feature that Pycket does not support is Racket's FFI, most built in functions can be implemented pretty easily if missing.
comment 9y ago · link · parent