Page 1 of 1

Add brainfuck for modding

PostPosted: Fri Jun 27, 2014 16:35
by drkwv
Oh, it's already added... I blame Lua particularily for this:
Code: Select all
local nodes_list
print("What a wonderful happy sunny day!")
nodes_list["modname:nodename"] = true
-- ERROR[main]: ServerError: error in error handling
-- unreachable code:
print("Why, god, why?")

Also, when would be a _VERSION bump? I need goto and labels so bad, because now I need to define a named function (anonymous call not working properly) to be able to do a simple nested loop break.

P.S. Do not be offended. Topic name is just a joke.

Re: Add brainfuck for modding

PostPosted: Fri Jun 27, 2014 20:55
by 4aiman
Goto and labels are working just fine. Go get a build with lua 5.2 or make one by yourself.
As for errors in error handling - post that @"bugs and problems" or even better - open an issue @ github.

Re: Add brainfuck for modding

PostPosted: Sat Jun 28, 2014 03:12
by drkwv
4aiman wrote:Go get a build with lua 5.2

Where do I get it? I downloaded 0.4.9-dev deb package from download page, but there is only 5.1. Even if I'll make mod using 5.2, no one will be able to use it. So, I'm asking about general massive lua update, not about my personal.

Re: Add brainfuck for modding

PostPosted: Sat Jun 28, 2014 03:24
by kaeza
There has been a discussion recently to update to 5.2. I don't recall what was the final decision.

In the meantime, you can build Minetest with LuaJit, which supports `goto', and some other 5.2 features (most Win32 builds come with LuaJit nowadays, and most Linux users use it).

EDIT: On the other hand, I recommend restructuring your code to avoid using `goto' unless absolutely necessary.

Re: Add brainfuck for modding

PostPosted: Sat Jun 28, 2014 16:46
by rubenwardy
Taking the topic title seriously, you could use a brainfuck interpreter written in Lua, if such a thing exists.

Re: Add brainfuck for modding

PostPosted: Sat Jun 28, 2014 18:55
by drkwv
rubenwardy wrote:Taking the topic title seriously, you could use a brainfuck interpreter written in Lua, if such a thing exists.

Couldn't this be considered as code obfuscation, which is AFAIK restricted by LGPLv3?

Re: Add brainfuck for modding

PostPosted: Sat Jun 28, 2014 19:12
by rubenwardy
drkwv wrote:
rubenwardy wrote:Taking the topic title seriously, you could use a brainfuck interpreter written in Lua, if such a thing exists.

Couldn't this be considered as code obfuscation, which is AFAIK restricted by LGPLv3?

You don't have to license your mods as LGPL, you could use WTFPL.

Re: Add brainfuck for modding

PostPosted: Sun Jun 29, 2014 08:54
by Calinou
drkwv wrote:
rubenwardy wrote:Taking the topic title seriously, you could use a brainfuck interpreter written in Lua, if such a thing exists.

Couldn't this be considered as code obfuscation, which is AFAIK restricted by LGPLv3?


Minetest is LGPL 2.1, not 3, anyway.

Re: Add brainfuck for modding

PostPosted: Sun Jun 29, 2014 10:52
by onpon4
Writing software in Brainfuck wouldn't be "obfuscation". Obfuscation is where you write code one way, but then only distribute a modified form that's harder to read and modify. If you write a program in Brainfuck, it's just unreadable because of a bad programming practice (using Brainfuck). No free/libre software license forbids bad programming practices.

If you took something in Lua and somehow automatically translated it to Brainfuck, that would be different. I don't think that's what rubenwardy was talking about, though.