Live data from Hacker News

Jai Language Primer

github.com

31–40 of 102 posts

Re: Jai Language Primer

#31

Earlier quoted context omitted.

I look at all these new languages with horrificly complicated syntax and wish for s-expressions. Lisp is perfectly well suited for game development, too, and not just for scripting. There are many implementations around with fast optimizing compilers, JIT compilers, and other modern features that make things run fast. When I see languages like what Jonathan Blow made, I think that most of the features can be implemen…

The one thing that keeps me away from Lisp/Scheme is the lack of built-in syntax for hashmaps and sets (I like Clojure's syntax, but don't want the JVM). I've never gotten the hang of car/cdr and dotted pairs.

I don't think this is a particularly large problem. Traditional hash tables are imperative data structures, and Lisp code (or Scheme code, at least) typically does not use them because of this. Association lists, which can be represented as literals, are persistent and provider faster lookup, despite being O(n), for the cases in which hash literals are typically used (small number of pairs). The Clojure language has built-in persistent hash tables and sets, so it makes sense for them to have a reader that can process them. I really don't think this is a deal breaker though, when you can just do stuff like this:

    (alist->hash-table '((foo . 1) (bar . 2)))

Re: Jai Language Primer

#32

Earlier quoted context omitted.

I look at all these new languages with horrificly complicated syntax and wish for s-expressions. Lisp is perfectly well suited for game development, too, and not just for scripting. There are many implementations around with fast optimizing compilers, JIT compilers, and other modern features that make things run fast. When I see languages like what Jonathan Blow made, I think that most of the features can be implemen…

garbage collection and a language that doesn't run as fast as performance minded C++ are not going to be used in hardcore game programming. You don't have control over the memory allocation or layout. For non native game programming there are many many choices.

This shows a bias that high-level languages do not have native code compilers that can generate faster code than what someone writes in C/C++. This is not true. Some of these compilers can produce better native code because the language lets you write better code in the first place.

Re: Jai Language Primer

#33

I stopped caring at no garbage collection.

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

#34
post #12

Earlier quoted context omitted.

Yes, how much fun folks could have if you could connect a Repl into your game and arbitrarily change the rules on the fly!

You can do that right now with Love2D and a stub game loop that sources the actual implementations every second or two.

That is a far cry from a REPL.

Re: Jai Language Primer

#35
post #5

This is interesting. Recently, I've been doing more c programming again, and everytime I do I find myself thinking about building a language that is essentially c with just a very few pain points removed. #1 is a build/module/package system for making it easier to build modular code without copy/paste that is the defacto c-standard. #2 would be removing the pain points of utf8/unicode support (go seems to get this pr…

It has been said that everyone wants their favorite language with just one more feature.

Re: Jai Language Primer

#36

Earlier quoted context omitted.

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…

Can you give me an example of soft real time game that isn't hurt by the presence of a garbage collector?

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

#37

Earlier quoted context omitted.

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…

Can you give me an example of soft real time game that isn't hurt by the presence of a garbage collector?

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

#38

> Abstractions like RAII, constructors and destructors, polymorphism, and exceptions were invented with the intention of solving problems that game programmers don’t have This is the only part of the Jai philosophy I struggle to understand. How is an explicit delete keyword better than deterministic destruction? From my perspective, the former method reintroduces the problem the latter method solves. Also, polymorphi…

There are cases where virtual functions lend a lot of flexibility, but for games they are usually a sign of a programmer that doesn't understand how pointer chasing destroys performance. If you look at Ogre (and I think box2d) both architectures could be massively sped up by not using arrays of pointers.

Re: Jai Language Primer

#39

Earlier quoted context omitted.

Can you give me an example of soft real time game that isn't hurt by the presence of a garbage collector?

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

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

#40

Earlier quoted context omitted.

Can you give me an example of soft real time game that isn't hurt by the presence of a garbage collector?

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

Right, you use C++ to build game engines, you can use scripting languages on top of that once the engine is built.
Post reply on HN