#Some preferences for scripting languages
1 messages · Page 2 of 1
metatables are the method of OOP in lua
yes and it's thereby pretty clearly stating it doesn't want to do OOP like a sane language
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
It's not designed for OOP I think, it just can be used for it
"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)
He is not declaring self though, the "self" here is just an instance
They name the variable self, because it is easier to read
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
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
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
I mean its the same thing as OOP you could argue, there’s nothing different fundamentally
sure, but you could say the same thing about writing assembly by hand instead of writing C code to do the same thing
You can still do class:function() and it is easy to declare new members, classes
your assembly will be harder to write and slower than the assembly the C compiler makes
and likely not by a small margin
You’re comparing very wrong things.. you can access functions and members like C, one thing different is that you have to use a colon when calling a function in an “instance”, because that passes the instance as the first argument, allowing for the use of self
You know Lua’s backend is C
And it does not assemble to x86
this hurts bad
this is like watching two guys argue about whether an apple or a fork is better
I do not understand what you’re trying to point out here
He obviously misunderstood Lua, I am trying to clear up confusion
I do not mean to argue, I am sorry if that came off like it
just to be clear i'm not trying to say "C is better than lua" - i'm trying to make a point that the claim that lua supports OOP is patently ridiculous
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
function a:b(c) end
is sugar for
function a.b(self, c) end
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
It is described as syntax sugar in the lua documentation there's keywords such as self and : specifically for oop
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
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
Yes its meant for simple scripting I think stuff like classes is when you stretch it a bit thin
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
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.
bro this thread needs locked
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
Do you really need one if you’re writing basic scripts for Brickadia?
yes because i want to implement entire games in brickadia
why are you arguing so aggressively in favor of Lua
Do I need a separate developer class when I can just add a develop() function dynamically?
I can also do that if you want, in 3 lines
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
why is this your immediate reaction to "can you create a subclass"
Its not in favor of Lua, everything he says against Lua is misleading
luar
it's not OOP if you have to assign the develop function to every instance of a developer you create manually
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
yeah and i want to keep it under the hood!
Create a structure, assign vtable pointer
It is under the hood
i don't want to have to make the vtable myself!
okay but it doesn't automatically stop being OOP just because its not your ideal version of OOP
function Developer(first_name, last_name, age)
local self = Person(first_name, last_name, age)
function self:develop()
print(“Wawa”)
end
return self
end
an "OOP Language" is different from a "Language that (technically) supports OOP"
not really
just reminds me of the way it looked to create objects in javascript before ES6
Its the same under the hood
javascript ES6 made the language usable for OOP
you can do anything in any language but that doesn't make it ergonomic
It is ergonomic though
an extra setmetatable call isn't going to send you into the abyss
you're literally telling me "why are your needs so complex for a scripting language? just reduce the complexity of your goals"
bro didnt say that???
"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
I did not mean it like that, but you are right,
But what you’re not right about is that complex systems with Lua are very sophisticated aswell
The ergonomics are the same really
You can implement those though
I did not say we don’t have those
Or you dont need those
"can implement" doesn't necessarily mean "can implement intuitively"
I think intuition is a big part of this
its one setmetatable per class man, its not that hard
It is intuitively though
because a lot of people that are going to be using scripting are going to be people with very limited programming knowledge
You did not use Lua extensively
I have not
Then they are not going to use those features anyways?
they will if it doesn't blow to use them like in Lua
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
another Brainfuck joke
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
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
I can tell you do not like it
it sucks if you're a new user
It is simple because you do not need classes or anything if you need to print a hello world or adjust certain properties or just call functions.
you don't need that in python either
you don't need that in most scripting languages that are actually relevant here
Lua's syntax for running one thing is simple but doing any actual structure to what you're doing gets annoying
you want to change a parameter for some object you have? it's the same thing
can you remind me of how performant javascript and python are again
it has such a weird-ass structure to its syntax
completely irrelevant to syntax
Then why do you not like Lua?
there are languages that run better than Lua (not necessarily Luau) with better syntax
Your concern is about the inexperienced though, why are you moving away from your argument to favor one that’d benefit you more
javascript is performant enough to run the entire infrastructure of the modern internet, sandboxed, regardless of the browser you choose.
I am the inexperienced in Lua
python is performant enough to manage entire enterprise network infrastructures through tools like Ansible
I have made One serious attempt at using it in the context of a GMod addon and that shit was awful to use
I am sorry I misread your message
it doesn't help though that the APIs for GMod stuff blow
GMod’s API is not the best
they'd definitely be better here, but I'm still not a fan of the overall structure of Lua scripts
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
Its not just about speed though
Maintainability, sandboxing, simplicity, and I am guessing size
I wasn't talking about that part
I was specifically responding to the take about JS and Python
I do not see what’s your argument other than your failed attempt at Lua
also if we're talking sandboxing, simplicity, and size, Wren completely blows it out of the water
Then we choose Wren
not too sure about maintainability, that could mean multiple things
How much do you need to maintain the updates for security flaws, and if things break how easy is it to fix the bugs
either script maintainability or within the game's codebase
Why isn’t wren more widely adopted then though
personally out of the examples brought up, Wren and Teascript are the two that look good to me
there's literal like, thousands of scripting languages present in the ecosystem
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?
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
I think Wren looks better than Teascript
same, Vitawrap suggested Teascript and I just gave it a quick lookover
And the concurrency feature only adds onto it
I might even try to implement Wren in my own project, I like it
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)
Thats cool
Function declaration is very weird
This is not what I imagined it to be like honestly
function declarations are more usual in the context of class methods than as ones outside of classes from what I can tell
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
looks like a static method is just
class Foo {
static exampleMethod() {
return bar
}
}
Fair
the docs are just weird and tell you how to do non-class functions before class methods
took me a bit cause i wanted to make sure i did it right and wasnt just writing fake code but i really dont think its that much more complicated its just a few lines for the metatables and you only have to worry about it when writing ur constructors
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
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
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
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
ie on my search for a way to do inheritance that wasn't too convoluted and felt easy to read I found this dude who made an entire module to emulate classes and inheritance in a way that'd have far more features than what i posted would allow and i come across stuff like this every day 🥲
I experience this a lot too when I read code from teams that don't use tools like rojo. They often all have dramatically different ways of doing almost everything and it doesn't even look like the same language
this is exactly the problem with forcing the user to implement inheritance. people already want to do things very differently from one another, so making it easier to do that will make it way harder to change your code to adapt to someone else's down the line if you end up having to merge projects or change habits to accommodate a new collaborator or new team
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
…?
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.
????
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"
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.
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
Isn’t that true for most languages?
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
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.
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
Lua lacks more advanced OOP paradigms but it’s otherwise fully OOP?
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
"lua doesn't have all the features of fully-featured OOP languages but is otherwise a fully-featured OOP language"
ideally it'd either be purely functional or properly OOP but it's instead this weird chimera that's needlessly hard to work with
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
Yea, meaning it’s still OOP even if it’s not like… got all that fancy shit like Java.
You don’t need to implement it yourself it’s literally
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
"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
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
classes don't exist in lua, they are a thing you have to build out of the parts you're given
…?
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.
that's not what OOP is
???
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.
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

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
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.
https://www.lua.org/pil/16.2.html
I think it’s neat how OOP concepts are emergent from a simple concept
if you like emergence from a single concept, go read the free upenn course on haskell
Been meaning to.
it's very cool
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#
Found this incase people still do not want Lua
Funny but people might have meant this by Teascript
Teascript is related to Chaiscript I think
this is a very interesting resource
????
this is wild, can we please keep that out of here and have productive conversations
Lol
Daslang is high-performance strong statically typed programming language designed to be data oriented in C++ environment.
Another interesting one
is that why it took 3 days of this thread for you to post it
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
you do not use third party libraries though, your only concern is that it's "pretending", when that is basically how every language works
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
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
you'd also have to deal with people who don't know (or dont care about) how metatables work
can't you just add a class library to lua and call it done
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
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
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!!!
yes, and that's what the OP i made actually actively tries to do
Yea
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
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
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
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
Im still in favor of wren also
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
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.
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)
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
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
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
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 :)"
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
i can't pin things because i'm not a moderator
the only thing i got for my trouble was this silly OP badge
Why do you keep on talking about some imaginary constraints, when you do not even need to go by those
You are going to learn a new scripting language anyways, why do not you just learn how to do it in Lua
i'm not going to validate this with a direct response to your challenge because you're ignoring all of the real reasons we gave why real OO is important and why lua isn't good at accomplishing the goals of OO despite nominally supporting the paradigm
also because you're refusing to engage with me directly so why would i entertain you with a real response
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"
¯_(ツ)_/¯
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
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
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
there's no right way either lol
me when roads are roads, why bother trying to define which way cars should be going on them, the drivers can figure it out
how to re-derail a thread the moment anyone shows any sign of getting back on topic: a master class
you can define which way though
the point is lua does not
it does though
and that is the problem
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
you're crying too much 😭
trying too hard to defend our opinion 💔
Just clearing confusions about the language you guys seem to not get at all
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
I've already told you we can set directions, Lua does so too
lmao
"there does not need to be a standard for scripts to be compatible"
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
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
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
this is so fucking funny dude holy shit i did not know you could engage in faith as bad as this
y'all be trying to counter points and it's just "oh no I do not like this" 😭
i love you man this is great keep going
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.
about this i dont think having lower level data types is that big a deal unless theyre like necessary to use
to give an example, there's multiple sizes for integral types in angelscript, and you have to pick which one you want
you can of course just pick "int" every time and not think about it but "int8" and "uint64" are options on the table
int just defaults to int32 yeah
well yea i dont think thats too big a deal unless you have to like explicitly cast them
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
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.
though i guess for those that are only familiar with scripting implicit casting could end up being confusing
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
i tend to prefer having distinct int/float types rather than one number type personally
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
oh yeah thats what i mean just int/float not going into the sizes yeah
long long and doubles 😎
i dont mind being limited to just one size of int n float
i'm a static type enjoyer
bignum libraries being required for really big isnt something intuitive for new coders tho
or even just letting the interpreter figure out what kind of int or float you need, if the language is really fancy
and i hesitate to support an implicit typecasting situation for numbers
lest we get a torquescript 6sigfig situation
yeah i can see implicit casting for numbers in a scripting language being problematic lol
i have one million and one dollars
oh you have one million dollars?
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
Imo lua's only real benefit that I saw when learning was just how to path out the logic - it was really annoying having to self-impose guardrails instead of them just being there.
From a learner's perspective, anyways.
this one billion percent
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"
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 😭
in what way do you mean "guardrails"
Lua just kinda lets you do whatever, it's a lot easier to make messy code.
oh i gotcha, yeah
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.
that's a pretty common problem with interpreted languages in general
javascript especially can be bad at this
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.
i've also seen some of the world's worst perl code at work written by a non-developer
i will say thats part of why i cant wholeheartedly support js as an option despite it probably being a pretty good one
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
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.
and typescript solves the latter of the two issues pretty neatly through the strict type constraints
so what you're saying is implement a native typescript interpreter so people cant use a javascript workaround :3c
meet my friend any
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.
sometimes you just gotta use any...
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.
it would be super poetic that both bl and br use ts as their scripting language
i think that's pretty in line with what i want
honestly it could be a parser option
we are taking your ass back to ts
we are going to concat tagged strings to global variable names
NO NOT DETROIT
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.
we are going to check for null using ""
no!!!!! i don't want to work on farming!!!!!!!
and yes, we are going to construct arbitrary calls (or full variable names) with eval.......
(Probably why I view bad-mouthing is so negatively despite knowing it's not an amazing language, I still found some value in learning it initially since it was my first language)
I wouldn't have gone into broader programming without it.
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
missing my favorite feature: odd? or was it even? negative numbers modulo wrong
-2%5 etc
i mean thats an issue with the crt itself
my real fav feature was var[1] being the same as var1
Very true
and then var[2,1] being var2_1
because funny
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.
torque3d added ""anonymous"" functions which just means it registers a function with a hashed name like __anonymous_2dfe46
its so good
I would very much rather not have people go through the pains I did having to learn even the basics.
sounds very python
if i read the torque interpreter right before i rewrote it, you should be able to do nativeFieldWithNumberListType = {1,2,3}; by default in an object
Y'know, make the journey for the next people easier - not harder.
agreed
if a game like bl can lead to br, a game like br with broader appeal can lead to many others
scripting language proposal: the same wire system but in a little 2d window
Sobbing
no, not blueprints, wires..
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,,
some people out there would just get really good at reading wire diagrams
it just opens up verilog
LOL
:3c
not my fucking EE class in college
br to cpu architect pipeline
REM chips
Virtual Circuit Board, or VCB, is a sandbox-only drawing-based logic simulator featuring an assembler and a powerful simulation engine. All of it designed to give you the freedom to build and experiment with logic circuits to your heart’s content.
Set your own goalsIn VCB you will set your own goals of what and how you want to build, it do…
$10.49
260
just tack this onto the side of brih
minimal dev effort needed, $10 dlc to get scripting
Pay to win programming, I like it
as seen in the preview, you can document your code! with color coded wires!
just open up an instance of the powder toy and figure it out from there
powder toy :D
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
We should make an accurate 1:1 recreation of the Chernobyl incident in Brickadia, for educational purposes for course
just use LSL which i think defines a unique power and time value to every single script function
is brickadia scripting a professional context tho
thats a good question
does not matter, conflicting "standards" were nothing but a headache in blockland so let's not do that
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
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
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 😭
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
this is kinda where im at.. depending on the extent that they decide to use scripting, some of the nice things that are provided by different languages may be a little moot
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
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
from my understanding module scripts in roblox are one of the ways to make a class
at least to me it looks quite similar to a class structure
Modules are used to export functions and variables in a table, similar to namespaces
Roblox scripts have exclusive server and client contexts which must be manually set. Module scripts just exist as an in between as they only get ran when another script requires them and they have separate instances for server and clients
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
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
So they are kinda like classes. People often organize their modules like classes and whatnot but at the end of the day its always a variable that gets returned so ur usually shoving a bunch of functions into a dictionary which is funny to me
Maybe not luau itself but I think describing roblox development itself as Frankensteined makes more sense when stuff like this exists https://github.com/Roblox/react-lua
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
and the gui is still so ass
that is hilarious
So when are we adding E2?
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
do we really have to do this again
another 500 messages arguing about coding
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.
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:
- 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
- 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
We should make Brickadia's coding Assembly 
how would c++ even work
it wouldn't, it's not relevant to the discussion
i see
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)
people are already doing this by building CPUs out of wire btw
only thing we need is a way to push a file from your PC into the gate-built memory
lole
then we CAN port a version of doom in the game

