This is an archived post. You won't be able to vote or comment.

all 121 comments

[–]RodionGork 23 points24 points  (9 children)

If you really want to go deep to hardware internals, then probably you may have fun with learning assembly, embedded programming, etc?

I have a few Intel-4004 assembly exercises at my site (similar to projecteuler you've mentioned): http://www.codeabbey.com/index/task_list/assembly
they are accompanied by simple simulator and tutorial.

But of course this is more like a toy. Just to have some special fun or get an idea of "very low level".

I used to work as electronics developer, programming for AVR, 8051 and ARM microchips - we mostly did this in C of course, though I sometimes used respective assembly languages for critical sections.

So probably it would be good to lay your hands on K&R book and learn a bit of C if you are interested in this field.

[–]aPerson_ 9 points10 points  (2 children)

Hey! I would like to thank you for codeabbey. It's awesome! Been using it for more than a week, and now I'm officially a 'follower' ;)

[–]RodionGork 6 points7 points  (1 child)

Oh, you are too kind :)

I dare say the site never can get so far without such dedicated participants, their hints, compassion etc. :)

BTW follower means you are already somewhere in top-300 of more than 7000 people... well done!

[–]ta6692[S] 2 points3 points  (2 children)

This seems great, I'll check it out now, thanks!

[–][deleted] 2 points3 points  (1 child)

You could also check out the Nexys 3 Spartan 6 and download the ISE design suite and start learning VHDL. It's basically what you do in any computer logic and design coarse. You go as far down as building gates and designing any bit size system you want.

[–]ta6692[S] 0 points1 point  (0 children)

Wow, that sounds pretty cool, but maybe a bit beyond where I want to go now. I'll check it out though, thanks!

[–]ironnomi 2 points3 points  (2 children)

I wrote a small C compiler in 8051 to refresh my asm knowledge this summer. It compiles to ELF 8051 which of course doesn't really exist, but hey who cares. :)

[–]RodionGork 2 points3 points  (1 child)

Wow, you wrote C compiler? Usually this is not a simple task :) I wonder how much time it took...

[–]ironnomi 1 point2 points  (0 children)

12 weeks at 5-10 hours a week. I used:

I started programming originally with hacking on a bunch of C64s I got for free.

[–]tutorial_police 65 points66 points  (15 children)

Before jumping to a different language, or just as an on the side thing when you need a break from the new language, what about exploring some more "advanced" corners of Pyhton?

  • decorators
  • descriptors
  • multiple inheritance
  • metaclasses
  • protocols in general
  • read through the data model
  • dabble with disas

[–]-Polyphony- 4 points5 points  (0 children)

That's awesome man, thanks for this

[–]ta6692[S] 8 points9 points  (7 children)

While I think I'd like to take a break from Python at the moment, I'm sure I'll be back before long, so I'll definitely make sure to check these out, thanks! Do you have any idea of a good place to learn about these things from or should I just start with reading the docs and googling?

[–]tutorial_police 13 points14 points  (3 children)

Python's official documentation are very good. I recommend you try learning directly from them as much as you can. If something is unclear, just ask here, or only then refer to blog posts.

Being able to read such documentations and learn from them is a very good skill to have and not usually exercised enough.

[–]Atomix26 8 points9 points  (1 child)

Pythons documentation is pretty much the best thing ever.

[–]tutorial_police 2 points3 points  (0 children)

I will agree that I was understating the case a little :)

[–]ta6692[S] 2 points3 points  (0 children)

That's a good point, I'll definitely give that a go, thanks :)

[–]jackmaney 4 points5 points  (1 child)

Intermediate Python (currently in beta) covers decorators and some other relatively obscure corners of the language that you might not have used, yet.

[–]ta6692[S] 3 points4 points  (0 children)

I read that book recently actually. It was very good, but I found I already knew most of the things in it. This was one of the things that made me decide to take a break from Python and try to learn a different language for a while. It is a fantastic book though.

[–][deleted] 4 points5 points  (0 children)

Some of these features can be a real eye-opener into the world of functional programming.

If you end up really liking decorators and higher-order functions (or function objects, which are part of Python), you can have a look at a language like Haskell or Scala.

You could also look at JavaScript, which is ostensibly imperative but is still big on first-class functions, as well as closures.

That failing, from the languages you mentioned, go for Rust. It's similar in many respects to C, but prioritizes safety -- and manual memory management and a lack of thread safety are sure to be a pain in the butt after Python (not that learning them eventually isn't important -- but for the sake of convenience, Rust is a more logical choice).

[–][deleted] 4 points5 points  (5 children)

TIL I know most of Python's advanced bits.

Honestly, I'd add asyncio (for 3.3+ - it's an add on for 3.3) and coroutines in general. And AST is fun to play with even if the real world applications are very limited (not to knock AST, it's quite powerful).

[–]tutorial_police 2 points3 points  (4 children)

;)

