#Some preferences for scripting languages

1 messages · Page 2 of 1

tropic raft
#

(or if you're using javascript and doing something awful, consider being normal instead. you don't have to be normal, i've done some horrible things to the javascript object system, but consider it)

acoustic sluice
#

metatables are the method of OOP in lua

tropic raft
#

yes and it's thereby pretty clearly stating it doesn't want to do OOP like a sane language

obtuse talon
#

You are not stating self, this is a static function that's supposed to create a new instance, this is merely just a typing convention of some programmers on Lua, the "self" here is just a new instance of the class

obtuse talon
tropic raft
#

"this is a static function that's supposed to create a new instance" in any other language this is called a constructor and you don't have to declare self

#

(or this, depending on the convention or keywords)

obtuse talon
#

He is not declaring self though, the "self" here is just an instance

#

They name the variable self, because it is easier to read

tropic raft
#

do you know what a constructor is

#

like have you ever used anything other than lua

#

have you ever written a class in like, javascript

obtuse talon
#

I think I did not understand what you meant by “explicitly stating the value of self”

#

You do not state the value of self, it is just the “constructor” function’s new instance, and in the constructor function you are not in the context of the instance

tropic raft
#

yeah so reading up on what the metatable actually is: lua doesn't even have real OOP, it just has common conventions used to emulate it (by creating metatables and entries for those metatables to declare the behavior of doing various things to a table the metatable describes)

#

you can use this to get the full feature set of OOP and even replicate some of the ergonomics, but it's not enshrined in the language so it leads to developer concessions at every turn

obtuse talon
#

I mean its the same thing as OOP you could argue, there’s nothing different fundamentally

tropic raft
#

sure, but you could say the same thing about writing assembly by hand instead of writing C code to do the same thing

obtuse talon
#

You can still do class:function() and it is easy to declare new members, classes

tropic raft
#

your assembly will be harder to write and slower than the assembly the C compiler makes

#

and likely not by a small margin

obtuse talon
obtuse talon
#

And it does not assemble to x86

tropic raft
#

this hurts bad

acoustic sluice
#

this is like watching two guys argue about whether an apple or a fork is better

obtuse talon
#

I do not understand what you’re trying to point out here

obtuse talon
#

I do not mean to argue, I am sorry if that came off like it

tropic raft
acoustic sluice
#

lua supports OOP through metatables

#

it has syntax sugar specifically for it

indigo grotto
tropic raft
#

i'm not seeing any sugar, it all looks like salt to me - you have to manually build your inheritance tree all the way from the root by setting up metatables yourself

#

this is way too much work when i could write the same thing in python in under 10 lines and get everything i need to start using it, complete with the ability to create subclasses

acoustic sluice
#
function a:b(c) end

is sugar for

function a.b(self, c) end
indigo grotto
#

But yea like oop in luau is typed like real oop and you can technically do the same things and on a surface level they behave the same. But under the hood its a dictionary of values referring to another dictionary of functions and I think that is very different to real oop

indigo grotto
median glen
#

as someone with limited experience in Lua, it seems like getting anything done in it is several times less intuitive and more annoying than a comparable interpreted language

tropic raft
#

let me write a comparable person class in python as an example:

class Person:
  def __init__(self, first_name, last_name, age):
    self.first_name = first_name
    self.last_name = last_name
    self.age = age
indigo grotto
#

Yes its meant for simple scripting I think stuff like classes is when you stretch it a bit thin

tropic raft
#

that's It

#

5 lines and i have a fully-featured Person class that functions as a simple data container

#

in practice you'd just use a dict if you wanted a plain data container but that's all you need to start with

#

no messing with prototypes or metatables to establish an inheritance tree

#

you need something to extend from Person? ok, easy:

class Developer(Person): # give me all the Person stuff
  def __init__(self, first_name, last_name, age, preferred_ide):
    super().__init__(first_name, last_name, age)
    self.preferred_ide = preferred_ide
#

that's it

#

9 lines and you can get a base class and something to extend it, and from there you define whatever methods you want very simply inside the class bodies

obtuse talon
#
function Person(first_name, last_name, age)
  return {first_name=first_name,last_name=last_name,age=age}
end

Woowww look Im better I do it in 3 lines….

#

In all fairness, you did not use Lua, you prejudged it from a single quick glare

#

Why do you fight against it.

acoustic sluice
#

bro this thread needs locked

tropic raft
#

i'm not making a code golf argument i'm saying that there's actual organization and a class hierarchy

#

go ahead and extend Person with a Developer class

obtuse talon
#

Do you really need one if you’re writing basic scripts for Brickadia?

tropic raft
#

yes because i want to implement entire games in brickadia

median glen
#

why are you arguing so aggressively in favor of Lua

obtuse talon
#

I can also do that if you want, in 3 lines

median glen
#

this thread's whole point is discussing potential alternatives to Lua I see no reason to argue about how Lua is actually perfect or whatever

#

it's weird

#

if Lua's good, the devs will choose it, but this thread is here to present options in case there's something better available

tropic raft
obtuse talon
quasi void
#

luar

tropic raft
#

it's not OOP if you have to assign the develop function to every instance of a developer you create manually

obtuse talon
#

Python does the same thing underhood

#

And everything in existence

median glen
#

I don't have too terribly much experience but from what it looks like, doing these things in Lua is much more convoluted and roundabout than doing it in a true OOP language

tropic raft
#

yeah and i want to keep it under the hood!

obtuse talon
#

Create a structure, assign vtable pointer

obtuse talon
tropic raft
#

i don't want to have to make the vtable myself!

obtuse talon
#

If you use it eight

#

Here watch this

acoustic sluice
#

okay but it doesn't automatically stop being OOP just because its not your ideal version of OOP

obtuse talon
#
function Developer(first_name, last_name, age)
  local self = Person(first_name, last_name, age)
  function self:develop()
    print(“Wawa”)
  end
  return self
end
median glen
#

an "OOP Language" is different from a "Language that (technically) supports OOP"

acoustic sluice
#

not really

tropic raft
#

just reminds me of the way it looked to create objects in javascript before ES6

obtuse talon
#

Its the same under the hood

tropic raft
#

javascript ES6 made the language usable for OOP

median glen
#

you can do anything in any language but that doesn't make it ergonomic

obtuse talon
#

It is ergonomic though

acoustic sluice
#

an extra setmetatable call isn't going to send you into the abyss

obtuse talon
#

You guys’ whole argument is “extra words more work”

#

God damn guys

tropic raft
acoustic sluice
#

bro didnt say that???

tropic raft
#

"Do you really need a class hierarchy if you're writing basic scripts" how am i supposed to take this then

#

how am i supposed to read "do you really need inheritance and polymorphism"

#

"you don't need allat" What do you mean

obtuse talon
#

The ergonomics are the same really

obtuse talon
#

I did not say we don’t have those

#

Or you dont need those

median glen
#

"can implement" doesn't necessarily mean "can implement intuitively"

#

I think intuition is a big part of this

acoustic sluice
#

its one setmetatable per class man, its not that hard

obtuse talon
median glen
#

because a lot of people that are going to be using scripting are going to be people with very limited programming knowledge

obtuse talon
#

You did not use Lua extensively

median glen
#

I have not

obtuse talon
median glen
#

they will if it doesn't blow to use them like in Lua

quasi void
#

just use brainfuck you don't need readability or functions or abstraction or anything do it how alan turing intended back in world war 2

median glen
#

another Brainfuck joke

obtuse talon
#

Simpler tasks are way simpler with Lua, if they’re limited with programming knowledge then Lua is just greater.

#

Though simplicity is up to devs’ implementation of the API

median glen
#

I Don't like Lua and never have since I've tried using it in other contexts

#

the simplicity argument just feels disingenuous, it feels simple because you have experience with it

obtuse talon
#

I can tell you do not like it

median glen
#

it sucks if you're a new user

obtuse talon
tropic raft
#

you don't need that in python either

median glen
#

you don't need that in most scripting languages that are actually relevant here

tropic raft
#

print("Hello, world!") Wow

#

console.log("Hello, world!") javascript

median glen
#

Lua's syntax for running one thing is simple but doing any actual structure to what you're doing gets annoying

tropic raft
#

you want to change a parameter for some object you have? it's the same thing

acoustic sluice
#

can you remind me of how performant javascript and python are again

median glen
#

it has such a weird-ass structure to its syntax

median glen
obtuse talon
median glen
#

there are languages that run better than Lua (not necessarily Luau) with better syntax

obtuse talon
tropic raft
tropic raft
#

python is performant enough to manage entire enterprise network infrastructures through tools like Ansible

median glen
#

I have made One serious attempt at using it in the context of a GMod addon and that shit was awful to use

obtuse talon
median glen
#

it doesn't help though that the APIs for GMod stuff blow

median glen
#

they'd definitely be better here, but I'm still not a fan of the overall structure of Lua scripts

quasi void
#

i tried using lua for pico 8 and picotron i need the objects to orient my programming i am too fucking stupid to implement it myself please help

obtuse talon
median glen
#

I wasn't talking about that part

#

I was specifically responding to the take about JS and Python

obtuse talon
#

I do not see what’s your argument other than your failed attempt at Lua

median glen
#

also if we're talking sandboxing, simplicity, and size, Wren completely blows it out of the water

obtuse talon
#

Then we choose Wren

median glen
#

not too sure about maintainability, that could mean multiple things

obtuse talon
#

How much do you need to maintain the updates for security flaws, and if things break how easy is it to fix the bugs

median glen
#

either script maintainability or within the game's codebase

obtuse talon
#

Why isn’t wren more widely adopted then though

median glen
#

personally out of the examples brought up, Wren and Teascript are the two that look good to me

median glen
#

in part it's a matter of luck on who picks them up

#

Lua does have the huge advantage that it's well-known and therefore well-tested

#

Lua is also 32 years old, Wren is ~5 I think?

obtuse talon
#

I was just checking that

#

Wren was made in 2013

#

So I guess thats why its not widely adopted

#

And it does talk about Lua’s syntax in why it was created

median glen
#

yea

#

I couldn't find its age so I just checked the Github's source code's age lol

obtuse talon
#

I think Wren looks better than Teascript

median glen
#

same, Vitawrap suggested Teascript and I just gave it a quick lookover

obtuse talon
#

And the concurrency feature only adds onto it

#

I might even try to implement Wren in my own project, I like it

median glen
#

it looks veery nice from what I've looked of it

#

it looks like exactly what I imagine in my head whenever I try to think of a "basic scripting language for game modding"

#

I wish I knew of more contexts it's already used in, it's apparently used in Payday 2 modding (as an option alongside Lua)

obtuse talon
#

Thats cool

#

Function declaration is very weird

#

This is not what I imagined it to be like honestly

median glen
#

function declarations are more usual in the context of class methods than as ones outside of classes from what I can tell

obtuse talon
#

It feels like scripting on drugs, I don’t know why we do things the way we do, but it seems its this way now I guess

#

Are there even statics

median glen
#

looks like a static method is just

class Foo {
  static exampleMethod() {
    return bar
  }
}
obtuse talon
#

Fair

median glen
#

the docs are just weird and tell you how to do non-class functions before class methods

indigo grotto
#

Again I would be cool with any language being added to the game but I just want to clarify any confusion for how lua works. which is very easy since the language lets you do whatever the hell you'd want and this is just one of many ways people do oop in it

#

if you really care about how many lines ur doing you could just have some real ugly code and do

Person.__index = Person

function Person.new(first_name, last_name, age)
    local newPerson = {first_name = first_name,last_name = last_name,age = age}
    setmetatable(newPerson, Person)
    return newPerson
end
tropic raft
#

it shouldn't take that many lines for something so simple is my point, and two of those lines are wasted even in the minimal example

#

setmetatable is unique to lua and entirely semantically void - it means absolutely nothing outside the context of specific quirks lua has and basically does the same thing as the class keyword in any other language, but it's more flexible so it's harder to parse and figure out if what you're reading is actually meant to be a class in the traditional sense or if the code you're looking at is doing something else strange with the metatable functionality of lua

#

plus, it's an entirely impure function so it's extremely hard to understand how it affects anything in the surrounding code, as opposed to a class declaration which is purely declarative and says "this is a new construct, this will show up later and be used again"

#

meanwhile every constructor's defining characteristic is that it might, if the author is following conventions, be called ClassName.new but otherwise looks like any other method declaration

indigo grotto
#

I prefer how lua doesn't really have any standard or many libraries and leaves it up to the user on how they'd do things but I can see how frustrating it is when you just want a standard and not to reinvent something as basic as classes and inheritance

tropic raft
#

i initially genuinely wanted to avoid stooping to bashing lua because i knew people would come out of the woodwork to run to its defense (it's only natural; someone calls out a thing you like on its flaws and you want to defend it because it feels a bit like they're insulting something about your personality; i've been there)

#

but it really is just obtuse for the sake of being obtuse and forces the programmer to redefine basic functionality of a language just because there might be some other way to handle things that the language's developers didn't think of

#

opinionated languages are good because it means you can draw a clear line between good and bad code, and it means that you can go into a source file with some expectations around what you're going to see there

#

i do not want a scripting wild west where everyone does things in a completely different way to their neighbor, that'd make collaboration actively painful

#

and just so we're clear i'm not saying i want everyone to write code in exactly the same way, i just want there to be easily-recognizable patterns that make sense to use. OO is tried and tested and there's no need to try to be new and interesting

#

there's plenty of variety between codebases even within those bounds

indigo grotto
indigo grotto
tropic raft
#

something as basic as OO should not be left to the end user to implement, and it should not be debatable as to the best way to do it

#

the best way to use it, that's perfectly fine to argue about - there's a million and one forum topics comparing and contrasting paradigms, and tons of arguments between functional purists and OO purists, but at the end of the day the goal should not be absolute developer freedom, it should be clean, maintainable, working code that doesn't look entirely alien to someone who might have to come along later and modify or repair it

#

lua is really good at making alien-looking code and i don't think that's a feature

silent fog
#

…?
Any language is clean and maintainable if you know the language.

This is just going back and forward on personal preference.

#

Thread is getting very stale.

median glen
#

????

#

that just outright isn't true LOL

#

languages can absolutely be built in less clean/maintainable ways

#

that'd imply that batshit esolangs that are intentionally built to suck to use can be maintainable if you just "use them right"

silent fog
#

Yes; I totally was referring to esolangs. That’s 100% the extreme example I was going for.

#

I’ve had to maintain PowerShell scripts. It’s a god awful language but once you understand it, its structure improves.

median glen
#

regardless, just because you can make a language usable, doesn't mean it is usable, usability is in large part contingent on how difficult the language makes it to make code that doesn't suck

#

and a language that sucks to maintain unless you follow very strict rigor is a terrible choice for a modding language in a game like this

silent fog
#

Isn’t that true for most languages?

median glen
#

it's true for all languages, duh

#

it's a sliding scale between sucking to maintain and sucking less to maintain

#

some languages are worse than others in this regard

#

like, obviously x86 ASM is going to suck more to maintain than for instance Python

#

it's not even necessarily a bad thing

silent fog
#

I know C, Lua, Python.
I see Java and it could be the best written code and I’m going to be lost cause I don’t know the language.

tropic raft
#

lua is the only language that i know that requires you to roll your own custom implementation of object oriented paradigms other than C, assembly, and haskell

#

those are not friendly languages

#

lua is the only language i know that is interpreted on top of that

#

an interpreted language forcing you to fiddle with the intricacies of how object oriented code works is not doing its job as a high-level language, full stop

silent fog
#

Lua lacks more advanced OOP paradigms but it’s otherwise fully OOP?

median glen
#

you can make good code in any language, but it's easier in some than others, I think choosing a language it's easier in is a better choice for a game like this

#

an interpreted scripting language shouldn't need to be in the same subgroup as C and Haskell really

tropic raft
median glen
#

ideally it'd either be purely functional or properly OOP but it's instead this weird chimera that's needlessly hard to work with

tropic raft
#

C is fully object oriented if you implement your own object oriented stuff on top of it, and it can work great in that context, but high-level languages, especially scripting languages, are meant to handwave that complexity away in favor of making implementation simpler and faster

silent fog
#

You don’t need to implement it yourself it’s literally

median glen
#

any language can be OOP if you implement OOP in it, that doesn't make it an OOP language

#

Lua still requires you to implement a weirdly significant chunk of that

#

even if it's not everything

tropic raft
#

"all that fancy shit" is what defines OOP. a hashmap you can change the behavior of a little bit does not an object-oriented language make

median glen
#

Lua just requires too much work on the end user to implement basic functionality for the context of an intuitive scripting language for game modding

tropic raft
#

classes don't exist in lua, they are a thing you have to build out of the parts you're given

silent fog
#

…?
It has objects. You can make objects. It’s an OOP. It might not be what you want but that’s the only point I was making.

tropic raft
#

that's not what OOP is

silent fog
#

???

#

I mean if it’s not OOP-y enough for you that’s fair I just wanted to make sure that it was clear it has those features.

tropic raft
#

i promise you i'm the last person you need to explain to that lua has "methods" and "objects"

#

to me, OOP is not defined by having chunks of data that are uniquely identified, nor by having functions that can operate on that data and track that identifier

#

that's "i have a pointer to a struct" in C

silent fog
tropic raft
#

OOP requires polymorphism and objects that you can talk about the liskov substitution principle with

#

in lua you have to build up a prototype chain yourself

#

that doesn't make any sense in an interpreted language

#

classes don't exist in lua unless you tell the language about them, and inheritance means you set a property on a table and treat it a certain way

#

that's not good OO

#

that's a hash map

silent fog
#

To be clear I don’t care if it’s Lua, JavaScript, or whatever I just think Lua was neat when I spent some time with it.

tropic raft
#

if you like emergence from a single concept, go read the free upenn course on haskell

silent fog
#

Been meaning to.

tropic raft
#

it's very cool

silent fog
#

Ye, Haskell looks cool

#

I would prefer Lua only because I’ve spent the past few years learning it, I find it intuitive and interesting.
But tbf as long as it’s not some abomination language with no applicable use outside of the game, idrc

#

let’s do C#

obtuse talon
#

Found this incase people still do not want Lua

median glen
#

Teascript is related to Chaiscript I think

median glen
obtuse talon
#

Yep

#

And I found it in 5 minutes

#

I guess the OP couldnt bother to search

median glen
#

????

mighty talon
obtuse talon
#

Lol

#

Another interesting one

pallid zealot
#

re: lua oop
what I'm getting here is you get amorphous blobs of data with no defined structure that you can just modify freely and share around wherever?
that Sucks
im not going to Pretend to do oop man
it should not take 10 lines to make a class with one field and you should not need to use a third party library to have Better pretend oop

obtuse talon
#

you do not use third party libraries though, your only concern is that it's "pretending", when that is basically how every language works

pallid zealot
#

every language is ones and zeroes big deal yeah
the difference is every language actively handles it everywhere for you while here you have to actively hold up the illusion yourself the entire time

obtuse talon
#

Its not an illusion though

#

The writing is the same

tropic raft
#

go ahead and write object-oriented code without defining a class as a function and without making a call to setmetatable then

#

in lua

#

if you want to make that kind of claim you have to back it up with an example of real code that actually satisfies the constraints we're setting or else you just sound like you're making shit up

#

it sucks that i keep having to have these slapfights over "oh lua does have real OO you just have to jump through these specific easy-to-clear hoops" because i didn't even want to talk about lua in this thread to begin with

#

i don't want to jump through hoops to get OO i want to say class Thing and then define fields and methods on that class

#

i don't want to Set Metatable Entries

slender pebble
#

you'd also have to deal with people who don't know (or dont care about) how metatables work

mighty talon
#

can't you just add a class library to lua and call it done

indigo grotto
#

Also good luck defining types for ur classes in lua and not just blindly hoping ur referencing the right names for stuff and goodluck with the absolute debug nightmare of pretend oop where the interpreter will just give you random segments of metatables and not even find the functions causing a problem

#

You can add a "library" for classes in lua but you'd be operating under a different standard than everybody else and that's the core issue with the language if ur using it in a professional context

#

Like idek how you can do classes and oop before luau type annotations its literally like working with ambiguous variables and having to check back on ur class code constantly to see what type of data ur functions are built for

#

Idk how u guys can bicker so much about it I'm like luau warrior I love working with it and I can only imagine inexperience to lend you into defending the weakest parts of the language

#

I mean u don't really fw a language until you understand its downsides and learn to live with them imo

#

And talking about luau is still relevant to the thread... You can find alternatives to it but you should be finding alternatives that share the strengths of luau and also improve on its shortcomings

#

In my class example I made the simplest code possible but a real developer would have it be way way wordier with loads of type annotations to prevent any headaches. The linting for preferred_ide in my child class would say its an error type and wouldn't even autocomplete

tropic raft
# indigo grotto And talking about luau is still relevant to the thread... You can find alternati...

thank you for actually coming at this from a sane perspective, though i do take some issue with this last message - you're not wrong per se, but the main issue is that if you frame an entire conversation around "what language is better than luau?" we're going to inevitably keep having this mistaken prejudice that the devs are dead set on luau or that it's even a leading contender when multiple devs have said they actively dislike it for one reason or another

#

we can't just put everything in terms of pros and cons compared to luau no matter how many people like it because it puts luau up on this false pedestal that it's inherently the starting point we need to work from

indigo grotto
#

But they want luau because its sandboxed and very easy to embed. So you should find other langaues that share that among other things is my point. Instead of just saying I hate lua!!! There's nothing good about it!!!

tropic raft
#

yes, and that's what the OP i made actually actively tries to do

indigo grotto
#

Yea

tropic raft
#

libriscv is sandboxed and has the advantage of letting you use any interpreter or even compiled language you like (that supports risc-v as a build target), with the tradeoff of being very hands-off, no-batteries-included - it's just a bytecode interpreter that you have to compile to

obtuse mango
#

the original op doesnt harp on "lua bad", but instead recommends/suggests some other languages/approaches for consideration

#

people have turned to asking why lua bad, trying to argue the reasons, and derailing the topic

tropic raft
#

i'm not familiar with embedding python but it is likely very possible to do, even if it's a bad idea for potential performance issues and its own controversial syntax

#

wren's entire goal is to be an embeddable language that does exactly what the devs seem to want from luau including sandboxing, plus actually robust OO paradigm support and a syntax friendly to people familiar with C-like languages

obtuse mango
#

i have issues with some of the suggested languages/approaches in the op but i still think its a good conversation to have as it exposed a weakness in lua and will likely expose weaknesses in the other suggestions

indigo grotto
#

Im still in favor of wren also

tropic raft
#

javascript's weaknesses were actually pretty fairly discussed earlier too and while it is tempting to get the node.js ecosystem, many of those libraries rely on the DOM API or the node.js API and therefore would be kind of a headache to implement despite being a battle-tested sandboxed language with perfectly workable performance

#

angelscript was suggested, and its primary weakness that i can see is that it has a lot of low-level data types that simply aren't necessary in an interpreted and embedded context, but it's also tried and tested in industry and wouldn't be a bad choice

indigo grotto
#

The starting point is luau anyway cause the devs published a blog where they specifically mentioned it alone as something they're looking into. So for suggesting alternatives I think you should compare and contrast to luau because of that. And that's why I've tried to explain exactly how the language works cause I think I have a good grasp on it besides being a hobbyist programmer.

tropic raft
#

instead of comparing and contrasting with luau, i'd rather compare and contrast with the features the developers are explicitly looking for (as well as ones it's reasonable to assume they might be looking for)

indigo grotto
#

Like just saying don't do this cause I don't like lua syntax is very different to don't use lua because you can barely do oop in it and this language would allow that and let us make stuff with bigger scopes than luau would

tropic raft
#

leaving luau on the table is just begging to have this thread run around in circles for another 3+ days, with anyone looking to actually have a productive conversation getting stuck explaining over and over again to new people coming into the thread that lua's OOP is a poor implementation, that its syntax isn't friendly to a large portion of developers, and that its performance isn't as big of a leg up as it seems like it might be at first blush

indigo grotto
#

Yea I'm not implying that people should constantly think about luau I just don't think it should be completely discarded when finding alternatives to it because its what was presented as the only potential choice

tropic raft
#

the primary reason i think anyone is actually upset at this thread is they think it's the lua hater power hour thread where anyone who comes in and says "lua's ok" without actually understanding the original topic gets nuked from orbit by the squad of rabid redditors that just want to shit on lua

#

in reality though i just want people to understand the point is to sincerely attempt to investigate alternatives instead of just saying "whatever the devs say is good enough for me :)"

indigo grotto
#

Having some pinned messages to summarize other languages and also clarify more as to why luau isn't the best choice would be good ig as the product of all the conversation

#

cause obviously nobody is going to read the tens of thousands of words of arguing to find the few short suggestions of like oh here's teascript

#

There's some good suggestions here but no easy way for people to see a summary of them

tropic raft
#

i can't pin things because i'm not a moderator

#

the only thing i got for my trouble was this silly OP badge

obtuse talon
tropic raft
#

also because you're refusing to engage with me directly so why would i entertain you with a real response

obtuse talon
#

I engaged with you directly on multiple occasions and you keep ignoring everything I say with "I am not used to it" or "it's not comfortable to me"

#

¯_(ツ)_/¯

tropic raft
#

i very much did not and if you scrolled up to read any of the very real reasons why lua would inhibit collaboration and lead to a lot more developer confusion than just picking a different language would, you would know that

#

your prejudiced assumptions about the reasons i dislike lua are the only inhibition to real conversation here, so until you figure that out and stop strawmanning me for shit i didn't say i don't really think there's anything more to be said

obtuse talon
#

Prejudiced assumptions? You were the one prejudicing Lua, I countered your points and you keep finding it quite uncomfortable to use personally, making it a bad scripting language somehow

obtuse mango
#

the fundamental problem i see with your explanation of how oop can be done is that its left to the person using it to decide how they feel like doing it. your explained approach may be the canon one, but theres no hinting or safeguards in the language that tell people "youre doing it wrong" and this will absolutely trip up people new to oop in general. relying on scripters to "just do it right" is not a solution since without a canon approach forced by the interpreter, inexperienced unaware or lazy programmers will pollute addons and scripts with various implementations of oop or oop like concepts and not be cross compatible

obtuse talon
#

There is no wrong way though

#

And it can be cross compatible anyways.

pallid zealot
#

there's no right way either lol

obtuse mango
#

me when roads are roads, why bother trying to define which way cars should be going on them, the drivers can figure it out

tropic raft
#

how to re-derail a thread the moment anyone shows any sign of getting back on topic: a master class

obtuse talon
obtuse mango
#

the point is lua does not

obtuse talon
#

it does though

obtuse mango
#

and that is the problem

obtuse talon
#

you guys are trying too hard to find a counter point, and it isnt even a proper one, there does not need to be a standard for scripts to be compatible

tropic raft
#

holy shit that's your best bait yet

#

nicely done

#

👏

obtuse talon
#

you're crying too much 😭

pallid zealot
#

trying too hard to defend our opinion 💔

obtuse talon
#

Just clearing confusions about the language you guys seem to not get at all

obtuse mango
#

i guess since land is solid and you can drive in any direction on it, we dont need standard roads at all to keep traffic organized

#

just drive straight to your destination

obtuse talon
#

lmao

obtuse mango
#

"there does not need to be a standard for scripts to be compatible"

pallid zealot
#

no the language has zero real oop
just because you can shape your amorphous blobs of data the way you like doesn't mean it is oop as people expect it to be

#

there's no two ways about it. Its fake

obtuse talon
#

then C++ is not OOP

#

¯_(ツ)_/¯

#

y'all hella salty

obtuse mango
#

only cause you're getting in the way of actually discussing the merits (and downsides) of alternative options and making it entirely about lua and opinions being wrong

pallid zealot
#

what, because it operates in bits and bytes under the hood? why use math operators then, just manipulate your bits directly as they're fake too yeah

tropic raft
#

this is so fucking funny dude holy shit i did not know you could engage in faith as bad as this

obtuse talon
tropic raft
#

i love you man this is great keep going

dawn crow
#

I will admit that the original thread did just feel like a Lua hate train, but frankly after monitoring this channel for a while it's felt less so.

#

I'm very much interested in exploring potential alternatives so long as their inclusion is logical.

pallid zealot
tropic raft
#

you can of course just pick "int" every time and not think about it but "int8" and "uint64" are options on the table

pallid zealot
#

there's no basic int type? like in c# ints default to int32 iirc

#

o

tropic raft
#

int just defaults to int32 yeah

pallid zealot
#

well yea i dont think thats too big a deal unless you have to like explicitly cast them

tropic raft
#

it's not anywhere near unworkable at all it's just sort of confusing why it's there when most other interpreted languages just have a general Number type

dawn crow
#

I'm still interested in seeing a more OOP-friendly alternative that still feels simple to pick up - I don't want new coders to feel "left behind" like I did when I was trying to learn.

pallid zealot
#

though i guess for those that are only familiar with scripting implicit casting could end up being confusing

obtuse mango
#

when i started programming it was helpful that i started with a language closer to standard languages (java), lua is pretty out there syntactically and is easier to move to after learning core concepts in languages with more guardrails and fewer language-specific quirks

pallid zealot
#

i tend to prefer having distinct int/float types rather than one number type personally

tropic raft
#

it is nice to have distinct int/float types but i'd prefer just a general Integer and Decimal (or float if you want to avoid the connotations of "it's an accurate representation of decimal" that you can get in some languages) type if you really have to separate them, with no concerns for "oh how many bits does my integer or how much precision does my float have"

#

converting between them is a headache regardless of whether it's implicit or explicit because it creates edge cases every time you have to do it

pallid zealot
#

oh yeah thats what i mean just int/float not going into the sizes yeah

slender pebble
#

long long and doubles 😎

pallid zealot
#

i dont mind being limited to just one size of int n float

late raft
#

i'm a static type enjoyer

obtuse mango
#

bignum libraries being required for really big isnt something intuitive for new coders tho

tropic raft
#

or even just letting the interpreter figure out what kind of int or float you need, if the language is really fancy

obtuse mango
#

and i hesitate to support an implicit typecasting situation for numbers

#

lest we get a torquescript 6sigfig situation

pallid zealot
#

yeah i can see implicit casting for numbers in a scripting language being problematic lol

tropic raft
#

oh you have one million dollars?

obtuse mango
#

id rather it support explicitly only say 64b ints and doubles, and anything past that requires you to learn bignum

#

if theres too many intermediary types available then the implicit casting between them leads to more Hidden Language "Features" you have to learn

#

and i doubt the efficiency gains of supporting auto handling of (u)int8/16/32/64 primitive type swapping would be important for memory or performance

dawn crow
#

From a learner's perspective, anyways.

dawn crow
#

That and to the average person, starting tables with "1" makes more sense, but it's bad practice to teach that to new programmers since virtually every other language starts at "0"

obtuse mango
#

when i started using lua for the first time i was shocked at how little the language provides out of the box

#

where is my standard string lib 😭

tropic raft
dawn crow
tropic raft
#

oh i gotcha, yeah

dawn crow
#

And the only real way to learn is to either get criticized or to view more experienced coder's work, otherwise you'll just continue down a weird path.

tropic raft
#

that's a pretty common problem with interpreted languages in general

#

javascript especially can be bad at this

dawn crow
#

I was fortunate enough when learning Lua to have cleaner code references to learn from, but even then it took a while to click since the language doesn't impose anything.

tropic raft
#

i've also seen some of the world's worst perl code at work written by a non-developer

obtuse mango
#

i will say thats part of why i cant wholeheartedly support js as an option despite it probably being a pretty good one

tropic raft
#

the architectural problems and the absolute freedom it gives you are both pretty bad issues with js, i'm just biased because i love typescript to bits

dawn crow
#

I used to prefer how freeform interpreted languages were, which can certainly still be a benefit, but there's something nice about just knowing that something is - without any doubt in your mind - that thing.

tropic raft
#

and typescript solves the latter of the two issues pretty neatly through the strict type constraints

obtuse mango
#

so what you're saying is implement a native typescript interpreter so people cant use a javascript workaround :3c

slender pebble
#

meet my friend any

dawn crow
#

I will def say that I am largely in support of strict types, even though it could be harder to initially grasp. I would prefer a slightly heftier learning curve if it's more applicable to the wider language world.

tropic raft
dawn crow
#

It might be a weird take but I want whatever Brickadia uses to be largely in-line with more traditional languages since it allows those skills to be easily transferred, which to anyone doing this sort of thing could be a huge plus.

obtuse mango
#

it would be super poetic that both bl and br use ts as their scripting language

tropic raft
#

i think that's pretty in line with what i want

slender pebble
tropic raft
#

you're scaring me

#

don't take me back to ts

#

:(

slender pebble
#

we are taking your ass back to ts

#

we are going to concat tagged strings to global variable names

late raft
#

NO NOT DETROIT

dawn crow
#

I will admit that I certainly have a soft spot for Lua since I've worked with it for so long, especially since I can still very much appreciate its benefits, but it would be naive not to explore other options.

slender pebble
#

we are going to check for null using ""

tropic raft
#

no!!!!! i don't want to work on farming!!!!!!!

slender pebble
#

and yes, we are going to construct arbitrary calls (or full variable names) with eval.......

dawn crow
#

I wouldn't have gone into broader programming without it.

tropic raft
#

lua was my first language too so i get the impulse to defend it for sure

#

it's just really clunky to do anything more advanced with it

#

like obscenely so if the metatables doc is anything to go by

obtuse mango
#

-2%5 etc

slender pebble
#

i mean thats an issue with the crt itself

obtuse mango
#

my real fav feature was var[1] being the same as var1

tropic raft
#

because funny

dawn crow
#

I love Lua because it's what got me into programming, but from a logical standpoint I'd rather start people out with something more streamlined to make their skill transfer easier.

tropic raft
#

also var[2][1] is just nonexistent

#

can't nest tables

mellow temple
#

its so good

dawn crow
#

I would very much rather not have people go through the pains I did having to learn even the basics.

slender pebble
dawn crow
#

Y'know, make the journey for the next people easier - not harder.

obtuse mango
#

agreed

#

if a game like bl can lead to br, a game like br with broader appeal can lead to many others

slender pebble
slender pebble
#

no, not blueprints, wires..

dawn crow
#

Bonus points if there's no ways to actually color code anything

#

Or document

#

You WILL NOT document your code and you WILL like it,,

tropic raft
#

some people out there would just get really good at reading wire diagrams

obtuse mango
tropic raft
#

LOL

obtuse mango
#

:3c

tropic raft
#

not my fucking EE class in college

obtuse mango
#

br to cpu architect pipeline

slender pebble
#

REM chips

dawn crow
#

Waiting for the Brickadia DOOM port

#

Using only wires

obtuse mango
#

just tack this onto the side of brih

#

minimal dev effort needed, $10 dlc to get scripting

dawn crow
obtuse mango
#

as seen in the preview, you can document your code! with color coded wires!

tropic raft
#

just open up an instance of the powder toy and figure it out from there

pallid zealot
#

powder toy :D

tropic raft
#

script that simulates a nuclear meltdown in a powder toy instance. no output or visual feedback, you just have to know it's happening

#

it's just there

dawn crow
#

We should make an accurate 1:1 recreation of the Chernobyl incident in Brickadia, for educational purposes for course

slender pebble
#

just use LSL which i think defines a unique power and time value to every single script function

late raft
#

lmfao

lethal star
#

thats a good question

pallid zealot
#

does not matter, conflicting "standards" were nothing but a headache in blockland so let's not do that

median glen
#

in a professional context you can enforce a standard by policy, in an unprofessional context you can't do that, so ideally it's difficult to diverge from the standard unintentionally

tropic raft
#

not gonna claim that what's good in professional contexts is good in all contexts (sometimes professional standards lead to a large amount of unnecessary overhead) but standardizing an OO implementation is one of the least likely things to lead to development overhead

#

and simultaneously one of the most likely things to improve developer experience and make it easier for new users to learn how to write OO software

indigo grotto
# lethal star is brickadia scripting a professional context tho

No, which is why I would favor a luau implementation because it'd be nice for simple behaviors but I think everybody would appreciate something else for large collaboration and projects with bigger scope. Cause lua is hard to collab with when everybody has their own method of typing and stuff like oop is a headache to deal with

#

Big projects on roblox can only work because of many roblox exclusive APIs and I think brickadia would need to put a lot of work into their luau implementation to reach the same efficiency... So other languages might be better in that context as well

#

But I really don't know what the scope of scripting will be... Like we're comparing a feature in a sandbox game to add functionality to stuff to a game engine where the language is used for everything

#

Which is also why there are so many damn community modules on roblox that people can not live without 😭

indigo grotto
#

And lua was initially chosen for roblox when it was some physics toy where everything was server sided. Even player movement was done by clients requesting the server to add velocity to their character. So the complexity was very low and lua was a good fit for that. I wouldn't say that luau is some battle hardened language that's been wrung through the test of making fully featured games and more some Frankensteined language that roblox has kinda been forced to make proficient. And that's why we even have luau in the first place and why its backwards compatible with lua. So it really depends on the scope of brickadia for whether it'd be a good fit or not

#

A lot of the sandboding and stuff with luau. Besides stuff that roblox did to their own engine... I think also came from the fact that rce exploits were so ubiquitous in older roblox clients its not even funny

#

If they knew what roblox would've become in the future I severely doubt they would've gone with lua

warped grail
#

it is unfortunate catching up on this thread every day to see which flavor of butting heads plagued it

#

instead of any new language suggestions or interesting ideas - at the end of the day i'll be fine with whatever language but its interesting to think about the different possible approaches or choices

#

i would say lua wasnt a frankensteined language, although i do question the latest versions approach on including labels/goto since it looks particularly bad compared to the rest of the syntax, but def. how roblox integrated it was frankensteined and evolved over time

#

actually, did some self educating, really interesting early history in the language - i'll say half half

obtuse talon
#

I’m fine with any language really, I wanna learn something new more than anything, even if it has some weird constraints I’d like that even more. Finding a way around limitations is the most fun thing imo

lethal star
#

at least to me it looks quite similar to a class structure

obtuse talon
#

Modules are used to export functions and variables in a table, similar to namespaces

indigo grotto
#

If you were just using luau outside of roblox and attrmpting the same thing, youd put a bunch of functions into a dictionary in a different file and then return the dictionary in another file

#

Its just different on roblox because server and client scripts can't access the same stuff so you may have a lot of checks for runtime context

mighty talon
#

clientside scripting will be fun if that's exposed

#

ui effects, local sfx, etc

indigo grotto
#

I'm assuming that scripting will initially just be exclusively server stuff

#

There hasn't really been any mentions on the blogs for explicitly client sided things in like wires or behaviors

indigo grotto
indigo grotto
#

And that the GUI api also just has a direct clone of flexbox

#

Maybe I like didn't notice but I've never seen an engine that just rips so much from webdev for its GUI

young tundra
#

So when are we adding E2?

warm loom
#

Im team lua all the way. The scripting should be fairly simple and the API would be easy to use. It's also very easy to learn and is super nice to players who just are getting into programming. However, the devs have stated via their website a desire to add modding in the future so *subject to implementation you might be able to make a mod that adds another language in for scripting

tropic raft
#

do we really have to do this again

drifting spade
#

another 500 messages arguing about coding

tropic raft
#

luau is actively bad for any development that goes beyond the scale of "i want to hook a few things together to make a new toy" which is the exact niche that wiring appears to be meant to fill. its object oriented design is anemic at best, and its overall architecture is rough around the edges to say the least. its skills don't transfer to other languages very well, meaning lua actively creates pigeonholed developers who fear the sight of an if block opened with anything other than "if then ..."

#

if you want to screw yourself over and build skills that are only barely transferable to other places in the real world, go ahead and support lua. if you want an actively bad object-oriented programming experience, lua all the way.

drifting spade
#

what language did you even want btw

#

i forgot

tropic raft
#

the OP has several recommendations, but the main sincere suggestion i have and like is wren

#

similar to lua in that it's easy to integrate and not complicated, but actually supports object-oriented programming natively and has a syntax that aligns with more conventional languages

#

a lot of people come in here and say one of two things:

  1. lua good just use lua - we have elaborated on why it is bad ad nauseam here if you just scroll up, but people seem to think that it's scary to scroll up when there's more than ten messages in a thread. read the OP, skim some recent context, and don't just blindly suggest the only language you have any experience with because the idea of learning scares, bores, or otherwise inconveniences you
  2. oh no you're going to pick a Complicated and Scary language like C++ or java! - no we are not. for those who know what it means the realistic options on the table are simple, easy-to-read, easy-to-write, high-level (this means something approximating "easy" too, if you're unfamiliar with the developer jargon usage of the term) interpreted languages. the developers are hopefully not going to throw all the 14 year olds who are just learning what scripting is under the bus just because they like writing engine code.
#

-# also this is neither here nor there but java isn´t really that scary to begin with. you should learn java if you want to get into compiled languages but memory management seems a bit out of reach

drifting spade
#

We should make Brickadia's coding Assembly br_clueless

tropic raft
#

it wouldn't, it's not relevant to the discussion

quartz schooner
#

i see

tropic raft
#

there are ways you could force it in but it wouldn't be fun or worthwhile

#

(unless you're a really hardcore developer, which wouldn't be productive to making a broadly-usable scripting language)

tropic raft
#

only thing we need is a way to push a file from your PC into the gate-built memory

#

lole

drifting spade
tropic raft
pine prairie
#

Just give me syntax that's similar to C#, JavaScript, or TorqueScript, and I'll be happy..

I hate Lua's syntax. It's easy, but gross. Lacks the visual markers I need to feel happy, personally.

warm loom
# drifting spade another 500 messages arguing about coding

True... and maybe I picked up the hornets nest that was already thrown away. I read the bulk of the conversation then skimmed the rest. I'll actually say I appreciate OPs vision with other suggestions because Lua isnt scalable when it comes to making full blown applications or managing an entire in game CPU (shout out to the absolute brainiacs doing that...). Having object orientation is a HUGE plus in that department. However, I am speaking in the part that Lua is both easy and approachable to understand and learn programming with and is fun to use because it has a lot of play to it. You trade OOP though for having that and it's a common ground for many people.

I think its unfair to say you're screwing yourself by using it because you wont "build transferable skills" - lets just remember we are playing Brickadia and just trying to build cool things and learn. This isn't school nor could anyone really put that on a resumè. Lua is actually what got me into programming a decade (maybe more now?) ago in a minecraft mod which caused me to go learn more cool computer stuff and I even went to uni to get a computer science degree (those are transferable skills). I don't want to deter a new player who wants to learn a little bit of scripting but then suddenly has to be aware of object orientation and all the fun things you can get caught up in there. Another huge plus is theres already a huge audience using it from other games that use scripting and they can transfer the bulk of that knowledge to this.

I'm totally down to develop or codevelop a mod though when that gets supported that adds something way more robust like you're talking about. It would actually be sick to have both in game scripting and then a mod that lets you take it up a level when youve gotten the hang of it and have seen the joy and pain of large scripting projects.

#

(adding the person I replied to is not OP, I meant to only reply to them with my first bit about the hornets nest)

wise wolf
#

torquescript

tropic raft
# warm loom True... and maybe I picked up the hornets nest that was already thrown away. I r...

i understand the impulse to recommend others pick up the languages you used when you started out but lua simply isn't a good place to start learning. when you're starting out writing software it is a wonderful and powerful advantage to start with a language that doesn't handicap you from the word go, as starting with something like lua or torquescript does - this is again that simple impulse to say "well other languages are too complex for people to learn, and we don't want to scare new developers" - when i was a child first starting out on roblox every language was too complex for me. there wasn't a single thought in my head about patterns or antipatterns, about paradigms or best practices. i was just struggling to flip switches and push buttons by nudging numbers around and swapping out little pieces here and there to see what made things tick

#

that experience is going to be universal to anyone picking up any first programming language, so saying "oh we don't want to scare them with object oriented" is like saying you don't want to scare people who are new to reading by giving them a book without any words in it, or scare people who are new to music by hiding the fact that there are different kinds of music from them

#

languages that are capable of true object orientation are not inherently opposed to the simple imperative paradigms that everyone actually starts with, and just because it's not lua does not mean it is going to be extremely hard to learn

wise wolf
#

also yeah as someone who started with torquescript, i wish i started with something that wasnt torquecript

tropic raft
#

i know plenty of very good developers who started out on more advanced languages with full feature sets - javascript is notoriously easy to learn and yet its object system is vastly better than lua's from the word go, and yet no one complains about how hard it is to understand objects when they're still learning what a function is

#

i know of one particularly smart fellow who started on C++ - you can start anywhere and be very successful, and i'm not even suggesting we start anywhere particularly difficult; not to mention that the easy mode is already there for new developers thanks to the wire system

indigo grotto
#

this is what im gonna be doing if luau gets added

tropic raft
#

i would say i started learning software in many different places, and in many different ways - i first started with lua, but i also started with littlebigplanet 2's wire system, and i also started with torquescript in a different context. these were each different approaches to my learning and they all taught me very different things

#

a broad exposure is extremely helpful in enriching your learning, so it's beneficial even for people who already know lua to pick something else up and carry the basics over from lua into the new language

#

i promise you it is not that hard for people to pick up a new language that meets the criteria of a good, simple, easy-to-read, easy-to-write scripting language, a set of criteria that has been met time and time again by many different languages

#

python and javascript to name the big ones, but also plenty of other languages exist that meet these criteria, and while lua is among them i would say it is one of the weakest candidates for its miserable lack of features and its inherent limitations - you can't learn to be a good developer if you only ever write lua

#

the only arguments for lua i have actually read in this thread are the above mentioned ones:

  1. other languages are hard or scary: no they are not. i promise you if you can learn lua you can learn any other scripting language out there.
  2. other languages are too complex: no they are not. any scripting language worth a damn can be applied in very simple toy programs to give new users a very easy onboarding process. we're not talking about low-level languages here, everything is pretty close to english in this space
  3. i already know lua: this is the same as 1., but if you already know lua then you have a head start over everyone who knows 0 programming languages. lua's syntax is distant from others, but it isn't far enough that you should resist trying to learn other languages for fear that they won't make any sense whatsoever to you. i promise they will.
  4. if other languages are fine, why are you so resistant to lua?: this is a very common one and the truth is i'm not, i would be perfectly fine using lua. i'm a professional software developer and i know how to pick up any language within a few weeks by this point. i would be perfectly capable of doing anything i could do in any other similar language in lua. however, there are very good reasons (mostly revolving around syntax differences and a complete lack of ergonomics in object oriented code) why i would not voluntarily choose lua for any of my own projects, which should be a very clear sign that lua probably isn't a good fit here
  5. luajit is really fast, and no other languages can compete - python especially is really slow!: as a case study, blockland used torquescript, one of the slowest scripting languages i have ever used in my life - slower than python. there were three cases not that i personally found, but three cases total, in the history of the game, that i am aware of where the performance mattered, and it was solvable by the developers. performance simply does not matter that much.
#

to repeat myself and hopefully drive the point home properly: anyone who is resistant to learning a new language, whether it's their first or second after lua, should not fear or dread or otherwise harbor ill feelings towards choosing any language other than lua, because all of the absolute fundamental basics of programming are applicable across every language. the "freedom" you tout lua having exists in all languages. you can always define functions, you can always read and write strings, you can always store data in tables and retrieve it later, you can always do any of the things you do in lua even if you rely on metatables to do it. you can even define your own system to act exactly like lua's object oriented code if you want to, with all of your own metatables and whatnot, in just about any language out there. there is no limitation to your freedom by choosing a language other than lua, the only thing you will have to learn if a different language is chosen is... syntax.

#

that's it. just syntax. open and close your if statements with curly braces instead of then/end, don't bother with the "local" keyword peppered everywhere, and access members with a dot instead of the colon.

#

that's almost the entirety of the syntax differences, and in exchange you open up an entire universe of possibilities with object oriented code that you don't have to write if you don't want to

#

you don't have to compromise on writing code your way regardless of language, because as long as no one else has to read it no one will care what you're doing or how you're doing it. i promise the interpreter will not bite you if your code isn't stylistically perfect even if the interpreter isn't the lua interpreter

warm loom
#

Those are some good points admittedly, I suppose I can actually agree there are other languages that are just as approachable even if they aren't as "approachable" (as in used as much in scripting in other games like MC, roblox, etc. with the large user base respective in those areas). I guess what I care about most for a newer/younger audience is that it's easy to understand and doesn't force a ton of semantics on the user at the start. So long as we dont force the user into an immediate CS101 class with main(...), include guards, etc and they can use the API in a single file I could be swayed.

I still like Lua and don't think it's a totally inappropriate choice since it's simple & the bulk of users are likely going to do simple tasks, but you're right there are other languages that can do simple and offer extensibility. I guess javascript/typescript would be an appropriate choice given what I know about those two (which isn't a ton*, I am mostly C/C++/Java coded).

tropic raft
#

those things wouldn't exist in any relevant language in this application

#

like i said, i promise nothing that would be added as an embedded scripting language would be scary or have anything that a 14 year old would have too much trouble understanding

#

that is, assuming the brickadia developers make a sensible decision, which judging by their consideration of angelscript i don't think they'd make a bad choice

warm loom
#

A true main function yes but IIRC Space Engineers uses the C# language and mimics some of that in their scripting API...

obtuse mango
#

space engineers is a case study in "nerd sniped developers" imo. by virtue of stating outright lua is their first worst choice, brickadia devs have implied they're not interested in going down that highly technical path/are explicitly interested in making scripting as approachable as they can while retaining the power needed to make scripting distinct from wires

tropic raft
#

i also know of exactly one developer who actually likes C# and i think he exclusively uses it because of unity

#

or is it monogame

#

idk. either way it's not a great choice even if it were a language that had nice sandboxing and embedding features

warm loom
#

I was simply saying everyone does it one way or another. At the end of the day it's all code and it's just syntax so choose whatever fits the mission/user base the best. If they (Brickadia developers) want their language to not necessarily be the easiest/most well known but be versatile while being capable maybe they have many options at their fingertips (many listed already in this thread of course)

warm loom
obtuse talon
#

Or they could do some magic and implement a compiled language if that tickles their fancy

pallid zealot
# warm loom I was simply saying everyone does it one way or another. At the end of the day i...

i would not call lua the Easiest
i only briefly started with it before getting hooked on bl modding with torquescript and that was where i learned the most (i was maybe like 13? when i looked into bl modding for the first time)
over the years i occasionally went back to roblox and tried making stuff on it here and there and i would not say its any easier or simpler, just different

pallid zealot
warm loom
#

Lua isn't an OOP language, or at least I wouldn't consider it that. You can get some features that are like OOP but it fails to hit pretty much any of the main 4 targets of OOP. I don't mean to call Lua the easiest language, it's just generally an easier language for most (since it's been picked up so much by many games for scripting (Roblox, Factorio, Garry's Mod, etc). Even Balatro won GOTY and uses Love2D (the only real "game engine" which you program in Lua) - though this one is more exceptional since it relies on this framework. I'm not calling a different/simple syntax with OOP capabilities more complicated necessarily. I'm saying it's typically less approachable from a scripting perspective by a lot of users who might just want to get into a scripting language to learn that first before transitioning to a more complex/feature-rich language. I have helped mentor several people through their degrees and helped tutor many others and generally speaking myself and others will start students with scripting then move into real languages. After reading OPs replies I can actually hop on the JavaScript train though, since it has capability of doing both and you don't get bogged down with heavier language stuff. It also doubles that it can do all the extra stuff once you start learning it - so I can get behind that one with no issues whatsoever

#

And of course if there is another language like JS that is more popular I can be down with that as well. This game has very large potential to go big and start a boom on its own so a lot of people might actually pick up their first programming lessons from this game like I did oh so long ago. It's a very feature rich game already

tropic raft
# warm loom Lua isn't an OOP language, or at least I wouldn't consider it that. You can get ...

i think what you're referring to with "real languages" is compiled languages, that build binaries and often have more low-level concerns like memory management and whatnot - again, this is explicitly not the environment to put such a language. embedding languages is almost exclusively done with an embedded interpreted language, which means that just about any such language will be a good choice for new users in particular. richer feature sets do not preclude simple imperative programming that makes e.g. hello world a one-liner, and a good API design will support that fully. my concern is that the developers will choose a language that has no room to grow - to put it in simpler terms, they're going to pick an interpreted language, which means the skill floor is as low as it can go; but there are plenty of interpreted languages that have much higher skill ceilings, which is wonderful for encouraging and facilitating more complex and interesting creations

pallid zealot
warm loom
#

I'm sure it was said at some point in this thread, but what languages would you guys prefer for this?

tropic raft
#

there have been a handful of recommendations ranging from niche to very common - teascript, angelscript, wren (my personal favorite), javascript, (less seriously) python, and probably a handful of others i'm missing

pallid zealot
#

angelscript looks interesting
there was another one that looked nice that i forgor the name of :0

tropic raft
#

squirrel i think was another suggestion

pallid zealot
#

oh yeah squirrel

tropic raft
#

funny .nut file

pallid zealot
#

thats the one i was thinking of

#

nut :D

light nymph
#

only 9 days and theres already 1600 replies. Safe to say this is a hot button issue

dusty pond
#

here’s my vote for anything, literally anything, other than lua

light nymph
#

id much prefer not lua as well

tropic raft
light nymph
#

damn

maiden hazel
#

Please PLEASE make it something with curly parenthesesss, indentation blocks are the devil

wintry pulsar
#

one consideration for language choice is tooling and documentation, a more obscure language is less likely to have comprehensive ide/editor support or thorough documentation of its spec

from my cursory glance i liked wrens syntax but how does it stack up in this area? i saw a vscode plugin for it with syntax highlighting which i would consider the bare minimum though it hasnt been updated in years

would something like angelscript be better in this aspect as it already has an unreal plugin integration and demonstrated games using it? though that may tie brickadia devs to a plugin maintained by others which could be undesirable

maiden hazel
#

Wellll wren is missing semicolons but I guess I could live with that…

#

I usually code in C with a very unique style so tbh there’s probably no pleasing me… unless C# is an option

tropic raft
#

trust me you don't want C# as an embedded language

tropic raft
#

but to be clear i don't know

spring oracle
#

C#..

maiden hazel
manic elm
#

If the devs are considered a text scripting language, how about AngelScript, since there's apparently UE support for it and it is a C-like language.

little onyx
#

ngl i still think lua would be the best choice overall. it's one most people are likely to be familiar with, and once you learn how to use metatables properly you can mimic a pretty decent object oriented environment, if needed. yeah it has some unusual differences from other languages, but i still think it's a great entry language and is more powerful than most people think

#

i can see problems coming from how "loose" it is, in that you can do the same thing in two scripts that look completely different from each other. you kind of have to decide on conventions to write lua code with, and if you're looking at other people's stuff, they might be doing some VERY weird stuff where they mess with metamethods to make things look "nicer" syntactically

obtuse talon
#

It can be fixed with the help of a right API implementation but as always, people shouldn’t be forced to follow a specific convention when a language doesn’t force it, because then you’ll just get everyone doing different stuff rather than following it, but again, it depends on the API implementation

tropic raft
#

i'm gonna be real i don't think any API or library would be enough to fix lua's metatable nonsense because the fact remains that there will be someone out there likely to use it because they've used it before

#

and "looseness" in a language is just a matter of course. every language has more than one way to do something - in most they support entirely different paradigms, and in extreme cases (as with lua) they even support systems of development that are entirely foreign to or simply questionable by comparison with other languages out there

#

it's neither a selling point nor a drawback for a language to support multiple methods for accomplishing the same task

#

it is, in some sense, part of what defines software development

obtuse talon
#

I didn’t mean it in more complex systems such as custom games and all, you’re right about that, it just will be easy to get started with when you do simple stuff, of course on more complex sides its just a lot of hassle if you do not know the way around the language

But my point about learning something new still stands imo, if we’re choosing a language, it’ll be different anyways. Everyone should be up to learn and get something new

tropic raft
# little onyx ngl i still think lua would be the best choice overall. it's one most people are...

lua's power was never in question, nor was its ability to emulate OO programming - the problem is that it leaves it up to the user to either create or source a library to get the OO niceties that are entirely standard in every relevant competitor language. these are features that developers learn in school (if they're formally educated) and features which are so common in other languages that the entirety of all of their infrastructure is typically founded on them.

the fact that this isn't standardized isn't merely a problem of "the language is too loose", it means that your foundational elements are impossible to standardize and therefore that every language and every project is going to look completely different from every other. this is not a new problem even to languages that do standardize - in web development you often have to learn entirely new development frameworks if you get a new job, like if you pivot from e.g. react to angular, without even changing languages (it's always typescript) - but this will be a problem compounded by the fact that lua doesn't standardize even the barest of essentials to development

#

if i were to join a new project in development at any company using a language like python or javascript i would get looked at like an alien if i asked them "so how is your object oriented paradigm implemented? do you run your own library providing classes and inheritance?"

#

that is not a problem a developer should have to handle in an interpreted language

#

it's an impediment to learning and will confuse countless new developers, and while i'm sure all the kids getting into software development are very smart and can handle that kind of thing, it's a burden that will ultimately keep them away from being able to make fun, interesting stuff

#

and it's also an impediment to standardization and will frustrate many seasoned developers for whom solving object oriented implementation is just not an interesting problem - if you want to do that kind of work you're learning C++ and developing your own interpreters, not writing gamemodes in lua

#

if i wanted to go build something new in an interpreted language today i would never in a million years choose lua because, if i were to do so, i would get bogged down in bikeshedding over the best choice of object oriented programming library and considering whether i should roll my own because certainly no such existing library had my specific needs in mind when they started development

#

if i don't want to deal with that kind of problem, what makes you think some kid fresh off making games in roblox is gonna want to deal with it?

quasi mango
tropic raft
#

you've never played a game on roblox or a unique server in blockland or a minecraft mod then

#

because people regularly perform total overhauls of the game in those contexts

quasi mango
#

also yeah roblox studio is a game engine but brickadia isnt

#

i think using a simpler language to understand for newcomers is better

#

not everyone playing brickadia will be seasoned software developers since brickadia is a game

tropic raft
#

not everyone playing roblox is a seasoned software developer either, nor are minecraft or blockland players

#

what's your point

#

the simpler language requirement is fulfilled by wire

#

wren isn't complex either

#

nor would angelscript be, nor would python or javascript

#

i learned python and js when i was like 16 these are not hard things to pick up

quasi mango
tropic raft
#

have you used anything other than lua ever

#

have you tried learning javascript or python

pallid zealot
#

Most other languages are Not any more complicated or difficult to understand

quasi mango
tropic raft
#

interpreted languages are not difficult to understand, full stop and it's baffling that i keep having to tell people this

quasi mango
#

they had to ask their mom for her card to buy it

pallid zealot
#

a 9 year old playing brickadia for the first time isnt going to hop into modding day one ?
and either way if they could learn lua for roblox they could learn literally anything else for this game lol

#

that is a very weird point to make

#

i learned programming at like 12, only very briefly touched lua before moving to torquescript for multiple years

#

after learning one language i was able to pick up basically any other language in days

tropic raft
#

and besides, the 9 year old isn't gonna know the difference between lua or wren or javascript or angelscript or python, it's all going to look bizarre at first

#

because it's a completely new way to use your brain

quasi mango
#

i see

#

this means that lua must be the perfect language to use because it is already very popular in modding other games

pallid zealot
tropic raft
#

???

#

i don't see how popularity has anything to do with anything

quasi mango
#

it makes it easier for people coming from other games to mod this one

tropic raft
#

"it'll mean more people will be comfortable with it already coming into the game"

#

YUP

#

CALLED IT

pallid zealot
#

Looool

quasi mango
#

read like a book

#

Smh

#

okay but like is that a bad thing

tropic raft
#

no, it's not a bad thing, but it's equally valid depending on who you want to target it at, and is a non-issue for most of the people who would actually want to make anything in the game

pallid zealot
#

a language being niche does not really matter
as long as it has a reasonable amount of docs on its syntax and such, the rest Does Not Matter
the bulk of documentation players will need is that of the game's api

median glen
#

I feel like equally as many people will be put off from scripting as will be actively enticed by use of Lua

tropic raft
#

if you used javascript, all the web developers that play the game (surely not an insignificant number) would be interested in making things, and their skills would transfer trivially. you might even attract an audience of makers from web development who could make the game even cooler!

#

this is the exact shape of the argument for using lua based on popularity

#

just do a find and replace on javascript > lua and web > roblox

#

or web > gmod, or web > whatever game that uses lua

median glen
median glen
tropic raft
# tropic raft if you used javascript, all the web developers that play the game (surely not an...

the argument for people other than web developers takes the same shape too:
and for any developers for things other than the web, it's very easy for them to transfer their skills quickly anyway because programming is relatively similar across languages. so you wouldn't be leaving roblox developers without a paddle - they already know software, they just have to pick up the javascript language syntax. that really isn't that hard

tropic raft
#

for clarity my point isn't that js is the best language choice, it's that the argument based on popularity simply doesn't hold any water

median glen
#

also also JS(/TypeScript) is already technically the best language in terms of familiarity for anyone already doing Brickadia modding, as that's what Omegga has used

tropic raft
median glen
#

tbf that's like half because GMod's API fucking blows

tropic raft
# tropic raft for clarity my point isn't that js is the best language choice, it's that the ar...

in other words i'm just saying that you can make the exact same point just by playing mad libs with who you're aiming the popularity argument at, and you can make the exact same counter-counterargument against anyone saying the language would be too hard for new users to learn by just saying "well if you know something else then it's not like you have to re-learn what programming is, and if you don't you have to learn what programming is regardless so it isn't any harder or easier if you swap languages"

#

popularity just isn't the foundation of a good choice of scripting language

quasi mango
#

ok ok i agree with you now i see

#

you dont need to write another novel

quartz schooner
obtuse talon
wise wolf
#

i also dont like the idea of making things incredibly oversimplified for children. been seeing this a lot in games and media.

i know for sure i enjoyed the more difficult things as a child myself. i could play the hard games. i could watch and understand the shows that had character depth. etc.

median glen
#

regardless of audience, wiring is the "simple" visual option for scripting

obtuse talon
slender pebble
#

you've inspired me

little onyx
#

havent heard of wren. might have to take a peek at it

obtuse talon
slender pebble
#

i really like that wren contexts can be configured to accept many custom functions like the default allocator and module loader

slender pebble
#

also wren is interesting especially in godot because i wouldn't be surprised if gdscript is slower

vague stream
#

If we're considering Lua to make things simple "for the children" or whatever because other languages are too hard (they're not), we might as well go all the way and create UltraLua:

  • in spirit of the "then" and "end" keywords, everything is now a keyword (no more complicated and scary symbols):
    character member Jump args height then if character member onGround then character member velocity member y equal character member jumpHeight end

  • to remove confusion with variable scoping and ensure even more beautiful keyword pollution, variable access is also now global by default:
    local var equal constant 10 print args local var comment prints 10 print args var comment prints nil

  • in spirit of avoiding intimidating and useful control flow commands like continue we're also removing return and break,
    this is a strength, not a weakness. You now return values by setting the builtin returnValue in your function:
    `function findThree args arr comma size then
    local returnValue equal constant minus 1
    local notFound equal constant true

    for local i equal constant 1 comma local size do
    if local arr index local i equal constant 3 then
    local returnValue equal local i
    local notFound equal constant false
    end
    if not local notFound then
    local i equal local size plus constant 1
    end
    end

    if local notFound then
    print args constant doublequotation did not find 3 :( doublequotation
    end

    comment glorious returnValue is returned
    end`

  • added native OOP suppor- haha just kidding, fat chance lmfao

  • lastly, array index constant 0 now explodes your PC, because counting from zero SHOULD be scary

I think the roblox and gmod devs will feel right at home with this one

obtuse talon
#

This is the best shitpost here

warped grail
#

you missed an opportunity - to improve ease of reading every end should be qualified by what structure it is ending like in VBA

#

end function

#

end if

#

end do, etc.

warped grail
#

also interesting to start by extending from ibject rather than script, is your idea to containerize the context so you can have separate vms?

#

object*

#

oh wait right script is just the resource, spacing hard today

#

i havent messed around much with that part of the codebase

slender pebble
#

i did want to extend from script but that seemed to me like limiting its use to act like a godot class

#

besides i'm embedding it to use it as a runtime scripting context, not as a replacement for gdscript

#

and yeah i'm also figuring out how i can do marshalling with wren and godot

warped grail
#

yea totally fair

deft sky
#

why not throw in a concatenative language for the computer nerds (joke!!!!)

#

actual thought: fennel is a nice dialect of lua

warped grail
deft sky
#

nice lol

warped grail
#

that could be a fun challenge for anyone building cpus in brickadia

#

i love fennel but i couldnt seem to get a comfortable workflow going to do anything cool with it

#

i thought itd be fun to use for a game jam using love2d and ive seen people do it

deft sky
#

that's fair

warped grail
#

so alas it goes to the bin of cool stuff that lives rent free in the back of my mind

tropic raft
#

fennel is really just a transpiler anyway - you'd still get people writing lua if you decided to run something fennel-compatible

warped grail
#

i think it was the transpilation step i was having difficulty with

deft sky
#

I just feel like a lisp would be a good complement for the logic gate stuff given the syntax is closer to the function

tropic raft
#

lisp-like languages would be fine by me either way though

warped grail
#

how does the xkcd adage go, every sufficiently advanced codebase has a partially implemented unspecified variation of rs5 scheme in it

#

or mayve i mean rs7

#

greenspuns tenth rule

#

not xkcd

tropic raft
#

as far as i personally have seen they're not super common in the wild unless you like emacs (i had a phase in college. i got better)

#

but i also don't really dislike them

#

they're nice

warped grail
#

hey emacs isnt half bad, especially if you use evil cough

deft sky
warped grail
#

i like elisp over vimscript but when i found neovim it kinda was over since i already knew lua better than vimscript

deft sky
warped grail
#

ya fair

deft sky
#

I just use lite-xl for simplicity

tropic raft
#

ok, sweet, never have to mess with my editor ever again

warped grail
#

its a good point, i keep vs code handy for anything i dont want to subject myself to configuring neovim/emacs for

#

things just work tm

tropic raft
#

only downside is: electron app 🤮

warped grail
#

yah...

deft sky
warped grail
#

i have to clear out my extensions every 5 or 6 months to keep it feeling fresh

deft sky
#

rainbow parentheses <3

tropic raft
#

i try my best not to beef over text editor choice though because it affects me literally not at all and i've used and liked so many myself that i don't think any modern option is a bad one

warped grail
#

i like sbcl but its practically useless in 2025

#

or CL i mean, but specifically ccl or sbcl

deft sky
#

yeah, seems like fun

warped grail
warped grail
#

but like you say almost any text editor is good enough now

#

totally comes down to preference

tropic raft
#

yeah i mean it at least makes sense to discuss languages because they actually have ramifications for the project you're working on and they have a very wide variety of applications

deft sky
#

I know of a fellow who wrote a networked VR game in stock notepad, nothing can disturb me now

#

(not even notepad++)

tropic raft
#

like i wouldn't transpile C++ to wasm for front-end web dev, i'd just use a js framework or something unless i had some very specific needs that required wasm

warped grail
#

ive done it a few times in limited environments, and the lack of an undo stack actually is probably the most hardcore thing i can imagine

deft sky
#

for sure, every tool has its place

warped grail
#

we can talk about general scripting/programming languages ad nauseum but it feels a little silly not having a full picture of the actual requirements

deft sky
#

fair point

warped grail
#

but the languages are interesting and at least theyre being brought up

#

idrc what they pick cause i have very few languages i dislike (looking at you, bash)

#

but i like talking about languages

deft sky
#

bash is pretty weird indeed

warped grail
#

esac and fi and the syntax for conditions haunt me

little onyx
#

if only we could get jai br_blurrily
/j

warped grail
deft sky
little onyx
#

compiles so fast you might as well treat it as a scripting language sometimes lmao

#

jai is obv more complicated though since it compiles to machine language

warped grail
#

jon blow would probably have an aneurysm seeing his perfect language used for a lego fame

deft sky
#

lol

warped grail
#

game*

deft sky
#

there are also some languages with scripting "versions" if they wanted to pick something powerful

little onyx
#

it's a lang made for games tho

deft sky
#

e.g. nim, elixir (nim has friendly syntax and is fast but is also extremely complicated. elixir is great but it's not too fast at raw computations and is functional so less "accessible" (popular) compared to OOP)

warped grail
#

yea, im just teasing a little cause jon stands on business for sure

#

he has reasonable strong opinions about how games should be written

little onyx
#

yeah im sure he tones down his opinions of c/c++ in his talks

warped grail
#

that is pretty quirky

#

jai is unironically super inpressive though

little onyx
#

(side note if someone's able to invite people to jai beta, i'd appreciate an invite 👀 )

warped grail
#

if it does ever release publically it feels like it could be go for games

little onyx
#

i agree

warped grail
#

what go is for webservices and cli utils , jai could be for games*

#

i wish he wouldnt treat it like a walled garden though

deft sky
#

personally hoping to write an engine in V at some point... that is, if I ever learn enough to do all that porchblob

little onyx
#

i feel like jon just dismisses the potential jai has, but i strongly believe it has the chance to change how people write code. i hear lots of people who have beta access say things like "i never thought about doing it that way, but that makes so much sense and i dont know how we werent doing it that way before" etc

slender pebble
#

oh one thing that pisses me off with wren: why is the signature string passed to bindForeignMethods so noisy? why isn't it at least a word list à la torque? or even a struct with a read-only name and arg counts??

warped grail
#

oh right, you have to pass in a formatted signature, right?

slender pebble
#

yeah

#

well wren does it

#

in the other end you have to parse it (or compare it at least)

deft sky
#

oh, it has arity overloading, that's neat

#

been using a lot of elixir so I got used to that

warped grail
#

its functional enough he should just put it out there and get more eyes

little onyx
#

same. i'm just impatient for it lol

#

anyway i digress a lot. the language isnt even out yet so it prob cant be used in brickadia

warped grail
deft sky
#

I'd guess brickadia will end up using C++ itself (unlikely), lua, or its own thing

warped grail
#

handling bindings as a callback sounds like an unecessary challenge for someone trying to use the language

little onyx
#

i dont think the devs want to make their own custom language. i cant remember where but i think they voiced that

deft sky
#

given it's a commercial project it's probably not likely to use less popular scripting languages

slender pebble
#

i'm genuinely trying to understand why the signature has to be formatted to a fancy string for binding

#

for a performance focused scripting language

warped grail
#

it does seem a bit antithetical

slender pebble
#

unless that signature is created once and for all by the parser but still

pallid zealot
slender pebble
#

why is that signature parsing ordeal offloaded to me now

warped grail
warped grail
#

im only skimming but in my eyes they should have provided a performant look up table / method registration system instead of providing consumers a free footgun

#

im guessing its because of the choice of parameter passing style

#

lua has a simple api because it uses a stack based approach that you have to manage yourself

slender pebble
deft sky
#

I've heard the squirrel language is interesting but I haven't tried it yet

warped grail
#

oh, sorry, maybe im skimming too fast since im on break, but in the calling c from wren (like exposing c functions) it looks like youre handed a callback and are expected to return a c function and thats about it

#

how you look up the function and return it is left as an exercise to the reader

#

oh i see

#

my bad

slender pebble
#

a bindForeignMethod call is done once

warped grail
#

thats just during binding yeah

#

phew, ok, its weird but its not a hot callback

#

total reading comprehension epic fail

slender pebble
#

skill issue

#

fellow green specimen

warped grail
#

still seems a little tedious though Lol

slender pebble
#

it seems fine, i see how the slot system is a direct byproduct of C not being too good at creating a completely opaque hull over "variants"

willow sage
#

every time I see 25+ more messages in this thread I get concerned

slender pebble
#

handles are nice though

#

but yeah if you know how to use the C api for lua you can pick up the wren api quickly

deft sky
warped grail
#

judging by the quantity of near 1800 comments on this thread, maybe

#

judging by the quality... maybe... maybe..

tropic raft
#

roughly 500 of those are mine

#

maybe i should do something else

#

:p

tropic raft
#

since that's how you expose the API to users

#

bit sad to hear that it's clunky regardless though

obtuse talon
pallid zealot
#

god i hate lisp syntax

obtuse talon
#

I did not know what lisp even is up until seeing this

#

brainfuck is better....

deft sky
#

what's so bad about lisp syntax? it makes nesting easier to read

#

function1(value1, function2(value2)) is more confusing than (function1 value1 (function2 value2)) imo

maiden hazel
#

Blehhh that’s lisp? Grody

maiden hazel
pallid zealot
deft sky
#

I use rainbow parentheses so having the nesting this way is just more comfortable for me

#

can just see the scope by color

#

the snippet from fennel's site for reference:

#

compared to a more typical syntax:

tropic raft
#

lisp just has a very functional philosophy backing it so it makes sense that traditional C-like developers are frequently put off by its syntax

warped grail
#

yes, lisps syntax is a little cumbersome, the main neat thing about it is the ease of writing templated code/macros cause of its simple and homoiconic syntax

tropic raft
#

and also is a decent reason why it isn't widely used, since C-like is what most people have agreed upon

warped grail
#

yeahh

tropic raft
#

i love functional syntaxes though

warped grail
#

lisp had its time in the spotlight before C

tropic raft
#

i do think they're better than C-like but that's extremely subjective and controversial, and it's not an opinion i hold dear enough that i'd want to force a scheme implementation on people just starting out software development

warped grail
#

nothing beats the macro syntax in lisp and i think its totally because youre writing the syntax tree directly

#

but , the drawback, youre writing the syntax tree directly

deft sky
#

you see pretty much what's happening

#

or rather, that style of parenthesis, not lisp itself

warped grail
deft sky
#

interesting

warped grail
#

it is simpler if you have a good grasp on pattern matching and are wired that way

tropic raft
#

yeah, the main problem is that such syntaxes (syntices?) also don't lend themselves well to a human model of the world

deft sky
#

fair x2

warped grail
#

but for people who are starting from nothing it turns out to be basically like trying to teach algebra from scratch

#

harder to motivate

#

does not help lisp does not have a lot of flashy environments to make it fun

deft sky
#

pattern matching is amazing

tropic raft
#

C style lends itself really well to a more "concrete" understanding of the world (and is also why i think it's so important to have good OO if you're going for a traditional, non-functional language)

#

functional languages should be mandatory if you're getting a degree in CS

deft sky
tropic raft
#

(and if you're just a lurker who's seriously, incurably interested in software development: go learn haskell! it's really cool if you like software for its own sake)

deft sky
#

I've basically only used functional languages, I need to learn proper OOP

warped grail
#

i became obsessed with lens for about three months

#

got burnt out and havent touched haskell since

#

someday i will return

#

its truly a lovely language but hard to find uses for in my projects

pallid zealot
deft sky
#

having expressions visualized like that

#

my first "proper" language was nim and- looking back- it was horrifically complicated due to syntactic sugar

#

like, everything was written in a way that wasn't representative of how it actually works, often with multiple options for how to write it

tropic raft
pallid zealot
tropic raft
#

the problem is if you get too bogged down in OOP patterns like with java you can end up making your code way worse because of it

deft sky
#

I've come to take that for granted with pattern matching

#

I end up unpacking everything in a single case / cond expression with barely any nesting

tropic raft
#

me when every object has to be made through a builder that comes from a factory and i have to compose a cup of coffee from a beanbuilderfactory.makebeanbuilder().buildbean() and a milkfactorybuilder.buildmilkfactory().getmilk()

deft sky
#

real

#

seems to me like classes should model practical differences, not "groupings"

#

so that you don't end up worrying about arbitrary designations more than your actual processing

pallid zealot
#

is this how java users do things

tropic raft
#

do not Ever do enterprise java code

#

dependency injection is awesome and it is really cool that it lets you sidestep a lot of these problems but my god is it just

#

it's all builders and substitutes for singletons and huhhurhughrugh

#

it's a lot of cool abstraction but if you don't spend a week or two learning how DI providers work you just never know where that HttpClient your code needs actually comes from

deft sky
# deft sky my first "proper" language was nim and- looking back- it was horrifically compli...

some old crap I wrote 🤮 ```nim
proc zippedModInfo*(dir: Path): seq[string] =
result = @[]

if dirExists(dir):
let filepaths = collect(newSeq):
for v in walkDir(dir, checkDir=true):
if v.kind == pcFile or v.kind == pcLinkToFile:
if getFileExt(v.path) == ".zip":
v.path

for i, v in filepaths:
  let reader = openZipArchive($v)
  try:
    result.add(reader.extractFile("modinfo.json"))
  finally:
    reader.close()
obtuse talon
#

Wait till you see my old Lua codes

#

The synthetic sugar is worse there

warped grail
#

outside of self and colon calling syntax i dont think lua actually has a whole lot of syntax sugar going on last i remembered

#

but some of the libraries that almost manage to make a dsl for oop in lua are kinda crazy

obtuse talon
warped grail
#

yea true

obtuse talon
#

Some people decide to make their code unreadable because, why not

warped grail
#

thats kinda par for the course with any form of operator overloading

#

thats one of the unpopular opinions i have about c++ and a few other languages

obtuse talon
#

The __index and __newindex:

#

Lol

warped grail
#

oh yeah true i forgot you can do that also lol

#

i just think of index for emulating methods but you can do all sorts of nasty stuff with it

obtuse talon
#

There are also proxies

#

Fun

deft sky
little onyx
#

yeahh lua does let you turn it into some pretty weird stuff

#

makes it difficult to read other people's code if they aren't following the same basic conventions as you. good example is when people just make everything global

indigo grotto
#

Initially in here I was a big fan of luau but as I've been building a more modular game its kinda driving me insane because you just can't get easy to read lua past a certain point

#

I said that before but it was hypothetical and now I'm just dying with the reality of it and I might just use robloxts 🐱

#

Its really difficult to read my other guys code too because without braces its hard to see nests at a glance and if they aren't indenting properly then you have to go searching for various different statements

obtuse talon
#

You’d have to blame not specifying a standard in the team for that

indigo grotto
#

Okay so that's obviously not something you should need to do

indigo grotto
#

You have function declarations and control structures but you can also have if then else expressions which don't use end statements so it isn't even a guaranteed keyword to look for

warped grail
#

ive never used luau, only lua; did they really add ternary expressions using if then? thats unfortunate IMHO

#

but still i guess that would come down to code formatting and following a common convention

#

id expect ternaries to span one or two lines at most and not be indented similarly to if then blocks

#

i know roblox probably doesnt let you set one up but code formatters are unironically so useful for any kind of collaborative programming to eliminate this class of issues

#

the same issue of poor formatting and hard to read code happens with c like languages too if a team doesnt follow any guidelines

tropic raft
#

yeah literally just get a code autoformatter

tropic raft
warped grail
#

ahh ok, then surely yea

#

the bigger issue i run into with larger lua codebases is how you decide to set up your require statements and modules, and avoiding accidentally creating globals due to typos in assignment statements

#

almost every lua project i lock the _G table or put an index metamethod to safeguard myself

spiral cairn
warped grail
#

yeah, for sure

#

i rarely find myself using ternaries anymore because they tend to be more of a stylistic choice rather than having any performance benefit

#

most compilers are smart enough to optimize even an if else away

spiral cairn
#

like, ternaries really should only be used in a math/formula context where succinctness matters; elsewhere plainly written if's are just better.

#

-# a surprisingly common stylistic choice for many a project, afaik

warped grail
#

yeah

#

thats true, the main ppace where i use them still is for math expressions where i dont want to add the noise of a control block or if it matches the definition of a math function better

#

place*

#

but thats just like gutfeel, i dont really think about it with any line in the sand haha

warped grail
#

pattern matching, linq, nullable types, stuff like that

#

syntax bloat? yeaa.. but with any decent editor its not that bad

spiral cairn
#

sigh... if only more scriptlangs made null handling explicit

warped grail
#

yeah, if i had a magic wand it would be languages should have an option type or algebraic data types like haskell and rust, but i know the practical problems with that

spiral cairn
#

I literally cannot bear to write normal JavaScript anymore cuz of it; some people believe having implicit nullability to be a good thing, as it is "less complicated"... like bro. No.

warped grail
#

for me that is like drilling speed holes in a rocketship

#

it gets the job done faster

#

if thats your goal its good

#

but eventually when you transition into maintaining or expanding the code if you dont follow other good practices to test and lint your code it will cause you much grief

deft sky
#

hence the existence of editorconfig and similar

deft sky
tropic raft
#

or maybe, or whatever you wanna call it

deft sky
#

or elixir def page_content(url) do case http_get(url) do {:error, code, new_url} when code == 301 -> page_content(new_url) {:ok, _, content} -> content _ -> "" end end
(slightly nonsensical but whatever)

tropic raft
tropic raft
deft sky
#

it really makes you wonder how you ever lived without it

tropic raft
#

pattern matching and type checking in the editor are just absurdly good at making code better

deft sky
#

haven't really used lsp- I just have syntax highlighting and rainbow parentheses

tropic raft
#

those are bread and butter yeah

#

i didn't know i needed rainbow parens until it was on by default in my editor

indigo grotto
# warped grail i know roblox probably doesnt let you set one up but code formatters are unironi...

we dont have any but he is using this https://github.com/Kampfkarren/selene?tab=readme-ov-file and it kinda impacts how the code is written and i just use a luau lsp and nothing else but there are some code formatters i think, i just dont know how to install them

GitHub

A blazing-fast modern Lua linter written in Rust. Contribute to Kampfkarren/selene development by creating an account on GitHub.

#

but it wasnt really what i was complaining about its very like luau syntax thing

#

like this isnt THAT bad but i feel like it'd be easier to make it not suck if things were braced

#

luau ternary operators there are two different ways of doing it and if expressions are new for luau and using binary operators is how it works in lua

#

these both do the same thing
state = 1 outputs 1
state = -1 outputs 0

#

sorry if i wrote like total dogshit i am like just recently wrapping my head around the ternary crap

#

point being that you can use if, then, else, and elseif in ur code without needing an end

#

thats like if in another language you could write { for stuff that didnt require a closing bracket

#

its harder to make stuff that isnt a pain to read and thats my point, not that its impossible

#

the language is easy to use for beginners but i think its difficult for everyone when ur trying to do literally anything with it and thats why we have crap like

indigo grotto
#

but you should have indentation for conditions...

warped grail
#

in C like languages its clearly different since they usually use ? and :

#

python i have noticed does it sort of similarly but is val-if-true if cond else val-if-false but since its whitespace sensitive its easy to tell apart

#

the alternative of using boolean operators in nornal lua never sat well with me

indigo grotto
#

also lua having nil just be a boolean which means false and i get mixed up in other languages when i cant just have a null object also mean false LOL

warped grail
#

im not sure i entirely follow the indentation issue youre describing since i feel like it can happen with any language where functions get too large or are not broken up cleanly

#

end should be on the same indent level as the opening structure

indigo grotto
#

yea its moreso that u have to do that and if u break away from that rule it gets difficult because you cant just trace for the other side of a brace

#

like when you do functions inside of something and they have to be wrapped in parenthesis and suddenly its super easy for me to see the scope of it at a glance

#

will probably just use stylua anyways

tropic raft
#

languages won't stop you from making unreadable code no matter how strict their indentation rules

#

just look at nested comprehensions in python if you want an example

#

or the IOCCC (just google it)

#

creating readable code is equal parts art and engineering, and not even an autoformatter will reliably save you from yourself

pine prairie
#
summoneth Brickadia.ModAPI;
summoneth Brickadia.World;
summoneth Brickadia.Bricks;
summoneth Brickadia.Players;
summoneth Brickadia.Audio;

openeth tome BardsLampMod : WorldScript
{
    keepeth LightBrick lamp;
    keepeth SoundEffect hum;
    keepeth truthy hathBegun = nay;

    // When the world awakens, we enter the stage,
    // To conjure the lamp and set up the page.
    override openeth doth return naught OnWorldStart()
    {
        // Conjure the glowing artifact, built from brick divine,
        // Its shape and light both old and fine.
        lamp = conjureth LightBrick();
        lamp.Position = (whole3)(0, 5, 1);
        lamp.Brightness = 2.5;
        lamp.Color = Color.Gold;
        World.SpawnBrick(lamp);

        // Summon a hum, most gentle and sweet,
        // That plays when a soul doth approach on their feet.
        hum = Audio.LoadSound("Assets/Sounds/MysticHum.wav");
        hathBegun = verily;
    }

    // With every tick, we keepeth watch,
    // For travelers near our golden torch.
    override openeth doth return naught OnTick()
    {
        an it be (hathBegun == nay)
            sendeth back;

        foreach (Player wanderer in World.GetPlayers())
        {
            whole dist = DistanceToLamp(wanderer);

            // If thy feet dare step too near,
            // The lamp shall sing — be still and hear!
            an it be (dist < 6)
            {
                lamp.Color = Color.Crimson;
                lamp.Brightness = 5.0;
                wanderer.PlaySound(hum);
            }
            elsewise
            {
                lamp.Color = Color.Gold;
                lamp.Brightness = 2.5;
            }
        }
    }

    // A helper most humble, yet useful in flight,
    // To measure thy distance by day or by night.
    keepeth whole DistanceToLamp(Player soul)
    {
        Vector3 delta = soul.Position - lamp.Position;
        sendeth back (whole)Math.Sqrt(delta.X * delta.X + delta.Y * delta.Y + delta.Z * delta.Z);
    }
}
pallid zealot
#

AWESOME