Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Java Interoperating with Golang V2
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
swt02026
May 28, 2019
Programming
54
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Java Interoperating with Golang V2
GraalVM
JNI
JDK 13 Panama( new!!!)
swt02026
May 28, 2019
More Decks by swt02026
See All by swt02026
Interoperating Golang with Swift
swt02026
0
60
Java Interoperating with Golang
swt02026
0
70
Other Decks in Programming
See All in Programming
AmebaブログはKMPから卒業します
kmars0605
0
190
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
150
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.5k
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
1
430
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
390
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
190
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
260
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.9k
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
32k
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
1k
Featured
See All Featured
Game over? The fight for quality and originality in the time of robots
wayneb77
1
300
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
30 Presentation Tips
portentint
PRO
1
430
Fireside Chat
paigeccino
43
4.1k
Agile that works and the tools we love
rasmusluckow
331
22k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
630
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
The Limits of Empathy - UXLibs8
cassininazir
2
720
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
270
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.4k
Transcript
在 Java 使用 Go 函式Ver.2 使用JDK 13 Panama Colab: http://bit.ly/2Ex4clY
簡報: http://bit.ly/2HXFYST
已知的解決方案 • Java Native Interface • GraalVM Native-Image • GraalVM
sulong + llgo • JDK 13 Panama
Java Native Interface Java Go C Header X 2 Library
jar Library 2
Java Native Interface 原理 • 撰寫 C 程式,將 JNI 與
cgo 產生 Library 包裝 優點 • 相關教學資源多 • Android 也適用 缺點 • 需要寫 C 、Java、Go • 產生的中介檔多
GraalVM Native-Image Java Go Header Library ELF or Mach-O .class
GraalVM Native-Image 原理 • 把 Java 程式編譯成 Native Binary,與 cgo
Library 進行 Linkage 缺點 • 編譯時間長,產生的執行檔很肥 • JVM 的功能無法完全取代 • Java 程式需要提供編譯器相關資訊 • 目前只提供 Java 8 的語法 • Android 尚未支援 優點 • 不用 JVM 就能執行 • 只需要寫 Java 、Go
GraalVM sulong + llgo Java Go LLVM bitCode jar
GraalVM sulong + llgo 原理 • 用 llgo 將 Go
程式編譯成 LLVM bitcode • 使用 GraalVM sulong 執行 LLVM bitcode 缺點 • llgo 已經五年沒維護,沒安裝成功.... • 可能會遇到 bitcode 版本相容問題 • Java 程式中要處理 bitcode Lifecycle • 編譯時期 Go 與 Java 產生檔案沒有直接相依,不易偵錯
JDK 13 Panama Java Go Library Header jar
JDK 13 Panama 原理 • 使用 jextract 工具,將 Header 與
Library 相關資訊包裝成 Java Package 優點 • Java 程式只需 Import Package 就可以使用 • 未來會取代 Java Native Interface,Android 不確定 缺點 • 目前文件很少 • 產生的 Java Package 資訊不透明,decompile 才能了解如何使用
None
我們都用GO直接重寫,沒在跨語言der
參考資料 https://hg.openjdk.java.net/panama/dev/raw-file/c359a9e944de/doc/panama_forei gn.html https://jdk.java.net/panama/