Make the Raku programming language familiar to C++ programmers
software.gellyfish.co.uk
software.gellyfish.co.uk
So much of the language is so fundamentally different from how languages are made in Current Year that I couldn't begin to evaluate how useful or confusing these features are in the wild (especially operators like `ff`); I simply have zero context whatsoever for it.
Although these were introduced as an implementation bug at first, and modern dialects (Scheme / Common Lisp) eventually replaced them with lexical-scoped variables, dynamic-scoped variables are still supported with different syntax in them (parameter objects in Scheme and special variables in CL.)
I don't use it, I probably won't, this kind of expressivity is something which feels good for developers but doesn't help them cooperate. The tradeoffs are probably not worth it.
I'm glad it exists, though. It's a language where the users mostly find neat ways to say things, Perl is a great basis for that sort of language, and I wish them well.
For anyone who just wants a cleaner Perl, it's there, it works. Descriptively, Raku as a 'scene' draws in a lot of people who come from the poetic school of Perl, which is great, it's clearly well designed for that crowd.
I don't know that I'd call Raku battle-hardened yet, but it's not an experimental language in the sense of having novel semantics, or frequent breaking changes, nor would you expect to hit a bunch of implementation bugs.
I'm not expecting many developers to decide to work in the large with a strict subset of Raku, because you can do that with Perl and get all of CPAN, or just use Python and black and have epsilon of zero problems of that nature.
You're right here, the Rakudo[1] compiler had its first stable release back in 2015 and comparatively speaking, there's a lot of space for growth.
[1]: https://rakudo.org/
And use of std::endl is widely considered an antipattern. Use of '\n' is always better for printing new lines.
people say that and then I loose half an hour trying to understand where my code is going wrong because my terminal did not flush when trying to debug log
endl just saves you from getting out of the habit of using endl, really.
Are you seriously suggesting no one uses std::endl? A simple search on Github actually reveals the opposite... almost everyone uses std::endl and almost no one uses std::flush (94% use std::endl, and 6% use std::flush).
I am also in the std::endl camp and find it absurd when people bike shed over it. It's the most intuitive/least surprising behavior (based on Stack overflow questions) and how almost all other mainstream languages behave (flush on new line), and as such it should be the default choice.
The use of ... << '\n' << std::flush is best when you want to explicitly call out that behavior because of performance reasons or some other exceptional circumstance.
Maybe, but when you're debugging it's essential. Those debugging cout's aren't going to be there in production.
Does this do the right thing on Windows?
If you read the specification of std::endl, it simply sends a "\n" and flushes.
STL is pretty much the foundational work of practical generic programming, while iostream is a trashfire of a feverdream someone had about "hey it'd be really cool if I overload operators to do I/O, wouldn't it? That would look so futuristic in code!1". The original STL implementation has even been formally verified.
But you're right, modern stdlib implementations for C++ tend to be essentially obfuscated beyond any notion of readability.
One good thing about Raku is that I thought it had what I called "a programmers mindset". To put it another way, the language seemed to be structured in such a way to "think the way I think", rather than the other way around.
By design/specification, Raku[0] is over 20 years old. The Rakudo[1] compiler is a lot younger, with its first stable release back in 2015.
[0]: https://raku.org/
[1]: https://rakudo.org/