other-languages

2021-09-20T14:36:51.003200Z

I’m experimenting with a setup in Python and what I’m trying to achieve is a Clojure-like dev experience. Evaluating code, without typing in a separate shell. Looks promising so far! Might be a blog post, but I’ll have to use it in the Real World, with Real World Code first 😄

👏 1
2021-09-30T06:50:50.013100Z

I wrote down some thoughts, ideas and remaining questions about REPL Driven Development in Python: https://davidvujic.blogspot.com/2021/09/can-we-have-that-in-python-too.html

💯 1
rmxm 2021-09-21T11:28:23.012300Z

I also fiddled with python to get some tru repl, the problem is you would have to somewhat hack the import system. Clojure code is namespaced, python has module base system?. So changes in module do not affect, importers. Nowadays, I typically have some watch agent that constantly runs my main module and i just type stuff at the bottom to eval. Its annoying, but far less annoying than hacking the imports. It is only viable with "my" stuff, as with "other" stuff I will quickly run into some internal uninitialized state.

teodorlu 2021-09-21T16:18:12.012500Z

Live-py is awesome :) I used it for a while, it's absolutely amazing to learn how a library works. I ran into limitations for larger pieces of code, though.

➕ 1
souenzzo 2021-09-20T15:31:41.005700Z

Nice! you can switch the REPL to example module? then call "sample" directly?

2021-09-20T15:44:18.005900Z

I don’t think that’s possible without loading the current buffer into the shell. I guess it is because Python isn’t namespaced like Clojure.

2021-09-20T15:45:25.006100Z

The module is loaded as example so I think one can access that one from everywhere example.message()

✔️ 1
teodorlu 2021-09-21T05:45:26.011400Z

Cool! Are you using the editor to fill the REPL buffer from the file buffer? I did some some similar work with different assumptions: https://github.com/teodorlu/hotload

2021-09-21T06:23:28.011700Z

Yes, I’m running elpy-shell-send commands to pass the code to the REPL buffer. I have also configured IPython to auto-reload when a module has been changed. When searching for solutions about live coding and feedback in Python, I found your repo too and will try that one out!

👀 1
➕ 1
2021-09-21T06:27:52.011900Z

I’m also experimenting with this tool. I think it’s very cool with the instant feedback: https://github.com/donkirkby/live-py-plugin

😄 1
borkdude 2021-09-20T14:51:08.003800Z

I'm wondering if some people here have used Hy for leveraging the Python ecosystem

2021-09-20T15:10:43.005500Z

Love the header in the Hy Tutorial: Lisp-stick on a Python 😆 https://docs.hylang.org/en/alpha/tutorial.html

mpenet 2021-09-20T14:58:34.004200Z

it's quite horrible in my experience (was years ago tho)

walterl 2021-09-20T20:43:28.011200Z

Checked Hy out a few months ago, and also thought they made some really odd syntax choices. Can't recall specifics, but there were multiple details where I thought opting for the Python way of doing things (rather than the Clojure way) was unnecessarily complicating.

mpenet 2021-09-20T14:59:15.004700Z

there was libpython-clj that was promising

mpenet 2021-09-20T14:59:25.005Z

not sure how it is, I never tried

jsa-aerial 2021-09-20T17:11:31.007800Z

Yes, libpython-clj is likely the way to go for this. It is still evolving and there are Docker images combining Python, R and Julia. See here for the details: https://clojurians.zulipchat.com/#narrow/stream/215609-libpython-clj-dev

👍 1
jsa-aerial 2021-09-20T17:11:41.008200Z

The latest just being minutes ago