r/rakulang • u/Brixes • Feb 27 '21
As a complete beginner...why Raku over Python and some others?
I'm a complete beginner to programming and choosing my first "beginner friendly" programing language is very difficult.I just don't want to use it just to learn the basics then need to move to another language based on what i want to achieve.
Raku seems to be better thought out in terms of syntax and brevity even compared to Python.
Python has maybe not so much brevity optimizations but has a enormous amount of support, libraries and learning resources.
Python has performance problems and addresses them with things like Cython,Pypy,Numba etc....but in actual development I don't know how easy it is to write "clean code" and "maintainable code" based on you needing to work with those C based "tools".
Raku has performance problems and since I watched Jonathan Worthington's 2019 talk where he showed some benchmarks of performance improvements I don't know what has improved in terms of performance. I don't know how Raku addresses needing to write code that needs to run very fast WHILE also being able to maintain that "pleasant writing experience" that Raku supposedly excels at.
Raku DOES NOT HAVE ANY tutorial on youtube about how to use it for developing quality websites,ecommerce websites, multi-patform apps.
Julia seems to be a better alternative to both Python and Raku as a beginner that actually wants to use the language to make fast multi-platform apps or website development and have better code maintainability.
Nim seems to be even better than Julia in some aspects and especially it being a systems programming language because theoretically is a language that can do literally everything super fast but the only disadvantage to it is that they do not have good resources for complete beginners and some of their tooling clearly are not as great as some need it to be to use it production from what i read.Many clearly prefer it to Rust or D and from me analyzing many blogs that gave their opinion on it it seems to be the most promising in terms of simultaneously delivering C++ speed but for most of the times be able to have Python ease of reading,brevity and code maintainability.
All in all it's super hard to choose "a 21 century programming language that does most things right by default while also offering speed,code maintainability,metaprogramming".
I know i will be forced to learn JavaScript to be able to do work in web development but at least i want my first programing language to be one that I return to work with with joy and rarely be thinking at what I'm giving up by not programming in another language.
I want to learn Raku because developers spent so many years fleshing out the syntax and features for making programing pleasant but I also don't want to just need a very high level of knowing the language(Raku) just to achieve here and there performance metrics that for example Julia or Nim achieve by default without using C or some other strategy that reduces productivity or code "cleanliness".
So..what do I choose??? But please argument your reasons in detail. I don't need half assed one line response that is made just because someone's feeling bored and thinks he's on youtube or facebook.I see so many threads on technical topics that receive lazy replies on reddit.
6
u/liztormato Rakoon πΊπ¦ ππ» Feb 27 '21
a 21 century programming language that does most things right by default while also offering speed,code maintainability, metaprogramming
You didn't mention concurrency here: Raku has great concurrency features with react / whenever, hyper for batching pipelines and distribute work on worker threads, to name a few features.
In any case, I would suggest you have a look at https://commaide.com, the Cro library for building reactive distributed systems, and Red, a Raku ORM.
The Raku Programming Language is still full in development, but with great emphasis to staying backward compatible. You can check out the Rakudo Weekly News if you want to stay up to date.
2
u/Brixes Feb 27 '21
Thank you Liz,I see you putting lot of effort to respond in almost all threads,but have in mind that I am a complete beginner. As a beginner I don't have the prerequisite knowledge to properly scrutinize advantages or disadvantages of using Raku in certain scenarios.While what you list in your post might be sufficient for a person who already is a programmer and has the prerequisite knowledge for me it is not and does not really answer objectively the main things i listed that do not look promising about Raku as my first language.
1
u/liztormato Rakoon πΊπ¦ ππ» Feb 27 '21
Fair enough. It's not often we see people here without any prior programming experience. And having been programming professionally for 42 years now, that is something that is really far away from my mindset.
I wish you strength in your choice. And of course, hope to see you again here at some point in the future!
4
u/webfiend Feb 27 '21
tl;dr: oh god I just couldn't stop typing. Sorry. Start with Python for broad support and Raku for flexibility and its dedicated community.
Avoid premature optimization
First things first: don't worry about performance until you are comfortable with programming. Bad algorithms are bad in every language.
Your knowledge about how to describe solutions with code is going to be the performance bottleneck for a long time before language issues come up, regardless of language. By that time, you can take the core development skills you developed to any language, or even improve the one you've chosen.
The performance issues about Python, Raku, and other languages that folks post screeds about? Those folks work at billion-dollar companies, solving billion-dollar problems β don't get impressed, most billion-dollar Internet problems involve how to shove more ads in your face. They're just mad because their $250k salary position tending ad farms has been inconvenienced.
Okay, languages. I'm just going to go down your list.
Raku
Right off the bat: I don't think Raku is a good first language yet except for the extreme DIY (do it yourself) enthusiast. It has all the capabilities and tools one needs to write useful, multi-platform applications. It's a powerful language for describing solutions. It's got a friendly community, and /u/liztormato helps us all keep track of things with a weekly newsletter. But the path you would use to go from complete novice to production site / application development? That path is still being constructed. Raku Essentials still has that new tutorial smell.
So for a person's one and only first language, no. But let's keep going.
Julia
Julia is a great language, if your focus is scientific programming: finding answers to tricky questions, then exploring the results. It's much weaker in the anything-can-happen world of production application development. I've been exploring Genie, and stumbling over tasks that are routine in Rails, Django, and other mature Web frameworks. I wouldn't start with Julia if my goal was production code.
Nim
Nim is fun, growing fast, and documentation provides multiple paths for the beginner. OTOH they're still answering questions about best practices that are taken for granted (or at least the debates have fallen into familiar patterns) in more established languages. Maybe they'll have it down by the time you're comfortable with it? I'd say Nim is a "maybe" for first language.
Python
Python? Well heck. Python was partially created as a learning language. You'll find a wealth of documentation, libraries, and tools that'll help you along every step of the way. Multiple Web frameworks β I use Django at work but suggest FastAPI for today's brand new Web dev. Lots of desktop application support from frameworks like Beeware.
With Pylint and Mypy, or just a decent editing environment β Visual Studio Code shines here β your code can be cleaner than a freshly scrubbed plate.
If someone was only going to learn one programming language, I'd tell them to go with Python.
My Advice
You're going to write code in more than one language. That's almost a given anyways. But if you've really put this much time into evaluating a best first language? I can say from personal experience you're going to spend the rest of your life going "oh but what if I tried this in V or Io or Rust or Smalltalk orβ¦"
So why not be honest with yourself and start from that angle? Pick two languages. Make your choices similar enough that you can compare solutions, but different enough that you can get a gut-level understanding of both core algorithm development and the many options you have for expressing it.
You're in /r/rakulang, so obviously I think one half of that pairing should be Raku. I doubt you'll ever find a more expressive programming language.
For the other half, which is probably where you'll spend more of your time, I suggest Python. For language style, Python is the opposite of Raku in nearly every way. Explicit where Raku is implicit, verbose where Raku is concise.
(To contrast, Python and Nim would make a terrible pair. The core syntax is so similar that you could occasionally forget which you were reading.)
Subscribe to Rakudo Weekly, so you know what folks are up to. Try the Raku Essentials tutorial. Andrew Shitov has some good introductory books. If you want something denser, maybe Think Raku?
PS: What about Go?
Wandering off your list: if a $250K job tending ad farms sounds appealing to you, maybe try Go? It's lower level than any of the languages on your list, but higher level than C, has a decent learning path, and from what I hear the pay's good.
3
u/Brixes Feb 27 '21 edited Feb 27 '21
Thank you for taking the time to write a good response.
Hypothetically...how can you become a master of the basics/fundamentals of programing AND "applied problem solving"?
Basically a language agnostic "stupidly thorough" course on programming fundamentals AND APPLIED problem solving/deconstruction using multiple methodologies("patterns").
Basically a "gold standard" course that tries to have the goal of making a ultra competent programmer that can pick up any language extremely fast.
Make this course "practical" using something like Python as the first language for teaching the fundamentals, not forgetting about the "stupidly thorough" part.
Then teaching the lower level optimization "fundamental programming concepts" in C.....then bring everything together in Nim (which at this point looks like what I want to end up focusing to master).
3
u/ExtraFig6 Feb 27 '21
It will help if you can tell us how old you are, if you have interest/ability in attending a university, how comfortable you are with self study, any background knowledge you have in a related field, and if you have any friends/family who can help support you in your studies.
There's no single course that will give you all of this in one go. These are broad skills people hone over a lifetime. What you're asking for is really like a curriculum and a reading list, not a single course.
Hypothetically...how can you become a master of the basics/fundamentals of programing AND "applied problem solving"?
The basics of programming you can learn by working through an intro course or tutorials. For applied problem solving, it depends a lot on the problems. Studying problems that have already been solved and how their solutions work is a good place. Studying algorithms will give you part of the solution here as well as a vocabulary of solutions to problems that show up everywhere (how do you sort a list?) For bigger picture modeling and problem solving, tools that are useful are Domain Driven Design, any kind of mathematical modelling, and I suppose any more applied flavor of ontology can be useful. There's also a book "How to solve it" by Polya. It's more focused on solving math problems, like for a math competition, but it has good insight. Problem solving is a broad skill and that comes with time. A lot of it is a meta-skill: what do you do when you don't know how to solve something?
Basically a language agnostic "stupidly thorough" course on programming fundamentals AND APPLIED problem solving/deconstruction using multiple methodologies("patterns")
You can't really have a language agnostic first course because you need to use a language to start programming in. I really do think how to design programs is a good starting point here. Even though it is not in python it is still teaching you practical skills in a time-tested way. It also focuses on using simple tools in Racket, most of which translate closely into other languages. I bet you can even find a version of How to design programs for python and maybe perl! But the most important thing is to actually get started.
> Basically a "gold standard" course that tries to have the goal of making a ultra competent programmer that can pick up any language extremely fast.
I am not aware of any such course. Ultra competent is essentially an infinite goal.
In my experience, what helps you pick up languages fast is to understand your building blocks and to know a handful of different kinds of languages. Here's Larry Wall, Perl + Raku's creator, coming up with a list of languages like that https://www.youtube.com/watch?v=LR8fQiskYII.Once you start to get the hang of things you'll want to study different paradigms and methodologies. Stuff about how to structure programs and how to keep code readable. In my experience this is not really covered in university, but there's lots of books, talks, and articles. I like Kent Beck and Kevlin Henney's talks for example.
Make this course "practical" using something like Python as the first language for teaching the fundamentals, not forgetting about the "stupidly thorough" part.
What do you mean by practical here (besides language choice?)
Then teaching the lower level optimization "fundamental programming concepts" in C
The relevant courses are usually called something like "intro to systems programming"2
u/Brixes Feb 28 '21
"What do you mean by practical " I mean going beyond pseudocode and using Python then C to write programs that can actually run, for added confidence and to better "ingrain" the lessons.
2
u/ExtraFig6 Feb 28 '21
Most courses go beyond pseudocode in my experience.
2
u/Brixes Feb 28 '21
Most courses are not designed to offer "mastery",most courses and most bootcamps are mostly superficial.I know of only ONE bootcamp among tens of the most popular bootcamps in the US that uses a mastery approach.I have seen only one person ever talk about this school on youtube and is mostly unknown.
1
u/VMChBOHO Jan 21 '22
I answered under your above reference to your question, but here I should add that CS50(x) starts from teaching you to use the visual pseudocode Scratch, which is also the best possible start I can think of. Again, I'm sorry to be writing this 11 months after you actually start.
4
u/webfiend Feb 28 '21
Unfortunately, imagining such a course is well beyond my capacity. I'm largely driven by ADHD, which meant "self-taught" by way of reading lots of books on whatever topic interested me that week, taking lots of notes, trying random ideas, and bothering every programmer I could find with whatever I couldn't figure out that day.
Somehow I turned that into a career, which reinforced the pattern.
If you find an ultra-competent programmer you can maybe ask them.
3
u/SwellJoe Mar 01 '21
Wandering off your list: if a $250K job tending ad farms sounds appealing to you, maybe try Go? It's lower level than any of the languages on your list, but higher level than C, has a decent learning path, and from what I hear the pay's good.
My theory about Go is the same as my theory about why Perl 5 is on the higher end of the payscale spectrum: Old developers like it.
The early adopters of Go were pretty heavily skewed toward older UNIX/Linux/C heads. Older folks just have a lot more experience and are more valuable/expensive. A new Go programmer isn't going to command those huge salaries most of the time, because they won't have the 20+ years of experience that the first wave of Go devs had in other languages (often "hard" languages like C and "hard" areas of expertise like systems programming).
That's not to say it's not a good language for a new dev to be learning. It's a simpler systems language than C++ or Java or C# (and much safer than C), and it is used in very high paying industries, like cloud infrastructure.
5
u/Intelligent_Moose770 Feb 27 '21
What people are trying to tell you is there is no right answer to your question.
When you are a beginner. You pick a language, you learn the basics, and you start some side projects to learn more then you learn how to refactor code then learn design patterns.
That's the way to go. Don't concentrate on the perfect language for beginners. That doesn't exist. Don't expect a language that is goog in everything. That doesn't exist. C is one of the most used language. It's the best in term of performance, it's the easiest language to learn but it's the hardest language to work with, because it does nothing for you, you do everything your self. I can continue to tell you about every language i know the same things Which means every language has it good parts and bad parts. As a beginner, Raku or python looks the same in the sens that you will not sens the difference until your needs became more specific. And i can't be more precise because I don't know what you will need in the future, what are the projects you will be working on. If it's mobile. Python or Raku or julia are irrelevant, i would go for Java or react native with js or kotlin for Android or swift for ios or better go with Dart and flutter. And this is valide for every field in the tech industry. It's huge.
If you are learning programming for fun then pick the language you fancy and play with it. You will enjoy Raku. I am not a beginner like you but starting to learn it and i can tell that i am enjoying it because I value spreed of writing code and solving problem over speed of execution - i would go to C for that - from my perspective. Hardware is cheap, dΓ©velopper time is expensive. My time is expensive. Of course you can't know what is valuable to you until you try.
Once again there no right answer to your question except this one : try and see, if you don't like, just move on, you didn't waist your time because what you learned is applicable elsewhere, you just learn a new syntax and all the knowledge can be expressed in the new one. Don't wast your time on analyzing the situation because at the end of the day all the choices are equivalent when you are a beginner. I tell you that because I faced that situation, people told the same things that was said to you and i came to the same conclusion after learning python, lisp, some Java, javascript, Elm, Ocaml, some perl, Dart. Was it a waist of time? Definitely not, it made a better programmer. Mature programmers will tell you that programming languages are just tools, pick the right tool for the right job.
If you decide to stick with Raku i can tell you that people here are amazing, very helpful and respectful, very patient. You can learn a lot here. The perl community contains very high profile programmers and Raku is connected to that. You will learn a lot from people here
4
u/P6steve π¦ Mar 01 '21 edited Mar 01 '21
Having spent 3-4 years working in perl, my career took me away from coding for about 15 years - coincidentally this was the period that it took to get raku (aka perl6) into reasonable shape.
So I was a like a new starter coming back to coding and I decided to learn raku. I really value the raku design where code can be shaped to frame the problem-solution rather than drawing the eye to boilerplate language constructs (shameless plug to my recent blog https://p6steve.wordpress.com/2021/02/09/raku-easy-hard/).
There are several good books on raku. For your needs, I recommend Think Raku [https://greenteapress.com/wp/think-perl-6/] which is a comprehensive and well-balanced tutorial and would suggest you consider combining that approach with the sister book Think Python.
I believe that mainstream raku is well oriented to new coders due to its thoughtful combination of OO, procedural, functional, concurrency, command line and grammar capabilities.
But there are two caveats: (i) by being inclusive, raku is large and took me about a year of daily use to become natural and (ii) you will get laughed at in job interviews and will struggle to convert raku into $$$.
So, I would advise you earnestly to learn something more mainstream (python / java / javascript) and leave raku to the folks who want to have fun ;-)
3
u/drth4 Feb 27 '21
Even the general purpose lenguajes have a more heavy development towards one side (graphics, statistic, etc) python addresses many areas, many where raku doesn't have a proper modules right now (for example a modern plotter for doing grammar of graphics) but much of that things can be easily solved.
Raku has two the possibility of use python code and c code, but as you say nobody wants to write a lenguaje inside other lenguaje. Personally with raku learn too much about the modern approaches use today, raku has the characteristics propers to solve easily things that I already do (the main for doing terminal things, an call to the terminal inside a lenguaje and use their outputs).
But as firts lenguaje it's not reconforting as we wish, because there many characteristics that only appreciated when you have experienced other lenguajes. If you are completely new I recommend Javascript + npm, they are not the most easy lenguajes but they give more in short than any other lenguajes, the most clear example for is p5.js: you can do TOO MUCH with too little code, or d3 or hydra a live coding of shaders, you can get amazing interactive graphics, and even better you have enormous portability. For me these examples are real killers of the rest of lenguajes but they because I don't do much about sistems administration and I don't care these topics.
With that in mind, I think that maybe you can point a examples of what you care and what you don't, the things that you don't have problems in leave out and the things that you will be use everyday. With all those say I wish to agregate have fun coding, do things that you care and matter, there is too much tools for building anything today and learn one don't explicitly meaning that you can only can learn one thing (at least if you are too stupid or something).
Raku has a small community, for me that's valuable because I learn with people and not post in internet and we grown together. I hope you can find your path
2
Mar 01 '21
As a side note, JavaScript/ECMAScript is a lot less painful to use in 2021 than it was just a few years earlier. When you do tackle that language, I respectfully suggest looking for newer tutorials that reference "let", "const", "async", and "await". If you work with older code - and that's inevitable - you'll need to grapple with JavaScript's "var" and promises or nested callbacks, but I think starting with those makes the language harder to learn.
1
u/byt3thematics Mar 02 '21
A language is just a tool, my advice is to βhyperβ focus on being a problem solver. Therefore, grasp the concepts of computational thinking.
A great resource for this task is the Structure & Interpretation of Computer Systems (SICP)
And as someone eluded in the thread earlier, you can go through this book for free with Racket.
1
1
Feb 27 '21
[removed] β view removed comment
-4
u/Brixes Feb 27 '21
it's almost like the perfect programming language doesn't exist.
I'm not looking for unicorns,i know the perfect language for everything does not
exist but I think a BETTER language that approaches this ideal that does ALMOST everything right can be pointed out.
Where is SPEED in Perl? Where is modern web development in Perl?
Also,like i requested,I don't need half assed responses that are made just because someone's feeling bored.
4
u/doomvox Feb 27 '21
Where is SPEED in Perl?
Uh... python people have never argued against perl with benchmarks, and there are reasons for that.
2
3
Feb 27 '21
[removed] β view removed comment
-2
u/Brixes Feb 27 '21 edited Feb 27 '21
I think you're the one that's rude in the type of lazy response you gave.
Requests for serious DETAILED replies is not "rude". Please don't act like you're a hormonal teenager that gets triggered for no legitimate reason.
1
u/doomvox Feb 27 '21
Requests for serious replies is not "rude".
Posting polemics disguised as "just asking questions" while not exactly rude is not going to earn you a lot of points with people.
3
u/Brixes Feb 27 '21 edited Feb 27 '21
They are polemic only if you can't admit in a honest and objective manner how good(performant,easy, concise ) some tasks are achieved in one language over the other.I want to learn Raku because developers spent so many years fleshing out the syntax and features for making programing pleasant but I also don't want to just need a very high level of knowing the language(Raku) just to achieve here and there performance metrics that for example Julia or Nim achieve by default without using C or some other strategy that reduces productivity or code "cleanliness".
10
u/ExtraFig6 Feb 27 '21
The best first language is whatever language you will stick with. Because human motivation isn't fully rational, if you are strongly pulled by a specific one, like Raku, it's worth trying. However, there are certainly factors that can make your learning experience easier or harder.
Plan to learn a handful of programming languages so you can pick the one that best fits a given task. This will relieve the pressure of having to pick the right first language. Like you said, you will eventually need to learn javascript and probably a systems language.
You are stressing too much about advanced aspects of the language, like high performance, metaprogramming, syntactic sugar, and how pleasant it is to write in. These things matter, but only after you know how to program. Especially since some of them take a lot of knowledge to use correctly, like high performance stuff.
As a beginner, you will need to learn things like algorithmic thinking, breaking your ideas down into processes you can convert to code; how variables and assignment works (research shows this is a huge stumbling block for beginners); how to debug; how to use the tools available to you; how to learn to program; how and where to look up the things you're missing; how to use abstraction; how to actually design the code.
You want the language to get out of your way as much as possible so you can focus on this. You want the language to be simple. You only need a handful of tools to build a program, so why complicate things? It's not like starting simple will hurt you later. It won't be hard to take these simple ideas and map them on to features of more complex programming languages. The simplicity can actually be an advantage because it will help you "see through" the differences between other languages.
Start with a dynamaic language. There's a lot of benefits of static typing, but they come with the cost of increased complexity.
My nomination for first language: Racket. This fits all of the needs I listed for a first language. It comes with a book that will take you through the essential concepts for programming, written by people who have studied both programming languages AND how people learn them.
On top of that, it is pleasant to write in and has powerful metaprogramming. It's not used as much as python for example, but it is powerful enough to build real applications. Naughty Dog uses it for scripting and metaprogramming!
If you find you hate it or you truly want to get started with something that's more popular, start with Python or Perl (try to stick with the simple features at first). These also fit a lot of the criteria, though they are somewhat more complicated. In particular, I have issues with the way variables are defined in python, and Perl has a lot of shortcuts that can be confusing.
These also make great second languages.
A good next step is to learn javascript (or a language that compiles to it). Since you want to make websites, this is necessary. However, there's enough messy parts in the language that I wouldn't suggest it as a first language. Don't overlook languages like typescript, coffeescript, or clojuresrcipt that can compile to javascript.
For web development, also keep a lookout for languages that can run both in the browser and the server. Especially if you're building by yourself, being able to run the same code in both places can save a lot of effort. Some good choices here are javascript itself with nodejs, clojure/clojurescript (especially if you liked racket), kotlin, scala.
Systems languages can also run in the browser using web assembly, but this is a newer technology so i would still recommend something javascript based first.
Then learn a systems language. I recommend starting with C because it is simple, it's everywhere, and it maps very closely to what the computer physically does. If you want to write high performance applications, you need a good mental model for how the computer physically works. I recommend working through the book The C Programming Language by Kernighan and Ritchie. Ritchie invented C and co-designed Unix. It is short and well written.
It's also worth checking out some assembly language, though it's not very important to know how to program in it.
However, you hit a limit to what you can abstract in C. You can make it work, but you have to be careful to clean up after yourself, for example. If you want to use a systems language to build something more complicated, I recommend studying one of the others. If you already know C, C++ is a natural choice. It has come a long way toward python-like ease of writing, reading, and maintainability. Just be discerning with where you find information on it. Look out for outdated information. Try to check out a book by Bjarne Stroustrup, its inventor. Make sure to read up on destructors and RAII. Remember, C++ isn't C. C++ gives you tools to do some things more cleanly and safely than C. Use them.
Between D and Rust, D builds on more conventional idioms. Rust is more experimental and gives you a model of programming designed so the computer can prove you don't have certain kinds of memory errors. This is cool but has a learning curve.
If you skipped Racket, you probably want to study at least a little bit of functional programming. Clojure is a very practical functional language. Haskell is more theoretical but definitely interesting, and it is the language the Raku compiler is written in, I believe.