#dev-general
1 messages · Page 340 of 1
it has to be closed and there has to be no references
hmm
Yeah but the GC is a really complex system that just kinda picks what it wants and can do some weird things sometimes
Isn't it?
Might be worth it to ask chestly what he did
Sadly yes🥲
chestly's thing is more comparable to dcevm afaik
ah, I just remember him saying something about getting classloaders gc'd
So GCing a class loader will also GC all of its classes right?
dcevm is pretty good but it too, in fact has limits
How does bukkit handle double blocked blocks, ie. bed, Block will enclose both locations right?
Since the class loader is what is keeping the classes loaded
For the classloader to be gcable, anything that holds reference to it must not be reachable
so yes
yes bardy, but to gc a class loader it has to be closed and there musn't be a single reference to one of its classes
ensuring there aren't any references is a particularly difficult thing
Yeah
and that in general is why it's so "unpredictable" afaik
because while it may seem that you've eliminated all references
Especially if another plugin uses it as a dependency and so holds a reference to it
you in fact haven't, for some peculiar reason
E.g. an API
Yea you're probably better of allowing the plugin to manage its own "reload"
If the plugin has an API that other plugins are using then surely those other plugins would need their class loaders destroyed too to remove the references they have
the plugin, and only the plugin, is capable of removing references to itself from its dependencies
but krypton, and only krypton, should be responsible for removing references to the plugin from krypton
I believe so
Which makes things even more difficult
If you just want to reload one plugin
Yeah
Of course
You can isolate a classloader right?
no, because the classes that are being provided to that api are loaded through the plugin's classloader
Well, if a plugin depends on the server and reflectively accesses and controls the class loader and unloads the classes then there's nothing I can do about that ofc (in response to only Krypton being able to remove references to itself)
I mean like Isolate a group of classes A from another group B?
Java modules might be the way to go there
reflectively accesses and controls the class loader and unloads the classes
this isn't possible
classes are stored in 3 places in a url class loader
you can remove a class from all 3 places but it'll still be loaded
Oh they can make classes completely inaccessible?
Even reflectively, I mean
Kinda weird
Maybe I should fight fire with fire then
A.k.a write some native stuff to destroy stuff on the JVM
native keyword
such stuff could only be integrated into the jvm itself (afaik)
I'm not sure but I think that's what broke pdm, the JVM internals were placed in an inaccessible module
ahh I see, if thats the case, would it not be possible to provide such an isolated env with intermediate "channels" for communication that is managed by krypton?
You don't need intermediate channels
an intermediate channel is just another place for references to be misplaced, making it even harder to unload a classloader
How so?
Wait so I can shut off access to a module reflectively?
there's no reason communication can't happen directly between plugin classloaders
You can do that?
yes
Oh you mean by passing instances of classes loaded from one side of the group
you can access a class from another classloader
Is there no way at all to isolate them?
You can deny reflective access through modules?
bm mentioned that modules do something similar
smh
I'm not experienced enough with modules to comment on that
Altho Im not at all familiar with how java 9+ modules work
Might be interesting to see
Well then, guess it'll be google time when I get home
good luck lol
If so, you could hook up something similar to interprocess communication
I'm pretty sure we've gone through pretty much everything to cover in this topic
like in AIDL
aidl?
but to be completely honest, what's the use of reloading the jar itself
Android's way of simplifying inter-process com.
nobody in production would do this, only reloading configurations or data is useful
BM you're right
yay
Module privacy applies to reflection too
no java since java 8
Yeah I agree. Reloading in production is dumb, and if things break in development you can just full restart
welp, i'm off for the night, fun chat lads, glad I could finally use my obscure urlclassloader knowledge
lol
gn
Gn
gn
^^^^^^^^^^^^^^^^^^^^^^^^
gn
But also a nightmare
Also, I want Krypton to be at least somewhat idiot friendly
EVM will support native hotswapping and unloading everything
arm is useless
Like you know that someone's gonna /reload and break everything

