cfbolz changed the topic of #pypy to: #pypy PyPy, the flexible snake https://pypy.org | IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end and https://libera.irclog.whitequark.org/pypy | the pypy angle is to shrug and copy the implementation of CPython as closely as possible, and staying out of design decisions
jcea has quit [Ping timeout: 268 seconds]
<ruth2345345> Does writing cached functions make sense with PyPy, or will repeated calls to the same function with the same arguments get optimized away anyway?
<cfbolz> ruth2345345: depends what the function is doing
<cfbolz> ruth2345345: if the function is straightline code, and mostly functional operations, pypy will optimize it away
<ruth2345345> And if it's a method providing a (potentially rather complex) string representation of an object, often accessed, but rarely changed (only when object's properties are altered) - in that case, should I manually cache it?
<cfbolz> ruth2345345: yeah, that sounds like a case where caching could help? but it's always best to try and measure
<cfbolz> ruth2345345: what are you using pypy for?
<ruth2345345> Not using it, but kinda wanting to run a small experiment and maybe try implementing a very simple version of Tcl on top of it, just for fun. In the original Tcl interpreter everything has a string and internal representation, either updated lazily from the other and cached. So I was wondering if maybe that's something that a tracing JIT would effectively take care of anyway
<ruth2345345> Is this guide on making an interpreter still valid? https://www.pypy.org/posts/2011/04/tutorial-writing-interpreter-with-pypy-3785910476193156295.html
<cfbolz> oh, tcl, that could be fun!
<cfbolz> ruth2345345: probably mostly still valid, it's possible that some details have changed
<cfbolz> it's git instead of hg now, and some imports are different
<cfbolz> ruth2345345: please ask questions here if you run into trouble
<ruth2345345> Thanks
<cfbolz> ruth2345345: I also did a relatively small language 2-3 years ago, let me try to find and link that
<cfbolz> it's for Lox, the language from the book "Crafting an Interpreter": https://github.com/cfbolz/yaplox/tree/jit
<cfbolz> and here's the stream I did about it, if you're into video: https://www.youtube.com/watch?v=fZj3uljJl_k
<ruth2345345> Thanks
Dejan has joined #pypy
campey has quit [Ping timeout: 246 seconds]
Diggsey has joined #pypy
[Arfrever] has quit [Ping timeout: 268 seconds]
[Arfrever] has joined #pypy
Dejan has quit [Quit: Leaving]
<ruth2345345> So first question... pypy/translator as mentioned in that guide no longer exists
<ruth2345345> So anyway, how do I just run RPython?
nij- has joined #pypy
<nij-> Hello! I saw that switching to sea-of-nodes is expected to make performance better in https://doc.pypy.org/en/latest/project-ideas.html
<nij-> I wonder though.. since python is dynamically typed, how would switching to sea-of-nodes make it much faster?
jcea has joined #pypy
nij- has quit [Ping timeout: 240 seconds]