# Is Julia good for game development?

**URL:** <https://discourse.julialang.org/t/is-julia-good-for-game-development/73804>\
**Category:** General Usage\
**Tags:** server, gui, games\
**Created:** [December 30, 2021, 8:21am UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804 "2021-12-30T08:21:17Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![junux](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/junux/32/32219_2.png) [@junux](https://discourse.julialang.org/u/junux)\
**Post date:** [December 30, 2021, 8:21am UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/1 "2021-12-30T08:21:17Z")

</div>

Hi there  
I want to develop server based games via Julia.

It’s going to be awesome if you write about your honest experience and opinion.

```julia
julia_is_ideal = readline()
parse(bool, julia_is_ideal)

if julia_is_ideal == 1
   print("please suggest libraries")
   ###
           not for call of duty of course, just 2D games 
           however I expect high potential
   ###
else
   println(" why not? ")
   println(" what programming lang do u suggest for it? ")
end

```

---

<div class="post-metadata">

**Author:** ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)\
**Post date:** [December 30, 2021, 9:42am UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/2 "2021-12-30T09:42:38Z")

</div>

No. If you’d like to use Julia, you may need to build/resurrect many packages in the ecosystem, whereas C#/C++/Unity has ready-to-use infrastructures.

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [December 30, 2021, 9:56am UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/3 "2021-12-30T09:56:31Z")

</div>

I wish Julia had better support for building games. Python and Java are also some alternatives, but Gnimuc’s recommendations might be better.

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [December 30, 2021, 9:59am UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/4 "2021-12-30T09:59:58Z")

</div>

This is the only effort in Julia that I am aware of.

