News for hackers. Stuff that matters.

tangus

Re:Learn Programming with OCaml on Saturday September 05, 2026 @05:33PM (#49580908)
Probably vector-drawn diagrams are rendered into bitmap images for the EPUB version.
Here's an index of sorts. I couldn't find anything better.

https://archive.org/details/byte-magazine?sort=date

Re:Fixing a 20-year-old bug in Enlightenment E16 on Wednesday April 15, 2026 @12:55PM (#47781836)
I guess they wanted to keep working on their slides (at least for the moment) and not be forced to go debugging. Sadly, the hang was deterministic, so they didn't have another option.
Re:Rob Pike's 5 Rules of Programming on Wednesday March 18, 2026 @08:26AM (#47424861)
Aren't they basically saying opposite things? Perlis is saying "don't choose the right data structure, shoehorn your data into the most popular one". This advice might have made sense before generic programming was widespread; I think it's obsolete.
Re:Cistercian Numbers on Wednesday February 18, 2026 @01:07PM (#47064081)
My minuscule pet peeve is that having only one source where the number 5 is depicted with a triangle (all others show it as a separated segment, like the number 6 but shorter), that's how every article or library draws it. It's all because the guy who wrote a book about them saw that source first so he based his figures on it.

Here's a small summary about the numbers with many examples: https://www.unicode.org/L2/L2020/20290-cistercian-digits.pdf

Re:ISBN Visualization on Sunday December 21, 2025 @06:48AM (#46344139)
Everything they have is downloadable. Go to their home page and follow the links.
Everybody carries a gun in Heinlein stories, so those terrorists will be quickly dealt with by armed citizens, thus confirming the superiority of Libertarianism.
Re:Some Smalltalk about Ruby Loops on Friday October 31, 2025 @03:15PM (#45775635)
For the record, if you want to avoid the creation of intermediate arrays, you can:

    lst.lazy.grep(Array).flat_map(&:itself).sum
Not as clear, because the standard library doesn't have a `#flatten` method for lazy enumerators.

But the point is the interface, not the implementation. Efficiency doesn't mandate assembly-like DSLs. Your interface could be as clear and clean as Ruby's and produce fast, inlined code by the power of macros. Ruby doesn't have macros, so stringing lambdas is the best it can do.

Ruby also has call/cc. None of the iterating methods has any provision to make them "safe" from it. They aren't safe from modifications to the iterated collection either. I think it makes sense; being forced to accumulate using only linked lists and having to be constantly on guard to support a rarely used quirky feature is a bad tradeoff IMO.

Careful. Seeing how I was downvoted for asking, it looks people here don't want that information to spread.
Re:Some Smalltalk about Ruby Loops on Thursday October 30, 2025 @05:35PM (#45765667)
It may be somewhat awkward; zipping collections to iterate over them in unison makes the first one (the sender) seem special, while it not necessarily is. And accumulating more than one value isn't always straightforward; you usually have to reduce explicitly. But it's so much better in the general case!

Like the example you showcase your macro with. In Ruby it would be:

    lst = [[1, 2], :dud, [3, 4], [5, 6]]
    lst.grep(Array).flatten.sum
    => 21
You can see what it does at a glance, you don't have to immerse yourself inside the directives to follow the logic. And when you can't do that, declaring iterators and accumulators outside a loop and then iterating and accumulating "by hand" yields code not so different than your more complex examples.

  def partition (arr)
    yes = []
    no = []
    arr.each do |elt|
      if yield elt
        yes << elt
      else
        no << elt
      end
    end
    [yes, no]
  end
Re:Some Smalltalk about Ruby Loops on Thursday October 30, 2025 @03:17PM (#45764104)
Looping in Ruby is the opposite of awful. You only have to define an `#each` method in your class and include the `Enumerable` module, and you get a plethora of composable methods to iterate and accumulate in every which way. I find it nothing short of brilliant.
It's paywalled, please provide a workaround.
Re:Webbol: A minimal static web server written in COBOL on Friday October 03, 2025 @01:43PM (#45465582)
In the late 90's I had a girlfriend who worked for a shop that made web pages in COBOL. I thought those were COBOL's death throes, but apparently I was mistaken...
Re:Katharine Graham: The Washington Post on Sunday July 27, 2025 @03:38PM (#44703966)
They provoked the strike on purpose by giving the workers an unacceptable contract. The aim was to wreck the union (they succeeded). They prepared in secret for two years for this.

Here's an account: https://www.huffpost.com/entry/wash-post-busted-pressmens-un...

Re:Simon Tatham's Portable Puzzle Collection on Saturday July 26, 2025 @09:11AM (#44693829)
Also related: https://puzz.link/db/
Even if it didn't dedupe strings, mutable string literals means that it has to create a new string every time it encounters a literal in run time. If you have a literal string in a method, every time you call the method a new string is created. If you have one inside a loop, every iteration a new string is created. You get the idea.

With immutable strings literals, string literals can be reused.

Strings are going to keep being mutable by default. Only strings created by string literals won't be.
Re:End of an Era on Monday June 30, 2025 @10:10PM (#44429936)
>I do not understand how you can even begin coming to the conclusion of ...

Obviously he's not serious, he's playing the part of the out of touch old man.

Re:Alternative Layout System on Friday June 27, 2025 @03:12PM (#44399426)
Related to "Last is first", old Spanish books sometimes put at the end of the page the first syllable of the next page. (It was quite disconcerting when I first saw it.)
Re:Show HN: I wrote a Java decompiler in pure C language on Wednesday June 04, 2025 @02:50PM (#44184129)
They say it right in the next sentence.
But fb2 files are marked up text, which is (relatively) trivial to index. The bulk of Anna's Archive's books are made of from scanned images.
Re:Red Programming Language on Wednesday May 21, 2025 @12:08AM (#44048172)
I don't think in Red a function can decide whether to evaluate its arguments or not. It's more like a Logo: functions have fixed arity, so you don't need to delimite the call, and lists ("blocks") are always quoted, so you need to explicitly evaluate them.
Re:Red Programming Language on Wednesday May 21, 2025 @12:03AM (#44048158)
Not very reliable, this Phantom thing.
Re:Red Programming Language on Tuesday May 20, 2025 @11:44PM (#44048082)
I've seen it. Sometimes a DSL is more readable than trying to shoehorn control flow into method calls (".then().catch()..."). Or see C#'s LINQ.
Re:Google Maps Doesn't Know How Street Addresses Work on Friday April 25, 2025 @01:03AM (#43790261)
Besides that, in Buenos Aires, for instance, every access to the street has its own address. A building with 2 entrances (front door and garage) has 2 addresses, etc.
Just in time to kill the giants sloths?
Re:C++ Is an Absolute Blast on Monday December 23, 2024 @10:12PM (#42499446)
You can pay the penalty and get safe container access, too. AFAIK, C++ standard containers provide both bounds checked (.at()) and unchecked ([]) element retrieval.
Re:ASCII Delimited Text – Not CSV or Tab Delimited Text on Sunday November 10, 2024 @11:25AM (#42100971)
And how do we escape those characters? With ESC (27)? Inside a SI/SO (15/14) pair?

I think CSV or TSV are good enough. People keep trying to find a format where you can separate the records and fields with a simple string.split and there's no need to contemplate escapes.

But that's not possible, no matter the format you'll have to parse it right. And then, a format that uses visual delimiters has the obvious advantage of being editable with any text editor.

Re:Why Pascal Deserves a Second Look on Friday November 01, 2024 @01:17PM (#42019267)
Yeah, well... you won't get very far with just TP-style objects and strings and without dynamic arrays.

Older »