Simple? EVM
Lightweight? EVM
Portable? EVM
Fast? EVM
Elara has its own architecture
Hotel? Trivago
EVM can do everything arm does but better
Yeah gl
EVM will be superceeded by ERM
Gl
😳
🤣
!!!
ERM = ?
🍋 RM better
EIS
Quantum machine haha
let
will elara ever finish though
Fake news
Sounds like something out of the 80's
80s? 🤔
And now elara is making fast code a reality again
more like the 40s
2080
Try balancing speed with usability and reliability
nah man 80's = 8000s
Gl with that one
ah shit you are right yugi
EVM is faster
This is technology far off into the future
Doesn't even exist yet lol
🥲
it does
But will it ever be the most compiled language?
Hmmm
and y'all bust even faster
No
yes
No
Is that a pcj reference
itll be taught in schools by 2022
Maybe
Lets make a worm that makes every infected computer continuously compile Elara code
This article was just too good to be serious
Wat dis
r/programmingcirclejerk
Lol
ez #1 compiled language
ikr
I swear if I see people using 2 or 8 space indents I'm actually going to jump off a cliff
I use 12, for that oompft
johnny do you have a link to that most compiled post
Jump off a cliff
Oh was that it?
yeah that's the article
I swear, fucking Kyori uses 2 space, and I had to write with that when I added ZLIB to NBT
It was literally cancerous
Gladly
Cant you have your editor handle that conversion?
Maybe
Absolutely
vim can do it in just 45 illegible lines
Anyway yes, elara will definitely become the most compiled language
Lol
You wish
Orders of magnitude more compiled than competitors!
When pigs fly
compile to IR
compile IR to kotlin
compile kotlin
Compile kotlin IR to java
Compile bytecode to native
Ez
You make fun of us talking about the most compiled languages, yet we don't even know what that means. Curious
You are either very optimistic, naive or deluded
i probably fit all of the above
but thats besides the point
elara will be the #1 compiled language!
Most compiled language in the world!

whats that got to do with anything
my point stands
Lol
Clearly
simple
Did you know that there is a tiny Leprechaun inside your computer performing actions to make everything you do work?
Yeah but you can't make the most compiled language without first making a compiler to compile it
Lol
We're halfway there

