ninenines/esdl2

Doubts about roadmap and implementation

brainstormi opened this issue · 4 comments

Hi...
Totally newbie here, so excuse me if I said something something totally stupid. I was start playing with esdl2 and Erlang, and during this sort period of time I could take a look to the project, I have some questions about it...

  1. I'm aware you're only interested in the 2d side of things from SDL, Do you think in implement SDL2_gfx plugin inside esdl2?. It would include additional functionality like polygons (2d), curves like bezier, rotozoom... It seems like a great candidate to expand current functionality.

  2. Threading is implemented using nif threads to avoid blocking schedulers, what are your thoughts about nif threads vs dirty CPU threads, taking in account that dirty schedulers are experimental at this stage inside Erlang?

  3. In your roadmap you include candidate ideas about implementing some kind of drawing pipeline/batching functions... Do you have some numbers about the nif calls overhead with esdl2?. What are your ideas about implementing this functionality? Some kind of maps list with a set of draw commands to be deserialized at once from C NIF side?.

  4. Is it possible to profile SDL code from Erlang?

  5. Regarding reference receive optimization inside the roadmap, could you describe a bit more in detail your discoveries about the bottlenecks with the current implementation.

  6. Do you think is it viable to support windows in erlang.mk?... esdl2 and windows could be a good platform for game development/simulation.

    I know that the project is slow paced at the moment, but it's a quite interesting idea by itself and I would like to deep a bit more on it.

Regards,

essen commented

Do not misunderstand the late answer, it's not that I don't care about the project, it's just that I didn't have Internets until yesterday. :-)

  1. I am personally interested in the 2D side of things, yes. But I don't have any problem with adding more things. SDL2_gfx is something that indeed looked interesting to add so there's no objection from me on that. I would also be OK with adding OpenGL support if someone wants it. :-)
  2. I think dirty schedulers are interesting but I do not think they fit. We have a thread because SDL2 is (still) single threaded (at least on some OSes) and we need that thread to have the graphics related code actually work.
  3. I do not have numbers about overhead and it's not implemented because I didn't need it yet, but it's something fairly useful to have even if you don't need the performance. I am not sure how this should be done at this point.
  4. Hmm, probably? Depends what you mean by that. All the Erlang profiling tools will work. :-)
  5. None. It's just food for thoughts when we try to optimize everything. :-) I'm not even sure it's possible to use that with NIFs anyway. Would be interesting to check just to know that, though.
  6. Yes, I want to add Windows support to Erlang.mk. I have some work started for that, but I have been quite busy this past month so it's still sitting on my laptop somewhere...

Thanks for your feedback and support...
Regarding dirty schedulers, probably you are right and I misunderstood its behaviour. It seems they create a thread associated to each CPU core and with some kind of scheduling algorithm, executing the C code in any of them. I thought it could be locked to only 1 scheduler/core, avoiding the implementation of complex NIF threading code.
I'll continue playing/learning with esdl2, it's quite interesting to discover what could be done with functional programming, erlang soft-real time properties and graphics at the moment.
PD: OpenGL would be a great addition, to have one erlang graphics library to rule them all :)

essen commented

Even if it could be locked to one thread, it would severely limit the other applications on your system which may benefit more from dirty schedulers, so it's not the best idea.

Feel free to send feedback. I know everything isn't implemented yet, so if you need a function that's missing, ping me. I can do a quick function or two even when busy. :-)

essen commented

Closing, please open a new ticket if more questions. :-)