4 ms·
You can write lisp-y python quite easily. It's not good, pythonic or maintainable, but for learning purposes it is acceptable, especially on the 2.x series. Jus
by antt 8y ago
You can write lisp-y python quite easily. It's not good, pythonic or maintainable, but for learning purposes it is acceptable, especially on the 2.x series. Just start with list comprehensions.
Lua and Ruby I fail to see how they are in any way lisp-y.
- armitron 8y agoRuby: Almost everything is an expression unlike Python, has symbols unlike Python, closures and anonymous functions are not crippled or second-class unlike Python, has full continuations unlike Python. Lua: Simple, minimal syntax which is consistent (unlike Python), multiparadigm, designed around one core datastructure, metatables/metamethods, metaprogramming is encouraged, has environments.
- cellularmitosis 8y agothere's also "hy", which gives you lisp syntax and access to the python libraries. https://github.com/hylang/hy https://github.com/hylang/hy
- alexeiz 8y agoI got the impression that Hy is stagnating. They removed 'let' in the recent releases (it's hard to imagine Lisp without 'let'). Also there is no support for async, which is pretty important for modern Python IMO.
- cellularmitosis 8y agoOh my, they removed 'cons' :( hy 0.11.1 using CPython(default) 3.5.3 on Linux => (cons 1 '(2 3)) (1 2 3) hy 0.15.0 using CPython(default) 2.7.13 on Linux => (cons 1 '(2 3)) Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/hy/importer.py", line 199, in hy_eval return eval(ast_compile(expr, "<eval>", "eval"), namespace) File "<eval>", line 1, in <module> NameError: name 'cons' is not defined
- emidln 8y agoIf by lispy you mean data oriented code with functions instead of classes and composition, I'd argue that it's not only pythonic, but import this compliant.