#dev-general
1 messages · Page 403 of 1
how could we have got it wrong all this time 🙄
boutta throw you of the edge Kali
off the edge because earth isnt round yes 🌚
java <> haskell?
yes
'cool'
weve got a haskell function add x y = x + y that's exported to a C function
JNIEXPORT jint JNICALL Java_Library_addHs(JNIEnv *env, jclass clazz, jint a,
jint b) {
return add(a, b);
}
``` and then a jni function that implements addHs and calls add
incredible
way too much work considering
but still
now the next step is obvious
make a plugin in haskell
🌚
// This is approximately 25.32 ticks per second. It should be 20 ticks per second
---- Krypton Profiler Results ----
// Now with less numbers
Minecraft version: 1.16.5
Krypton version: 0.17.3
Time span: 16154 ms
Tick span: 409 ticks
// This is approximately 25.32 ticks per second. It should be 20 ticks per second
--- BEGIN PROFILE DUMP ---
[00]root(409/1) - 100.00%/100.00%
[[ EXCEPTION java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 ]][00]unspecified(409/1) - 16.53%/16.53%
[00]tick start event(409/1) - 1.03%/1.03%
[[ EXCEPTION java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 ]][00]tick end event(409/1) - 0.47%/0.47%
[[ EXCEPTION java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 ]][00]tallying(409/1) - 0.38%/0.38%
[[ EXCEPTION java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 ]]--- END PROFILE DUMP --
```now that is what you call profile results
25TPS :pog:
sometimes watchdog kills it for no reason, sometimes the profiler doesn't work, nothing seems to happen consistently
probs cause you using kotlin
Please do
how do i fix intellij not recognizing imports ;-;
nvm i just went into the class that the import didn't work in and it fixed
:p
Why did you revert back into Kotlin hating? 😢
the problem with Krypton isn't that things are broken
the problem is that they're only broken some of the time
Kotlin good!
Haskell good!
the jvm does not play dice with minecraft
Also @hot hull i made a project on GitHub for TriumphChat, if you wanna add anything to it just open an issue
apparently it does
or at least, Krypton plays dice with the JVM
einstein said no 😦
🤩
coolio
is trumpetchat java
kotlin
shame
JNIEXPORT jlong JNICALL Java_dev_bombardy_testing_NativeUtils_sum(JNIEnv* env, jclass clazz, jint number) {
return number * (number - 1);
}
that's about as far as I've got with JNI so far lol
wait maybe you have a point
beautiful amirite
since 1 * 0 = 0
Trumpet 😢
true java<>haskell interop
trumbonechat
Better
why not
Haskell = native, Java = JVM
it's gonna get even more cursed soon
im gonna try and write a plugin in haskell
or as much as possible
didn't johnny do that
jesus
no wait that was clojure
yeah and clojure's a lot easier
why
🥲
JVM = VM that runs natively
Yea
cuz it compiles to jvm bytecode
I guess the code is still run natively
JVM runs natively 🙂
and has actually supported interop
xD
g
JIT turns bytecode into native code
g
g
my g
ur like
ew
Eta is a simple, compact and powerful programming language to build scalable systems on the JVM. It is a dialect of Haskell on the JVM.
wot dis
dis is
wot u need
boi
Thats dead piggy
yeah its abandoned i think
h
it got github
git on the hub
and fix it
fuck me sideways that's a fat repo
have fun with that
piggy are you okay
no'nt
bm
but it works sorta
yes
wait 2 sec
and uses maven
make sure to add a part where u copy the jar to server
wat
does it really use maven?
i think so
lol
Actually Piggy was just looking at it yesterday and unfortunately it has some funky issues with Kotlin
nah g
how do i compile hs?
ghc
Oh btw matt, we hit 4 stars
2 of which are absolute strangers
i haven't done kotlin hotswap at all
oh nvm
can i use stack ghc?
yes
since ghc isn't a valid cmd
Oh shit really?
That reminds me i need to work on that task :weary:
ok
man I hate maven more than nearly anything honestly
add ebt instead
hate maven more than skript
xD
oh fuck
I broke the message queue again
🥲
@cinder flare I think my camera might just be fucked
it seems that it just can't record 1920x1080 @ 30fps
haskell = scripting language?
is that hard to do or something?
die
apparently yes
huh?
haskell = freeze sublime
Basically very often it'll throw ClassDefNotFound on Intrinsics
are you relocating kotlin
Yeah
Unless ofc
only add the relocations when you're releasing the plugin or something
Oh interesting let me try again
slimJar
what is module Main where??
don't see slimjar fixing that issue
🥲
and is my code correct?
Whouldnt handling relocations at runtime not run into this issue?
yes
🥳
it's quite hard to mess a hello world up lol
hey it said hi back to me
5 now 
It just generates some config files at compile
it should generate a file called HelloWorld or HelloWorld.exe
and no, running relocations at runtime still wouldn't fix the issue, unless you also have a hotswapagent hook
.hi is kinda like the equivalent of .class
can i delete those?
yes
why?
but they'll regen every time you build so
oh
also running relocations at runtime in general is a bad idea because that allows for definition conflicts to happen in the time between the plugin being loaded, and your slimjar shit running
and if a conflict can happen
it WILL happen in that time
um
that's a 100% guarantee (iirc, so maybe like 50% in reality)
how do i test my hello world
run it?
What?
open command prompt
.\HelloWorld.exe
yay it worked
yay

