nim-lang / RFCs

A repository for your Nim proposals.
136 stars 23 forks source link

Remove javascript backend and use emscripten. #531

Closed FaisalAhmedAlghamdi closed 1 year ago

FaisalAhmedAlghamdi commented 1 year ago

Abstract

This is a proposal to deprecate and remove the nim javascript backend, The backend does not make any sense to exist in the language. Add an alternative which is emscripten.

Motivation

To increase development time spent on the most used backend (C).

To become more user friendly since the C and C++ backend dont often require drastic changes to your code.

Description

To focus efforts on improving the C and C++ backends, Currently the js backend is the only backend that requires dramatic changes to how your code works compare to C and C++.

I think we are better off compiling C with emscripten and add a first class library implementation of a canvas based web framework that also has the capability to map to a native gui framework (wxwidgets) for desktop apps.

Code Examples

No response

Backwards Compatibility

I propose to mark the javascript backend as deprecated and remove it next major version release (nim 3.0.0).

Varriount commented 1 year ago

Downsides to this would be that JavaScript API access would have to be meditated somehow.

Araq commented 1 year ago

To increase development time spent on the most used backend (C).

We already spend the time on this backend pretty much exclusively. The other backends are maintained by contributors who have little interest in the C backend but in the respective other backends: C++, JavaScript.

Also, emscripten is not nearly as useful as Nim's JS backend is. Advantages of Nim's JS backend:

FaisalAhmedAlghamdi commented 1 year ago

To increase development time spent on the most used backend (C).

We already spend the time on this backend pretty much exclusively. The other backends are maintained by contributors who have little interest in the C backend but in the respective other backends: C++, JavaScript.

Also, emscripten is not nearly as useful as Nim's JS backend is. Advantages of Nim's JS backend:

* Easier integration with JavaScript.

* Much faster compile-times.

* Fewer bugs. Emscripten has its own bugs and limitations, Nim's JS code generation is pretty easy to understand and influence.

Alright, it was just a suggestion guys. Thank you for your understanding.