News for hackers. Stuff that matters.
Re:Jai Language Primer by davidgrenier on Friday February 12, 2016 @09:07AM (#11087203)
I stopped caring at no garbage collection.
Re:Jai Language Primer by dang on Friday February 12, 2016 @04:41PM (#11090869)
You've posted several such dismissive comments to HN. Please don't do that any more.

Substantive criticism is fine, but it should be thoughtful, not snarky and shallow.

Re:Jai Language Primer by gregstula on Friday February 12, 2016 @09:34AM (#11087402)
Do you know why Microsoft rewrote Minecraft in C++?

Games can certainly be successful in spite of performance problems, but why purposefully introduce them in the first place?

In the case of Notch, he used Java because he was most skilled at Java programming. The garbage collection, procedural generation, and multi-platform availability of the JVM allowed him to successfully release a massive hit as a solo indie developer.

At least that's one way to interpret it. Another way is that, had Notch been as skilled in C++ or (these days) Rust he could have made just as good of a cross platform game (even more so on mobile), that didn't concern itself with resource management outside of RAII and reference counting, was way more performant (no pauses), and in similar time frame as a skilled Java developer.

If you have a great idea use your favorite language. No doubt about that. You might be successful in spite of its specific deficiencies. However, if you are seeking a new language for a certain problem domain - like video games - choosing one with a feature that actively fights one of your fundamental goals (consistent framerate is only going to be a decision your users will regret you made.

It's funny that people like to say "users don't care what language it's written in". The fact that 8th graders know the the minecraft's garbage collector is a problem, suggests that using a garbage collected language for soft-realtime video games results in a seriously leaky abstraction.

Re:Jai Language Primer by hacker_9 on Friday February 12, 2016 @09:53AM (#11087550)
Minecraft is a special case, as the amount of voxels in memory and the constant loading and deloading of blocks of the map every few seconds, means that memory management is incredibly important to the game. That's why the C++ version was more performant, as John Carmack had full control of both the memory layouts and lifetimes, and could fine tune it all to fit the game.

This is the only reason C++ is still in wide use today, in order for games to limit load times they have to do nasty 'unsafe' tricks (such as loading a block of memory from disk straight into an address space, and just assigning pointers to it), in order to get good performance. But if your game isn't open world (such as minecraft, GTA, Fallout), then using a garbage collected language will be fine (as long it's not stop the world, but runs concurrently).

Re:Jai Language Primer by gregstula on Friday February 12, 2016 @10:04AM (#11087630)
Can you give me an example of soft real time game that isn't hurt by the presence of a garbage collector?
Re:Jai Language Primer by greggman on Friday February 12, 2016 @10:16AM (#11087712)
I'm not sure what a soft real time game is. Here's two lists of some games with garbage collection

https://en.wikipedia.org/wiki/List_of_Unreal_Engine_games

https://unity3d.com/showcase/gallery

Re:Jai Language Primer by gregstula on Friday February 12, 2016 @10:23AM (#11087776)
Unreal and Unity were built using C++.

They offer garbage collected languages on top of their C++ game engines for scripting game logic. Any significant modifications to the engine will need to be done in C++

Re:Jai Language Primer by greggman on Friday February 12, 2016 @04:17PM (#11090683)
https://wiki.unrealengine.com/Garbage_Collection_Overview

The link is for C++ garbage collection in UnrealEngine, not UnrealScript nor Blueprints

Re:Jai Language Primer by gregstula on Friday February 12, 2016 @09:45PM (#11092196)
> Unreal's game-level memory management system uses reflection to implement garbage collection.

Yep. Game-level garbage collected C++. Which is exactly what I said, I just a didn't mention GC on C++ to avoid obscuring my point. I promise you the code at the game-engine-level is manually memory managed C++

Re:Jai Language Primer by greggman on Saturday February 13, 2016 @02:07AM (#11092995)
You do realize that reference counting is considered a form of garbage collection right? https://en.wikipedia.org/wiki/Garbage_collection_(computer_s...

BTW: I've written 6 engines for AAA games. 3 of them used reference counting. AAA C++ games use garbage collection all the time. Maybe yours didn't. Mine did. Unreal does. So does Unity

Re:Jai Language Primer by CyberDildonics on Saturday February 13, 2016 @11:02AM (#11094426)
That's like saying World of Warcarft uses garbage collection because it uses Lua. The higher level language on top of an engine isn't what was being talked about since Minecraft was written completely in Java and thus dealt with the garbage collector at every level.
Re:Jai Language Primer by hacker_9 on Friday February 12, 2016 @10:16AM (#11087709)
Anything built with Unity, such as Cities Skylines. Additionally anything built with unreal engine [0] like Gears of War, the Arkham KNight series etc

[0] https://wiki.unrealengine.com/Garbage_Collection_Overview

Re:Jai Language Primer by gregstula on Friday February 12, 2016 @10:24AM (#11087789)
Right, you use C++ to build game engines, you can use scripting languages on top of that once the engine is built.
Re:Jai Language Primer by greggman on Friday February 12, 2016 @10:13AM (#11087688)
I'm with you on this. I'm an old school gamedev. Shipped games on Atari 800, C64, NES, and most system since then. I hated garbage collection for the longest time.

But, I have to acknowledge plenty of games are shipping with garbage collection. Unreal has garbage collection. Unity games have garbage collection. They seem to all be running just fine and there's plenty of large AAA games or close to AAA games made with both engines.

Re:Jai Language Primer by gregstula on Friday February 12, 2016 @10:28AM (#11087816)
They do not have garbage collection. You're conflating game development with game engine development. When a big powerful, flexible, C++ engine has been written for you, you can use C# or JavaScript or BluePrints to use the engine to make a game.
Re:Jai Language Primer by eropple on Friday February 12, 2016 @12:21PM (#11088734)
Unity has garbage collection at the userland/scripting level. This is markedly different from garbage collection at, say, the level of the objects that marshal and keep tabs on your OpenGL resources. (Not least because--though AFAIK Unity does not do this--you can stop the world for GC only at the scripting layer rather than taking out your rendering, sound output, etc. as a side effect.)
Re:Jai Language Primer by frou_dh on Friday February 12, 2016 @09:21AM (#11087290)
Your announcement has been placed in the special filing cabinet.