Info

Login

Channels

APIs

Credits

  • cheeser
  • ernimril
  • joed
  • kinabalu
  • lunk
  • ojacobson
  • r0bby
  • ThaDon
  • ricky_clarkson
  • topriddy

« 2021-02-22

2021-02-23

2021-02-24 »

Nick Message Date
wordsToLiveBy [wordsToLiveBy!~wordsToLi@unaffiliated/wordstoliveby] has joined #kotlin [01:16]
Ladicek [Ladicek!~lthon@109.164.63.38] has joined #kotlin [02:14]
Matthijs [Matthijs!~quassel@unaffiliated/matthijs] has joined #kotlin [02:15]
sxmx [sxmx!~sxmx@sxmx.openbsd.amsterdam] has joined #kotlin [02:46]
sxmx [sxmx!~sxmx@sxmx.openbsd.amsterdam] has joined #kotlin [03:11]
joydeep_taiga <squirrel "run into a funny issue. i want t"> create a java wrapper around it lol [03:17]
joydeep_taiga <squirrel "isn't my library"> ask the dev nicely [03:18]
joydeep_taiga <ricky_clarkson "Is there a common pattern for an"> you mark it internal and annotate with @PublicApi. Is the helper polymorphic? Provided by the [03:20]
joydeep_taiga > <@freenode_ricky_clarkson:matrix.org> Is there a common pattern for an inline reified extension function that needs a helper method? It seems I need to make the helper public, which is understandable but can I discourage/prevent calls to it other than with @Deprecated? [03:20]
joydeep_taiga * you mark it internal and annotate with @PublicApi. Is the helper polymorphic? What provides it? [03:20]
argo [argo!~argo@unaffiliated/argo] has joined #kotlin [04:02]
wordsToLiveBy [wordsToLiveBy!~wordsToLi@unaffiliated/wordstoliveby] has joined #kotlin [04:12]
DTZUZU [DTZUZU!~DTZUZU@205.ip-149-56-132.net] has joined #kotlin [04:26]
silverbaq [silverbaq!~silverbaq@062066150157.static.telenor.dk] has joined #kotlin [07:20]
silverbaq [silverbaq!~silverbaq@062066150157.static.telenor.dk] has joined #kotlin [07:26]
silverbaq [silverbaq!~silverbaq@062066150157.static.telenor.dk] has joined #kotlin [07:42]
RedNifre How do functions inside functions work? Does the JVM bytecode support it, or are they just syntactic sugar and get inlined? [08:07]
noirx [noirx!~noirx@85.148.33.73] has joined #kotlin [08:48]
noirx hi [08:48]
sxmx hello noirx [08:49]
noirx can someone suggest me a goog kotlin beginner free pdf book please [08:49]
noirx good [08:50]
dreamreal what makes a book "good"? [08:50]
noirx teach u good [08:50]
noirx u can learn good [08:51]
dreamreal um [08:51]
dreamreal https://riptutorial.com/Download/kotlin.pdf is free, according to google and the site itself, no idea if it's "good" or not [08:51]
dreamreal "u can learn good" isn't a good sign [08:51]
noirx ok i ll check it thanks dreams [08:52]
snalty [snalty!~Shhh@81.141.22.107] has joined #kotlin [08:57]
RedNifre Superman can learn you good. The Kotlin book might learn you well. [08:57]
silverbaq [silverbaq!~silverbaq@062066150157.static.telenor.dk] has joined #kotlin [09:14]
joydeep_taiga <RedNifre "How do functions inside function"> it generates a class iirc [09:42]
cheeser RedNifre: those methods are actually generated on the enclosing class and then delegated to: https://javap.yawk.at/#AvCJbd/procyon [10:19]
cheeser it creates an anonymous inner class to hold the method and invokes against that. [10:20]
cheeser if bytecode reading isn't your thing, i can break down what you're seeing there. [10:20]
bjonnh[m] RedNifre: sign me in for the super(wo)man academy [10:28]
bjonnh[m] wow that procyon online thing is super useful [10:29]
bjonnh[m] thanks cheeser [10:29]
cheeser yep [10:30]
phaleth [phaleth!~phaleth@unaffiliated/phaleth] has joined #kotlin [11:29]
Techcable [Techcable!~Techcable@ip70-190-28-14.ph.ph.cox.net] has joined #kotlin [11:55]
RedNifre Hm, what's the paste limit here? [12:22]
RedNifre Well, okay, here's the thing, is this code good Kotlin style and are these inner functions worth it, just to make the while loop more readable?: https://pastebin.com/pxUdnaHP [12:25]
RedNifre That's the piece that prompted me to think about inner functions. [12:26]
RedNifre It's also a piece of code that would be called a lot quickly on an android phone, so it seems like inner functions are not worth it. (Why can't I mark them as inline? That would make them zero cost in that case) [12:31]
cheeser i like it actually. makes the code semantically readable and i only need to see what thingIsTooLarge() does if I care. [12:37]
squirrel i like this. the performance cost would probably be negligible [12:37]
cheeser makes it cosnumable in smaller pieces. [12:37]
cheeser squirrel: no more of a hit than having non-nested functions. [12:37]
squirrel this says inlined nested functions can be actually slower https://discuss.kotlinlang.org/t/nested-inline-functions-any-negative-impacts/16961/2 \_(?)_/ [12:39]
squirrel squirrel's title: "Nested Inline Functions - Any Negative Impacts? - #2 by darksnake - Support - Kotlin Discussions" [12:39]
cheeser those aren't inlined. they're just nested. [12:44]
Techcable_ [Techcable_!~Techcable@ip70-190-28-14.ph.ph.cox.net] has joined #kotlin [12:47]
silverbaq [silverbaq!~silverbaq@062066150157.static.telenor.dk] has joined #kotlin [12:53]
silverbaq [silverbaq!~silverbaq@062066150157.static.telenor.dk] has joined #kotlin [12:53]
silverbaq [silverbaq!~silverbaq@062066150157.static.telenor.dk] has joined #kotlin [12:55]
halvors [halvors!~Thunderbi@ti0071a400-4628.bb.online.no] has joined #kotlin [12:56]
orbyt_v7 [orbyt_v7!~textual@172.92.4.78] has joined #kotlin [12:59]
squirrel the linked comment is about inlined nested functions [01:00]
cheeser yes. and RedNifre's example doesn't use inline functions. [01:02]
cheeser and until a profiler says they're (too) slow, i wouldn't worry about it. [01:02]
squirrel well they were asking whether or not nested functions are inlined and whether it's "worth it" to use nested functions in code that's called "a lot quickly" [01:05]
cheeser \_(?)_/ [01:08]
cheeser it's a premature concern at best [01:08]
zutat [zutat!5d83136f@unaffiliated/zutat] has joined #kotlin [01:37]
argo [argo!~argo@unaffiliated/argo] has joined #kotlin [02:52]
ricky_clarkson joydeep_taiga: The helper is a simple function that takes a Class<T>. I'm providing it in the same file the extension method is in. [03:49]
ricky_clarkson The helper needs some package-private stuff from the Java code the extension function extends, so I don't believe inlining the helper into the inline function works [03:50]
ricky_clarkson as then callers won't be able to use it as their bytecode would be calling another package's private stuff. [03:51]
bjonnh[m] also the jvm may optimize things in ways you can't rally predict just looking at it like that. so profiling, with a real benchmarking harness ideally) is best [03:55]
jdlee [jdlee!~quassel@unaffiliated/littlezoper] has joined #kotlin [04:08]
orbyt_ [orbyt_!~orbyt@172.92.4.78] has joined #kotlin [04:51]
joydeep_taiga <ricky_clarkson "Taiga Joydeep: The helper is a s"> Make the method @PublicApi internal fun ... [05:09]
joydeep_taiga <bjonnh[m] "also the jvm may optimize things"> ( [05:09]
joydeep_taiga * --Make the method @PublicApi internal fun ...-- [05:10]
joydeep_taiga * ~~Make the method @PublicApi internal fun ...~~ [05:10]
cheeser don't paste here [05:11]
joydeep_taiga * Make the method @PublicApi internal fun ... [05:11]
joydeep_taiga <cheeser "don't paste here"> Who pasted? [05:12]
joydeep_taiga Oh [05:12]
joydeep_taiga This is bridged to IRC isn't it [05:12]
joydeep_taiga Sorry, i guess replies show up as pasting the original content [05:12]
cheeser i dunno but it's an awful lot of noise [05:12]
joydeep_taiga Sorry [05:13]
JorgenV [JorgenV!~Jorgen@201.165.106.39] has joined #kotlin [05:36]
JorgenV Hi [05:36]
JorgenV So I am new at Android Development, and Kotlin was highly suggested [05:36]
JorgenV but my question is, can I use both Java and Kotlin at the same time? in the same project? [05:37]
JorgenV Can I call a Java method from a Kotlin method? and vice versa? [05:37]
Techcable [Techcable!~Techcable@ip70-190-28-14.ph.ph.cox.net] has joined #kotlin [05:41]
squirrel yes to all questions [05:42]
JorgenV ) thank you [05:44]
cheeser [cheeser!~cheeser@redhat/cheeser] has joined #kotlin [05:48]
ricky_clarkson JorgenV: You can find Java from Kotlin and Kotlin from Java documentation on the main kotlinlang site. [06:49]
ricky_clarkson joydeep_taiga: Are you using this channel through discord or something (no idea if that's a thing)? [06:50]
RedNifre Inlined nested functions being slower makes no sense to me, unless I'm missunderstanding what inlining means or if the comment doesn't apply to functions that are only used once. [06:59]
RedNifre But thanks for the insights, I'll use nested functions more frequently for naming complex pieces of code then. [06:59]
FuzzyBottom [FuzzyBottom!~FuzzyBott@d207-216-62-240.bchsia.telus.net] has joined #kotlin [07:00]
FuzzyBottom This is something I am wondering about with whether or not I should learn coding. I am lousy at math, and on codewars, it seems that even level 7 involves a lot of math equations. Minus game programming, will this be an issue for someone like me? Thanks... [07:02]
FuzzyBottom A better question might be, should I look into learning web development over proper coding if the math would be an issue (HTML, CSS etc)? [07:09]
RedNifre I'm not sure, I think you still need to be somewhat good at logical thinking to be good at programming. I also think that this can be trained. [07:15]
RedNifre What do you mean by math? Juggling quarternions to render 3D graphics, or avoiding out of bounds exceptions? [07:16]
FuzzyBottom The logical thinking is not an issue. I have been into networking and the hardware side of computers for 27 years. I am thinking more along the lines of equations that the average person would look at and have their brain turn off. [07:17]
FuzzyBottom https://www.codewars.com/kata/562f91ff6a8b77dfe900006e [07:18]
FuzzyBottom FuzzyBottom's title: "Going to the cinema | Codewars" [07:18]
FuzzyBottom here is an example. It's needing to know things that even after seeing the answer, I was needing to ask this question. [07:19]
ricky_clarkson FuzzyBottom: Programming doesn't involve a lot of maths unless you're writing code to do naturally mathematical things. [07:30]
ricky_clarkson Game programming can be fairly mathematical, depending on the engine you're using. Same for machine learning. [07:31]
ricky_clarkson most of it is logic, reasoning, not specifically numbers. [07:31]
ChrisLane [ChrisLane!~irc@cpc119494-heme14-2-0-cust126.9-1.cable.virginm.net] has joined #kotlin [07:33]
FuzzyBottom ricky: Okay, I just seem quite lost working at the codewars challenges when so many of them seem to be math based. I do appreciate the input. [07:35]
lankanmon [lankanmon!~LKNnet@cpeb4fbe4e331bd-cm64777d632380.cpe.net.cable.rogers.com] has joined #kotlin [07:52]
halvors [halvors!~Thunderbi@ti0071a400-4628.bb.online.no] has joined #kotlin [08:57]
orbyt_ [orbyt_!~orbyt@172.92.4.78] has joined #kotlin [11:07]
Renari [Renari!~Renari@64.67.31.239.res-cmts.bgr.ptd.net] has joined #kotlin [11:32]
w0x12ef [w0x12ef!~textual@114.246.35.141] has joined #kotlin [11:32]