Undefined Behavior in C and C++ (2024)
In some ways, that's because C is a lower-level language, closer to assembly; it just gives you what the underlying machine gives you.
Topics /
The most popular blog posts about programming languages on Hacker News. 5,634 posts.
In some ways, that's because C is a lower-level language, closer to assembly; it just gives you what the underlying machine gives you.
It's not about technology for its own sake. It's about being able to implement your ideas.
Objective-C remains an impediment for many programmers coming to the Mac or iPhone platforms — few programmers have ever experienced it before learning Cocoa, forcing two learning curves at once for new Cocoa developers. How did Apple end up with such a weird language? And for a company known to replace CPU…
I semi-regularly hear developers who claim that using Rust would not gain them anything because they would have to use `unsafe`. But this is not true. Local reasoning matters.
(Most) C++ implementations provide at least 8, 16, 32, and 64-bit signed and unsigned integer types. There are annoying implicit conversions, discussions about undefined behavior on overflow (some think it’s too much UB, others think it’s not enough), but for the most part they do the job well. Newer languages like…
Creating a programming language is apparently all the rage these days, and it’s got me thinking about what I would really like to see in one. I’m starting to suspect the things I want are either impossible or mutually incompatible, so I’d better write them down and let smarter people tell me why I can’t have…
If you're a fan of dynamic languages then you should also be a fan of functional programming.
This morning Miroslav Bajtoš asked "Why do C++ folks make things so complicated?" in response to my article on regular expressions in C++. Other people asked similar questions yesterday. My response has two parts: Why I believe C++ libraries are often complicated. Why I don't think it has to be that way. Why would…
In October this year I had the privilege of speaking at the GothamGo conference in New York City. As I talk quite softly, and there were a few problems with the recording, I decided to write up my slide notes and present them here.
Why choose Swift as a backend language in 2020? What are the available frameworks to build your server? Let me guide you.
Me and my close friends have been interested in starting a project together and I suggested we use Haskell. I do not think the suggestion was received well or perhaps in seriousness. I have a tendency to joke about almost everything and have put forward that we use many interesting but not practical languages in the…
Java 7 quietly changed the structure of String. Instead of an offset and a count, the String now only contained a char[]. This had some harmful effects for those expecting substring() would always share the underlying char[].
F# is not just for math and big data, it's a general purpose language that will greatly reduce the amount of bugs in your code.
Historically, LLVM's major releases always added "0.1" to the version number, producing major versions like 3.8, 3.9, and 4.0 (expected by March 2017). With our next release though, we're changing this.
No matter how many blog posts and tutorials I read about lenses, it seems like there's no replacement for just using them to get an intuition. So here are some exercises I came up with. While they shouldn't be all that difficult, they build up from some basic knowledge about lenses up to the more advanced usages of…
While working on an article for the Monad.Reader, I’ve had the opportunity to think about how people learn and gain intuition for abstraction, and the implications for pedagogy. The heart of …
Deciphering Glyph, the blog of Glyph Lefkowitz.
We build smart, robust, enterprise-level software that works, both with you and for you.
As a workaday Python developer, it’s hard to shake the feeling that the Python 2 to 3 transition isn’t working. I get occasional requests to make my libraries work in 3 but it’s far from clear how to and when I try to look it up I find all sorts of conflicting advice, none of which sounds very practical.
Starting Forth has always been the fun way to learn Forth programming. This free, online edition uses updated code that runs on modern Forth systems.
Friendly Attributes pattern enables writing human-friendly attributes with compact and flexible syntax.
Having just returned from the annual Oregon Programming Languages Summer School, at which I teach every year, I am once again very impressed with the impressive growth in the technical sophisticati…
We had an opportunity to talk with James Gosling, a Canadian computer scientist, best known as the father of the Java programming language, and get his insight into the languages, features, and solutions that we use every day.
Sum types are pretty cool. Just like how a struct is basically “This contains one of these and one of these”, a sum type is “This contains one of …
You’ve probably seen this Python 101 thing before: @memoized def fib(n): if n <= 1: return n return fib(n - 1) + fib(n - 2) Leaving aside the absurdity of computing Fibonacci numbers recursively, it’s a common first introduction to Python decorators and higher-order functions. fib is just a function, and memoized…
A recent Twitter thread brought home to me that there is widespread confusion about what types actually are, even among the most prominent researchers. In particular: are types the same thing as sets ? At the risk of repeating some of my prior posts, perhaps it’s time for a little history about type theory, set theory…
Someone on StackOverflow stumbled onto the strange term “open recursion” and asked what it meant . Since most of the other answers to this online are pretty opaque, I started writing an answer. But then I accidentally wrote a blog post.
Why 'indirection has a cost' is usually the wrong reason to inline and what actually costs you.