Live data from Hacker News

Anyprint: use any language's print statements in Python

github.com

21–30 of 76 posts

Re: Anyprint: use any language's print statements in Python

#21
post #20

Ironically, what I miss most from Python is Python2's print, which for a language proud of getting rid of parenthesis, that is very contradictory....

Same here. I will probably keep using Python 2 for as long as it works... simply because I don't have to type those parentheses.

As someone most at home in lisps--there's just no accounting for taste ;)

Re: Anyprint: use any language's print statements in Python

#23

Ironically, what I miss most from Python is Python2's print, which for a language proud of getting rid of parenthesis, that is very contradictory....

Perhaps you'd enjoy Nim which supports both.

    echo "hello world"
    echo("hello world")
and as a bonus, also the following:

    "hello world".echo

Re: Anyprint: use any language's print statements in Python

#24
Worth noting: the language's syntax must still be minimally compatible with Python -- this isn't some sort of magic parser hack, it's just adding functions and types with special behaviour (like having "cout" be an object that overrides __lshift__). Now, given that many Lisp and Lisp-likes support ridiculous parser hacks (Scheme/Racket come to mind), I bet you really could pull off "Anyprint" in one of those languages...

Re: Anyprint: use any language's print statements in Python

#25

Ironically, what I miss most from Python is Python2's print, which for a language proud of getting rid of parenthesis, that is very contradictory....

When I saw the title I thought to myself "this is going to be some elaborate troll about Python2 vs 3's print, isn't it?"

Re: Anyprint: use any language's print statements in Python

#26
post #21
post #20

Earlier quoted context omitted.

Same here. I will probably keep using Python 2 for as long as it works... simply because I don't have to type those parentheses.

As someone most at home in lisps--there's just no accounting for taste ;)

Is there a LISP with significant white space in place of parentheses? Our two groups could be united by the disgust of the rest of the programming community.

Re: Anyprint: use any language's print statements in Python

#27
post #23

Ironically, what I miss most from Python is Python2's print, which for a language proud of getting rid of parenthesis, that is very contradictory....

Perhaps you'd enjoy Nim which supports both. echo "hello world" echo("hello world") and as a bonus, also the following: "hello world".echo

Lua does too, for literal tables and strings being sole argument you can omit parentheses. But to call method on a literal you need to add them.

> print("OK")

> print "OK"

> ("OK %d"):format(1)

I've seen some funky (ab)use of these, people using literal strings and tables and functions named class and similar to do:

> class "Something" {

> -- ...

> }

Re: Anyprint: use any language's print statements in Python

#28
post #23

Ironically, what I miss most from Python is Python2's print, which for a language proud of getting rid of parenthesis, that is very contradictory....

Perhaps you'd enjoy Nim which supports both. echo "hello world" echo("hello world") and as a bonus, also the following: "hello world".echo

I'm a primarily Python dev, have been for a long time. Lately I've been working in Javascript/typescript and there is no worse antifeature than having 3 different ways of doing the same thing.

You try to figure out how to do something, you see 3 different solutions and you ask yourself, what's the difference? What's more correct? Will I need one over the other? Are they compatible? Is one way better supported than the other?

The amount of time I've spent looking up differences between two APIs or two paradigms in Typescript is seriously ridiculous. And it feels really bad to not recognize something you've done before because it's written differently.

Common culprits: require() and imports, the countless ways of creating classes, the crazy amount of different ways to implement similar or identical workflows in webpack and pretty much the entire JS ecosystem in general.

Re: Anyprint: use any language's print statements in Python

#29
post #26
post #21

Earlier quoted context omitted.

As someone most at home in lisps--there's just no accounting for taste ;)

Is there a LISP with significant white space in place of parentheses? Our two groups could be united by the disgust of the rest of the programming community.

Check out Dylan and Sweet Expressions.
Post reply on HN