Live data from Hacker News

Ask HN: I want to learn a low-level, compiled language. What should I chose?

news.ycombinator.com

11–20 of 29 posts

Re: Ask HN: I want to learn a low-level, compiled language. What should I chose?

#11
post #5

Why not step off the beaten path and try a language that is safer than Rust, has a better concurrency story than Go, performance similar to C (but without as many ways to shoot yourself in the foot)? Ada.

Ada doesn't have Rust's concurrency-safety guarantees, and if you're using dynamic allocation then Ada requires a garbage collector to maintain memory safety whereas Rust doesn't.

Re: Ask HN: I want to learn a low-level, compiled language. What should I chose?

#12
post #8
post #4

Earlier quoted context omitted.

Honestly, I have no projects or specific uses for these languages. Rather, I am treating it as a tool for learning and to experience low level programming. I might make some kind of machine learning application in it later down the line though.

The usual recommendation "for learning and to experience low level programming" would be C. See this for example http://www.joelonsoftware.com/articles/CollegeAdvice.html although that was written before Go and Rust. Also if you're mucking about with machine learning a lot of the libraries seem to be in C or C++. I played about a bit with computer vision using Python but sometimes the Python bindings don't work or do…

We're actually growing a rather nice machine learning ecosystem on the Rust side, though obviously it's much less mature than the C/C++ solutions. See https://github.com/autumnai/leaf/blob/063ce978004b8bf4b7fc74... for an example.

Re: Ask HN: I want to learn a low-level, compiled language. What should I chose?

#13
Rust makes a fantastic first systems language, due to the fact that the compiler guides you in learning correct low-level memory management and prevents things that would just cause your C program to crash unhelpfully.

If you don't need a language that's as low-level as possible, then Go is also a good language to learn. It doesn't have much to teach in the way of memory management, but it does have pointers.

Re: Ask HN: I want to learn a low-level, compiled language. What should I chose?

#14

C and Go are quite small languages. I love C for its history and low-level view of the machine. It's worthwhile learning C I think, as a way to understand part of the history of programming. However it makes it time consuming to program even simple things. Go is more productive, with maps, strings and a garbage collector. C++ and Rust are both relatively complex. If you have aspirations to working on large native pro…

While I'm a fan of Go, I don't see it as a low level language. I suppose in terms of language features you could argue that simple/small is low level, but from a machine point of view, I feel like anything that doesn't let you manage memory manually can't really be considered low level.

I'd probably throw my vote at C for a low level language. Even if you never actually write anything in C, being able to understand the massive amount of code out there in C is a definite plus, and it gives you a good understanding of what's happening at the machine level and underneath the abstraction of other languages.

Re: Ask HN: I want to learn a low-level, compiled language. What should I chose?

#15
C because, a) every language we're currently using is a reaction to C (or a reaction to a reaction to C, etc.), and b) it is still going strong in areas such as Linux development, and is enjoying a huge resurgence in areas such as Arduino.

Re: Ask HN: I want to learn a low-level, compiled language. What should I chose?

#16
post #11
post #5

Why not step off the beaten path and try a language that is safer than Rust, has a better concurrency story than Go, performance similar to C (but without as many ways to shoot yourself in the foot)? Ada.

Ada doesn't have Rust's concurrency-safety guarantees, and if you're using dynamic allocation then Ada requires a garbage collector to maintain memory safety whereas Rust doesn't.

Overall, I got an impression that Ada encourages value-based programming. It is possible to do a lot of things without dynamically allocating a memory.

Re: Ask HN: I want to learn a low-level, compiled language. What should I chose?

#17
I'd recommend learning assembly language using a macro assembler. Getting up close and personal with actual hardware without a particular programming model being interposed will give you an appreciation for the conceptual and practical support programming languages provide. Writing programs that run on bare metal and programs that run with operating system support is an educational experience of the first order. Just writing a program that bootstraps itself is a right of passage.

Re: Ask HN: I want to learn a low-level, compiled language. What should I chose?

#18
When I started learning low level programming, I've studied C and x86 assembly simultaneously. This gave me a somewhat broader perspective.

From my experience with learning Rust, it might be a little hard to grasp both "the low level world" and Rust-specific things at once.

Re: Ask HN: I want to learn a low-level, compiled language. What should I chose?

#20
You don't say why you want to do it.

I would really recommend learning to program in assembler. And I think the best way to do that is something like AVR [1] or ARM on an embedded device but X86 is do-able with NASM [2] [3]

There's always MIPS via SPIM [4]

Learning assembler will give you more than simply swapping one imperative language for another. Python / Java -> C / Go / Rust is really not that large a leap. You will have the basics down in a few evenings.

[1] https://en.wikipedia.org/wiki/Atmel_AVR

[2] http://www.nasm.us/

[3] https://en.wikipedia.org/wiki/Netwide_Assembler

[4] http://programmedlessons.org/AssemblyTutorial/

Post reply on HN