- The document discusses how Scala code is compiled to Java Virtual Machine (JVM) bytecodes. It begins with an introduction to Koichi Sakata, the presenter, and an overview that the session will look at JVM bytecodes for beginners.
- The presentation then asks if attendees know what happens when Scala code is compiled. It is explained that Scala code, like code from other JVM languages, is compiled to class files that contain JVM bytecodes.
- An example Java class file is opened in a binary editor to show the JVM bytecode format. It is explained that class files have a defined format with elements like magic number, version, and bytecode instructions.
Scala Refactoring for Fun and Profit (Japanese subtitles)Tomer Gabel
A talk given at Scala Matsuri 2016 in Tokyo, Japan.
New Scala practitioners often experience the uncomfortable feeling of "not quite getting it." If you've studied the syntax and written tests, maybe production code; if you're becoming comfortable with the language and libraries, but keep worrying that there's "a better way", or that your code isn't "idiomatic enough" - this session is for you.
By refactoring a real, live codebase, this talk will provide you with new tools and increased confidence. Between the provided examples and the ensuing discussion, you will walk away with a better feel for Scala and how to employ it in the real world.
Refactoring to Scala DSLs and LiftOff 2009 RecapDave Orme
An introductory presentation given to the Chicago Area Scala Enthusiasts (a) beginning with a recap of the Scala LiftOff unconference in Reston, VA, 2009, and (b) describing how to gradually migrate Scala code translated directly from Java into a DSL that facilitates readability and maintainability of client code. We then observe that this technique makes it possible to use Scala DSLs as a way to introduce Scala in a Java shop.
Scala Refactoring for Fun and Profit (Japanese subtitles)Tomer Gabel
A talk given at Scala Matsuri 2016 in Tokyo, Japan.
New Scala practitioners often experience the uncomfortable feeling of "not quite getting it." If you've studied the syntax and written tests, maybe production code; if you're becoming comfortable with the language and libraries, but keep worrying that there's "a better way", or that your code isn't "idiomatic enough" - this session is for you.
By refactoring a real, live codebase, this talk will provide you with new tools and increased confidence. Between the provided examples and the ensuing discussion, you will walk away with a better feel for Scala and how to employ it in the real world.
Refactoring to Scala DSLs and LiftOff 2009 RecapDave Orme
An introductory presentation given to the Chicago Area Scala Enthusiasts (a) beginning with a recap of the Scala LiftOff unconference in Reston, VA, 2009, and (b) describing how to gradually migrate Scala code translated directly from Java into a DSL that facilitates readability and maintainability of client code. We then observe that this technique makes it possible to use Scala DSLs as a way to introduce Scala in a Java shop.
Presented at BJUG, 6/12/2012 by Roger Brinkley
This talk is on 55 new features in Java 7 you (probably) didn't hear about in an ignite format of one per minute. No stopping, no going back....Questions, sure but only if time remains (otherwise save for later).
A presentation at Twitter's official developer conference, Chirp, about why we use the Scala programming language and how we build services in it. Provides a tour of a number of libraries and tools, both developed at Twitter and otherwise.
With its ninth version, the Java platform has shifted gear and introduced biyearly releases. This was followed by a license change where Oracle, the steward of Java, now publishes a commercial and a non-commercial release of the Java virtual machine while other vendors took more space to promote their alternative builds of the OpenJDK. And in another flood of news, the Java EE specification was terminated and resolved into the Jakarta EE namespace.
A lot has been happening in the traditionally conservative Java ecosystem, to say the least, and many users are wondering if they still can rely on the platform. This talk gives an overview of the Java ecosystem, summarizes the changes that have been, that to expect and why the evolution of the platform is good news to the community.
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...Christopher Frohoff
Object deserialization is an established but poorly understood attack vector in applications that is disturbingly prevalent across many languages, platforms, formats, and libraries.
In January 2015 at AppSec California, Chris Frohoff and Gabe Lawrence gave a talk on this topic, covering deserialization vulnerabilities across platforms, the many forms they take, and places they can be found. It covered, among other things, somewhat novel techniques using classes in commonly used libraries for attacking Java serialization that were subsequently released in the form of the ysoserial tool. Few people noticed until late 2015, when other researchers used these techniques/tools to exploit well known products such as Bamboo, WebLogic, WebSphere, ApacheMQ, and Jenkins, and then services such as PayPal. Since then, the topic has gotten some long-overdue attention and great work is being done by many to improve our understanding and developer awareness on the subject.
This talk will review the details of Java deserialization exploit techniques and mitigations, as well as report on some of the recent (and future) activity in this area.
http://www.meetup.com/Open-Web-Application-Security-Project-San-Diego-OWASP-SD/events/226242635/
Presentation from JVMLS 2015
One bottleneck in the Nashorn JavaScript engine is startup time. Nashorn, as it works currently in Java 8, JITs everything to Java bytecode, accruing overhead in code generation and class installation. Nashorn in Java 9, can in unfortunate cases, increase this compilation workload significantly, as the new optimistic type system, which has greatly increased steady state performance, requires more code invalidation on warmup. Based on our optimistic type compilation framework, which contains all the mechanisms for quick code replacement and on stack replacement on the bytecode level, I will present the new execution architecture we are developing. It will minimizes compile time intelligently, while maintaining or possible even increasing code performance, due to extra profiling and execution frequency information being passed to the JIT. I will also talk about what the future will bring in terms of other dynamic languages on the Nashorn engine, partial method compilation of hot paths and other intriguing possibilities that our new execution model opens up.
JVM Mechanics: When Does the JVM JIT & Deoptimize?Doug Hawkins
HotSpot promises to do the "right" thing for us by identifying our hot code and compiling "just-in-time", but how does HotSpot make those decisions?
This presentation aims to detail how HotSpot makes those decisions and how it corrects its mistakes through a series of demos that you run yourself.
Inside the JVM - Follow the white rabbit! / Breizh JUGSylvain Wallez
Presentation given at the Rennes (FR) Java User Group in Feb 2019.
How do we go from your Java code to the CPU assembly that actually runs it? Using high level constructs has made us forget what happens behind the scenes, which is however key to write efficient code.
Starting from a few lines of Java, we explore the different layers that constribute to running your code: JRE, byte code, structure of the OpenJDK virtual machine, HotSpot, intrinsic methds, benchmarking.
An introductory presentation to these low-level concerns, based on the practical use case of optimizing 6 lines of code, so that hopefully you to want to explore further!
Presented at BJUG, 6/12/2012 by Roger Brinkley
This talk is on 55 new features in Java 7 you (probably) didn't hear about in an ignite format of one per minute. No stopping, no going back....Questions, sure but only if time remains (otherwise save for later).
A presentation at Twitter's official developer conference, Chirp, about why we use the Scala programming language and how we build services in it. Provides a tour of a number of libraries and tools, both developed at Twitter and otherwise.
With its ninth version, the Java platform has shifted gear and introduced biyearly releases. This was followed by a license change where Oracle, the steward of Java, now publishes a commercial and a non-commercial release of the Java virtual machine while other vendors took more space to promote their alternative builds of the OpenJDK. And in another flood of news, the Java EE specification was terminated and resolved into the Jakarta EE namespace.
A lot has been happening in the traditionally conservative Java ecosystem, to say the least, and many users are wondering if they still can rely on the platform. This talk gives an overview of the Java ecosystem, summarizes the changes that have been, that to expect and why the evolution of the platform is good news to the community.
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...Christopher Frohoff
Object deserialization is an established but poorly understood attack vector in applications that is disturbingly prevalent across many languages, platforms, formats, and libraries.
In January 2015 at AppSec California, Chris Frohoff and Gabe Lawrence gave a talk on this topic, covering deserialization vulnerabilities across platforms, the many forms they take, and places they can be found. It covered, among other things, somewhat novel techniques using classes in commonly used libraries for attacking Java serialization that were subsequently released in the form of the ysoserial tool. Few people noticed until late 2015, when other researchers used these techniques/tools to exploit well known products such as Bamboo, WebLogic, WebSphere, ApacheMQ, and Jenkins, and then services such as PayPal. Since then, the topic has gotten some long-overdue attention and great work is being done by many to improve our understanding and developer awareness on the subject.
This talk will review the details of Java deserialization exploit techniques and mitigations, as well as report on some of the recent (and future) activity in this area.
http://www.meetup.com/Open-Web-Application-Security-Project-San-Diego-OWASP-SD/events/226242635/
Presentation from JVMLS 2015
One bottleneck in the Nashorn JavaScript engine is startup time. Nashorn, as it works currently in Java 8, JITs everything to Java bytecode, accruing overhead in code generation and class installation. Nashorn in Java 9, can in unfortunate cases, increase this compilation workload significantly, as the new optimistic type system, which has greatly increased steady state performance, requires more code invalidation on warmup. Based on our optimistic type compilation framework, which contains all the mechanisms for quick code replacement and on stack replacement on the bytecode level, I will present the new execution architecture we are developing. It will minimizes compile time intelligently, while maintaining or possible even increasing code performance, due to extra profiling and execution frequency information being passed to the JIT. I will also talk about what the future will bring in terms of other dynamic languages on the Nashorn engine, partial method compilation of hot paths and other intriguing possibilities that our new execution model opens up.
JVM Mechanics: When Does the JVM JIT & Deoptimize?Doug Hawkins
HotSpot promises to do the "right" thing for us by identifying our hot code and compiling "just-in-time", but how does HotSpot make those decisions?
This presentation aims to detail how HotSpot makes those decisions and how it corrects its mistakes through a series of demos that you run yourself.
Inside the JVM - Follow the white rabbit! / Breizh JUGSylvain Wallez
Presentation given at the Rennes (FR) Java User Group in Feb 2019.
How do we go from your Java code to the CPU assembly that actually runs it? Using high level constructs has made us forget what happens behind the scenes, which is however key to write efficient code.
Starting from a few lines of Java, we explore the different layers that constribute to running your code: JRE, byte code, structure of the OpenJDK virtual machine, HotSpot, intrinsic methds, benchmarking.
An introductory presentation to these low-level concerns, based on the practical use case of optimizing 6 lines of code, so that hopefully you to want to explore further!
No dark magic - Byte code engineering in the real worldtcurdt
ften byte code engineering is perceived as "black magic" and considered too low level. This session will not bore you with all the details of the JVM specification but provide you with a practical overview of how this byte code "swizzling" can be used in the real world instead. Several projects have sucessfully leveraged this technique to achieve some amazing things (e.g. AOP). This session will go through some of these examples and try to outline the differences between the two major libraries (BCEL and ASM). Maybe your next project can then benefit from some of this "magic".
How do we go from your Java code to the CPU assembly that actually runs it? Using high level constructs has made us forget what happens behind the scenes, which is however key to write efficient code.
Starting from a few lines of Java, we explore the different layers that constribute to running your code: JRE, byte code, structure of the OpenJDK virtual machine, HotSpot, intrinsic methds, benchmarking.
An introductory presentation to these low-level concerns, based on the practical use case of optimizing 6 lines of code, so that hopefully you to want to explore further!
Presentation given at the Toulouse (FR) Java User Group.
Video (in french) at https://www.youtube.com/watch?v=rB0ElXf05nU
Slideshow with animations at https://docs.google.com/presentation/d/1eIcROfLpdTU2_Z_IKiMG-AwqZGZgbN1Bs2E0nGShpbk/pub?start=true&loop=false&delayms=60000
Fast as C: How to Write Really Terrible JavaCharles Nutter
For years we’ve been told that the JVM’s amazing optimizers can take your running code and make it “fast” or “as fast as C++” or “as fast as C”…or sometimes “faster than C”. And yet we don’t often see this happen in practice, due in large part to (good and bad) development patterns that have taken hold in the Java world.
In this talk, we’ll explore the main reasons why Java code rarely runs as fast as C or C++ and how you can write really bad Java code that the JVM will do a better job of optimizing. We’ll take some popular microbenchmarks and burn them to the ground, monitoring JIT logs and assembly dumps along the way.
Understanding bytecode and what bytecode is likely to be generated by a Java compiler helps the Java programmer in the same way that knowledge of assembler helps the C or C++ programmer. Java bytecode is the form of instructions that Java virtual machine executes. This knowledge is crucial when debugging and doing performance and memory usage tuning. The presenter will share his knowledge on what bytecode means for your platform and how to create compiler while using some awesome tools.
Many students reach out to me asking for project ideas they can do as a summer project for learning. Here is an interesting project idea - implement your own java disassembler (and expand it to a VM later).
Similar to How Scala code is expressed in the JVM (20)
2019/11/23 JJUG CCC 2019 Fall
「多言語対応の仮想マシンGraalVMが照らす未来」のセッションスライドです。
---
オラクル社からGraalVMというOSSプロダクトが発表され、話題を呼んでいます。GraalVMは、Javaで書かれたJITコンパイラ、Graalを搭載しています。さらに、言語実装用のフレームワークTruffleを提供しており、そのフレームワークを使って実装したJavaScriptやRuby、Pythonなど他の言語を、GraalVMは高いパフォーマンス実行できます。GraalVMを多言語対応の仮想マシンと呼ぶ理由です。加えて、それらすべての言語間で、相互に呼び出しができます。また、ネイティブイメージを作成し、JVMを利用せずにアプリケーションを実行できます。MicronautやQuarkus、Helidonといった最新のフレームワークが、この機能を利用して起動時間の短縮を図っています。ともすれば、GraalVMとは、ネイティブイメージを作成するためのものである、というイメージを持たれている方もいるかもしれません。しかし、GraalVMが持つパワーは、それだけではありません。このセッションでは、上述のGraalVMの概要の説明やデモに加え、単にGraalVMの使い方に留まらず、GraalVMによって今後何が実現されるのか、世界でのGraalVMの活用事例、Java on iOSとの関連、といったことお話しします。
Introduction to GraalVM and Native ImageKoichi Sakata
2019/08/23 JVM Language Summit Report Event at KanJava JUG
https://kanjava.connpass.com/event/139770/
This slide is about GraalVM, especially SubstrateVM that is able to generate native images.
Bytecode Manipulation with a Java Agent and Byte BuddyKoichi Sakata
Oracle Code One 2018, Birds of a Feather (BOF) Session
Bytecode Manipulation with a Java Agent and Byte Buddy
[BOF5314]
Tuesday, Oct 23, 07:30 PM - 08:15 PM | Moscone West - Room 2005
Have you ever manipulated Java bytecode? There are several bytecode engineering libraries, and Byte Buddy is one of the easiest, and you can also use Java agents, which are related to the Instrumentation class in the java.lang.instrument API. Instrumentation is the addition of bytecode to methods. Because the changes are purely additive, a Java agent does not modify application state or behavior. With Byte Buddy and a Java agent, we can add behaviors to existing classes. This session explains what Java agents and the instrumentation API are, introduces Byte Buddy, and presents sample code that uses a Java agent and Byte Buddy to modify behavior. The presentation will be useful for those who want to start manipulating Java bytecode with Byte Buddy.
2018 Jul 25th LINE Developer Meetup #41 in Fukuoka
Session Slide in English / セッションスライドです。
Graal in GraalVM - A New JIT Compiler
オラクル社からGraalVMというものが発表され、話題を呼んでいます。GraalVMはHotSpot VM上に新しいJITコンパイラGraalと言語実装用フレームワーク/ASTインタプリタであるTruffle、さらにネイティブイメージ作成機能とその実行に使われるSubstrateVMを併せ持ったものです。すでにTruffleを使用したJavaScriptやRuby、R、Pythonの実装も提供されており、これらの言語とJavaはコードから相互に呼び出しができます。このセッションではGraalVMを概観したあと、JITコンパイラGraalにとくに注力して解説します。GraalとTruffleはOracle Labsとヨハネス・ケプラー大学で共同研究されており、多くの論文が発表されています。HotSpotのJITコンパイラとパフォーマンスや構造などを比較しつつ、GraalのJITコンパイルのテクニックについてもいくつか触れます。とにかく、私がGraalをとても好きなのです。デモも実施しつつ、Graalのすごさを伝えられればと考えています。
2018/03/20(火)に開催した関西Javaエンジニアの会(関ジャバ) '18 3月度イベントでのスライドです。
・From Java EE to Jakarta EE
InfoQ.comの翻訳担当でJava EE関連の記事をかなりの数翻訳しました。MicroProfileのこと、EE4Jのこと、Java EEの名称変更のことなどを話します。
“Purikura” culturein Japan andour web application architectureKoichi Sakata
DevoxxUS Quickie Session on 2017/03/22
Our web application contains more than one billion files of young Japanese women's face image. The photos taken with Photo Booth and are sent to our application through the internet. We use Java, Spring Framework and Oracle RAC as well as MogileFS, is open source distributed filesystem for storing images, . We had not expected that our application had so many images when we started developing. I will explain our architecture, mainly forcused on use cases of MogileFS and troubles we've met. And I also will introduce Japanese "kawaii" culture. "kawaii" includes "lovable", "cute", or "adorable" and the quality of cuteness in the context of Japanese culture. Many Japanese young women take photos with Photo Booth to become more "kawaii".
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
1. Koichi
Sakata (阪田 浩一)
@jyukutyo
How
Scala
code
is
expressed
in
the
JVM
-‐
ScalaMatsuri
2016
-‐
2. 関ジャバです!
2
@jyukutyo
produced three Java framework books
one was translated into Korean
JUG Leader (KansaiJUG)
blog:Fight the Future
http://jyukutyo.hatenablog.com/
FURYU CORPORATION
age: 36
Koichi Sakata (阪田 浩一)
フリューの阪田です 関ジャバの会長です
14. ClassFile
{
u4
magic;
u2
minor_version;
u2
major_version;
u2
constant_pool_count;
cp_info
constant_pool[constant_pool_count-‐1];
u2
access_flags;
u2
this_class;
u2
super_class;
u2
interfaces_count;
u2
interfaces[interfaces_count];
...
-‐-‐
u1
represents
one-‐byte
quantity,
Hexadecimal
2
digit.
15. ...
u2
fields_count;
field_info
fields[fields_count];
u2
methods_count;
method_info
methods[methods_count];
u2
attributes_count;
attribute_info
attributes[attributes_count];
}
-‐-‐
u1
represents
one-‐byte
quantity,
Hexadecimal
2
digit.
u1が1バイト
16進数では2桁になります
42. public
static
void
main(java.lang.String[]);
0:
getstatic
#16
//
Field
HelloWorld$.
MODULE$:LHelloWorld$;
3:
aload_0
4:
invokevirtual
#18
//
Method
HelloWorld$.main:
([Ljava/lang/String;)V
7:
return
-‐-‐
4:
in
Java
HelloWorld$.MODULE$.main(arg);
43. public
final
class
HelloWorld$
-‐-‐
omit
Constant
pool
public
static
{};
0:
new
#2
//
class
HelloWorld$
3:
invokespecial
#12
//
Method
"<init>":()V
6:
return
-‐-‐
<init>
means
constructor
46. The
following
samples
are
quoted
from
tutorials
in
Scala
official
site
http://docs.scala-‐lang.org/tutorials/
これ以降で使用するサンプルは
Scalaの公式サイトのチュートリアルです
55. abstract
class
Term
case
class
Var(name:
String)
extends
Term
case
class
Fun(arg:
String,
body:
Term)
extends
Term
case
class
App(f:
Term,
v:
Term)
extends
Term
58. public
class
App
extends
Term
implements
s.Product,s.Serializable
public
static
s.Option<scala.Tuple2<Term,
Term>>
unapply(App);
public
static
App
apply(Term,
Term);
public
...
tupled();
public
...
curried();
public
Term
f();
public
Term
v();
public
App
copy(Term,
Term);
public
j.l.String
productPrefix();
public
boolean
equals(j.l.Object);
...
59. public
final
class
App$
extends
s.r.AbstractFunction2<Term,
Term,
App>
implements
scala.Serializable
public
App
apply(Term,
Term);
0:
new
#23
//
class
App
3:
dup
4:
aload_1
5:
aload_2
6:
invokespecial
#26
//
Method
App."<init>":(LTerm;LTerm;)V
9:
areturn
60. Fun
and
Var
looks
the
same
as
App
FunとVarも同様の内容です
61. Scala
compiler
generates
many
functions
from
few
snippets
of
code
Scalaコンパイラは少ないコードから
多くの機能を生成しています
63. object
MatchTest2
extends
App
{
def
matchTest(x:
Any):
Any
=
x
match
{
case
1
=>
"one"
case
"two"
=>
2
case
y:
Int
=>
"scala.Int"
}
println(matchTest("two"))
}
88. § Summary
§ JVM
is
excellent!
§ class
file
has
a
format
§ javap
is
useful
to
understand
Scala
at
the
bytecode
level
Try
typing
"javap"
after
you
compile
Scala
code