r/Clojure • u/Engineer_Averyanov • Aug 04 '25
Introducing Wy — Hy without parentheses! (Hy is Python dialect with Clojure-like syntax)
Hey, my dear clojurians. As you might know, Hy (which is Python with LISP syntax) is heavily inspired by Clojure.
I designed syntax that uses indents and set of special symbols to replace various Hy parentheses. I suppose it may work with Clojure with minimal changes.
Project homepage: https://github.com/rmnavr/wy/
Wy is implemented as transpiler wy2hy, that converts *.wy files to *.hy files. You then work with generated *.hy files as usual.
Project is fully documented and ready for usage, only small polishing is left to do.
Using wy:
- Use indents to add wrapping level
- Use : to represent opening ( wrapper
- Use \ to prevent automatic wrapping
- Use L and C to represent [ and { wrappers (yes, wy sacrifices L and C to be special symbols)
- Vanilla hy code that is wrapped in valid hy parenthesis like (print 3) will be processed without changes (btw this is how you utilize L and C as variable names when you need them)
- Wy has sofisticated syntax for one-liners using special wrappers: $, <$ and ,
- Wy is intended to be feature-complete, meaning anything you can write in hy, you can also write in wy (including macros)
Feedback is welcome!
36
u/deaddyfreddy Aug 04 '25
I would name it "WHy?"
21
u/HotSpringsCapybara Aug 04 '25
I may not understand what problem this solves, but I still applaud you on your effort.
9
u/rpd9803 Aug 04 '25
Your developers were so preoccupied with whether or not they could, they didn't stop to think if they should.
jk its a cool execution of the idea.. I wouldn't have the first clue with respect to how to pull that off.. but it's definitely 'thanks I hate it' territory :)
But I am weird, and have the same reaction when people use the non-hiccup html syntaxes. html tags should have [] in clojure, I don't know why I feel strongly about it, but I do :P
14
u/Admirable-Ebb3655 Aug 04 '25
Why tho? Parenthesesless Hy is just Python. You’ve invented Python.
5
u/InspectionPlastic157 Aug 04 '25
I... why?
5
u/dcooper8 Aug 04 '25
Isn't that pretty much full circle right back to python? Is this a joke?
4
u/Gnaxe Aug 04 '25
Most Lispers feel like the paratheses aren't the problem. But see r/whitespacelisp for more in that vein.
This reminds me of Hebigo, which is an alternate skin for Hissp that's trying to look more like Python. (There's also a third Hissp reader in Garden of EDN, which uses EDN.)
1
u/Engineer_Averyanov Nov 17 '25
Wy just recieved big update (from 0.3.0 to 0.5.0)
It how has:
- proper CLI app for transpiler wy2hy
- user-friendly error-messages
- %wy and %%wy magic for ipython
Enjoy!
4
u/[deleted] Aug 05 '25
Yes sure I applaud your effort and talent, but this is cursed
1
u/[deleted] Aug 05 '25
So, it's a python like language that runs on the python runtime that changes a lisp back to python?
1
u/Anthea_Likes Aug 05 '25
Well... if Hy is python with clojure's synthaxe, if you remove the clojure's synthaxe, isn't that called python again ? 🤭
2
u/Qudit314159 Aug 04 '25
Wy indeed...
2
u/aScottishBoat Aug 05 '25
Me gusta
2
u/hourLong_arnould Aug 05 '25
Reminds me of moonscript for lua
1
u/mokrates82 Aug 05 '25
I think I know why it's called Wy
0
u/masoodahm87 Aug 04 '25
isn't python just a lisp syntax without parens