Maybe if BM forces Yugi to keep doing all the work then we might finally get there xD
mhm
Typer + compiler ez
what
blatantly untrue
I'm messing
🥲
No need to force anyone, its been less than a year since we even started
A fair amount of work has been done for that time frame
I swear pretty much all the commits to the "compiler" are Yugi
Wish we could say the same about PDM relocations.
anyway syntax rework first
Ikr
Me too
That would be nice
You have a PR there
PDM rewrite when?
Literally just waiting
There is no compiler
Afaik
There's the asm port
lucko
Didn't realise yugi had done anything with that
relocation
Wrong asm
it uses asm
I didnt
o
Wat
Theres only 1 or 2 commits on the asm port
luck's relocation
You talking about Luck's jar relocator?
yea
Ah
So rn typer and emitter left
It works pretty well
java tutorial pdm rewrite and typer coming tomorrow I guarantee it
also should i cache gson instances
PDM Kotlin rewrite
cant wait
Just make a constant
In other words yes
kk
can't really
pdm kotlin rewrite doesnt make sense
is it fine if i have like one for each class
Why not?
PDM lisp rewrite?
Because KOTLIN
pdm runtime needs to be embedded into every jar
Dependencies
phat stdlib
I need to keep that runtime small
Stfu lol
huh?
Fair
Did you read the next message bard? xD
Yes
Easier to make a single one
and probably better
Also, the dream of not having to shade Kotlin will finally come true with Krypton
GsonProvider.getGson()
Ewwwwwwwwwww
all the gson i know is
- set pretty printing
nauseated face
AbstractGsonProviderBuilderFactory
not Enterprise enough, sorry
AbstractGsonBuilderFactoryGetterBuilderSetterFactoryBaseAbstract.java
There we go
gson.toJson
gson.fromJson
🙂
I think Jackson is more on OOP?
let str = toJson obj
let obj = fromJson 'Type str
/**
* Creates a new variable
* @ApiNote might create a singularity and result in a black hole
*/
class AbstractGsonBuilderFactoryGetterBuilderSetterFactoryBaseAbstract {
...
}```
man those javadoc comments
i have no javadoc comments
cause i have no javadoc
cause implementing an API is harddd
okay
like sure
i can make a custom event
but then i have to
do maven shit
mvn central
utter headache
U bad
but whhyyy would i

Reminds me of the pain that is Aeson tho
Dw elara json will be easy to use
In the year 2070 yes
Our grandchildren will code in elara
imagine if torvalds made a language
It would be C
yes it would
he would make rust because rust is good
He said in one interview (if i remember correctly) that he thinks C is the perfect language
I honestly i am not able to do any C or C++
uve made atleast 3 clojure references in the past hour
memory management is just not for me
Have you heard of this up and coming Language called rust?
Not very well known at the moment
I heard of rust
C has so many security poops caused by bad memory
Rust doesn't have those problems
exactly
Low level stuff is preety hard to understand
it is fast AND memory safe
calls C a low level language
pffffffffft
They're low level nowadays
for today standards
man I'll make a game in 6502 assembly
Since people only know expensive garbage collected null safety array length
I can barely get done hello world in assembly
that's ez
Imagine reading docs
Visual Basic 
;)
Electron 🤢
🤢
C memory management isn't even that hard
torvalds probably thinks objective c is modern
okay I'll go exploit all the memory bugs u have
Nobody's saying it's hard, it's just annoying to have to always think about
I swear most things get destroyed automatically in C when they ain't in use anyway
man I'll pointer you in a minute
Not on the heap
Stack memory does obviously
But i love electrical component stuffs 👀
free ?
Those are the cool electrons
Github electron bad
Oh that, welp
death
Yeah quick google seemed to tell me it's a method not a keyword
Yeah that would probably cause the JVM to overload
Also, 2 space indent
Leave
Electron is really really good from what I've seen
have you written a bigger C application?
Wait what?
yea
you didn't know...
It's convenient
But it's slow as hell
Omfg WHY
Don't think so, System.gc doesn't necessarily actually cause a gc cycle
I think my favorite part of that whole style guide is this
https://google.github.io/styleguide/javaguide.html#s6.4-finalizers
lmao
And even if it was cycling, i don't think thered be a noticeable difference
Yeah
Empty allman block
while(true)
{}
ew
Looks about right
seeing {} tho
Ewwwwwwwwwwww
md_5
while ( true )
{
}
Bro i fucking hate the people who add spaces in the loops
like i understand if its something like algorithm and formatting and easier to understand
GoLang be like:
but this
Nooooo
for ( i = 0 ; i < 10 ; i ++ )
{
}
😈
Leave
imagine writing braces tho
int i = 10
while (i --> 0) {
}
😌
python 🌚
That syntax is cool tho
shame IJ ruins it
it doesnt
By default it does
Also @old wyvern @prisma wave, this would be an interesting feature for elara, a syntax for infinite loop
while {
}
As in just while without any condition
Ik you can change
Go has that
We already have that I think matt
Do we?
¯\_(ツ)_/¯
Oh shit, that's nice
Just need to let the condition be true if the next token is a {
I dont remember chnaging any defaults
No warning or anything
- ligatures makes that look lit
ah I see
Turns it into i-- > j
Oh interesting, go's version is
for {
}
4.7k lines on bw so far, yikes
bw?
bedwars
for i > 5 {
}
You tell me
I'm op, it still won't work
go for is nice
Stick to 1 channel.
Very versatile
lol
im at 18k lines 🥲
18k lines? pfff
GitHub seems to think I've added 386,361 lines and removed 193,970 lines for Krypton in 32 commits
totally not that the blocks.json file is 171k lines or anything
I mean I'm gonna hate myself when I start refactoring all this
refactoring what?
my potato code

right, should probably make a repo for the API in the Krypton org actually, thinking about it
tempted to call it "Api" just to piss everyone off xD
whats so bad about "Api"
I swear the official Java convention is to have an abbreviation of 3 characters or less be fully uppercase
I mean it makes sense for it to be uppercase
oh btw, I might switch us to log4j 2 at some point
since log4j 2 is faster and supports async loggers
thank you
for not fucking using JAVA.UTIL.LOGGER
which is what Spigot
apparantly uses
we're already using SLF4J and Logback
just thinking of switching Logback out for Log4j 2
tfw your logging isn't fast enough
Nooooo
Logging is a HUGE hotspot in our Fermat's last theorem brute forcer
Wales 🤢
I know someone from Wales, I should tell them you said that
Please do
what???
I swear
...
you have about 5 brain cells on a good day
W H y
u suc
what does a logging lib have
Can't tell if you're trolling or not
dw its a dkim moment again
;-;
this is dkim lol
you said before it was bad
take a wild guess
one of my developers has been blaming Kotlin for all the problems with my plugins, but I started teaching him it yesterday and now he loves it lol
LMAO
Almost as if criticising a language you've never used is dumb...
lol
has anything really changed since then?
I mean, not like dkim has really progressed in that time 
He's trying ok
Dkim is pro in code cave
fair enough lol
wot
Helpful
is it just me or does code cave sound like you're referencing code combat lol
I agree
it'd be more active
I bet dkim can't even do code combat
What's code cave?
What's code combat?
Made in discord.elr
its a discord
any British people here familiar with code combat?
Second best coding discord
is hc one
@half harness no
Regrettably
Code cave is good because I'm mod but it's also full of dumbasses
inv
lol
Make me immune to consequences and I'll call them dumbasses for you
That's why I always ask in HelpChat 🥲
i mean
you're effectively immune
what are they gonna do, cry?
Well I meant being banned
wait what? you didn't tell me I get to laugh at idiots!
well
most of them are just noobs
but theres this one guy
i cant really describe it
theyre braindead but incredibly overcompetend
wait what
my english died
thats not a word
overconfident*
Can we abuse help said person?
absolutely
@jovial warren Look at this abomination https://paste.helpch.at/osewaleviz.java
Jump off a cliff
frosty did you write that code
I mean, you can't code anyway, so I'm not that surprised by this
Yes 👀
it isnt really that bad
What's so wrong about it, apart from functional interface abuse
Nah I prefer them, cleaner imo
like when an instance variable and stack variable have the same name
also, that execute method and the Arrays.asList have 8 space indents wtf
4 too litle, my bad
i only this in constructors but its personal pref
I only use this where the compiler complains if I don't lol
lol
but that really doesn't happen in Kotlin unless you're stupid lol
also, Frosty wtf
i love how kotlin is much less verbose
?
shut up
the repeated cast as well
I'll fix that eventually
Just trynna get shit working first lol
And before you ask what the point of this is, it's per world listeners
casts like that are dangerous
also is there a way so that intellij deletes semi colons automatically when coding in kotlin
totally didn't do that once in Krypton before I yeeted it because it was damn ugly
you still write them?
yeye I believe I can yeet the lambda all together, just no clue how
I find it an inconvenience to have to press the right arrow all the way to the end of the line just to type it
java instinct i use both
i use java for my main library code
and kotlin for testing
why would you do that to yourself smh
well it has advantages cause kotlin tests are much easier to write
better testing overall ig
just use Kotlin everywhere lol
and i need to let my mind differentiate the two
lol
so my brain can realize that kotlin doesnt use semicolons
does kotlin even use any semicolons like anywhere in the language?
like not syntax wise
but like anywhere
besides like string names
if you want to put two things on the same line
you gotta use 'em
same as in Python
comes in handy in CoC shortest lol
until you inevitably get rinsed by Python
skript tho
leave
nah I'm fine thanks
lets make an anticheat in skript
You need jesus
I believe the link you just sent includes your cookies aswell
Noice
I'm on my phone so no
oh btw, I'm on to designing the command manager, just thinking of how to do it
I wanna buy that just to see the actual files kek
should I just have a few registration and deregistration functions?
its only 25 cents
If it does actually work, its completely worth it lol
yeah
No
FFS I have to disable my VPN every FUCKING TIME
LOL
because they block VPNs for non-supreme users
not kidding
fucking money hungry scumbags
also, the words "free" and "MC market" just don't go together do they
i was looking on the mineacademy site and i found this:
Our focus for this training is to teach you development and coding. If your dream is to become a developer at Google, or to offer your own development services, Project Orion is a great place to start.
dumbass you think you can fucking get into Google?
just by taking this one course for 20 days?

anyone can get into google with enough experience
Not with that course
^
It teaches shit, but it's 90% wrong
"Is a great place to start"
isn't mineacademy that one run by that really shady guy who got banned from Spigot because he advertised literally everywhere?
yea
CHAD
Yeah
kangarkoo
and then he complained that the price limit was "too low" in his blog
dude would've probably charged 100 for a plugin no doubt
and this is exactly the reason why the limit exists
chatcontrol is literally only 200kilobytes
Chatcontrol is utter shit
bUt iT HaS lOaDS oF FeaTuREs
So rude!?!?
nah kangarko deserved what he got
Jokes aside, definitely
if he can teach people on how to get into google, why isnt he in google :kekw:
god damn man you got him hard
replace the words "snakes" with "spigot developers" and "on this mother fucking plane" with "complaining about these mother fucking limits"
honestly though, in the terms of spigot vs developers, that's one of the things I fully agree with md_5 on
some developers think that it is somehow their god given right to sell their shit on Spigot
also, for the CommandManager, ```kotlin
interface CommandManager {
fun register(command: Command)
fun register(vararg commands: Command)
fun register(commands: Iterable<Command>)
fun unregister(command: Command)
}
Yes
and should I add an easy registerCommand method in Plugin to avoid you doing ```kotlin
class MyPlugin(context: PluginContext) : Plugin(context) {
init {
context.server.commandManager.register(SomeCommand)
}
}
I presume listeners will be done in a similar way when it comes to registration?
class MyPlugin(context: PluginContext) : Plugin(context) {
init {
on<SomeEvent> {
// do some whack
}
}
}
oh so no actual registration
or optionally, registerListener maybe, if you want to separate listeners into classes
that method will register a listener that will call the code in the block when the event is fired
I see
or something like that
it'll use an event bus
which I still need to look into lol
a.k.a steal from Guava or LuckPerms and pretend I know what I'm doing
Why reinvent the wheel 
wdym?
.
bus
🚌
does anyone here know about how event buses work and wouldn't mind explaining it to me pls?
more like copy from kyoripowered/event
fun fact, with the LP API you can subscribe to LuckPermsEvent and unlike stupid Bukkit it will be called for every event
EventEvent
oh wow
also, https://github.com/KyoriPowered/event/blob/master/api/src/main/java/net/kyori/event/EventSubscriber.java this can just be (T) -> Unit right?
Nothing 
it's void that can be returned
oh
xD
e.g. ```kotlin
interface EventBus {
fun <T : Event> subscribe(subscriber: (T) -> Unit)
}
void and Unit
void urMum(void, void, void void...)
u can do stuff like return someVoidFunction() with Unit
Void tho
so void and Unit are the same
thats useless though
its really not
this would work right?
its concise
just return Object ez
how is it not
player.sendMessage("hello")
return
return player.sendMessage("hello")
which do u prefer
if u say first i will smack u
second
the main reason for unit is that everything is a function
a function always returns something
When you try and figure out why stuff doesn't work, but you made it uppercase instead of lowercase :sadge:
sudge
meaning you can do () -> Unit rather than some weird syntax to represent "void"
@prisma wave teach me the event bus ways pls senpai
sodge
you have asked me that 3 times
same answer as last time
wait for the 4th
you don't know 😦
@prisma wave teach my the sftp script ways pls senpai
This is an unregistered copy of Sublime Text
So a dude from the other discord decided to respond to the statements of why lombok is bad
"one of the most stable projects"
JetBrains remakes Lombok plugin because it breaks every other update
We've seen this already
Heretere?
mhm
who dis
some nerd
huh?
that's a world class insult I swear
lol
can someone send this in some other format
what
Literal asshat that should be dead
paste
not a file preferably
wasm?
I swear you wrote ?plsnolombok BM
this guy loves Furthermore 🤣
nvm lol
debunk: So what?
why even care about stability?
Isnt that what piggy sent earlier?
@stuck harbor what is your pfp
duck
@lunar cypress what is your pfp
I mean...
sadge
seems legit
also, tf is stability?
what does that even mean?
something to do with stables
Staple's?
u mean American wilko's?
wilko!
and you can say what you want, that is the case with lombok. It remains to be a compiler hack, even if you dislike the term
It doesn't use an official API
or rather, it uses an internal API
Also: facts and logic
This "compiler hack" is likely more stable than most projects you'll ever make
sult
you could say that I was "owned" by this. "Destroyed", even
lies. Everything I make is stable.
100%
:)
I wonder what the argument against proper annotation processors is that do the same thing
interface EventBus<E : Event> {
val subscribers: Map<E, EventSubscription<E>>
fun call(event: E)
fun register(subscription: EventSubscription<E>)
fun unregister(subscription: EventSubscription<*>)
}
```wonder if that'll work 🤔
(using a functional interface because of unregistering)
though actually, is unregistering event listeners actually even a good idea?
o i forgot @hot hull what language we learning this week
altho i only touched f# on that one day kek
Same lol
lol
Legit got to many stuff to finish rn
slep
E?
E!
I gotta make an AHK script to help me sleep
interface EventBus<E : Event> {
val subscribers: Map<E, (E) -> Unit>
fun call(event: E)
fun register(subscription: (E) -> Unit)
}
```maybe this better
actually lucko's is better than that
it has register return an EventSubscription and takes a consumer as an argument
interface EventBus {
fun <T : Event> subscribe(handler: (T) -> Unit): EventSubscription<T>
}
and then calling as well
wait nvm xD
also, I swear some of my KDocs are gonna look like they were written for children lol
for children, by children 
/**
* Plain old survival mode. In this mode, you have a finite amount of health,
* and you can take damage.
*/
```for example lol
okay Frosty, I swear, I will actually find out where you live
gimme addr
I can give you his address if you want
123 Sesame Street?
oh that makes so much sense lol
Street: Turjaška 4
City: Preserje
Phone number 031-947-131
Zip code 1352
Country calling code +386
Country Slovenia```

