|
CRIP EATIN BREAD posted:make sure to add -Xjsr305=strict to your compiler config if you haven't. this will make sure that annotation based nullability annotations will cause compilation errors instead of warnings Yeah, that was one of the first things I did. A little boilerplate-y, but at least I only have to add it to build.gradle.kts once and never have to think about it again (until I make a new project).
|
![]() |
|
![]()
|
# ? Feb 8, 2025 23:50 |
|
I thought kotlin basically was java
|
![]() |
|
scala is the same. you have to do a little more work to make your scala libs work in java but in practice you rarely need to do this and if you’re doing it a lot then write the libs in java instead. DONT THREAD ON ME fucked around with this message at 19:40 on Jun 6, 2019 |
![]() |
|
sorta is but it has a lot of happy things to make your life easier. plus it doesnt HAVE to compile to the JVM (it can compile to javascript if that's your thing) or native machine code. it has some neat things like coroutines that generate the statemachine for you so if you have something like: code:
also it does the non-blocking poo poo, so you get pretty easy concurrency and whatnot if that's your thing without having to deal with futures. spring 5.2 is adding support for coroutines in controller methods so you can do poo poo like: code:
|
![]() |
|
DONT THREAD ON ME posted:insofar as anything on the jbm is java i guess jaba birtual machime
|
![]() |
|
Finster Dexter posted:I thought kotlin basically was java it’s java without semicolons or checked exceptions. some people like these changes, others don’t I think the second one also probably means it’s never safe to call kotlin from java, idk
|
![]() |
|
the kotlin compiled javascript code isnt bad either, it trims out poo poo you dont need and seems to work pretty damned well. i dont have any need for javascript in my work (inshallah), but i was curious to see what it did and it's pretty smart about mapping kotlin collections to basic javscript stuff and doesn't bring in a massive supporting runtime. you cant use any of the java stuff (java.time, etc) but you do get the entire kotlin stdlib and they even map assertions and whatnot so you can run your tests in both the jvm and js without rewriting poo poo.
|
![]() |
|
Soricidus posted:it’s java without semicolons or checked exceptions. some people like these changes, others don’t its perfectly safe to call kotlin from java because it just means that you have to catch the exceptions. in the jvm the kotlin exceptions are just subclasses of RuntimeException, you don't have to worry about it. all the kotlin properties get mapped internally to java style getter/setters (getX, setY), there's very little you can't do when calling kotlin from java.
|
![]() |
|
CRIP EATIN BREAD posted:its perfectly safe to call kotlin from java because it just means that you have to catch the exceptions. in the jvm the kotlin exceptions are just subclasses of RuntimeException, you don't have to worry about it. I’m thinking of the case where your java calls some kotlin code, that in turn calls some java code that throws a checked exception, that the kotlin code doesn’t catch. what happens then?
|
![]() |
|
if you are worried about interop like that then you can be explicit for java:code:
|
![]() |
|
what’s rare about this use case? it can happen trivially if anyone ever writes a library in kotlin. - person a writes useful library a in java - person b writes useful library b in kotlin, depends on library a - I write a program in java, that depends on library b like sure it’ll be fine if person b thought of java interop and knew that library a throws checked exceptions and added the right annotations as so on, but what happens if they didn’t? (you might reasonably argue that this whole problem just proves that checked exceptions were a mistake, but that’s beside the point)
|
![]() |
|
scala has the same issue and in practice it's not really a problem. most scala libraries are either scala-y wrappers around java, or so functional/scala oriented that no sane java person would want to use them. in the few cases where there are libraries written in scala that need to be java friendly, you just have separate java/scala apis that call the lower level code.
|
![]() |
|
trip report: redleader was right (and shaggar ) using option recompile halved query time because a new plan is better than no plan (or a hosed up one from doing param redeclares) and the variable nature of the inputs means there's no practical loss of performance form losing plan caching. Whether it will fix the prod issues.... Eh who cares I learned something. Thanks yospos, thospos.
|
![]() |
|
kotlin sounds cool and good, especially the part about concurrency, as the baked-in concurrency is one of the few things I actually like about Go, and it sounds like kotlin has something similar.
|
![]() |
|
the worst data format i've had to work with recently is json-ld, which is the result of the semantic web people getting their greasy hands on jsoncode:
|
![]() |
|
animist posted:the worst data format i've had to work with recently is json-ld, which is the result of the semantic web people getting their greasy hands on json rdf rules but encoding it in json is not great because it makes people think it should be human readable/writeable
|
![]() |
|
animist posted:the worst data format i've had to work with recently is json-ld, which is the result of the semantic web people getting their greasy hands on json no.
|
![]() |
|
the talent deficit posted:rdf rules but encoding it in json is not great because it makes people think it should be human readable/writeable it should be S-expressions as McCarthy and Lenat intended drat it
|
![]() |
|
eschaton posted:McCartney and Lennon
|
![]() |
|
animist posted:they're pushing this to the blockchain people for some godforsaken reason so at least it will never be used by anyone who matters
|
![]() |
|
animist posted:the worst data format i've had to work with recently is json-ld, which is the result of the semantic web people getting their greasy hands on json gently caress this
|
![]() |
|
I’m http://schema.org/longitude iykwim
|
![]() |
|
i like how a json "schema" doesnt even indicate whether it should be decimal or degrees, minutes and seconds. but of course it's that way because nobody who uses json has half a brain or deserves to be taken seriously because web dev is for idiots
|
![]() |
|
animist posted:the worst data format i've had to work with recently is json-ld, which is the result of the semantic web people getting their greasy hands on json I like how they aren't HTTPS urls. I'm "http://schema.org/description" quote:EXAMPLE OF A DESCRIPTION ![]() I like how every time I try to "Preview Reply" for this message CloudFlare makes me prove I'm not a robot beep boop oh boy, I sure do love identifying store fronts
|
![]() |
pseudorandom posted:I like how they aren't HTTPS urls. There's plenty to complain about, but this doesn't really matter, they're all just identifiers, not actual resources. We're using json+ld in some bits of our application and it's been OK, except that there's some aggravating corner cases/bugs in the jena de/serializer.
|
|
![]() |
|
it’s sad Cycorp shut down their OpenCyc ontology server, it put this scheme.org poo poo to shame maybe I need to set up OpenCyc 4.0 on a server somewhere just to let people reference its grown up ontology
|
![]() |
|
I like how people complain about C++ tooling and at first you're like "maybe they have a point, it is kinda poo poo" and then you hear them talk about maven, gradle, whatever and you're just like "nah, I'm good"
|
![]() |
|
Falcorum posted:I like how people complain about C++ tooling and at first you're like "maybe they have a point, it is kinda poo poo" and then you hear them talk about maven, gradle, whatever and you're just like "nah, I'm good" this is stockhom syndrome talking, until you've tried it you have no idea what the other ones are actually like - anecdotes or complaints aren't indicative. gradle and sbt are poo poo though but luckily there are good ones out there!
|
![]() |
|
the biggest problem with c++ tooling is c++
|
![]() |
|
i hear maven is good yo
|
![]() |
|
it really is, unless you’re actually allergic to xml, or have extremely specific and unusual requirements
|
![]() |
|
imo gradle is fine if you're not doing anything crazy where crazy is anything beyond dependency management
|
![]() |
|
gradle is fine if you don't mind a build too that takes a minute just to decide what to build every time
|
![]() |
|
Blinkz0rz posted:imo gradle is fine if you're not doing anything crazy using a limited subset of gradle is fine in the same sense that having a beer and then getting in the drivers seat is fine. technically it might be legal and statistically speaking you’ll probably get home safely but it’s still really loving stupid and wrong (and most of the people who claim to do it regularly it are lying about where they draw the line)
|
![]() |
|
at best gradle can maybe be almost as good as maven in extremely basic scenarios. idk why you would ever choose to use gradle
|
![]() |
|
Soricidus posted:using a limited subset of gradle is fine in the same sense that having a beer and then getting in the drivers seat is fine. technically it might be legal and statistically speaking you’ll probably get home safely but it’s still really loving stupid and wrong (and most of the people who claim to do it regularly it are lying about where they draw the line) ![]()
|
![]() |
|
gradle? more like grundle
|
![]() |
|
gradle always feels like it's on the edge of becoming usable but somehow never is for instance, they never supported importing maven boms until recently but then immediately introduced 4 subtly different ways of specifying a version override they now also use kotlin scripts which is cool and gives you autocomplete but kinda is not completely supported by all tooling meanwhile maven just uses xml which already has autocomplete and ide support for years
|
![]() |
|
maven is very good
|
![]() |
|
![]()
|
# ? Feb 8, 2025 23:50 |
|
The kotlin gradle stuff still does everything through the same gradle api, so choosing kotlin or groovy is mostly just an aesthetic choice.
|
![]() |