[https://github.com/aviks/GameZero.jl](https://github.com/aviks/GameZero.jl)

---

<div class="post-metadata">

**Author:** ![c42f](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/c42f/32/52842_2.png) [@c42f](https://discourse.julialang.org/u/c42f)\
**Post date:** [December 30, 2021, 10:54am UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/5 "2021-12-30T10:54:34Z")

</div>

It depends on your goals.

I’ve found Julia to be super fun for developing a little game where I can live-code new game rules while my children are playing it. See: [https://github.com/c42f/Gameoji](https://github.com/c42f/Gameoji)

Gameoji is very much a quirky bespoke game which I doubt anybody else will play, but we’re having fun with it. Some features:

- Terminal-based tile rendering of emojis (with low-res raycast visibility 🙂 )
- 2D dungeon crawler like gameplay
- “In-person” multiplayer (multiple devices with keyboards can connect, but all rendering happens on the main screen)
- Change the game logic and game state interactively via [RemoteREPL.jl](https://github.com/c42f/RemoteREPL.jl)

I highly recommend using an Entity-Component-System abstraction for your game logic; I use @louisponet’s [Overseer.jl](https://github.com/louisponet/Overseer.jl) and this hugely cleaned up the game logic in my game.

I think there’s a few reasons not to use Julia for a game:

- Distribution! Creating a reasonable-size game bundle for low-latency startup and distribution could be hard. If you care about game distribution you should investigate this early on (see PackageCompiler.jl and related tools).
- The library ecosystem isn’t very complete (though for 2D you might be fine with the SDL bindings (maybe via GameZero.jl?) and an ECS via Overseer.jl?)

Although the ecosystem of game-specific libraries in Julia isn’t large, many of Julia’s scientific and technical computing libraries are very useful for game development. For example, Julia has various high quality libraries for geometry and image processing, many of which are very applicable to game programming.

---

<div class="post-metadata">

**Author:** ![junux](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/junux/32/32219_2.png) [@junux](https://discourse.julialang.org/u/junux)\
**Post date:** [December 30, 2021, 1:27pm UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/6 "2021-12-30T13:27:47Z")

</div>

Thanks for reply.

---

<div class="post-metadata">

**Author:** ![junux](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/junux/32/32219_2.png) [@junux](https://discourse.julialang.org/u/junux)\
**Post date:** [December 30, 2021, 2:14pm UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/7 "2021-12-30T14:14:48Z")

</div>

Thank you, so I start this with Julia and see what’s gonna happens  
it is worth it for sure  
after a week if it doesn’t make sense, ill switch to C++

and wow this [RemoteREPL.jl](https://github.com/c42f/RemoteREPL.jl) is really cool  
I left a star

---

<div class="post-metadata">

**Author:** ![Chris\_Green](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chris_green/32/32265_2.png) [@Chris\_Green](https://discourse.julialang.org/u/Chris_Green)\
**Post date:** [December 30, 2021, 4:52pm UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/8 "2021-12-30T16:52:25Z")

</div>

I’ve been in the game industry for 35 years, and have been playing with Julia.  
I think it’s a pretty solid language for using as a game scripting language -ie a replacement for things like LUA, C#, in-house languages, and I have integrated it into my distributed simulation engine. The ability to run at compiled code speed and easy integration with the mainstream game dev language (c++) are strong positives.

The risks I would say are GC, and big issues about load-time compilation. I think the first is maybe not such a problem, and because of the ability to do code introspection, you could define “allowed” and “not allowed” constructs in your game logic scripting. The second seems a bit problematic though, julia’s startup times for even relatively simple code packages could easily become the bottleneck in game/level startup time.

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [December 30, 2021, 5:36pm UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/9 "2021-12-30T17:36:42Z")

</div>

I’d think sysimages should help solve number 2. once you’ve deployed, you know all the code you need.

---

<div class="post-metadata">

**Author:** ![Chris\_Green](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chris_green/32/32265_2.png) [@Chris\_Green](https://discourse.julialang.org/u/Chris_Green)\
**Post date:** [December 30, 2021, 5:49pm UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/10 "2021-12-30T17:49:24Z")

</div>

Yes that was my thought too- that you’d link your whole game and Julia code into one dumped .exe.  
Wouldn’t help with user mods though

---

<div class="post-metadata">

**Author:** ![sashmit](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sashmit/32/18791_2.png) [@sashmit](https://discourse.julialang.org/u/sashmit)\
**Post date:** [December 30, 2021, 6:50pm UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/11 "2021-12-30T18:50:38Z")

</div>

> [@c42f](#):
>
> I highly recommend using an Entity-Component-System abstraction for your game logic; I use @louisponet’s [Overseer.jl](https://github.com/louisponet/Overseer.jl) and this hugely cleaned up the game logic in my game.

Thanks for the link, Overseer seems like a really nice library.

The ECS paradigm is quite underrated and probably could be used in many places where it isn’t right now. It’s used for example in the rust compiler.

---

<div class="post-metadata">

**Author:** ![jbytecode](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbytecode/32/17719_2.png) [@jbytecode](https://discourse.julialang.org/u/jbytecode)\
**Post date:** [December 30, 2021, 6:57pm UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/12 "2021-12-30T18:57:19Z")

</div>

If you mean “the logic in server” and “the UI is in browser” games when you say “server-based game”, yes Julia may be a nice choice if you use a web framework to handle HTTP connections, cookies, and sessions. Genie is a good candidate for this.

> **[Genie Framework - Productive Web Development With Julia](https://genieframework.com/)**
>
> Genie is a productive web development framework in Julia. Build web applications, UIs, backends, integrate with databases, set up web services and APIs.

---

<div class="post-metadata">

**Author:** ![c42f](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/c42f/32/52842_2.png) [@c42f](https://discourse.julialang.org/u/c42f)\
**Post date:** [December 30, 2021, 8:47pm UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/13 "2021-12-30T20:47:05Z")

</div>

> [@Chris\_Green](#):
>
> The risks I would say are GC, and big issues about load-time compilation. I think the first is maybe not such a problem, and because of the ability to do code introspection, you could define “allowed” and “not allowed” constructs in your game logic scripting. The second seems a bit problematic though, julia’s startup times for even relatively simple code packages could easily become the bottleneck in game/level startup time.

Right, if a game is latency sensitive or creates a lot of garbage then GC pauses could be an issue. People have used Julia for realtime control of robots which is even more demanding, so low latency is possible. I think they had to pay a lot of attention to avoiding allocation though.

> [@Chris\_Green](#):
>
> Wouldn’t help with user mods though

That’s basically the same problem that the main Julia audience faces with time-to-first-plot. There’s been a lot of effort put into this but there’s still no really slick solution for end users. I guess we’ll have streamlined sysimage creation at some point via the REPL and this may be less of a problem. Separate compilation has also been discussed.

---

<div class="post-metadata">

**Author:** ![junux](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/junux/32/32219_2.png) [@junux](https://discourse.julialang.org/u/junux)\
**Post date:** [December 30, 2021, 9:07pm UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/14 "2021-12-30T21:07:20Z")

</div>

Thank you

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [December 30, 2021, 9:29pm UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/15 "2021-12-30T21:29:33Z")

</div>

> [@c42f](#):
>
> Right, if a game is latency sensitive or creates a lot of garbage then GC pauses could be an issue. People have used Julia for realtime control of robots which is even more demanding, so low latency is possible. I think they had to pay a lot of attention to avoiding allocation though.

Link to timestamp discussing the problems faced by robotics user (2018) with 1-millisecond cycle time:

[![](https://global.discourse-cdn.com/julialang/original/3X/0/b/0b71256d516593ad3b81147b0fb018d0cc526872.jpeg "JuliaRobotics: Making robots walk with Julia | Robin Deits") ](https://www.youtube.com/watch?v=dmWQtI3DFFo&t=1621)

At [37:00](https://youtu.be/dmWQtI3DFFo?t=2220) he says it would be much easier to debug memory management issues if there were a macro that disallows allocations in its context, turning allocation into error. At ~39:00, Jeff responds positively to this suggestion. Is this macro possible now?

---

<div class="post-metadata">

**Author:** ![Chris\_Green](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chris_green/32/32265_2.png) [@Chris\_Green](https://discourse.julialang.org/u/Chris_Green)\
**Post date:** [December 30, 2021, 9:32pm UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/16 "2021-12-30T21:32:27Z")

</div>

> , if a game is latency sensitive or creates a lot of garbage then GC pauses could be an issue. People have used Julia for realtime control of robots which is even more demanding, so low latency is possible. I think they had to pay a lot of attention to avoiding allocation though.

Yes. For a 3d game to be viable, it’s got to get through a whole simulation+rendering loop every 10-15ms or so. For VR, you really want 8ms, and much longer will make people nauseous.

If you can architect your game to work that way, you may be able to run the Julia parts in another thread walled off from the c++ parts

---

<div class="post-metadata">

**Author:** ![junux](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/junux/32/32219_2.png) [@junux](https://discourse.julialang.org/u/junux)\
**Post date:** [December 30, 2021, 9:40pm UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/17 "2021-12-30T21:40:39Z")

</div>

Thanks, its helpful  
so as u said latency in solvable.  
And for GC, I think trying to create as less as possible garbage, can be the solution for me.  
Then the Julia GCA should take care of the rest.

---

<div class="post-metadata">

**Author:** ![non-Jedi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/non-jedi/32/3645_2.png) [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Post date:** [January 1, 2022, 3:08am UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/18 "2022-01-01T03:08:40Z")

</div>

> [@jzr](#):
>
> At [37:00](https://youtu.be/dmWQtI3DFFo?t=2220) he says it would be much easier to debug memory management issues if there were a macro that disallows allocations in its context, turning allocation into error. At ~39:00, Jeff responds positively to this suggestion. Is this macro possible now?

I don’t think so. For reference, the relevant github issue is linked below:

> <https://github.com/JuliaLang/julia/issues/34248>
>
> When implementing real-time applications (robotics control, streaming audio-sign…al processing, software-defined radio, etc.) in Julia, the unpredictable timing of heap allocation and garbage collection is a significant hazard. Developers who want to use Julia for such applications have to ensure that all required heap memory allocations happen in advance, and not inside time-critical loops. What would help enormously with learning and practicing such allocation-free time-critical programming is a macro that turns allocations into errors. The main purposes of such a macro would be:
> \* Developers can get compile-time feedback on whether they have succeeded in implementing algorithms in a way that cannot trigger allocations and garbage collection
> \* Users of existing allocation-free methods can see in the source code a compiler-enforced promise that this method will not cause allocations
> 
> This feature suggestion was originally made by @rdeits at the end of his wonderful JuliaCon 2018 talk “JuliaRobotics: Making robots walk with Julia”
> https://youtu.be/dmWQtI3DFFo?t=2263
> (also mentioning @tkoolen ) in response to my question of what tools he could envisage to make allocation-free real-time programming easier in Julia:
> https://youtu.be/dmWQtI3DFFo?t=2160
> @JeffBezanson then asked “Would it be enough for the turn-allocation-into-error feature to be lexically scoped”, and after the speaker agreed, promised “OK, you got it!” (followed by audience applause):
> https://youtu.be/dmWQtI3DFFo?t=2330
> 
> What is the status of this feature?

---

<div class="post-metadata">

**Author:** ![claforte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/claforte/32/19115_2.png) [@claforte](https://discourse.julialang.org/u/claforte)\
**Post date:** [January 4, 2022, 3:41pm UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/19 "2022-01-04T15:41:25Z")

</div>

In the short-term I think where Julia can shine right away is for game tools, e.g. level editors, baking tools, optimizers, etc.

---

<div class="post-metadata">

**Author:** ![YongHee-Kim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yonghee-kim/32/5965_2.png) [@YongHee-Kim](https://discourse.julialang.org/u/YongHee-Kim)\
**Post date:** [January 4, 2022, 4:12pm UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804/20 "2022-01-04T16:12:36Z")

</div>

Yeah, I’ve used Julia as data management & balancing tool in my previous mobile game project. Free to play game requires a lot of calculation and sometimes simulations with game data, and I think Julia is perfect for [such task](https://www.gamedeveloper.com/design/breaking-down-the-metagame-design-in-a-mobile-rpg)

I have been working on developing a general data manager tool with Julia. It’s still in the early stage, but if anyone is interested; here is the [link](https://github.com/YongHee-Kim/GameDataManager.jl) to my package

[Next page](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804.md?page=2)