Reads the files bytes, uses asm for relocations and then defines the classes
ok i made a 30 line program
what is it
🥲
ah
Also I was actually asking what you meant as being the issue piggy? I did not understand what confict you meant
It would already be relocated by the time its loaded tho?
wha xD
it depends
It shouldnt
Oh I don't think that'd be an issue because the plugin classes would relocate at compile time and the libs at runtime (right Yugi?)
yea
why would plugin classes need to be relocated?
can someone send the spigot gradle stuff rq
he means the references
The imports
i cba to google
😦
maybe 🥲
lmao
as an alternative, slimjar also provides an isolated classloader option so you wont need relocations there
actually I'm not going to bother logically going through this when it can easily be experimentally tested
and I can't be bothered to test it either so ima just believe you
thanks lol
is there a way to run hs files without compiling?
there's ghci
Yes
I thought slimJar was a gradle plugin or something
me and Matt
lol
it includes a gradle plugin
yikes ok
i mean running a file
I was making a load of assumptions thinking it's some public plugin
didn't realise you guys were making it
that changes everything
lol
not really dkim, you could just do something like ```
ghc file.hs && ./file
pog it worked
idk what the batch equivalent would be
uhh
printCool = putStrLn 🙂
this is pretty much all i know about haskell without looking it up
ig
o
lol
i more meant the &&
ah maybe it does
wrong emoji
you know lots more than me
😎
i've got no fucking clue what that shit is
god speed time crunchring super cps bridging
pig spoof bad
so i found this in that eta repo 🤔
What
eta?
xD
not sure what they're doing with strs
definitely not nsfw
Wasnt there a post about this
nah he was asking for an eta on how long it'll take his potato to compile his 5 line haskell
and see if i can do it
im back to not knowing what to make
make a turing machine
Man… I work with some pretty ancient code and a lot of this code was written absolutely terribly (examples further below). There are a ton of shortened names that no one here even knows what they mean anymore but everyone is too scared to try to f...
There
u want a specific project idea or just some challenges?
bad
challenges 👀
make a lambda calculus interpretter
im too busy with making bedwars
state bad
to make a haskell project
DO IT
first thing that comes to mind is "print something 5 times with recursion, no repeating yourself allowed"
I CAnt
uhhhh is google allowed
Yes you can!
yes
as long as you can explain the code you're allowed to copy paste too
although ill fail
bm
yea?
first channege should probably just be taking input 🙂
oh good point
IO OI IO IO IO IO String
🥲
I wonder if we can wrap an IO inside an IO
learnyouahaskell to the rescue
IO IO?
So an actual IO (IO String)
🙂
bm gimme a few years :)
IO IO String i guess
dkim
yea?
uh
ok first challenge is to take user input and print it actually
I think the types actually require the brackets
second challenge is to get user input as an int and double it
i tihnk i can do that without google
not this though
Go for it
lol
ik
Then we'll talk
wait what
which is the first
ok first challenge is to take user input and print it actually
or recursion
take user input and print it
ok
Dont google
font ligatures
ye
sublime definitely has an option for them
🥲
what font do u want
didnt work?
how do i do thissss haiusjndkasd
the main function doesn't do anything lol
jetbrains mono ftw
lmao
it should be installed already
try return $ putStrLn "Test"
i see why it doesnt do anything, but not why it compiles
its embedded in intellij obviously but idk if ij actually installs it
I guess IO a matches a with IO String
Fira code medium 
Wait
i dont think in a normal file it would compile
oh maybe
yeah tested with an actual file and it definitely compiles
for some reason
Does the print one actually print
no
lmao
Useless, as all things should be
simon wasn't lying
🥲
Also how is "Fira" supposed to be pronounced? Fi like in Fire or would it be like Fee-ra 
im a fee ra guy
That's how i say it too
fear-ruh
Fi - Ra
i dont think the main function is special actually
The course I had mentioned specifically IO () for some reason
But then main = putStrLn "Test" shouldnt work
putStrLn returns IO () lol
interestingly hs main :: IO () main = readLn works but ```hs
main :: IO ()
main = return ""
and by "works" i mean takes input and then throws an exception
@half harness once you install fira code
"font_face": "Fira Code",
in sublime settings
😮
ligatures don't need explicit enabling iirc
help there are so many lisp languages
yes
there's like 4 commonly used ones
I thought lisp was a small subcategory of programming language
maybe 5
yeah
like clojure
just very old
and haskell
Closure
haskell 
is haskell not a lisp?
oh
scheme has a billion dialects
but
It could get close
yeah lol
my bad
chez scheme is my fav
fixed
there also MIT scheme
there's nothing stopping you putting parentheses everywhere lol
i was thinking:
- common lisp
- scheme
- racket
- clojure
- emacs lisp ?
emacs lisp yeah
no idea if people still use that
this is valid haskell
masin = (putStrLn (show (map (\x -> "HelloWorld") [1..10])))
well I use it for emacs config
its good
(print "Hello World")
``` clojure and haskell
15 minutes later
except in haskell that will print ""Hello World""
got bluescreened
lmao
:c
ah yeah whoops
Haskell isn't anywhere close to a lisp
haskell is cursed
🥲
🥲
sounds like a you problem
Ivory towers on display
lmao
i can't figure it out
what have u got so far
main = do
putStrLn "user input:"
putStrLn <- getLine
```this is what i have
i thought its <- getLine
<- is a little bit weird
you can't use it with everything, you have to give it a name
wdym
so ```hs
line <- getLine
putStrLn line
alternatively if you want a 1 liner, getLine >>= putStrLn
dewit
nope
are you using jb mono
so did you even install a font?
probably not
ffs
have you done anything I told you to
link?
lmao
google it
ok
install jetbrains mono u fuckin' nerd
no
either
jetbrrrrraaaiiiiinnnnssss
yeah pretty sure they look identical lol
theyre very similar yeah
Fira code is a little thicker
I think u mean thiccer
ok guys
without googling
tell me which is which
I use fira on the daily and I can't even tell
bottom is jetbrains
nah the top is jb i think
100% committing to this
oh my ffs
🥲
I'm going to kill u
nah jk lol bottom is jb top is fira
x <- actionruns the IO action, gets its result, and binds it to x
@half harness this is why you cant doputStrLn <- getLine.<-is sort of like making a variable with the result
bruh
u mind bro
d;methods CompletableFuture
java.util.concurrent.CompletableFuture#isDone
java.util.concurrent.CompletableFuture#newIncompleteFuture
java.util.concurrent.CompletableFuture#join
java.util.concurrent.CompletableFuture#completedStage
java.util.concurrent.CompletableFuture#completeOnTimeout
java.util.concurrent.CompletableFuture#getNumberOfDependents
java.util.concurrent.CompletableFuture#toString
java.util.concurrent.CompletableFuture#obtrudeException
java.util.concurrent.CompletableFuture#completedFuture
java.util.concurrent.CompletableFuture#obtrudeValue
java.util.concurrent.CompletableFuture#toCompletableFuture
java.util.concurrent.CompletableFuture#CompletableFuture
java.util.concurrent.CompletableFuture#failedStage
java.util.concurrent.CompletableFuture#get
java.util.concurrent.CompletableFuture#orTimeout```
u mind bri
what are you lookin gfor
for what
map?
apparently not
huh
d;completablefuture#apply
<U> CompletionStage<U> thenApply(Function fn)```
Returns a new CompletionStage that, when this stage completes normally, is executed with this stage's result as the argument to the supplied function.
This method is analogous to Optional.map and Stream.map.
See the CompletionStage documentation for rules covering exceptional completion.
the new CompletionStage
fn - the function to use to compute the value of the returned CompletionStage
I'm really confused rn, this hikari dependency is coming from somewhere, but I can not find where from,
show gradle
also run gradle clean before showing
also stop compiling intellij/jetbrains annotations
why not jetbrains lol?
lol
therefore they should be compileOnly
cursed
whats the font u use? fira something something
fira code
i forgot
ok so remember i said the IO monad is sort of like CompletableFuture? >>= and <- are quite similar to thenCompose
so hs do a <- getLine putStrLn a is just syntax sugar for ```hs
getLine >>= (\a -> putStrLn a)
fira code
wat
o
through package control
in java terms that's ```java
getLine().thenCompose(a -> putStrLn(a));
replying to this
oh
so a is the name of the "lambda parameter", which is why you can't pass it to a function
material theme dkim
and because we've got \a -> putStrLn a we can just simplify it to putStrLn, hence getLine >>= putStrLn
easiest way is to just drag a folder into sublime
and why r u coding java in sublime
configure kotlin
i did
configure kotlin
Piggy, it's not in my gradle, and none of the other dependencies shade it
did you clean gradle?
Yes
is it open source?
No
intellij is so annoying 😫
wanna send it to me anyway?
even eclipse doesn't do this
restart ij / reload gradle
Don't think I'm allowed
bro why is it that whenever i use kotlin dsl i find guides that only use groovy dsl
since kotlin dsl is less common
yeah but most guides have it nowadays
me
which?
looking up bukkit packages
oh
lol
also, I just found out that I can tell IJ to format with at minimum a single blank line between the class declaration and the first thing
e.g. ```kotlin
class MyClass {
private val x = 0
}
I have a very strange coding style
yes you do
i do same
every function must be separated by a blank line unless it's an override function that does nothing (e.g. ```kotlin
override fun foo() = Unit
override fun bar() = Unit
i do same
all stuff must use 4 space indentation
even with overrides
yeah it depends on the day with that one lol
there must be at least one blank line between property declarations and function declarations
e.g. ```kotlin
class MyClass {
private val foo = 0
fun bar() = foo
}
expression functions should be preferred anywhere you have a single statement you can fit within your set character limit
all my classess are 1 liners
that's the weird one
to save space
this is strange
lowers jar size 🌚
package net.yakclient.mixin.internal.methodadapter;import org.jetbrains.annotations.NotNull;public class PriorityMatcher<T extends MixinPatternMatcher> implements Comparable<PriorityMatcher<?>> {private final int priority;private final T pm;public PriorityMatcher(int priority, T pm) {this.priority = priority;this.pm = pm;}@Overridepublic int compareTo(@NotNull PriorityMatcher<?> o) { return this.priority - o.priority;}public T get() {return pm;}}
increases speed
#goodcode
lemme show you an example of a terribly terrible extension function I wrote
private fun buildRawArgumentsLiteral(
alias: String,
brigadierCommand: com.mojang.brigadier.Command<Sender>,
suggestionProvider: SuggestionProvider<Sender>
) = literal<Sender>(alias.toLowerCase(Locale.ENGLISH))
.then(argument<Sender, String>("arguments", greedyString())
.suggests(suggestionProvider)
.executes(brigadierCommand))
.executes(brigadierCommand)
.build()
that's an example of my coding style lol
private fun LiteralCommandNode<Sender>.buildRedirect(alias: String) =
literal<Sender>(alias.toLowerCase(Locale.ENGLISH))
.requires(requirement)
.forward(redirect, redirectModifier, isFork)
.executes(command)
.apply { children.forEach { then(it) } }
.build()
```and again
also, my "grouping" of properties makes 0 sense
https://paste.helpch.at/acoxupepod.cpp example of some... questionable programming practices
also, I've recently taken up the style of ```kotlin
private var foo = 0; private set
BM I swear if you say one thing about mutability
STATE BAD
"im not like other programmers🥺 💫 "
state bad
at the low level, you know your "fancy Haskell functional programming" turns into the same state and behaviour system and imperative logic as any other language right?
at the low level, you know your "fancy kotlin null safety" turns into the same pointers as any other language right?
also, void brister(mitten); that's not even correct syntax, let alone it being some sort of C or C-like syntax (cough Java cough)
It is correct
at the low level, you're executing electronic signals, you know that right?
it is valid C
there is no way that's valid C
It is
mitten is a struct somewhere else
there isnt one
mitten becomes void type I think
it's a definition
Doesn't matter, the function declaration doesn't need param names
There was a medium article about this
it would be valid in a header file
yeah I did
ik the issue
void brister(mitten) {
return;
}
```must be in the definition
Remove the body
not allowed Yugi
???
huh?
?
Function declarations and definitions are two different things
Show the whole code
#include <stdio.h>
#include <math.h>
struct mitten {
char* brister;
char* mitten;
};
void brister(mitten);
int main() {
return 0;
}

what
write an implementation as well maybe?
those includes are remnants of the code that was once here
#include <stdio.h>
#include <math.h>
struct mitten {
char* brister;
char* mitten;
};
void brister(mitten);
int main() {
return 0;
}
void brister(mitten m) {}
try that
I think you need to specify struct mitten or use typedef somewhere in the struct definition idk
is it bad having a class 600 lines long?
oh true
and a third of it being an enum
not according to notch
def
chestly
Wouldnt you need the typedef like fefo mentioned?
apparently not
dkim19375
lets 1v1
i dont think you need to write struct in a signature
Try removing the struct definition bm
1v1 what
Does it compile after that?
🥺
uh
🥺
not really
haha cps
also ur ign
doesn't seem to work for me
definitely compiles
aah
um
Which is what I initially said
makes sense
xD
wait what
alr
i'm totally not less than half of that
i totally dont have a CPS of 6
nope
lol
not at all
lol
imagine not getting above 50
sh
what-
@half harness im in
drag + triple/double click
literally impossible for human fingers to click that fast
what language dis
german ofc
German
German?
lol
probably uses cpp compiler
lol
whats your ign
probably lol
ill try
do they differ?
dkim19375
Or a different version rather
The name only declaration is not allowed in newer compilers
Like vlas
i assume it worked?
nah CMake is using GCC
is there party chat @humble silo
progress
Try testing yourself with gcc
man I really need to understand how this works
without clion
@half harness no idea, was just trying to find it
/pc
now i forgot how to link it lol
oh I gotta write a plugin in C now because you said that lol
also r u in na region?
write one in haskell
^^^
it's actually blessed
where's the code that powers this?
whats with the 2
Louisiana
-_-
without the 2 is the original one that just wrote to files lol
in that repo?

no way
it's a combination of all 3
that literally has 0 code in it
ur mum
surely there's more than that
u have no code in there
there is some
not much
the hardest bit was figuring out how to link all of the binaries together
@humble silo accept f and p request ;-;
oh god
eyy we're both vip
no u
huh?
ive got to copy the entire JNIEnv struct into a haskell data structure and make sure the bytes align properly
whats ew?
cause factions are ew
actually nvm no i dont
i agree
uh
guess who is installing racket (the lisp)?
Haskell should probably just return the changes to be made
purity
Also
Smack is showing its wonders again
OfflineMessageManager#getMessages() Guess what this does?
gets the messages
Get's the messages
False
classic
i guess it's easier to do most of the work in C and just import the functions
It returns an empty list, and you receive the messages in the normal message stream
Such an amazing library
🥶
As much as Id sit down for a week fixing this shit coz that would make my job of using this much easier, The guy who maintains this is too much work
Yugi ur purple gross
go bac to blue :(
ur gross
no u
🥲
@forest pecan i luv u uwu
😓
sweat
I know paper is a fork of spigot, and it's much better overall, but how about sponge, where do sponge belongs in this bukkit -> spigot -> paper fork battle, and how good is its performance?
It doesn't
Sponge is an entirely different mod loader
Sponge mods are pretty much "plugin-like" more than "mods", SpongeVanilla is a mod loader over the vanilla jar and SpongeForge is a mod loader that runs as a Forge mod
Bukkit Holds Water, Sponge absorbs it
Spigot pours water into Bukkit. Sponge then absorbs it. Then you squeeze the Sponge onto Fabric using a Waterfall and wipe the Forge. Finally, you use the Forge to make a TacoSpigot.
I'm hungry
Bukkit suck, sponge doesnt
Seems contrary
Imagine providing cool utils like sponge does
It's a joke Gaby
Im surprised bukkit even has that thing for maps
BEcause sponges suck...
I know, just saying xd
Your right, vanilla best
sad bardy noises
🤢
What is Competitive Programming: https://www.youtube.com/watch?v=ueNT-w7Oluw
I don't know how I won again, but I'll gladly accept it :)
Contest site: https://codingcompetitions.withgoogle.com/kickstart/round/000000000019ff43
Explanations video: https://youtu.be/jlWA73MDrC4
Website: https://williamlin.io/
Instagram: https://www.instagram.com/...
This guy’s good
Not as good as bm though 
