Which functional programming language is best for game development?

Which functional programming language is best for game development?

I am fully aware that they might not be ideal for this purpose, but this is what I want to do. I don't plan on making games that require amazing performance.

Thanks.

Attached: functionallanguages.jpg (638x479, 56K)

Other urls found in this thread:

alvinalexander.com/scala/fp-book/disadvantages-of-functional-programming]
itnext.io/pros-and-cons-of-functional-programming-32cdf527e1c2]
github.com/cbaggers/cepl
youtube.com/playlist?list=PL2VAYZE_4wRITJBv6saaKouj4sWSG1FcS
github.com/lispgames/lispgames.github.io/wiki/Lisp-Games
github.com/tomhrr/dale/blob/master/README.md
github.com/stoeffel/awesome-fp-js
twitter.com/SFWRedditGifs

javascript

Scala because of OO kek

(OP)
If it helps, I've been mainly looking into Common Lisp, Racket/Scheme, and Haskell.

There's a LISP game jam going on I think, you could see what they do
I think Haskell can work with Godot

None of them. Lisp is probably the best for performance reasons, but you would still be better off with lua or sepples.

>I don't plan on making games that require amazing performance
Just download Unity you fucking half ass cunt

Lua is good for high performance? I didn't think it was anywhere near comparable to C++

For video game just use OOP. Look at all the engine support. And OOP is not bad with games, a few state things can give you bugs but it's easy to reason about.

>Which functional programming language is best for game development?
None of them you fucking retard

Haskell and LISP would have the most active game dev communities you could go to for help

>Haskell
>active game dev community
Good one

Use the gloss library for your engine.
Game dev is fun, good luck my friend!

Thanks. Do you recommend any resources or books to get started? I have zero functional programming experience.

Common Lisp for performance? That surprises me

Lisp doesn't try to abstract away everything like Haskell does, you can still use it to program imperatively

Real World Haskell and Learn You a Haskell are both free online. Those are good for learning.

why is python not on this list

i use python and i find it functions most of the time

Rust

>functional
>game dev
fucking what nigger?
game dev requires constantly changing variables and memory, but functional is locked down shit that never changes, are you fucking retarded, you fucking doubleniggerlicious kike?!?!??!

Attached: oh shit nigger!.jpg (259x194, 11K)

t. mt. stupid

not functional enough

Javascript

>immutability
>"why yes, creating a new state space very time the frame updates makes perfect sense to me"
the absolute state!

>recursion
the problems with this should be obvious.

If you're smart you'll use a combination of Haskell and C++ since they would be complementary, but if you think you can write a full fucking game in pure functional language, then i'm sorry to say but you have a lukewarm IQ.

Sources:
[alvinalexander.com/scala/fp-book/disadvantages-of-functional-programming]
[itnext.io/pros-and-cons-of-functional-programming-32cdf527e1c2]

Perl 6

It's not, user was likely thinking of LuaJIT which in fact is silly fast.

Probably Scala or Common Lisp because they are multiparadigm and you can escape fp when you need to.
But if it were me, I'd try to use Scheme embedded in an existing game engine like how people do with Lua.

>I am fully aware this is a completely retarded decision but I still want to be a fucking retard and shoot myself in the foot before I even start

Attached: 1210393849.jpg (500x563, 51K)

In game loops performance is often critical to hit 60fps. functional heavily promotes immutable copies. This is slow AF. It simply doesn't make sense for games. Also, I would be very hesitant to abandon polymorphism and event driven design which is discouraged in functional. Also, plugging in behavior with func and delegates can be powerful, but this is something else I see discouraged often with functional. Just not great for performance critical data that has a large graph triggers and events, nor data that needs to be frequently mutated.

Attached: 2018-12-09 23 01 441544395630640.png (1500x1500, 1.53M)

>what is functional reactive programming

Event driven design is literally promoted by every new functional framework fad.
Fuctional is great for embarassing prallel perfomance. not for sequetial performance.

Lua is functional

I used Haskell and an ECS package called Apecs and even wrote a like tutorial on my findings (found on the Apecs repo). While going for an ECS system kind of defeats the point of going functional in the first place, it does make some things a lot easier and you simply do your pure functions as you need them. Let Apecs handle the state of the game and let your pure functions do the logic. It's nice to work with.

But either way, you're going to need to be hot shit if you're going to succeed. Best of luck.

Can I make a game entirely with Lua and LuaJIT

There's an F# implementation of tetris somewhere on github, it's my entry point into functional along wtih expert in F#.

>Lisp
>functional
The current state of /g in just 2 words.

>polymorphism and event driven design is discouraged in functional programming

Attached: 907.jpg (177x219, 68K)

Lisps