one of which is the only partially serious suggestion to use libriscv or similar embedded VMs/bytecode interpreters (not too educated on the terminology but i at least know the intent of the technologies: sandboxed native code execution)
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.
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)
torquescript
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
also yeah as someone who started with torquescript, i wish i started with something that wasnt torquecript
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
this is what im gonna be doing if luau gets added
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:
- 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.
- 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
- 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.
- 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
- 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
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).
main functions and guards and such are all properties of compiled languages that build to native executables, which is simply not applicable here
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
A true main function yes but IIRC Space Engineers uses the C# language and mimics some of that in their scripting API...
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
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
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)
Soooo bash is still on the table? Pinky promise 😔
Or they could do some magic and implement a compiled language if that tickles their fancy
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
having a different (and more common!) syntax and oop doesnt mean everything has to become complicated? if anything lua's disjointed approach to "oop" makes it more so, but if you're doing simple stuff you're likely not going to have to interact with many oop systems and so its not going to matter either way
this just becomes an issue of how complex the api is, not the language
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
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
not going with a language that supports oop proper for a game just doesnt make sense imo
n yeah we're not suggesting to add a full on compiled language, itd still be a simpler scripting language
I'm sure it was said at some point in this thread, but what languages would you guys prefer for this?
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
angelscript looks interesting
there was another one that looked nice that i forgor the name of :0
squirrel i think was another suggestion
oh yeah squirrel
funny .nut file
only 9 days and theres already 1600 replies. Safe to say this is a hot button issue
here’s my vote for anything, literally anything, other than lua
id much prefer not lua as well
1600 replies over 6 days, really - there was a full 72 hours where people didn't have anything to say on the subject apparently
damn
just use python atp
😭
Please PLEASE make it something with curly parenthesesss, indentation blocks are the devil
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
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
trust me you don't want C# as an embedded language
its syntax highlighting probably doesn't need much in the way of updates as long as the language itself hasn't dramatically changed, and i'm sure it has a language server of some sort available to help with smarter autocomplete and error highlighting and such
but to be clear i don't know
C#..
You’d know better than me :P
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.
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
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
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
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
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?
brickadia is a game not a game engine i dont think any of this is very important
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
??? dude im a roblox developer
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
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
my point is: brickadia does not need a complicated language that is difficult to understand since it is a game
have you used anything other than lua ever
have you tried learning javascript or python
Most other languages are Not any more complicated or difficult to understand
Yes
interpreted languages are not difficult to understand, full stop and it's baffling that i keep having to tell people this
you're talking about a 9 year old playing brickadia for the first time
they had to ask their mom for her card to buy it
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
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
i see
this means that lua must be the perfect language to use because it is already very popular in modding other games

