News for hackers. Stuff that matters.
Re:Homoiconic Python by Garlef on Sunday May 12, 2024 @03:06PM (#40336685)
Wait... Isn't this just an implementation of lisp in python?

It's not a homoiconic version of python as the title sugests, right?

Or am I missing something?

Re:Homoiconic Python by evanjrowley on Sunday May 12, 2024 @03:24PM (#40336830)
You would be correct according to Greenspun's 10th Rule: https://en.m.wikipedia.org/wiki/Greenspun's_tenth_rule
Re:Homoiconic Python by dj_mc_merlin on Sunday May 12, 2024 @04:01PM (#40337143)
Yep. I also got really excited thinking this is homoiconic python I might be able to make my coworkers use (without having them buy into lisp). But no, it's just lisp.
Re:Homoiconic Python by gus_massa on Monday May 13, 2024 @12:17AM (#40339748)
You may want to take a look at Rhombus, that is a somewhat-python-like language with macros that is written in Racket.

> Rhombus is an experimental, general-purpose programming language with conventional expression syntax that is built on Racket and that is macro-extensible in the same way as Racket.

It's still work in progress, but you can install and run the prototype. I recomend to take a look at the "demo" file with examples https://github.com/racket/rhombus-prototype/blob/master/demo...

Or read the docs https://docs.racket-lang.org/rhombus/index.html , in particular an overwiew in https://docs.racket-lang.org/rhombus/Modules.html and some examples of macros in https://docs.racket-lang.org/rhombus/expr-macro.html .

Re:Homoiconic Python by matheusmoreira on Sunday May 12, 2024 @10:08PM (#40339208)
Looks like it. I was curious to witness this homoiconic Python but I'm not sure it's even possible. For that to be true, Python syntax would have to be made out of tuples, lists or dictionaries, and the interpreter would have to evaluate those directly.
Re:Homoiconic Python by 3abiton on Monday May 13, 2024 @05:49AM (#40341396)
What is the difference?
Re:Homoiconic Python by xaellison on Monday May 13, 2024 @10:44AM (#40343934)
The whole point of homoiconicity is that a language (lisp) is implemented in itself. This is lisp implemented in python (not itself).
Re:Homoiconic Python by Zamiel_Snawley on Monday May 13, 2024 @12:10PM (#40344880)
I thought the point of homoiconicity was essentially runtime reflection and evaluation of programs constructed at runtime, i.e. code is a first class datatype in the language.

I don't think these properties imply much about the underlying implementation of the language.