Common lisp is not so much of a functional language as it is multiparadigm, but it's the only one of this bunch that I'd use. Mostly because of this:
github.com/cbaggers/cepl
youtube.com/playlist?list=PL2VAYZE_4wRITJBv6saaKouj4sWSG1FcS
There aren't so many enviromnents where you can compile GPU code into a running game.

Nowadays lisp is faster than Java, and that's fast enough for Minecraft.

Attached: feb8862f497e8c2044e21fca91dc821d.jpg (419x600, 49K)

> Which functional programming language is best for game development?
You could make games on Scala, but it will be mainly good for some kind of 2D visual webbrowser novel / porn game.

3D games are possible, but far easier to do with the industry standard C++.

> Nowadays lisp is faster than Java
Not usually, no.

> and that's fast enough for Minecraft
Minecraft is still rather terrible software even after all these updates.

Yea, it was obviously good for Minecraft that people were able to decompile it into reasonably moddable Java, but it isn't overall a good thing that they used Java.

>Just download Unity you fucking half ass cunt

Attached: nodev.png (743x800, 28K)

What do you recommend then

Which

C and Vulkan

>functional
>means there's no polymorphism
Carry on, junior frontend developer

You really haven't said anything about what your application requires. If you need strong, battle-tested concurrency then go with Erlang or Elixir.

If you're targeting the JVM then go with Scala.

If your application is a pointless toy then go with LISP, Clojure, or Haskell.

If you want something enterprise tested but with the familiarity of objects then go with OCaml

>functional programming language
>game development
>require amazing performance

No game will ever have amazing performance on a functional programming language. Unless you are making a stock market game with no graphics.

crash bandicoot runs on lisp

>Game Oriented Object Lisp
Object.
Oriented.

Not a functional programming language.

Another bit of advice, program first optimize later (if at all).
When making a game just set your ms per frame goal or target fps goal.
Then make the game. And use profiles to find parts too slow and optimize those until you reach the mark.

OOP and FP do not contradict each other.

>using a buttrknife as a screwdriver
alright.

Did you knpw that in C the compiler output files are called object files so C is object-oriented and not at all imperative because fuck understanding anything when you can just vomit terminology all over discussion boards

Attached: 1469497118825.jpg (480x700, 42K)

Carmack took a couple of nights to rewrite Quake in a functional language as a way of learning it. He had good things to say.

Wolfenstein 3D, not Quake...

Probably clojure

Use Common Lisp since it's not strictly functional.

What is your goal?
What is your definition of "functional"?
Rust can be pretty "functional", and it's extremely efficient at the same time.
Other than that, I would probably pick Clojure or maybe Scala because of Java interop, or some compile-to-js functional language because of JavaScript interop. Pick your poison..

You can just use Love2d if it’s simple. Plenty of commercial games have been made with it, many more than with a meme like Godoy.

Is Lua good for that task though?

Simple games that don't require a ton in the way of performance. Probably mostly 2D to start with, MAYBE 3D later on.

They're all unusable practically for game dev even for simple games. You simply can't tolerate the latency of GC when you need to push a frame every 16 ms. However there is one caveat. You can write your own domain specific language that doesn't use GC in haskell and write your game loop using it. However you should probably just use C or C++ at that point.

I'm seeing Lua mentioned a lot. Would I be better served giving Lua and maybe LOVE2D a go? Is Lua a good language in general?

I've seen many examples of rather well-made games in functional languages. I just don't think it's as easy to get started in it, because it's so rare. Of course it might be suboptimal, but I don't think it's impossible.

>I've seen many examples of rather well-made games in functional languages
like what?

github.com/lispgames/lispgames.github.io/wiki/Lisp-Games

They're not AAA, but they work and are possible

Dale looks interesting, but I'm not sure it's in a state that's usable enough for games:

github.com/tomhrr/dale/blob/master/README.md

t. has only read medium articles about functional programming
OP you want Clojure or Scala, end of story.

B T F O

At this point, probably F#. It can be used with Unity/Monogame. There is a niche but active community using it, and it can interact with C# almost seamlessly.

There are also Data-driven game engines like Rust's Amethyst, after all data driven programming is a subset of functional programming (citation needed, fight me).

>t.brainlet

Q

Literally built for handling complex event loops

LuaJIT is SILLY fast. The interpreter is written in assembly and is remarkably fast even before the JIT warms up.
It's still a few times slower than well-optimized C, but many 2D games do not need C speed.

this unironically

github.com/stoeffel/awesome-fp-js

Although you're not wrong here, the language he's talking about was imperative

Can Lua work as a standalone language?

Scheme, if it counts. Runs well, easily embeddable in other languages for scripting, incredibly flexible and multiparadigm.

And obviously, when you dunno bout shit, wikihow should be the sixth video I download from this site.
What part of this set if anyone has any good kisses or just slice of life boys-being-boys stuff, I would punch it like a vagina you'll feel great.