News for hackers. Stuff that matters.
Re:Ask HN: I want to learn a low-level, compiled language. W... by dman on Monday March 07, 2016 @08:52PM (#11243102)
Pick C or C++. There is a huge amount of code out there in these languages and learning one of them will open the door to you being able to benefit / learn from it.
Re:Ask HN: I want to learn a low-level, compiled language. W... by kibwen on Tuesday March 08, 2016 @12:30AM (#11243707)
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. W... by jtchang on Monday March 07, 2016 @11:28PM (#11243540)
Learn C. Specifically learn pointers and memory management. Just these two concepts will give you a huge understanding of any other language.
Re:Ask HN: I want to learn a low-level, compiled language. W... by kristianp on Monday March 07, 2016 @09:06PM (#11243136)
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 projects, then C++ might be the way, with Rust becoming more prevalent in the future.

Re:Ask HN: I want to learn a low-level, compiled language. W... by Tiksi on Tuesday March 08, 2016 @01:22AM (#11243818)
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. W... by johan_larson on Tuesday March 08, 2016 @03:55PM (#11248537)
I'm not familiar with Rust, so I can't advise you there. But I have worked with the other two languages.

Go is not a great choice, because it's not very low level. You don't allocate and free memory explicitly, and you often work with maps, slices, and channels, which are quite high-level.

C is a reasonable choice, since the core of it is fairly simple. I expect that forty years of incremental additions have added quite a bit of cruft though, which you have to be able to see though. There also isn't very much work done in plain C these days. Most people in this space use C++, which is even more complicated.

May I ask what you are hoping to do with this skill? If you just want a chance to learn more about how computers work, an artificial assembly language like MMIX may teach you more while avoiding much of the cruft that real languages pick up as they evolve. If you actually want to use this for work, C++ is the way to go, but expect to be a beginner for a long time.

https://en.wikipedia.org/wiki/MMIX

Re:Ask HN: I want to learn a low-level, compiled language. W... by brudgers on Tuesday March 08, 2016 @05:03PM (#11249131)
Are there any workbooks with challenging exercises for MMIX?
Re:Ask HN: I want to learn a low-level, compiled language. W... by johan_larson on Tuesday March 08, 2016 @05:13PM (#11249218)
I haven't used it, but this supplement to Knuth's classic The Art of Computer Programming is bound to be instructive:

http://www.amazon.com/gp/product/0133992314

Re:Ask HN: I want to learn a low-level, compiled language. W... by stray on Monday March 07, 2016 @08:48PM (#11243082)
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.

Re:Ask HN: I want to learn a low-level, compiled language. W... by kibwen on Tuesday March 08, 2016 @12:21AM (#11243683)
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. W... by zerr on Tuesday March 08, 2016 @09:31AM (#11245398)
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. W... by woolybully on Tuesday March 08, 2016 @08:01AM (#11244920)
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. W... by hanniabu on Wednesday March 09, 2016 @09:05AM (#11252994)
You're saying people are moving away from C++ to C for the Arduino? What's your guess for reason of the resurgence?
Re:Ask HN: I want to learn a low-level, compiled language. W... by SixSigma on Tuesday March 08, 2016 @02:31PM (#11247836)
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/

Re:Ask HN: I want to learn a low-level, compiled language. W... by drallison on Tuesday March 08, 2016 @09:58AM (#11245563)
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. W... by MalcolmDiggs on Wednesday March 09, 2016 @08:28PM (#11256890)
Given your background, I think you'll enjoy C. The standard Python interpreter is written in C, and the Sun JVM runtime is C. So if you learn C, you'll start to understand the building blocks that came together to make those higher-level languages.

After you get the fundamentals down, take a look at the source code behind those runtimes, and it'll make you a much stronger programmer in all the languages you know.

Re:Ask HN: I want to learn a low-level, compiled language. W... by JoachimSchipper on Wednesday March 09, 2016 @05:30AM (#11252083)
Aside from everything already said, C integrates very well with Python; understanding C will let you write Python bindings for new libraries and will let you easily rewrite performance-critical chunks of Python in a faster language.

For Java, you could learn C++ (via JNI) for the same reasons - but Java is less likely to use C libraries, and going from Java to C++ usually doesn't produce as much of a speedup as going from Python to C.

Re:Ask HN: I want to learn a low-level, compiled language. W... by kele on Tuesday March 08, 2016 @11:36AM (#11246322)
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. W... by ddgflorida on Tuesday March 08, 2016 @01:26PM (#11247286)
Choose C because of the huge amount of source code still out there, plus coding that close to the machine will help you be a better programmer.
Re:Ask HN: I want to learn a low-level, compiled language. W... by tim333 on Monday March 07, 2016 @08:28PM (#11243015)
Depends a bit what you want out of it. C for fundamentals, Go for fast web serving, Rust for stuff that's memory safe?
Re:Ask HN: I want to learn a low-level, compiled language. W... by Jmoir on Monday March 07, 2016 @08:33PM (#11243034)
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.

Re:Ask HN: I want to learn a low-level, compiled language. W... by tim333 on Monday March 07, 2016 @09:18PM (#11243179)
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 don't exist and I was thinking it would be easier to just call the things from the C/C++ they are written in.

Re:Ask HN: I want to learn a low-level, compiled language. W... by kibwen on Tuesday March 08, 2016 @12:23AM (#11243689)
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. W... by Retra on Monday March 07, 2016 @10:27PM (#11243387)
In that case, I would recommend Rust because it's just harder to learn than the other options.
Re:Ask HN: I want to learn a low-level, compiled language. W... by AnimalMuppet on Monday March 07, 2016 @08:30PM (#11243025)
C++ for fundamentals plus RAII?
Re:Ask HN: I want to learn a low-level, compiled language. W... by chmielewski on Tuesday March 08, 2016 @05:59PM (#11249471)
REBOL and/or red-lang.org
Re:Ask HN: I want to learn a low-level, compiled language. W... by syllogism on Wednesday March 09, 2016 @02:54PM (#11255337)
Cython
Re:Ask HN: I want to learn a low-level, compiled language. W... by tomyncy618 on Thursday March 10, 2016 @09:58AM (#11259515)
test comment, sorry!