Hacker News new | ask | show | jobs
by deworms 1414 days ago
Godot is effectively not accepting contributions, and masquerades as open source. List comprehension, one of the most sought-after features and requested by dozens of people, is repeatedly undermined by maintainers, because they happen to dislike the syntax. Godot offers nothing similar in terms of processing arrays, so it makes any code involving them ugly and more complex than it needs to be.

There was even a pull request implementing this feature opened, but they claim the assigned maintainer just didn't have the time to review it yet (over 5 years!). One person can effectively stall all progress out of spite. That's no way to run an open source project.

Just look at this discussion: https://github.com/godotengine/godot-proposals/issues/2972

6 comments

> That's no way to run an open source project.

The way contributions are accepted (or not) is completely unrelated to the project being open source or not. It's always up to the maintainer to decide whether a feature should be merged or not. Open source projects are not popularity contests.

I find it a bit untrustworthy when someone frames a language design issue as representative of the way the project is run. List comprehension is a feature that comparatively few languages have, and I can easily imagine that the GDScript team has other things they consider a priority.

For a programming language, 5 years is not at all an unusual delay when we're talking about an extension to the basic syntax.

Open source != open contribution.

Don't like how they run it? Fork it. The maintainers have ZERO obligation to merge your PRs, especially when they don't actually agree with it.

Why would you want list comprehensions in a game engine? It's just sugar to make looping over a list or array look more functional but not particularly useful in a game.
What's so special about games that makes it not useful? Python has it and it's bread and butter, and Godot language is basically a gimped, less expressive, and less useful knockoff of python
> gimped, less expressive

That's the point. Lots of what Python does isn't required in a game engine and is slow.

It's basically visual scripting but quicker to produce, the whole thing is C++ underneath.

So basically instead of

   number_list = [ x for x in range(20) if x % 2 == 0]
   print(number_list)
one gets to write something like this,

    auto number_list = std::views::iota(0, 20) | std::views::filter([](const int n) {return n % 2 == 0; });
    for(int num: number_list)
        std::cout << num << ' ';
Maybe look at the code of real games out there to find out why list comprehensions aren't needed in a game engine specific language and what typical code looks like...
Once upon a time I was on SCEE offices in SOHO, was IGDA member for almost a decade, attended a couple of GDCE back in the day, regular visitor of Flipcode and GameDev.net back when they actually mattered.

Maybe don't try to guess the possible lack of knowledge of random people on the Internet.

> One person can effectively stall all progress out of spite.

I'm not sure about this one, I can understand why someone might agree with some of the arguments about list comprehension making readability worse, like stated in this comment: https://github.com/godotengine/godot-proposals/issues/2972#i...

  I have to agree with @pycbouh. While a lot of things python does is good, I really don't like list comprehension, especially when it becomes nested.
  
  numbers = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
  print([n for sublist in numbers for n in sublist if n % 2 == 0])
  # > [2, 4, 6, 8]
  
  Not very readable, and you save what, 3 lines? Not worth.
Some might enjoy writing code like that, others might dislike it. The current lack of such functionality doesn't hold anyone back that much and therefore doesn't get prioritized. It might get introduced in the future, but when there is still lots of discussion for and against adding it instead of how best to actually implement it, you know that the time has not yet come.

Personally, I enjoy both LINQ in C# and Streams in Java, perhaps more than a one liner. But again, that's a personal preference and the opinions are often split about syntax related questions.

GDScript went through a major rewrite for Godot 4, so they avoided adding lots of new features in the meantime and focused on getting it stable.

The rewrite should make it easier to add new features now.

Also the design of Godot values ease of use and simplicity to an great degree. They are very conservative about adding new features and I think they have a point there.

Also list comprehension is an odd example, I wouldn't really rank it that highly when it comes to features I miss. More annoying for me is not having traits or interfacse. You are expected to go full in with "everything is a node" and are a bit limited when it comes to more advanced abstractions. I understand why they are reluctant adding them though and I respect their commitment to keeping things simple.