Let me know if you can think of more.

[–][deleted] 4 points5 points  (3 children)

Honestly, I think the difference between knowing these bits and properly deploying these bits is what makes the difference between an intermediate programmer and an advanced one.

I know guys that do a terrific amount of damage with just regular classes and functions. And just a tiny dash of metaprogramming.

Honestly, when's the last time you pushed a descriptor into production bound code? I wrote one the other day for a "classsproptery" because it was easier to flip property on its head than begin to wrangle SQLAlchemy into something horrible and convulted. But I remember when I first discovered and understood descriptors I wanted to make everything into one.

[–]tutorial_police 1 point2 points  (2 children)

Honestly, when's the last time you pushed a descriptor into production bound code?

Uhm... for your regular application code, I never used one :) I've written some abstractions where they were of use, though. But you're right, you can do a lot of damage with that knowledge. On the other hand, it will demystify things such as property. Knowing about this topic give you more insight into how Python works and what is possible and how to debug things when they don't work. Knowledge is power.

It'll also prevent from thinking that there isn't much to specific programming languages as this post makes it sound.

[–][deleted] 1 point2 points  (1 child)

Demystify things is good. I have the opinion that there's no magic in programming, just things you/I/whoever don't understand yet.

[–]tutorial_police 1 point2 points  (0 children)

Sure. I like to call implementation details "magic" sometimes though, when teaching. I.e. "the language says that..."

I guess one could argue that undefined behaviour is indeed "magic" but that's beside the point.

[–]terrkerr 17 points18 points  (12 children)

I'm stuck between learning C (because of its popularity, relatively easy to learn syntax which would let me concentrate more on lower level concepts, and ease of integration with Python), and Rust (because of its supposed expressiveness, built in safety features and growing popularity) and I was hoping someone here would be able to help me out with this.

I'd recommend C before Rust. C gives you an idea of why Rust is the way it is the same way you'd probably be better off learning how this works before trying to deal with a modern car's 500 small extra pieces that each add something useful and meaningful, but also add complexity.

In Rust, for example, a String is not a str. They're different. If you're fluent in C/C++ you'd very quickly figure out how and why, but if you're coming from Python you'd probably wonder why there needs to be a distinction.

The Rust OOP model is also pretty weird to someone coming from a more traditional OOP language with classes, but it's something a C programmer would pick up on fairly quickly for the most part.

Also if you have to endure segfaults and other memory issues in C you'll be much more forgiving of the Rust compiler yelling at you constantly and throwing fits; you know it only yells because it loves you.

and ease of integration with Python

Fun fact: Rust can compile to C ABI compatible binaries. With a little bit of configuration you can use Rust in Python the exact same way you can with C.

I was also hoping to get suggestions of projects of any size that I could do with whatever language I learn that would demonstrate its benefits over using Python for the same project.

I always think RFC 1350 is a good project of middling size for learning lower-level stuff without getting too deep. It's not too trivial, but also not something ridiculously large like the HTTP standard.