this isa ll his info
bois
I call BS lol
for legal reasons it is not
Wrong
I have used bestrandoms.com
-_-
sadge
I mean it's close, but you can't actually get my address from my ip
It'll just lead you to the data centre for some reason
well because that's how it works
yeah
shut up
What if they had access to your location from your's phone's GPS?
🙂
Never understood the handler list bs
To store handlers
also, Cancellable is also a thing
/**
* An event that can be cancelled
*
* This has a single value, [isCancelled], which states whether the
* event has been cancelled or not.
*
* @author Callum Seabrook
*/
interface Cancellable {
/**
* Whether or not the event has been cancelled.
*/
var isCancelled: Boolean
}
```noice
and yes, that is a var, but that's literally the cleanest way to do it
trying to think if I can even do that lol
have cancellable events
but if I don't, I will literally be hung by the neck lol
from lahwran's fevents apparently
It just represents a static collection of event handlers afaik
https://github.com/lahwran/fastevents/blob/master/src/main/java/net/lahwran/fevents/HandlerList.java
Not sure why they chose so many things to be static
taking inspiration from messy donkey code is one of Bukkit's biggest mistakes
HandlerList<TEvent extends Event<TEvent>> wat
I mean i know what it is, what I meant i never understood is because I feel like there is better ways to do it xD
ah, just bukkit being bukkit
welcome to event buses
Just an irrecoverable state tbh
event buses handle events through pub/sub
🤢
well it's either that or ```kotlin
interface Cancellable {
val isCancelled: Boolean
fun cancel()
}
I guess
also, why tf didn't Bukkit just do https://github.com/lahwran/fastevents/blob/master/src/main/java/net/lahwran/fevents/Listener.java this for listeners ffs
idiots
asking questions that shouldnt be answered 🙂
https://github.com/lahwran/fastevents/blob/master/src/main/java/net/lahwran/fevents/Order.java not gonna question whatever tf this is
right, close tab
yea that's bad
but this looks interesting
but doesn't that mean you can have only one listener per class?
ah yeah, good point
I mean, not even sure how I'll do listeners in classes yet (if I will)
SRP 
well yea, you can use multiple listeners for one thing
ex for an afk system you can use chat, interact, command events etc and just put them all in one class
depending on context

