News for hackers. Stuff that matters.

joejev

Re:Strings Just Got Faster on Saturday May 03, 2025 @12:56PM (#43880379)
Isn't the entire point of an optimizer to convert "bad code" into "good code"?

Your proposed solution is to have the user manually implement a hash table, but if you have a good optimizer, users can focus on writing clear code without bugs or logic errors and let the machine turn that into efficient code.

Re:Fat pointers in C using libcello on Wednesday April 29, 2020 @01:03PM (#23021474)
Interesting idea, but this implementation has UB:

    typedef void* var;

    struct Header {
      var type;
    };

    // ...

    #define alloc_stack(T) header_init( \
      (char[sizeof(struct Header) + sizeof(struct T)]){0}, T)

    var header_init(var head, var type) {
      struct Header* self = head;
      self->type = type;
      return ((char*)self) + sizeof(struct Header);
    }
The section "struct Header* self = head" is UB. The alignement requirement of the local char array is 1 but the alignment requirement of struct Header is that of void* which is probably 8.
Re:Configs suck? Try a real programming language on Sunday April 05, 2020 @08:17PM (#22789861)
It's not an ad-hoc turing complete language, it is just a programming language. Makefiles are just programs. There are some strange implicits, but that isn't unique to the Make programming language.
Re:Retro: A Modern, Pragmatic Forth on Thursday May 23, 2019 @11:55PM (#19998338)
I think they meant that the bytecode itself reads like a forth. The data stack works just like it does in forth within a single Python function.
Re:Near-duplicate features of C++ (2017) on Thursday May 23, 2019 @11:11PM (#19998154)
> The argument comes down to when the undefined behavior occurs: is it at the deference to create the reference, or is it on the first memory access using the reference? The language pedants will say the former, but in practice, it's the latter.

The undefined behavior is always when the null reference is created. The issue will _usually_ manifest when you try to dereference the pointer, but the undefined behavior was creating the null reference in the first place.

Re:Kickstarter’s staff is unionizing on Tuesday March 19, 2019 @09:38PM (#19438071)
> And regardless of that, if my employer is willing to pay our CEO over 20x what they pay their average employee, they are not in a position to niggle over the kinds of systemic inefficiencies they would suffer under a union.

Do you not believe that a CEO could have at least 20 times the impact on the value of a company than the average employee, and if so, should they not be compensated accordingly?

Re:The CPython Bytecode Compiler Is Dumb on Monday February 25, 2019 @10:54AM (#19246476)
I work on a library for doing Python bytecode transformations like this, but with a more abstract API. Here is a similar transformation with this library, which works with Python 3: https://github.com/llllllllll/codetransformer/blob/master/co...
So, like some sort of shared library that my programs dynamically communicate with? How is this functionally different from a shared object?
Re:Japan’s special take on a packed lunch on Friday October 12, 2018 @10:14PM (#18206002)
I've been to chiles, not surprised to see that on the top of the list.
You need to know how the character is written regardless because the stroke order is part of the character. There are some basic rules like working left to right and top to bottom. Also, each component has the same order when written out.
Re:Young Chinese are sick of working long hours on Thursday May 10, 2018 @07:46PM (#17043851)
What about a 9 hour flight? Bring 2 sets of pilots?
Great write up. I am a maintainer of a project you opened a PR on, but the diff is large and seems to include unrelated changes. Maybe you based of a fork and the opened the PR to upstream? If the bot had worked as intended I would have thought it was cool, but given that it opened a large PR with an incorrect description I found it harmful. I guess the problem with these bots is that it is easy for you to make a mistake which takes a lot longer for people to deal with than it took for you to make, so github needs to ban these to prevent this.
> elipsoid earth theory

Do you actually know this is true? Have you tested this?

I'm also in Cambridge, for a long time they were replacing some pipes under my street. This would cause weird, seemingly ambient sounds.
Re:Twitter Killing Its Mac App on Saturday February 17, 2018 @02:18AM (#16399503)
Why does it matter if the users are high income? Twitter can still serve ads to low income users.
With enough wrapping, the templates can be okay to write. For example https://github.com/llllllllll/wired looks like a shitty lisp.
Re:Scope exit in C++11 (2012) on Tuesday February 06, 2018 @04:54PM (#16320241)
This pattern was possible with a scoped class in c++ 98.
Re:Solving Minesweeper and making it better (2015) on Friday February 02, 2018 @06:08PM (#16294996)
Many games (by common definition) are strictly execution based. For example, most rhythm games (e.g. Osu!, Beatmania, DDR, Guitar Hero, etc) do not have any element of randomness or strategic requirements, yet some people find them very fun.
> 1. BTC is useful as a store of wealth.

> 8. Don't put in more money than you're willing to lose.

Cryptocurrency-think

Re:When is it OK to remake a classic game? on Wednesday November 22, 2017 @03:43PM (#15760429)
I can see the art being preserved as a critical feature for adventure games, but with StarCraft remastered it seems everyone loves the new art. The most important thing for that game was to keep the gameplay exactly the same while supporting newer displays.
Re:How to Get Rich Playing Video Games Online on Wednesday November 15, 2017 @02:41AM (#15702104)
I love osu!, but there are no strategic actions, you just click the circles.
Re:Starcraft II goes free-to-play seven years after launch on Tuesday November 07, 2017 @04:19PM (#15647745)
> For too long, Blizzard was far too afraid to make sweeping changes to their game in the same vein as DotA or League.

Why are big changes a good thing? As someone who started playing brood war since the remastered release, I really like that the game is the same as it ever was. Leave tweaks to the community through map making. People come up with all kinds of fun ways to change up the game like reverse ramp mains or that weird assimilator/neutral egg setup on gold rush.

When I was still playing SC2 I appreciated how well thought out the changes were, for example when they increased the range of queens. That had such a huge affect on the game but it all came from such a small change.

Re:I can no longer recommend MailChimp on Tuesday October 31, 2017 @07:30PM (#15597630)
I get newsletters for a few music labels to see their new releases. I also get announcements for local music shows.
Re:Philosophers Who Like Stuff on Friday October 06, 2017 @07:24PM (#15421190)
Interesting article, including the subtitle, "Their case against frugality", may help people understand what the article will be about. The article title alone is quite vague.
Re:Some Excel users pop F1 off their keyboards (2012) on Friday September 22, 2017 @06:46PM (#15316597)
Filco also has this.
Re:Redesigning Python's named tuples on Friday September 01, 2017 @03:33AM (#15146794)
More syntax makes a language harder to read. The point isn't that making this special syntax would be harder, because it's not that hard. The point is that you don't need new syntax. In this case, the new syntax saves a few characters at best. I'm also don't think this syntax is any easier to read than a function call; I actually think it looks so similar that it would be easy to confuse with a function call making the language harder to read.
Re:Redesigning Python's named tuples on Friday September 01, 2017 @02:41AM (#15146624)
Why is (x=1, y=2) more practical than nt(x=1, y=2)? Also, we have a very efficient implementation for tuples. collections.namedtuple is quite fast and the article shows cnamedtuple (which I am the author of) which is a C implementation that is even faster. None of this needs a change to the language itself.

Older »