-
Notifications
You must be signed in to change notification settings - Fork 0
lessons
Miguel Gamboa edited this page Feb 27, 2024
·
17 revisions
Lessons:
- 26-02-2024 - Lesson 01 - Introduction and Modern VMs, e.g. JVM, Node
- 28-02-2024 - Lesson 02 - Metadata, Classpath and Java Type System introduction
- Bibliography and Lecturing methodology: github and slack.
- Tools:
javac
,javap
,kotlinc
, JDK 17 andgradle
. - Program outline in 3 parts:
- Java Type System and Reflection;
- Metaprogramming and Performance;
- Lazy processing.
- Project in 3 parts according to program outline.
- Managed Runtime or Execution Environment or informally virtual machine (VM) or runtime.
-
Execution Environment includes:
- Compiler,
- Programming languages,
- Standard libraries,
- Dependency manager (e.g. gradle, maven)
- Central Repository (e.g. Maven Central Repository, Nuget, NPM, etc)
- Examples of languages targeting JVM: Java, kotlin, Scala, Clojure.
- Examples of languages targeting Node: JavaScript, TypeScript, Kotlin.
- JVM runs
.class
files with bytecode - JVM translates bytecode to machine code (e.g. IA-32, AMD64, etc depending of the CPU)
- In Javascript ecosystem modules are deployed in source code i.e. Javascript.
- Distinguish between Programming Language
<versus>
VM
- One file
.class
for each class definition -
Metadata:
- data that provides information about other data
- In a
.class
the metadata provides a description and structure of a Type.
- Using javap -c -p AppKt.class to inspect metadata and bytecode definition of class
AppKt
- CLASSPATH
- e.g. -cp . - local folder
- e.g. -cp '.:~/JetBrains/IntelliJIdea2022.2/plugins/Kotlin/lib/*'
- (for windows use ; rather than :)
- Type System - Set of rules and principles that specify how types are defined and behave.
- Two kinds of types: Primitive and Reference types.
- Classes have Members
- Members may be: Fields or Methods.
- There are NO properties in Java Type System.
- Using
javap -p StudentPerson.class
to inspect metadata - The fully qualified name of a class includes its package name.
-
Constructor is a method with the name
<init>
returning void.