Topics /

Programming Languages

The most popular blog posts about programming languages on Hacker News. 3,709 posts.

Any year
3152

Types as axioms, or: playing god with static types

A common perspective is that types are restrictions . Static types restrict the set of values a variable may contain, capturing some subset of the space of “all possible values.” Under this worldview, a typechecker is sort of like an oracle, predicting which values will end up where when the program runs and making…

3155

Ruby Fiber Scheduler

Ruby can work asynchronously with just a Fiber Scheduler and a couple built-in methods - no frameworks are required! It's easy to use, scales well, and has amazing performance benefits.

3157

Defeating Racket’s separate compilation guarantee

Being a self-described programming-language programming language is an ambitious goal. To preserve predictability while permitting linguistic extension, Racket comes equipped with a module system carefully designed to accommodate composable and compilable macros . One of the module system’s foundational properties is…

3163

`std::flip`

std::flip is a little-known utility from the C++ standard library header <functional>: it is a higher-order function that accepts a Callable and returns an equivalent Callable with the order of its parameters reversed (or “flipped”).

3164

Contracts for C

C++ seems to finally converge with their contracts proposal, I decided to give it a try and come up with ideas how such a thing would look for C. This is in early stages, not a full proposal yet, a…

3166

Performance Analysis of Python's Dict() and {}

Some time ago, during a code review, I had a discussion with a colleague of mine about preferring dict() over {} in new Python code. They argued that dict() is more readable — and expresses intent more clearly — therefore should be preferred. I wasn’t convinced by that, but at that time I didn’t have any…

3170

A few good ideas in programming languages

Crystal is a compiled programming langauge with static type-checking with syntax very similar to the Ruby programming language . Something that keeps Crystal feeling like a dynamically typed language is how a variable can be assigned to multiple types throughout the course of its lifetime, unlike most statically typed…

3173

Writing a DSL in Lua (2015)

DSLs, or domain specific languages, are programming languages that are designed to implement a set of features specific to a particular problem or field. An example could be Make , the build tool, which is a specially designed language for combining ...