jason810496 commented on code in PR #65956:
URL: https://github.com/apache/airflow/pull/65956#discussion_r3158667503


##########
java-sdk/sdk/src/main/kotlin/org/apache/airflow/sdk/execution/Client.kt:
##########


Review Comment:
   I had the same question when I start this project, here's the comparison 
between Kotlin and Java that I ask Claude before.
   
   Perhaps naming the SDK and corresponding provider as `jvm` might be more 
accurate?
   
   ---
   
   <h3 class="text-text-100 mt-3 -mb-1 text-[1.125rem] font-bold">🐍 → ☕ Your 
Mental Map: Python vs Java vs Kotlin</h3>
   <h4 class="text-text-100 mt-2 -mb-1 text-base font-bold">What Are They?</h4>
   <div class="overflow-x-auto w-full px-2 mb-6">
     | Python | Java | Kotlin
   -- | -- | -- | --
   Type System | Dynamic (types checked at runtime) | Static (types checked at 
compile time) | Static (but smarter — often inferred)
   Compilation | Interpreted | Compiled → JVM bytecode | Compiled → JVM 
bytecode (or JS/Native)
   Verbosity | Low | High | Medium (Java's "fix")
   Performance | Slower | Fast | Fast (same as Java)
   Null Safety | None can crash anywhere | null can crash anywhere 
(NullPointerException) | Null safety built into the type system
   Age | 1991 | 1995 | 2011 (by JetBrains)
   
   </div>
   <hr class="border-border-200 border-t-0.5 my-3 mx-1.5">
   <h3 class="text-text-100 mt-3 -mb-1 text-[1.125rem] font-bold">🤝 Why Are 
Java &amp; Kotlin Used Together?</h3>
   <p class="font-claude-response-body break-words whitespace-normal 
leading-[1.7]">This is the key insight: <strong>Kotlin compiles to the same JVM 
bytecode as Java.</strong> They are 100% interoperable.</p>
   <div role="group" aria-label="Code" tabindex="0" class="relative group/copy 
bg-bg-000/50 border-0.5 border-border-400 rounded-lg focus:outline-none 
focus-visible:ring-2 focus-visible:ring-accent-100"><div class="sticky 
opacity-0 group-hover/copy:opacity-100 group-focus-within/copy:opacity-100 
top-2 py-2 h-12 w-0 float-right"><div class="absolute right-0 h-8 px-2 
items-center inline-flex z-10"><button class="inline-flex
     items-center
     justify-center
     relative
     isolate
     shrink-0
     can-focus
     select-none
     disabled:pointer-events-none
     disabled:opacity-50
     disabled:shadow-none
     disabled:drop-shadow-none border-transparent
             transition
             font-base
             duration-300
             ease-[cubic-bezier(0.165,0.85,0.45,1)] h-8 w-8 rounded-md 
backdrop-blur-md _fill_10ocf_9 _ghost_10ocf_96" type="button" aria-label="Copy 
to clipboard" data-state="closed"><div class="relative"><div 
class="transition-all opacity-100 scale-100" style="width: 20px; height: 20px; 
display: flex; align-items: center; justify-content: center;"><svg width="20" 
height="20" viewBox="0 0 20 20" fill="currentColor" 
xmlns="http://www.w3.org/2000/svg"; class="transition-all opacity-100 scale-100" 
aria-hidden="true" style="flex-shrink: 0;"><path d="M12.5 3A1.5 1.5 0 0 1 14 
4.5V6h1.5A1.5 1.5 0 0 1 17 7.5v8a1.5 1.5 0 0 1-1.5 1.5h-8A1.5 1.5 0 0 1 6 
15.5V14H4.5A1.5 1.5 0 0 1 3 12.5v-8A1.5 1.5 0 0 1 4.5 3zm1.5 9.5a1.5 1.5 0 0 
1-1.5 1.5H7v1.5a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-8a.5.5 0 0 0-.5-.5H14zM4.5 
4a.5.5 0 0 0-.5.5v8a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-8a.5.5 0 0 
0-.5-.5z"></path></svg></div><div class="absolute inset-0 flex items-center 
justify-center"><div class="transition-all opaci
 ty-0 scale-50" style="width: 20px; height: 20px; display: flex; align-items: 
center; justify-content: center;"><svg width="20" height="20" viewBox="0 0 20 
20" fill="currentColor" xmlns="http://www.w3.org/2000/svg"; 
class="transition-all opacity-0 scale-50" aria-hidden="true" 
style="flex-shrink: 0;"><path d="M15.188 5.11a.5.5 0 0 1 .752.626l-.056.084-7.5 
9a.5.5 0 0 1-.738.033l-3.5-3.5-.064-.078a.501.501 0 0 1 .693-.693l.078.064 
3.113 3.113 
7.15-8.58z"></path></svg></div></div></div></button></div></div><div 
class="overflow-x-auto"><pre class="code-block__code !my-0 !rounded-lg !text-sm 
!leading-relaxed p-3.5" style="color: rgb(234, 236, 240); background: 
transparent; font-family: var(--font-mono);"><code style="color: rgb(234, 236, 
240); background: transparent; font-family: var(--font-mono); white-space: 
pre-wrap;"><span><span>Your Kotlin Code (.kt)  ──┐
   </span></span><span>                           ├──► JVM Bytecode (.class) 
──► Runs on JVM
   </span><span>Your Java Code   (.java) ──┘</span></code></pre></div></div>
   <p class="font-claude-response-body break-words whitespace-normal 
leading-[1.7]"><strong>Real-world reasons they coexist:</strong></p>
   <ol class="[li_&amp;]:mb-0 [li_&amp;]:mt-1 [li_&amp;]:gap-1 
[&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-decimal 
flex flex-col gap-1 pl-8 mb-3">
   <li class="whitespace-normal break-words pl-2"><strong>Legacy</strong> — 
Millions of lines of Java exist in production. Companies can't rewrite 
everything overnight.</li>
   <li class="whitespace-normal break-words pl-2"><strong>Gradual 
migration</strong> — Teams adopt Kotlin file-by-file, calling Java from Kotlin 
and vice versa.</li>
   <li class="whitespace-normal break-words pl-2"><strong>Android</strong> — 
Google made Kotlin the official Android language in 2017, but all Android 
libraries were written in Java.</li>
   <li class="whitespace-normal break-words pl-2"><strong>Libraries</strong> — 
The entire Java ecosystem (Spring, Hibernate, etc.) is available to Kotlin for 
free.</li></ol>



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to