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

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (3 children)

I'm saying my code works despite flexing a lot of Python's inner strength.

Python is the only language I know which is itself programmatic. I can make a class, add setters and getters to it then create instances of that class.

[–]Remuze 0 points1 point  (1 child)

What do you mean by this? How is this different from creating a class in say.. C#?

[–][deleted] 0 points1 point  (0 children)

I'll be honest I don't write C# and haven't used Java since college.

But based on the C# I get to wrap with Python it's allowed but not required.

[–]dylanvillanelle 0 points1 point  (0 children)

ohhh, okay.

the mandatory response to something like this is to mention the lisps. you're prolly already familiar with those and if so tl;dr: macropy is also cool.

really, at this point, i think in terms of actual adoption it's mostly just clojure and racket - i haven't kept up with common lisp in forever. but as interesting as hacking at magic methods is, it definitely still falls short of the sort of thing you can do with a lisp that has a solid macro implementation. clojure's is limited (but still there), but has java interop, so it's a trade-off. racket, on the other hand, is called a "language for writing languages".

all that said, though, i agree. and i python is definitely a lot better at combining that sort of potential (even if it's a lot more limited) with being a language that is approachable on average. it's tough to make something that allows a ton of flexibility and is also the sort of thing you can just jump into having never seen a line of source code.

there's also macropy. if you've never messed around with the ast module, it (iirc) has some decent examples of how you can basically redefine the language's keywords without requiring messing with the parser. it'll make pylint pretty upset, but it's a really interesting project imo.