JavaScript for moddding

drkwv
Member
Posts: 102
Joined: Thu Jun 28, 2012 13:48
GitHub: aa6

JavaScript for moddding

by drkwv » Post

Is there any chance of adding JavaScript as a language used for modding? Programming with Lua is pain. It even doesn't recognize != operator. It blows my mind. I hate Lua. Lua is a bullet that missed it's aim. They wanted simple pretty language but created a freaking brain-eating monster instead.

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

Re: JavaScript for moddding

by kaeza » Post

This has already been discussed here.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

sfan5
Moderator
Posts: 4094
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

Re: JavaScript for moddding

by sfan5 » Post

Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

Re: JavaScript for moddding

by BrandonReese » Post

Use ~= instead of !=

Problem solved

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

Re: JavaScript for moddding

by Evergreen » Post

No. Just no.

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

Re: JavaScript for moddding

by PilzAdam » Post

Yea sure, we start recoding thousands of lines of the engine and break every single mod because you want to use != instead of ~=.

OmniStudent
Member
Posts: 261
Joined: Sat Nov 03, 2012 06:40

Re: JavaScript for moddding

by OmniStudent » Post

drkwv wrote:Is there any chance of adding JavaScript as a language used for modding? Programming with Lua is pain. It even doesn't recognize != operator. It blows my mind. I hate Lua. Lua is a bullet that missed it's aim. They wanted simple pretty language but created a freaking brain-eating monster instead.
I like your passion :-)

drkwv
Member
Posts: 102
Joined: Thu Jun 28, 2012 13:48
GitHub: aa6

Re: JavaScript for moddding

by drkwv » Post

PilzAdam wrote:Yea sure, we start recoding thousands of lines of the engine and break every single mod because you want to use != instead of ~=.
sfan5 wrote:Please compare Why JavaScript sucks and Why Lua sucks
Well, I see the point. But, just to satisfy my curiosity, why not Python then? Does the Python has ever been considered before you decided to choose Lua?
BrandonReese wrote:Use ~= instead of !=
Problem solved
No. Just no.

sfan5
Moderator
Posts: 4094
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

Re: JavaScript for moddding

by sfan5 » Post

drkwv wrote:
PilzAdam wrote:Yea sure, we start recoding thousands of lines of the engine and break every single mod because you want to use != instead of ~=.
sfan5 wrote:Please compare Why JavaScript sucks and Why Lua sucks
Well, I see the point. But, just to satisfy my curiosity, why not Python then? Does the Python has ever been considered before you decided to choose Lua?
Lua was chosen because it is more lightweight than Python.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

spillz
Member
Posts: 138
Joined: Thu Feb 13, 2014 05:11

Re: JavaScript for moddding

by spillz » Post

I don't think it would be terribly hard to write bindings for python using the Lua api as a starting point. But not clear enough people would use it to make it worthwhile (you and maybe me). And it would fragment development. And as far as i can tell, most devs are happy enough with lua and the ones who aren't probably want c++ mods.

So unless you are interested in maintaining a Javascript or python or whatever port just stick with lua. Code in it for a week and you will adapt well enough.

User avatar
philipbenr
Member
Posts: 1897
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

Re: JavaScript for moddding

by philipbenr » Post

spillz wrote:Code in it for a week and you will adapt well enough.
I think that Lua is fine for Minetest, and it is very easy to learn. I did it in one day. (Not very extensively, but hey)...

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: JavaScript for moddding

by Krock » Post

philipbenr wrote:
spillz wrote:Code in it for a week and you will adapt well enough.
I think that Lua is fine for Minetest, and it is very easy to learn. I did it in one day. (Not very extensively, but hey)...
Lua is confusing for programmers:
~= instead of !=
no var++ method
indexing starts at 1 instead of 0
everything is just one type of variable. my first try to define a string

Code: Select all

string test = "Hello world";
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: JavaScript for moddding

by Kilarin » Post

Krock wrote:Lua is confusing for programmers
Every programming language is a little different. I've worked in Java, C, PRPC, COBOL, VB, Assembler, Pascal, Javascript, Notetab Clips, Jython, and probably at least 8 different forms of Basic. If Lua began it's indexing at 0 instead of 1 it would be confusing to programmers from a different background.

What's tripping me up the most is Lua's requirement for a "then" on an if. But when I first switched from primarily programming in Pascal to primarily programming in Java, it was the LACK of a "then" that confused me. Every programming language has it's individual quirks.

