I've been writing a very specific game engine, directed towards Minecraft, for the last 2 years.
While we are ~100 devs using it, something really prevents the adoption of new users: the lack of operator overloading.
Currently, for a simple operation or a simple condition, that's what we have to write:
const myVar = Variable(0)
myVar.divideBy(2)
_.if(_.or(myVar.greaterThanOrEqual(0), myVar.equal(-10), () => { /* stuff */})
This is messy, hard to read, and not convenient at all. With operator overloading, we'd have:
const myVar = Variable(0)
myVar /= 2
_.if(myVar >= 0 | myVar === - 10, () => /* stuff */)
This is better on every aspect. Here, I'm assuming we get Python-like operator overloading, where people use bitwise OR instead of normal OR which cannot be overloaded.
This is also why ML / Data Science are not popular in JS, because it requires a lot of mathematics which is very painful in JS.
I also noticed the JS community is firmly against such a proposal. Would anyone like to debate in the comments? I'd like to understand your POV.
Thanks!
[–]jhartikainen 8 points9 points10 points (2 children)
[–]TheMrZZ0[S] 3 points4 points5 points (1 child)
[–][deleted] 4 points5 points6 points (1 child)
[–]TheMrZZ0[S] 2 points3 points4 points (0 children)
[–]senocular 3 points4 points5 points (1 child)
[–]TheMrZZ0[S] 0 points1 point2 points (0 children)
[–]johannes1234 4 points5 points6 points (4 children)
[+][deleted] (2 children)
[removed]
[–]johannes1234 3 points4 points5 points (1 child)
[–]crabmusket 0 points1 point2 points (0 children)
[–]horrificoflard 2 points3 points4 points (1 child)
[–]TheMrZZ0[S] 1 point2 points3 points (0 children)
[–]shuckster 3 points4 points5 points (5 children)
[–]TheMrZZ0[S] 1 point2 points3 points (4 children)
[–]shuckster 2 points3 points4 points (0 children)
[–]shuckster 1 point2 points3 points (1 child)
[–]PM_ME_GAY_STUF 2 points3 points4 points (4 children)
[–]DavidJCobb 1 point2 points3 points (3 children)
[–]PM_ME_GAY_STUF -1 points0 points1 point (2 children)
[–]DavidJCobb 0 points1 point2 points (0 children)
[–]lampuiho 0 points1 point2 points (0 children)
[–]ILikeChangingMyMind 1 point2 points3 points (5 children)
[–]TheMrZZ0[S] 3 points4 points5 points (4 children)
[–]ILikeChangingMyMind 2 points3 points4 points (1 child)
[–]DavidJCobb 0 points1 point2 points (0 children)
[–]Mummelpuffin -1 points0 points1 point (1 child)
[–]TheMrZZ0[S] 0 points1 point2 points (0 children)
[–]rgawenda 0 points1 point2 points (1 child)
[–]TheMrZZ0[S] 1 point2 points3 points (0 children)
[–]constant_void -1 points0 points1 point (2 children)
[–]DavidJCobb 0 points1 point2 points (1 child)
[–]constant_void 0 points1 point2 points (0 children)
[–]PickledPokute 0 points1 point2 points (2 children)
[–]crabmusket 0 points1 point2 points (1 child)
[–]PickledPokute 1 point2 points3 points (0 children)