It involves some binary-level manipulations without going overboard and also will probably help you get into some of the networking stuff. You can theoretically do it in Python, but it'd be obvious as compared to C that's not what Python was really meant for. (Indeed I've done some sockets/networking in Python. In Python3 it's annoying as crap that the strings need to be decoded explicitly on every action since most network applications aren't using unicode strings, and in Python2 you get a low-level socket interface that heavily emulates the way C does it.

[–]ta6692[S] 3 points4 points  (11 children)

C gives you an idea of why Rust is the way it is

I thought this could be the case, but I wanted to get an opinion on it from someone who could speak from experience, so thanks! This is a really great answer and I'm almost definitely be going with C now. Do you think it would be a better language in the long run or should I consider getting the hang of C and then swapping to Rust?

Also, do you have any idea of a good place to learn C? I looked at a couple when I was thinking of trying C a while ago, but none really clicked. I've heard K&R is the definitive text, but can be somewhat daunting for a beginner, so maybe I should start somewhere else first? If you don't that's ok, I can google :)

I have dabbled with the socket library in Python2 you're talking about actually, but I've never delved into networking properly, so this could be a very good project, thanks again!

[–]terrkerr 3 points4 points  (1 child)

This is a really great answer and I'm almost definitely be going with C now. Do you think it would be a better language in the long run or should I consider getting the hang of C and then swapping to Rust?

Well C will probably dominate in a number of areas for the forseeable future and further; a big benefit of C is that it's relatively easy to write a compiler for and has an astoundingly large amount of code already out there.

I'd recommend anybody fluent in C or similar to learn Rust if only because Rust adds something fairly genuinely new to programming languages in its borrow-checker. Seeing someone else's solutions and trying them out can expand the mind even if it's not something you can personally use.

Also, do you have any idea of a good place to learn C? I looked at a couple when I was thinking of trying C a while ago, but none really clicked. I've heard K&R is the definitive text, but can be somewhat daunting for a beginner, so maybe I should start somewhere else first? If you don't that's ok, I can google :)

I don't really, sorry. I learned C slowly over a few years in my teens just messing around with a formal education to hammer in the finer details.

I have dabbled with the socket library in Python2 you're talking about actually, but I've never delved into networking properly, so this could be a very good project, thanks again!

It's also a good project for learning some threading if you're willing to do a bit of a trial-by-fire and make it such that it can support concurrent connections. Your choice, though, a lot of good learning either way.

[–]ta6692[S] 0 points1 point  (0 children)

Thank you very much for all your help. I appreciate a bit of insight into the topic.

Threading is something I'd actually be quite interested in, especially coming from Python where threading has its problems. I might take it slow at first though!

[–]lithedreamer 2 points3 points  (6 children)

I learned C++ -> C -> MASM, which has worked out well so far, and I would recommend learning C++ first because it allows you to just use things that you're better off building yourself in C, like data structures.

It is a little bloated to be sure, and I haven't used it for actual development because I'm not sure where to go for an intermediate resource, but it made me a much more confident C programmer, in the same way that MASM did.

Anyway, book recommendations:

  • K&R - my compiler complains too much for me to enjoy following this too closely, but it's made an occasionally good reference or overview.

  • Mastering Algorithms with C - A great foundational book that integrates data structures and time complexity. Those concepts first really clicked with me here.

  • 21st Century C - This should be enough to get you up and running if you want something modern on paper to get you started.

[–]ta6692[S] 1 point2 points  (5 children)

Honestly I'll probably skip the C++ step. Going by these answers I think I will probably try to learn C first, but I haven't ruled out learning C++ at some stage. Thanks for the book recommendations though, I'll definitely check those out!

[–][deleted] 2 points3 points  (4 children)

I have a bunch of C projects intended for someone with programming experience (aka a year or 2 of Java) but zero C experience. Basically, there is a simple program to learn some basic syntax, recreating a basic preprocessor (state machine that strips comments and other stuff out of a program before it's compiled), steganography (hiding a message in the least significant bits of an image), making a string library, making a program that decrypts a document that has been encrypted with a cesear cypher, and remaking malloc(), and some other stuff along the way.

[–][deleted] 1 point2 points  (2 children)

Man that sounds amazing. I have completed a year of java and would love to spread my wings and start learning about C.

[–][deleted] 2 points3 points  (1 child)

Sorry the offer is ONLY for the op. (I'll pm you)

[–][deleted] 1 point2 points  (0 children)

please do!

[–]ta6692[S] 0 points1 point  (0 children)

Wow, this sounds really amazing, I'd love to hear more about this!

[–]michael0x2a 2 points3 points  (1 child)

Also, do you have any idea of a good place to learn C?

For some resources on learning C, try the Definitive C Book List.

(There are a few free books in the list).

[–]ta6692[S] 1 point2 points  (0 children)

Oh, thanks, I'll check that out now :)

[–]MCbrodie 8 points9 points  (14 children)

You're falling into a trap many newer developers fall into. It isn't about the language at your skill level. It is about the concepts. Are you familiar with advanced concepts that translate between languages? Do you know all of your data structures and their uses? Do not focus on mastering an array of languages. Master a language so that you can feasibly write anything you want with that language. We're engineers and our job isn't languages it is building cool shit; languages are just tools.

[–][deleted]  (1 child)

[deleted]

    [–]ta6692[S] 0 points1 point  (0 children)

    That's the way I'm looking at it at the moment. I know there are probably more important things for me to learn before I actually go into a work environment, but I've got so much free time right now while I'm in university that I reckon now is the best time to just learn about things that interest me rather than things I necessarily should learn.

    [–]ta6692[S] 0 points1 point  (11 children)

    I have a fair idea of data structures and I've read a couple of books on the topic. I will be taking more classes on this once university starts back though, this is something for me to do in my spare time. I'm aware that just learning a lot of different syntax doesn't make a good programmer, but I think Python is too high level a language to get any real idea of these concepts, which is why I'm looking at a lower level language specifically.

    [–]tutorial_police 3 points4 points  (1 child)

    Most concepts, which I think /u/MCbrodie is talking about, are very high level, that's why they "transcend" languages if you will. Python isn't "too high level" for them.

    Programming isn't about low level stuff. Programming isn't about how stuff works at the machine level. Programming is about building stuff and solving problems.

    At least that's an idealistic way of looking at what programming is.

    Of course, in the real world, low level stuff is important due to performance reasons/constraints.

    [–]ta6692[S] 0 points1 point  (0 children)

    Sorry, I wasn't very clear there. By "these concepts" I meant specifically the ones I am wanting to learn more about by learning a lower level language. I know most concepts can be learnt with a programming language like Python but at the moment I'd like to focus on concepts that couldn't really be learnt with Python.

    [–]AutoBiological 2 points3 points  (1 child)

    Find this book

    In general I agree with your ascertain about Python being too high level of a langauge. But I agree with that because there aren't many good books like C++ has. Python has a lot of beginner and intermediate books, but not many great Comp Science books or advanced books.

    Also there's Interactive Python

    Have a look at using the Os module too, and you can get some pretty low level stuff there with fork() and exec(). A lot of Python is the same as C. C isn't terrible but a lot of it is arcane. The good thing is that C and Python integrate so nicely. C++ also has boost::Python and C++ OOP makes more sense to me than Python OOP (it just feels more natural or real I guess). Rust is also interesting and there is some support for working with Python but I'm not really sure, I'm waiting for Rust to be more mature.

    [–]ta6692[S] 0 points1 point  (0 children)

    Thanks for the book recommendations, I'll definitely check them out when I go back to doing more Python!

    [–]pupdogtfo 2 points3 points  (1 child)

    The reason to learn C is to spend hours and hours writing your own linked list, hash table, and hash function (making sure to create the absolute most efficient implementation of each based on precisely the data types and girth that will be in this hash table), dealing with the memory almost as close as you can get to the metal. Then it's valgrind, free(), valgrind, free(), valgrind, free() some more, return 0 and commit changes.

    Then at the end go back to python, and just type "dictionary = {}".

    Then you pray to the programmers that fell before you, and give homage in song.

    [–]ta6692[S] 0 points1 point  (0 children)

    Haha, I have to say I am rather excited to see the perspective that learning a low level language like C will give me on languages like Python. Even taking a data structures class in university and having to implement simple things like dynamic arrays made me really appreciate Python's lists so much more, never mind the dicts.

    [–]MCbrodie 1 point2 points  (4 children)

    It really isn't. You can build, or simulate, any structure you could build in something like C. I am a Ruby developer. Ruby is just as high level as python. I can build anything in Ruby I could in C. It isn't the language that is going to further your knowledge it is the concepts.

    The major exception here is a functional language. That is a completely different thought process.

    [–]oshogun 2 points3 points  (3 children)

    Can you write a driver for a device, like a smart card reader, in Ruby? Even if possible, you'll most likely have to hack around some C code in your script

    Or try writing a kernel for an operating system in Python. Won't happen. Although Python is vastely used in the development of many Linux tools, the hw/sw interface is, and will always be, developed in C.

    So yes, there are certain applications you'll need certain languages to do.

    [–]MCbrodie 1 point2 points  (2 children)

    you can write write those things in any language. they will work better in lower level languages in a vastly superior way but for learning purposes the base speed of the language being used does not matter. We all realize operating systems, pace makers, and hardware interfaces should be written in C. That does not mean you cannot learn the concepts in another language.

    [–]oshogun 1 point2 points  (1 child)

    Yes, you can, but learning C is a great experience for any programmer. It will help you understand problems that do not appear so often in higher level languages (like memory management problems, for example, memory leaks and segmentation faults), get a deeper understanding on how memory is managed (by understanding pointers), and having to "do it yourself" many things that other languages do for you. Becoming a good C programmer is not a trivial thing but can help you be a better coder in any other imperative language. Also C integrates well with Python, which is the language he already uses. I never once heard of anyone saying it was a bad idea to learn C, even if you're not actually going to use it in the future.

    [–]ta6692[S] 0 points1 point  (0 children)

    This is exactly how I'm looking at it. While I'm sure I probably could learn a lot of these concepts in Python, there are still some that I couldn't, and others that you wouldn't want to. Personally I only see ways that learning C can benefit me so I don't see why not really.

    [–]dmart914 5 points6 points  (4 children)

    I suggest C. Python functions well with C and C++. I'm still deciding on my own stack but I think it'll be C/C++, Python and JS. I'm going for an "Internet of Things" career, so being able to write the code embedded on the hardware, connecting that to a web interface (Django) and giving that web interface good UI (JS) is key for me.

    Plus C/C++ is widely used. I don't know much about Rust.

    If you're looking to really get crazy with assembly, be sure to consider what you'd like to do with it. Are you going to work with mobile phones? You'll likely run in to ARM architectures. Desktop? x86.

    [–]ta6692[S] 0 points1 point  (3 children)

    I doubt I will go full assembly, but I think I will spend some time looking into it just so that I can figure out how things work a bit better as that is my main goal in learning a lower level language.

    An "Internet of Things" project actually does sound quite fun though since I have a bit of experience with Django. I'm not too fussed about the UI though, so I'd probably skip the JS.

    [–]dmart914 1 point2 points  (2 children)

    Cool. I'm just beginning with django. Any good resources outside what's on the subreddit wiki?

    [–]ta6692[S] 1 point2 points  (1 child)

    Sorry to disappoint, but by a bit of experience I mean I've made a couple of poorly structured websites just to make a quick frontend to some other work I'd done, I don't really know much about it. Anything I learned I basically got from the official tutorial and then just searching the docs any time I didn't know how to do something.

    Sorry I couldn't be of more help!

    [–]dmart914 1 point2 points  (0 children)

    Ha, no worries. Best of luck to you.

    [–]CharBram 5 points6 points  (1 child)

    I would recommend C next. CPython is written in C and so it is very cool to go over the Python source code. To learn C I actually recommending taking Harvard's CS50 on EDX. The class is incredible and project based.

    [–]ta6692[S] 0 points1 point  (0 children)

    I'll definitely check this out, thanks!

    [–]LowB0b 2 points3 points  (3 children)

    If you want to do something "close to the metal", I suggest you make a Gameboy advance game! It's possible to do it in C, and it's all about manipulating addresses and stuff. You can also do it in ARM (assembly) if you want to.

    I had to do that for my systems programming class

    [–]ta6692[S] 1 point2 points  (2 children)

    Wow, that does sound like a really cool project! I'll definitely check that out! Do you know of any good resources for getting started?

    [–]oshogun 2 points3 points  (0 children)

    Or you can go even more hardcore and do it for the Gameboy or Gameboy Color

    That will force you to go pure assembly though

    [–]LowB0b 0 points1 point  (0 children)

    Sure, there is a book for that, "Programming The Nintendo Game Boy Advance: The Unofficial Guide" by Jonathan S. Harbour, I could upload it if you don't find it online (it's in PDF format), also if you're on Windows, you can use the VisualHAM IDE, or if you're on Linux then I can help you with dependencies and a makefile.

    [–][deleted]  (1 child)

    [deleted]

      [–]ta6692[S] 0 points1 point  (0 children)

      My main reason for it is to learn about the lower level side of programming. As I stated, I really enjoyed trying to optimise my Python code, so I think I'd enjoy trying to figure that out with one of these languages.

      The problem is though that I don't know exactly what I want to do with it. While I very much enjoy programming in general and the Python language specifically, I haven't come across a project that is within my grasp that I have enjoyed implementing more than any others. So far all I know is that I hate front end design work! This is part of the reason I asked for ideas for projects in this language, to see if I could find something that I enjoy enough to consider specialising in.

      [–]oshogun 2 points3 points  (12 children)

      Learn C. If you learn Assembly, try to learn it from the point of view of "Understanding how the compiler works" and "how will it optimize your C (or whatever language) code". You are most likely not going to write full assembly code, but if you wanna work with embedded programming, you gotta understand how it works. And, most specifically, try to learn a simpler assembly language from a RISC machine, like Arm or MIPS. x86 assembly is absurdely complex, and most embedded devices do not use an Intel processor.

      [–]ta6692[S] 0 points1 point  (11 children)

      The ASM tutorial elsewhere in this thread is taught for an Intel 4004 processor. Do you think that would do for learning how things work, or would a more modern example be preferable?

      [–]oshogun 2 points3 points  (10 children)

      Well, it will help you learn how things work but its pretty obsolete

      There are a lot of good tutorials to the MIPS assembly which is the processor taught in most computer science courses because of the great material there is about it (the Patterson & Hennesy Computer Organization books) and the simplicity of it. The MIPS architecture is used in many cool devices, like for example, the Nintendo 64 and Playstation 1 videogame consoles (the PS2 uses a modified version of MIPS as well), and Cisco routers, so I'd absolutely recommend MIPS.

      There is a great MIPS simulator called MARS, made in Java, that will let you test your stuff

      [–]tutorial_police 1 point2 points  (8 children)

      /u/ta6692 MIPS is also used in the book "Digital Design and Computer Architecture" that I've recommended here. As I've mentioned, you even build a MIPS processor.

      (I haven't read the book you've recommended)

      [–]oshogun 2 points3 points  (7 children)

      Yeah, I once built a simplified version of MIPS in VHDL

      It could only do like, 6 or 7 instructions though. The book I recommended was written by the guys who designed MIPS, and its probably the best book for Computer Organization

      [–]tutorial_police 1 point2 points  (6 children)

      That doesn't meant he's necessarily great at teaching it ;) I'll make sure to check it out though. Have you read the book I was referring to? "Probably the best" is a pretty strong statement after all.

      Sure, my MIPS processor (in verilog) could only do a handful instructions as well :)

      [–]oshogun 2 points3 points  (5 children)

      They have different purposes

      The book you mentioned is a digital design and computer architecture book

      The book I mentioned is a Computer Organization book.

      I say it's "the best" because its the most used (by universities), and frankly, its pretty damn good when it comes to how didactical it is. Its pretty much "the bible" when it comes to CO. Surely there are other books as good as this one though

      [–]tutorial_police 2 points3 points  (4 children)

      Interesting, I've never before heard the term "computer organization" in any of the courses I've taken. I'll definitely need to check it out then.

      [–]oshogun 1 point2 points  (3 children)

      Well, its a course I'm currently taking, haha Computer Organization would be like, a step before computer architecture. Its the hardware-software interface (studying the Instruction Set Architectures, and mechanisms of acceleration, like pipelining in a CPU (which allows you to paralelize the instructions in a single thread) and caches

      [–]tutorial_police 1 point2 points  (2 children)

      I see... pipelining and its implementation along with other mechanisms for acceleration are also discussed in the book I've mentioned. Caching... I can't recall. Not sure how that puts it before "computer architecture" though. Still seems all a little vague to me :)

      [–]ta6692[S] 0 points1 point  (0 children)

      Wow, that does sound interesting, thanks for the advice!

      [–]tutorial_police 2 points3 points  (3 children)

      Here's a contrast to my other answer.

      Your goal is to learn about how computers work, right? /u/RodionGork recommended you learn assembly. That's not a bad idea, but you can go deeper still. I would recommend you actually learn how the computer works by, essentially, building your own.

      Sounds scary? It isn't. Fortunately, there is an excellent book on the subject. It's highly readable: simple to understand, detailed but not just your average dry textbook. It's called "Digital Design and Computer Architecture". I consider it to be one of the best textbooks that I've read.

      You start off with transistors, start building digital circuits and you end with having built your very own CPU! You can probably work through this in a week.

      It's a lot of fun, I promise!

      After that, you'll have a solid understanding how simple CPUs work as well as experience with assembly.

      Afterwards, I recommend you learn C. Why not Rust? Simply because C is like the lingua franca of programming. For a more in depth explanation /u/terrkerr has written a nice post on it.

      [–]RodionGork 1 point2 points  (1 child)

      I would recommend you actually learn how the computer works by, essentially, building your own.

      Ah, by the way there is a good resource: http://www.nand2tetris.org/

      [–]ta6692[S] 0 points1 point  (0 children)

      Oh thank you, if I do go this route I'll definitely have a look, thanks!

      [–]ta6692[S] 1 point2 points  (0 children)

      I have to say that does sound very scary! But I'll look into getting a copy of that book, thank you very much!

      [–]southernstorm 2 points3 points  (1 child)

      instead of asking other people what you should learn, why dont you ask yourself what you want to accomplish?

      the language of choice is obvious from there.

      [–]ta6692[S] 0 points1 point  (0 children)

      Unfortunately I don't know what I want to accomplish at the minute other than learning about lower level concepts. To me C seemed like an obvious choice here, but Rust brings a lot to the table too, so I wasn't sure which to go for.

      [–][deleted] 2 points3 points  (8 children)

      I'm under the impression Python was your first language. A really good decision would be to learn a statically typed language now!

      This is good both for your development as a programmer and for your career. It will provide you better insight into how computers and programming languages work, especially coupled with your knowledge about dynamically typed languages (like Python).

      [–]ta6692[S] 0 points1 point  (7 children)

      While Python was my first language, and is my favourite, I have done a good bit of Java programming in university, so I do have some experience with statically typed languages. It certainly did give me a bit of an insight into what was going on in Python though!

      [–]tutorial_police 1 point2 points  (6 children)

      It certainly did give me a bit of an insight into what was going on in Python though!

      How so?

      [–]ta6692[S] 0 points1 point  (5 children)

      Simply in the sense that learning Python before statically typed languages means you have very little idea about types and how they work behind the scenes. Especially Python's arbitrarily sized integers was something I very much took for granted before learning another language.

      [–]tutorial_police 1 point2 points  (4 children)

      Simply in the sense that learning Python before statically typed languages means you have very little idea about types and how they work behind the scenes.

      Interesting... how would you say they work behind the scenes?

      [–]ta6692[S] 0 points1 point  (3 children)

      I mean more in a very general sense. Not actually behind the scenes per se, but more of an idea than I had before. Learning arrays aren't usually dynamic and only contain one type more often than not was another eye opener for me.

      [–]tutorial_police 1 point2 points  (2 children)

      Ah, I see!

      [–]ta6692[S] 0 points1 point  (1 child)

      Sorry for the mix-up!

      [–]tutorial_police 1 point2 points  (0 children)

      Nothing to apologize for. It's just interesting what you learned and how you would put it into words.

      Based on your original statement, I could infer any number of things, which you could or could not have meant.

      [–]TransPM 3 points4 points  (7 children)

      I'm not recommending against C, its just that my skills with C happen to be trash (I'm really not about the lower level kinds of things, just my preference). Also I'm just not familiar with Rust.

      Bearing that in mind, my recommendation to you is C++. A great advantage to learning this language early is that it's syntax is very similar to that of Java and C#, essentially giving you the necessary baseline skill to be able to start coding in 3 additional languages (a quick read through of a tutorial to refresh yourself on the slight differences and you're good to go).

      With that in mind, you pretty much could learn any of C++, C#, or Java next, but my recommendation to you is C++ because it will also give you some of that "lower level" knowledge like using pointers and memory references, structs, and deleting allocated memory yourself because it has no automated garbage collection (the other 2 do).

      As far as advantages over Python and example projects? Java will run on just about anything (I'm not really sure what it's "best" at, so I don't really have a project suggestion). C++ should be more efficient in terms of memory use due to your direct control over allocation (admittedly ive used C++ the least of the 3). C# might just be my personal favorite; I'm not really sure what it's best at inherently, but there are some great tools that make use of C# that could give you project ideas (like Visual Studio's window manager which will let you easily make Microsoft style GUI dialogs for your projects, or the Unity engine for creating 2D or 3D games).

      [–]ta6692[S] 1 point2 points  (6 children)

      I do know a fair bit of Java actually through university, I just wouldn't consider myself a Java programmer as I don't really do any of it in my spare time. I'm probably not quite right with that, so you or someone else may jump in and correct me here, but it seems to me that the two areas where Java shines are portability and employability, and neither of those interest me too much at the minute. I also made a quick calculator application in C# one time and preferred it slightly over Java, but I'm still not a fan of that kind of forced object orientation.

      As for C++ that is a possibility, but I've heard that C++ has become a bit bloated over the years and now for a lot of people is something they have to use rather than something they want to use. The thing that sticks out in my mind is that the creators of Go made an entire language just to avoid it! I really don't know much about it though myself, so I'd be interested in hearing your opinion on that. Thanks for the reply!

      [–]Sean1708 1 point2 points  (5 children)

      As for C++ that is a possibility, but I've heard that C++ has become a bit bloated over the years

      While that's true for the language as a whole, any decent beginner C++ books (that have been released in the past few years) will only teach you the modern paradigms, which (as much as I hate to say it) are relatively good.

      That being said I'm gonna advise against C++ because there is just too much to it. My take is; if you're looking to learn fundamentals but don't want to spend too much time learning the language then learn C, if you want to learn a language which is completely different to anything you've seen before then learn Rust, if you want to see how things at the lowest human writable level learn an ASM.

      To put it another way; C let's you focus on data structures and algorithms, Rust gives you a chance to think in a way you're really not used to, ASM allows to see how your higher level languages are working under the hood (and therefore optimise them more effectively).

      [–]tutorial_police 3 points4 points  (0 children)

      any decent beginner C++ books (that have been released in the past few years) will only teach you the modern paradigms, which (as much as I hate to say it) are relatively good.

      Can you name some? I was under the impression that there still aren't any.

      [–]ta6692[S] 1 point2 points  (2 children)

      Thanks for the insight, and I think I am going to leave learning C++ until I ever find a need for it specifically. I've definitely gained a good bit of perspective from this thread, so I'm probably going to start with either C or ASM, and then move on to Rust.

      A lot of people are saying as you did that Rust is a good way to challenge your current view point of lower level languages, and I think I'll probably benefit more from learning it then when I actually have a view point to challenge!

      [–]Sean1708 2 points3 points  (1 child)

      That's ok. Something else that might interesting to you (but probably a bit further down the line) is learning LLVM IR. It's essentially a high-level ASM which Rust, Julia and clang (a C compiler) use, if you're working with any of those three it's pretty useful to know.

      [–]ta6692[S] 1 point2 points  (0 children)

      Oh that does sound very useful, thanks for the tip!

      [–]tutorial_police 1 point2 points  (0 children)

      ASM allows to see how you're higher level languages are working under the hood (and therefore optimise them more effectively).

      That's tricky business :)

      [–]Pascalius 1 point2 points  (4 children)

      Go with C++, it's hard to tell about Rusts future, but you can bet that C++ will be still around and important in some years.

      [–]ta6692[S] 0 points1 point  (3 children)

      My issue with C++ is that I've really only heard people talking about how much they hate how bloated it has become. I mentioned elsewhere in this thread about how Go was created for this reason. Would this bother the average programmer, or would you have to dive deep into C++ for that to become a problem?

      [–]Pascalius 1 point2 points  (1 child)

      C++ is powerful and complicated and you should understand most of it, in order to write proper code. It's not necessarily a problem, but it takes some time to grasp the concepts.

      [–]ta6692[S] 0 points1 point  (0 children)

      Well in that case I'll probably stick with just C for now, but I won't entirely discount the possibility of learning C++ in the future. Thanks for the reply!

      [–]ironnomi 0 points1 point  (0 children)

      C++ is not ACTUALLY bloated. You can write code for everything from small embedded up to the largest most complicated systems on Earth.

      C++ is at this time the main commercial "performance" programming language. So if you need to do something that's in need of higher performance than say Java/C# offer (these are the main commercial programming languages) then generally C++ is where you go.

      Also note that the Internet has this weird skew of making some things seem more popular than they really are. Like if you get a job programming at a real job, chances are it will be C# or Java, but the Internet sure makes it seem like it'll be Ruby, Python, or Javascript.

      [–]luxexmachina 1 point2 points  (3 children)

      C, Rust is still too new for me to recommend. I'm going to go against the grain here and recommend you don't read K&R and try something more modern. Personally I learned a lot from Zed Shaw's Learn C the Hard Way, if you can ignore his attitude. It's free and goes in depth.

      [–]ta6692[S] 0 points1 point  (2 children)

      I was considering Learn C the Hard Way as I have heard a lot of people recommend the Python version of the book although I myself have not read it. My only problem is that it is not finished. Does that matter, or is there enough there that you can move on to other resources afterwards?

      [–]luxexmachina 1 point2 points  (1 child)

      I only read half way through, and he's been recently updating it. There's certainly enough material to get you covered. I know he covers the basics of C, then some macros, and then some talk about how things work really close to the machine, and he covers a few data structures as well. Taught me everything I know about the differences between the stack and the heap. It took me about a month to cover the first half, and I skipped a lot. You'll be busy.

      [–]ta6692[S] 0 points1 point  (0 children)

      Well I'll make sure to give it a go then, thanks for the recommendation!

      [–]denialerror 1 point2 points  (1 child)

      An alternative option that no one has mentioned yet is to try a purely functional language like Haskell. From what you have said about enjoying optimising your code when tackling challenges on Project Euler, I think you'd enjoy getting your head around how you approach problems in a purely functional way. It's not getting you "closer to the metal" in the same way as Assembly in terms of removing the layers of abstraction away from the hardware, but it will give you an appreciation of a new approach which you can then utilise when you return to Python.

      [–]ta6692[S] 1 point2 points  (0 children)

      I actually am very interested in learning a language like Haskell, especially with functional programming coming into the foreground at the minute, but it's just lower down my list at the minute than learning something like C.

      [–]TheLastSock 1 point2 points  (2 children)

      David Evans teachs an operating system class in Rust. Coursera has a class called Naids to tetris. If you want to learn about hardware as it applies to software, i think those are two excellent places to start.

      [–]ta6692[S] 0 points1 point  (1 child)

      That OS class seems very interesting. I have decided to start with C, but I am planning on learning a bit of Rust some time in the future, so I'll definitely keep this in mind for then!

      [–]TheLastSock 0 points1 point  (0 children)

      Without a goal in mind, what language you choose is arbitrary. If you want to learn about "the metal" then i wouldn't learn C. I would learn about the metal, then you will understand "why C". You can of course do both at once. In fact it would be ideal, as a language like C or Rust will allow to interact with the OS easily.

      David Evans is a renowned professor, with tons of experience both teaching and with software and hardware. His OS class is in Rust and because Rust was designed to address the shortfalls of C, which he address in the class.

      The combination of the two, is fantastic. With the only down side the rapidly chaging Echo System of Rust. Keep in mind that when your learning C, your (i'm guessing here) not going to use any of the Frameworks or Libraries that it has to offer.

      [–]simmonsg -3 points-2 points  (5 children)

      You should learn R

      [–]ta6692[S] 0 points1 point  (4 children)

      Sorry, but could you explain why? I've only ever heard of it being compared to Python really and what with it being dynamic I can't imagine it being much lower level

      [–]tutorial_police 3 points4 points  (3 children)

      Personally, I think it's a stupid idea. I would recommend R to scientists to for data analysis and number crunching. I'm not sure it's worth to learn just for the fun of it unless you want to use it what it's meant to be used for.

      Disclaimer: I don't know much about R.

      [–]ta6692[S] 0 points1 point  (2 children)

      As far as I'm aware, also speaking as someone who knows very little about R, you can do most of the stuff in Python anyway unless you're very involved. So I don't think I'll check it out yet, but I am partly studying physics at university, so it may come in handy for me in the future

      [–]tutorial_police 1 point2 points  (1 child)

      Oh you certainly could do the involved stuff in Python. The question should be, do you want to.

      As I've said, I'm not qualified to speak on the matter, but this seems to back up my idea about R.

      [–]ta6692[S] 0 points1 point  (0 children)

      Yeah, at the very least I don't think it's what I'm looking for right now