ovidiubadita

ovidiubadita

Hey all,
I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but after discovering Elixir, I think I will spend a lot of time learning it well. For web development seems to be a great tool.

This is just out of curiosity, more than a practical question, but I want to understand the limits of this technology.

Can you make games in Elixir and deploy them on client systems?

I know it works in Erlang Vm, but I suppose the VM can also be installed on the client. But can Elixir render rich graphical content and use graphical resource?

Showing Posts 1 to 10

NobbZ

NobbZ

In theory, you can use erlangs :wx module to have GUI, you can even do OpenGL, but to be honest… Don’t!

The interface to :wx and OpenGL through erlang is very clumsy, because a multi-layered inheritance graph has been hammered down into a single behaviour. Mixed with a kind of mutable state that feels foreign in erlang/elixir, its no fun at all.

Also OpenGL is plain OpenGL, not the cool helpers which make OGL “accessible”… Many of the very useful helpers are missing and you need to rebuild them yourself.

Also there have been versions of SDL for the BEAM, but AFAIK they are all abondoned.

So I wouldn’t suggest to build the client with “pure” BEAM technology.


What could work though, is to build logic in the BEAM and also have a “Port” which communicates to another prgram which deals with user interaction/communication.

You can use any language you like for that interaction-Port.

You might probably require two different run-time systems on the clients computer. The BEAM and maybe the one for the Port…


And at the end of the post, I do remember, that @Qqwy or @OvermindDL1 planned to make a GUI package on top of a FRP-framework he build himself, but I’m not sure who of those two…

Perhaps you can build on top of that if it is already ready to use…

Qqwy

Qqwy

TypeCheck Core Team

Yes, I was busy building a Functional Reactive Programming wrapper on top of :wx, but it is quite the ambitious project, and I have not been able to devote a lot of time to it lately.

aseigo

aseigo

There is also a QtQuick bridge that would be pure awesome if it works well. I haven’t had time / motivation to try it out yet, but QtQuick is a declarative UI system that is absolutely fantastic (ok, I am biased: I worked at the company that made it, and was involved with its evolution in the first several years) .. it’s like what HTML5 should have been :wink:

ovidiubadita

ovidiubadita OP

Thank you for the answers. It helps being able to have a view of what you can and can not do with a thing you plan to learn. So far, I love Elixir, and plan to learn as much and as fast as I can. I will focus on web development, as I already do at this point in PHP and JS. The reason I asked is because I hope one day I will be able to build apps that do not need a browser to run. But is clear that I have a lot to learn until then. Maybe by then, the ecosystem will have more tools. At this point I don’t feel that confident to be the one to make any of them.

kokolegorille

kokolegorille

If You know JS already You can try Electron to build application with it.

OvermindDL1

OvermindDL1

The BEAM rules on servers, not clients, I would not recommend building a visual client on the BEAM.

You ‘can’, but I’d not recommend it.

@Qqwy was building an FRP in Elixir, I already built one in OCaml->Javascript. ^.^

Ooo, QtQuick is a good idea, I’ve use QML and it is indeed awesome.

If you want a web client, well Elixir makes a dang fine server for that. ^.^

Guh, I hate Electron, nothing eats more resources on my system then loading any Electron app… >.>

aseigo

aseigo

Which IMHO is very, very unfortunate. BEAM languages, especially Elixir, would be amazing to write client applications in if there was a good rich GUI facility. wxWidgets is not that (just look at the fun the last weeks on the erlang list about this!), but one can imagine such a thing existing. The lack of a good modern toolkit is one of the last things that holds the BEAM forever on headless services.

Concurrency is absolutely huge for modern GUI applications, something we’ve been working around for the last couple decades with one hack or another. Threading is a nightmare, so it is often faked with event loops and async I/O to varying degrees of success.

Good, modern UI toolkits put as much of the UI as possible in threads (QtQuick does this in several ways, as well as putting as much on the GPU as possible) leaving the application code to languish in yesterday’s development paradigms. It would be absolutely wonderful to be able to develop rich client applications with a language that gave you good concurrency out of the box. The other benefits like FP rather than OOP and all the other bits and pieces would be the icing on the cake.

kjwvanijk

kjwvanijk

If you like to do some functional web client I think Elm might be a nice option.

If you would like to create an installed client you could take a look at Arcadia. It is built on top of unity so for more serious projects it is nice to be able to leverage all the features off a fully fledged game engine.

Both of which could be combined with an elixir backend ofc :slight_smile:

Eiji

Eiji

@NobbZ: that’s really interesting!

I’m not planning writing game yet, but I heard about some topics related to it. Probably the most interesting was Vulcan API. Do you know if there is any possibility to “connect” features from Elixir world and Vulcan API?

Today’s CPUs (also in mobile devices) have lots of cores, for example 8 cores is not something new. I think that it could be awesome to have game data processing and process managing in Elixir and combine it with Vulcan API. Last time I saw a card game in beta version that does not loaded images for all cards and really fast I got idea like: Here Supervisor would be just perfect!.

And think about that ad: First game that could use full power of your CPU! It's written using Elixir and ... :smiley:

OvermindDL1

OvermindDL1

Vulkan (not Vulcan) is significantly lower level, manage your own memory and all, and very unforgiving for errors. Overall you will not get much of a speed difference if any between well written OpenGL and well written Vulkan except in a few very specific cases. Mostly Vulkan is just OpenGL cleaned up of it’s ancient cruft.

Eh I’ve already been doing so in C++ (custom engine) and Rust (amethyst, new engine). ^.^

Elixir/BEAM would not be performant for a client, at all. Maybe as a scripting layer, but not much beyond that at all…

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews