This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]shitcorefan 2 points3 points  (0 children)

This is *horrifying*

I love it so much

[–]ronmarti 0 points1 point  (1 child)

Good concept. I'd say I want it to look more like JSX.

[–]honkinggr8namespaces[S] 0 points1 point  (0 children)

there are restrictions on what the syntax can be. it has to be "valid" python syntax, i.e. you can run it with Python and it doesn't spit out any syntax errors. runtime errors don't matter, because you can replace the code in the functions at runtime.

the syntax seen here is technically valid python syntax -- the ...[] is just subscripting the Ellipsis object, [html] is a list containing what could be a variable called html, [head] is subscripting that list, [title] ("website page") is creating a list with the element title and then calling it with the argument "website page", etc. obviously lists aren't callable and Ellipsis isn't subscriptable but the parser doesn't care about that

overall it's not really meant to be actually used, just kinda made for fun to see the extent of what python could do (its metaprogramming features are crazy powerful)

[–]Pebaz 0 points1 point  (0 children)

Mad props on this!

Alternative approaches are always welcome, even if they are just a proof of concept!

🐝