HNHacker News
TopNewBestAskShowJobs

tangus

505 karma · joined June 22, 2010

submissionscomments
tangus··on Learn Programming with OCaml
Probably vector-drawn diagrams are rendered into bitmap images for the EPUB version.
tangus··on Archive of Byte magazine, starting with issue #1 in 1975
Here's an index of sorts. I couldn't find anything better.

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

tangus··on Fixing a 20-year-old bug in Enlightenment E16
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.
tangus··on Rob Pike’s Rules of Programming (1989)
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.
tangus··on Cistercian Numbers
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

tangus··on ISBN Visualization
Everything they have is downloadable. Go to their home page and follow the links.
tangus··on Paris had a moving sidewalk in 1900, and a Thomas Edison film captured it (2020)
Everybody carries a gun in Heinlein stories, so those terrorists will be quickly dealt with by armed citizens, thus confirming the superiority of Libertarianism.
tangus··on Some Smalltalk about Ruby Loops
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 chaining 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.

tangus··on Argentine peso hits fresh lows despite U.S. support – and it could get worse
Careful. Seeing how I was downvoted for asking, it looks people here don't want that information to spread.
tangus··on Some Smalltalk about Ruby Loops
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
tangus··on Some Smalltalk about Ruby Loops
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.
tangus··on Argentine peso hits fresh lows despite U.S. support – and it could get worse
It's paywalled, please provide a workaround.
tangus··on Webbol: A minimal static web server written in COBOL
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...
tangus··on Katharine Graham: The Washington Post
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...

tangus··on Simon Tatham's Portable Puzzle Collection
Also related: https://puzz.link/db/
tangus··on Ruby 3.4 frozen string literals: What Rails developers need to know
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.

tangus··on Ruby 3.4 frozen string literals: What Rails developers need to know
Strings are going to keep being mutable by default. Only strings created by string literals won't be.
tangus··on End of an Era
>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.

tangus··on Alternative Layout System
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.)
tangus··on Show HN: I wrote a Java decompiler in pure C language
They say it right in the next sentence.
tangus··on Ask HN: Has anybody built search on top of Anna's Archive?
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.
tangus··on Red Programming Language
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.
tangus··on Red Programming Language
Not very reliable, this Phantom thing.
tangus··on Red Programming Language
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.
tangus··on Street address errors in Google Maps
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.
tangus··on Who carved South America's mysterious ancient tunnels? [pdf]
Just in time to kill the giants sloths?
tangus··on C++ is an absolute blast
You can pay the penalty and get safe container access, too. AFAIK, C++ standard containers provide both bounds checked (.at()) and unchecked ([]) element retrieval.
tangus··on ASCII Delimited Text – Not CSV or Tab Delimited Text
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.

tangus··on Pascal deserves a second look
Yeah, well... you won't get very far with just TP-style objects and strings and without dynamic arrays.
tangus··on Why Pascal Deserves a Second Look
Yes, but Delphi is no rocket either.
Page 1 of 5Next →