As for everything being one type of variable, yeah, it is still taking me a while to get used to that, but that is one of Lua's strengths. It is designed to be a scripting language that works easily when interacting with just about any other parent language. Because Lua's variables are not strongly typed, they are VERY flexible.

Lua is simple and obvious enough that even non-programmers can work in it pretty quickly with just a few examples.

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: JavaScript for moddding

by rubenwardy » Post

I wouldn't like vanilla Javascript to be used for modding. However, Google makes a version which has classes, and it is open source.

It is best to keep with Lua, though.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
philipbenr
Member
Posts: 1897
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

Re: JavaScript for moddding

by philipbenr » Post

rubenwardy wrote:It is best to keep with Lua, though.
I second that.

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: JavaScript for moddding

by rubenwardy » Post

philipbenr wrote:
rubenwardy wrote:It is best to keep with Lua, though.
I second that.
The reason I say that is not because it is any better (I don't really have an opinion on that), but because it would be a PITA to modify the engine to either:
  • Add multiple languages
  • Switch to JavaScript.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
philipbenr
Member
Posts: 1897
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

Re: JavaScript for moddding

by philipbenr » Post

Plus, adding more languages would make things more complex, make the engine heavier, and take up much more space.

User avatar
JPRuehmann
Member
Posts: 334
Joined: Fri Mar 21, 2014 21:40
Location: Germany
Contact:

Re: JavaScript for moddding

by JPRuehmann » Post

Hi
<sarcasm>Java script is a pain in th as to! let us use bash.</sarcasm>
have Fun,
JPR

sfan5
Moderator
Posts: 4094
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

Re: JavaScript for moddding

by sfan5 » Post

Krock wrote:
philipbenr wrote:
spillz wrote:Code in it for a week and you will adapt well enough.
I think that Lua is fine for Minetest, and it is very easy to learn. I did it in one day. (Not very extensively, but hey)...
Lua is confusing for programmers:
~= instead of !=
no var++ method
indexing starts at 1 instead of 0
everything is just one type of variable. my first try to define a string

Code: Select all

string test = "Hello world";
C++ is confusing for programmers:
!= instead of ~=
WTF does var++ do?
indexing starts at 0 instead of 1
every variable needs to have types. my first try to define a string

Code: Select all

test = "Hello world"
Do you notice something?
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
HeroOfTheWinds
Member
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero
Location: Hawaii

Re: JavaScript for moddding

by HeroOfTheWinds » Post

The back-and-forth in this thread is making me split my sides in laughter. But seriously.

It's true: every language has its quirks. I started in Python, but then moved to Visual Basic, and couldn't wrap my head around the reason they make you say "dim" before declaring variables. Every language is going to have something that someone doesn't like, and that's not restricted to programming languages either. It just has to be dealt with and move on. I didn't like lua at first either, but I got used to it, and now I'm attempting to code things that I consider pretty neat. I wouldn't go using Lua to program the next Legend of Zelda, but it certainly gets the job done for a lightweight language to code mods for Minetest.

If you really despise Lua that much, do this, which I'm sure you'll find even less agreeable: Code a program that lets you write a mod in JavaScript, and then have that program convert your JS code to Lua automatically. Problem solved, everybody happy. (If you're an optimist.)
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

Re: JavaScript for moddding

by kaeza » Post

Krock wrote:everything is just one type of variable
Lua Manual wrote:Lua is a dynamically typed language. This means that variables do not have types; only values do. There are no type definitions in the language. All values carry their own type.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
aldobr
Member
Posts: 316
Joined: Sun Nov 25, 2012 05:46

Re: JavaScript for moddding

by aldobr » Post

I write my own programming languages for breakfest.

Lua is ok.

Real programmers (TM) can use any turing complete language, period.

D0431791
Member
Posts: 19
Joined: Wed Nov 06, 2013 11:43

Re: JavaScript for moddding

by D0431791 » Post

+1. I think somebody will branch Minetest and implement a javascript Modding System.
Last edited by D0431791 on Mon May 19, 2014 07:20, edited 1 time in total.

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: JavaScript for moddding

by rubenwardy » Post

D0431791 wrote:+1. Somebody will branch Minetest and implement a javascript Modding System.
Why the guarantee?
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

avyukt
New member
Posts: 7
Joined: Thu Oct 15, 2020 14:06
GitHub: moreavy
In-game: smugler5
Contact:

Re: JavaScript for moddding

by avyukt » Post

As what I see, JavaScript is an International language support, while LUA has only European Language support. Adding JavaScript as a modding language is not that difficult because Minetest already has LUA Support.
PHP & JavaScript Develepment!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 4 guests