it makes it easier for people coming from other games to mod this one
"it'll mean more people will be comfortable with it already coming into the game"
YUP
CALLED IT
Looool
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
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
I feel like equally as many people will be put off from scripting as will be actively enticed by use of Lua
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
in practice 99% of the documentation will, hopefully, be official Brickadia Scripting documentation, not documentation for the scripting language you use
because in practice most of what matters will be the actual Brickadia API
JS is by far a better choice if your singular requirement is popularity/enticing people who already know a language
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
yeah js would be better
is gmod modding also lua
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
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
yes and i don't think anyone i know who has done gmod modding likes it lol
tbf that's like half because GMod's API fucking blows
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
afaik people are starting to try out js for scripting languages, i know valve is
The audience is not mostly children, its grown up people
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.
regardless of audience, wiring is the "simple" visual option for scripting
To be fair Roblox heavily uses metamethods and not everyone is up to that, so Gmod is just like that
you've inspired me
havent heard of wren. might have to take a peek at it
This is peak
i really like that wren contexts can be configured to accept many custom functions like the default allocator and module loader
also wren is interesting especially in godot because i wouldn't be surprised if gdscript is slower
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
continuewe're also removingreturnandbreak,
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 truefor 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
endif local notFound then
print args constant doublequotation did not find 3 :( doublequotation
endcomment glorious returnValue is returned
end` -
added native OOP suppor-haha just kidding, fat chance lmfao -
lastly,
array index constant 0now 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
This is the best shitpost here
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.
if you get this integrated id be curious to see; i feel like for some cases itd still be slower due to marshalling in cases of high use of variants
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
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
yea totally fair
why not throw in a concatenative language for the computer nerds (joke!!!!)
actual thought: fennel is a nice dialect of lua
they got forth running on bricks now
nice lol
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
that's fair
so alas it goes to the bin of cool stuff that lives rent free in the back of my mind
fennel is really just a transpiler anyway - you'd still get people writing lua if you decided to run something fennel-compatible
i think it was the transpilation step i was having difficulty with
I just feel like a lisp would be a good complement for the logic gate stuff given the syntax is closer to the function
true
lisp-like languages would be fine by me either way though
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
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
hey emacs isnt half bad, especially if you use evil cough
I'm going to learn racket soon for a course lol
i like elisp over vimscript but when i found neovim it kinda was over since i already knew lua better than vimscript
it's cool until you go to a different mode and half the keybinds are different or don't work the same way
ya fair
I just use lite-xl for simplicity
emacs isn't bad but from my experience the juice just isn't worth the squeeze. once i found vscodium it was just like
ok, sweet, never have to mess with my editor ever again
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
only downside is: electron app 🤮
yah...
i have to clear out my extensions every 5 or 6 months to keep it feeling fresh
rainbow parentheses <3
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
racket is so fun, it has a wealth of libraries for data sci and visualization
i like sbcl but its practically useless in 2025
or CL i mean, but specifically ccl or sbcl
yeah, seems like fun
yea, i think beefing over text editors is up there with beefing over languages for me, at least with languages theres a little more meat on the bone for discussion
same
but like you say almost any text editor is good enough now
totally comes down to preference
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
I know of a fellow who wrote a networked VR game in stock notepad, nothing can disturb me now
(not even notepad++)
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
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
for sure, every tool has its place
yea, this is kinda why i still wanna know what the devs are planning for scripting just from an api/implementation standpoint
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
fair point
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
bash is pretty weird indeed
esac and fi and the syntax for conditions haunt me
if only we could get jai 
/j
honorable mentiob
the positional argument retrieval messes with me more
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
jon blow would probably have an aneurysm seeing his perfect language used for a lego fame
lol
game*
there are also some languages with scripting "versions" if they wanted to pick something powerful
it's a lang made for games tho
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)
yea, im just teasing a little cause jon stands on business for sure
he has reasonable strong opinions about how games should be written
yeah im sure he tones down his opinions of c/c++ in his talks
i forgot, i never got deep enough to be writing functions or anything too sophisticated
that is pretty quirky
jai is unironically super inpressive though
(side note if someone's able to invite people to jai beta, i'd appreciate an invite 👀 )
if it does ever release publically it feels like it could be go for games
i agree
what go is for webservices and cli utils , jai could be for games*
i wish he wouldnt treat it like a walled garden though
personally hoping to write an engine in V at some point... that is, if I ever learn enough to do all that porchblob
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
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??
oh right, you have to pass in a formatted signature, right?
yeah
well wren does it
in the other end you have to parse it (or compare it at least)
oh, it has arity overloading, that's neat
been using a lot of elixir so I got used to that
yeahh.. i feel like hes misapplying his perfectionism for his games to jai
its functional enough he should just put it out there and get more eyes
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
now i see what youre saying , that is kinda..
I'd guess brickadia will end up using C++ itself (unlikely), lua, or its own thing
handling bindings as a callback sounds like an unecessary challenge for someone trying to use the language
i dont think the devs want to make their own custom language. i cant remember where but i think they voiced that
given it's a commercial project it's probably not likely to use less popular scripting languages
which is fair
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
it does seem a bit antithetical
unless that signature is created once and for all by the parser but still
they did Want to but they decided against it because itd take too long
why is that signature parsing ordeal offloaded to me now
seems like they settled for putting that creative energy sneakily into upgrading wires, since the graph based execution structure is essentially an AST
yea im kinda surprised, i didnt look into the binding docs for wren but it seems actually really rough
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
it's what it does already if i read correctly
I've heard the squirrel language is interesting but I haven't tried it yet
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
a bindForeignMethod call is done once
thats just during binding yeah
phew, ok, its weird but its not a hot callback
total reading comprehension epic fail
still seems a little tedious though Lol
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"
every time I see 25+ more messages in this thread I get concerned
felt that chef
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
clearly this server needs a programming channel foot64
judging by the quantity of near 1800 comments on this thread, maybe
judging by the quality... maybe... maybe..
re: over 1800
if i'm reading right the whole foreign method binding thing should only be done by the game devs anyway, right?
since that's how you expose the API to users
bit sad to hear that it's clunky regardless though
yea
this melted my brain
god i hate lisp syntax
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
Blehhh that’s lisp? Grody
Real
without highlighting, maybe
i have never had an issue with reading nested statements (unless its like 50 of them but you shouldnt do that anyway)
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:
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
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
and also is a decent reason why it isn't widely used, since C-like is what most people have agreed upon
yeahh
i love functional syntaxes though
lisp had its time in the spotlight before C
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
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
personally I think lisp is easier to learn in the first place because there are less special cases
you see pretty much what's happening
or rather, that style of parenthesis, not lisp itself
anecdotally, i have had a harder time getting people interested in programming through lisp
interesting
it is simpler if you have a good grasp on pattern matching and are wired that way
yeah, the main problem is that such syntaxes (syntices?) also don't lend themselves well to a human model of the world
(re: this)
fair x2
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
pattern matching is amazing
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
true, more of a tinkerer thing
(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)
I've basically only used functional languages, I need to learn proper OOP
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
to me the "nesting is easier to read" argument is completely offset by the fact that everything is nested
you dont need all those parentheses mane...
true, but it does make the way things work clearer
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
OOP is awesome in a lot of the same ways that functional is awesome - the end goal of any paradigm is to more cleanly and closely model the world so you write code that expresses intent more than it expresses procedure
not really imo :0
like c style can be less obvious if you're stacking statements on the same line i guess but most of the time its not going to be (or at least it shouldnt be lol)
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
for sure
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
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()

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
???
is this how java users do things
enterprise java code is Hell
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
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()
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
Its just that you can make your own sugar with the metamethods
yea true
Some people decide to make their code unreadable because, why not
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
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
nim is the same way, I used to write in a pipe operator lol
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
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
You’d have to blame not specifying a standard in the team for that
Okay so that's obviously not something you should need to do
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
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
yeah literally just get a code autoformatter
roblox studio has a whole plugin system to modify the editor; i'm sure it allows for reading and modifying scripts in-editor from plugins, which is all you'd need for an autoformatter
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
Ternaries can be reduced quite a lot if a language supports inline pattern matching and/with flow-scoped variables, like if (hitBrick is MicroBrick hitmicrobrick) { DO_THING(hitmicrobrick); }
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
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
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
i know a lot of people feel negatively about c# but this is one of those things i like about it.. despite being a mainstream language with little need to add, they do add language features that make it way more ergonomic
pattern matching, linq, nullable types, stuff like that
syntax bloat? yeaa.. but with any decent editor its not that bad
sigh... if only more scriptlangs made null handling explicit
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
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.
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
it's a common problem with any language
hence the existence of editorconfig and similar
EditorConfig is a file format and collection of text editor plugins for maintaining consistent coding styles between different editors and IDEs.
yay typescript!
guard clauses + pattern matching <3
def combine(x, y) when is_binary(x) and is_binary(y), do: x <> y
def combine(x, y) when is_integer(x) and is_integer(y), do: x + y
def combine(_x, _y), do: 0```
option is one of the best additions you can make to any language that doesn't support it natively, even if your language server (assuming there is one at all) can't help you with handling it
or maybe, or whatever you wanna call it
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)
of course where it truly shines is when your language server can help, because then it goes from smoothing over runtime (or compile time) error detection to static analysis you don't even have to do yourself
we love pattern matching
it really makes you wonder how you ever lived without it
pattern matching and type checking in the editor are just absurdly good at making code better
haven't really used lsp- I just have syntax highlighting and rainbow parentheses
those are bread and butter yeah
i didn't know i needed rainbow parens until it was on by default in my editor
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
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
because when you see an indentation ur thinking, okay when does this end. and usually it doesnt end. usually there is no consistent declaration for that
but you should have indentation for conditions...
yeah, this is why i think its kind of unfortunate they chose to do ternary that way
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
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
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
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
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
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);
}
}
AWESOME