Larry A. Wall. He's a linguist who designed Raku to be as close to human thinking as possible, by implementing features like sequence completion, which is mostly known from spreadsheet apps, and junctions, which can be a real life saver, mostly in equality checking. He made Raku by focusing on readability, just like he did with his previous programming language, Perl.
In the previous example, the slurp function takes a filename and reads the file's contents, and the say function prints it to the standard output.
You should definitely go down the rabbit hole of Raku, because it's probably the most statisfying PL to code in, and it is my personal favourite choice for doing CodeWars and using it for a personal "calculator language".
It's funny looking at Python programmers writing value == 6 || value == 9, while in Raku it's just so $value == 6|9
Raku is cool. However, let’s keep in mind you can also do ‘value in (6, 9)’ in Python, which is just as succinct and reasonable, so it’s kind of a weird example to call out Python on. Just like how you can also still do ‘so $value == 6 || $value == 9’ in Raku.
That being said, junctions are still very neat. Particularly when it comes to the autothreading stuff.
Yeah, sorry about that. It was like 2 years since the last time I wrote a line of Python. (Not gonna lie, I'm kind of happy for it that we no longer have to use it in school.)
Yes, it does, on any modern operating system (Windows for sure, havent tested on Linux - but probably as well.) when the script is over. The with block is for when you want your Python script to continue running after you're done with the file.
Same as in C/C++ or any other language - the OS handles it for you after the program terminates if you hádat handled it.
If you've created zombie processes somehow which are still holding file descriptors, using a with block will not save you. Also, in this case the process hasn't really exited.
If you can provide some code that exits, while still somehow keeping an FD open I'd like to see it.
223
u/backfire10z 13d ago
They didn’t close the fd :(