What are Minetest modders' thoughts on MoonScript?

Kodiologist
Member
 
Posts: 13
Joined: Fri Dec 27, 2013 18:06

What are Minetest modders' thoughts on MoonScript?

by Kodiologist » Sun Jan 05, 2014 20:42

MoonScript is a programming language that "compiles to Lua". That is, it's a programming language that's implemented as a MoonScript-to-Lua translator. Effectively, it's an alternative syntax for Lua. It adds some features clearly inspired by Python (like whitespace sensitivity, assignment to local rather than global variables by default, and list comprehensions) but also has a Perlish flavor (There Is More Than One Way to Do It, you don't need parentheses to call functions, and the syntax is made more concise by creative use of punctuation, as in function definitions).

I'm a fan of MoonScript. I find it pleasanter to work with than plain Lua. My only big complaint is that it's too strict about newlines. You can't just continue expressions on multiple lines by surrounding them with parentheses, as in Python. Newlines can only continue an expression after a comma. I try to get around this with 'do', as in:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
inside = (lo, p, hi) ->
    lo.x <= p.x and lo.y <= p.y and lo.z <= p.z and do
        hi.x >= p.x and hi.y >= p.y and hi.z >= p.z
 

User avatar
Pitriss
Member
 
Posts: 253
Joined: Mon Aug 05, 2013 17:09
GitHub: Pitriss
IRC: pitriss
In-game: pitriss

by Pitriss » Sun Jan 05, 2014 20:49

oh noes, whitespace senistive code..
I reject your reality and substitute my own. (A. Savage, Mythbusters)
I'm not modding and/or playing minetest anymore. All my mods were released under WTFPL. You can fix/modify them yourself. Don't ask me for support. Thanks.
 

User avatar
webdesigner97
Member
 
Posts: 1307
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97

by webdesigner97 » Mon Jan 06, 2014 09:17

-1000
Don't change the modding frontend, but improve the backend.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Mon Jan 06, 2014 15:50

Old:
C++ -> LUA -> C++

New:
C++ -> LUA -> MoonScript -> LUA -> C++

I don't know how you see this but for me it looks like an useless addition.
We already have a common programming language avaliable to use.

EDIT: the ++ should be italic...does not seem to work
Last edited by Krock on Mon Jan 06, 2014 15:51, edited 1 time in total.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Mon Jan 06, 2014 16:12

I haven't tried Moonscript yet, but from your example code it looks much less readable than Lua. Another thing is that the majority of the (modding) community has knowledge about Lua, and adding yet another language will reduce the amount of people capable of helping you with development.

This is just my humble opinion. If you feel more comfortable with Moonscript, by all means use it.

Krock wrote:LUA

Lua is not an acronym.
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 | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
xyz
Member
 
Posts: 449
Joined: Thu Nov 10, 2011 14:25

by xyz » Mon Jan 06, 2014 19:33

Great news! This topic is not about adding MoonScript to Minetest since it's already here! And the best thing is — you can't do anything about it because as OP stated, MoonScript compiles to Lua.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_on_chat_message (name, message) ->
    if message == "hi"
        minetest.chat_send_all("Hello, #{name}!")


minetest.register_node("moon:test", {
    description: "MoonScript is awesome!",
    on_place: ->
        print "I was placed! Awesome!"
})
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Fri Jan 10, 2014 09:13

Inspiration from Python? Ick! Why not FORTRAN? Or LISP? Hmm. LISP to Lua conversion tool. We might be on to something.... :-P
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 16 guests

cron