13 ms·
Anyprint: use any language's print statements in Python
- deleted 9y ago[deleted]
- krylon 9y agoThe Testimonials section cracked me up.
- rhencke 9y agoIt looks like your testimonial has been added to the project, ha.
- scardine 9y agoMakes all these valid in Python: printf("printf %d\n", 10); fmt.Println("hello") cout << "Hello, C++!" << endl; Print["Hello from Mathematica!"] console.log("yes"); System.out.printf("java stuff\n"); Ada.Text_IO.Put_Line("Ada is cool") Really funny, including the testimonials: > Anyprint has many glowing reviews from its many satisfied users: > > * "omg pls" > * "what is wrong with you" > * "That's stupid and not useful." > * "Please add my testimonial: "very accurate testimonials"." > * "kragniz, please stop writing questionable python metamodules :v"
- josefx 9y ago> cout << "Hello, C++!" << endl; For the love of god, please stop using endl. It performs a flush when "\n" is both valid and all that you ever want. Also what happened to the std:: prefix?
- ben0x539 9y agoAre you saying you never want to flush? If flushing after every line is good enough for printf then it's gonna be good enough for me~
- josefx 9y agoBuffering of Cs stdout is implementation defined. For Linux it is only line buffered in an interactive terminal session and fully buffered otherwise. > Are you saying you never want to flush? 90% of the time not. The other ten percent include asking for user input, which causes an implicit flush since std::cin is linked to std::cout, and debugging an ugly heisenbug.
- RodgerTheGreat 9y agoPlease add support for: `0:"Hello from K.\n"
- simonh 9y agoWhy stop at print statements? After all if you find yourself successfully using the print statement from some other language, you might accidentally also use its if, for loop, file handling and class declaration constructs among many others. Who's looking out for those people? This is just the beginning!
- stephengillie 9y agoComing from Powershell, nobody told me JavaScript copies arrays by reference instead of by value. Why would anyone want to pass a reference?
- cuchoi 9y agoIn Object Oriented Programming it can be useful if you want to pass the reference as the argument instead of the value.
- deleted 9y ago[deleted]
- amelius 9y agoNow implement printing to a string (sprintf, etc.)
- rhizome31 9y agoHow about Ruby, Perl or the Python 2 print statements?
- systems 9y agoAll your testimonials are belong to us.
- mhh__ 9y agoCan I have a D style: "Your text here".writeln;
- bugshideout 9y agoIronically, what I miss most from Python is Python2's print, which for a language proud of getting rid of parenthesis, that is very contradictory....
- fdej 9y agoSame here. I will probably keep using Python 2 for as long as it works... simply because I don't have to type those parentheses.
- sooheon 9y agoAs someone most at home in lisps--there's just no accounting for taste ;)
- andybak 9y agoIs 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.
- emidln 9y agoCheck out Dylan and Sweet Expressions.
- acchan 9y agoThe Arc language wiki has this list of languages that make use of significant whitespace. https://sites.google.com/site/arclanguagewiki/more/list-of-languages-with-s-expression-sugar https://sites.google.com/site/arclanguagewiki/more/list-of-l...
- klibertp 9y agoSee this: http://readable.sourceforge.net/ http://readable.sourceforge.net/ Works with both Scheme and Common Lisp, two most popular Lisps out there. Nobody uses it because paredit/parinfer is just too convenient, but the option is there.
- flavio81 9y agoLet's hope they also add (format t "hello ~a!" name) for completeness...
- emidln 9y agoThey closed my issue for a clojure style (prn "hello world") I was actually just looking into adding a hook for an automatic AST transformer so I could possibly call into Hylang.
- sbmassey 9y agoTo say nothing of vitally important format expressions like (format t "~{~a~^, ~}" list)
- stevelosh 9y agoAnd of course the stuff necessary for word-wrap-in-`format`: (format t "~{~<~%~1,40:;~A~> ~}" '("these" "words" "will" "be" "wrapped" "to" "40" "characters")) and the other `format` insanity in: http://cybertiggyr.com/fmt/fmt.pdf http://cybertiggyr.com/fmt/fmt.pdf
- flavio81 9y agoBehold the mighty power of CL format!! I wonder if the format string language, aka "line noise", is turing complete...
- Piccollo 9y ago5
- umanwizard 9y agoPlease add support for NSLog(@"Hello, %s and %s!", @"macOS", @"iOS");
- jibberia 9y agoWarning: Format specifies type 'char ' but the argument has type 'NSString '
- umanwizard 9y agoWhoops! Should have been `%@`
- cbanek 9y agoNow we just need a nice restrictive license to grab all the patents.
- rosstex 9y agoI already sent this to my co-founder
- nneonneo 9y agoWorth 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...
- derpydev 9y agoThis project is so wonderful it took down Github
- krallja 9y agoIronically, it doesn't (and can't) support Python 2 print statements.
- deleted 9y ago[deleted]
- sandwell 9y agoAnd by extension, QBasic's PRINT statement. 0/10.
- laurentlb 9y agoLovely! The idea is very similar to NoFail ( https://github.com/laurentlb/NoFail https://github.com/laurentlb/NoFail), a language I've described, but not yet implemented.
- RhysU 9y agoIs Fortan's WRITE(*, *) doable? How to handle the * isn't jumping out at me.
- bjackman 9y agoIn all seriousness, it never occurred to me before that because of access to "globals", an import statement can introduce (or alter the value of!) unexpected names.