SlideShare a Scribd company logo
GoLightly
A Go library for building Virtual Machines


            Eleanor McHugh
Go
a new language
statically-typed and compiled
object-oriented but no classes
garbage collected
concurrency via communication (CSP)
type polymorphism via interfaces
a new way of working

 the safety of a static type system
 the feel of a dynamic runtime
 the performance of a compiled language
Virtual Machines
from inspiration...

computation
serialisation
communication
...to perspiration
simulation v. emulation
instruction set design
bytecodes
memory abstraction
operation dispatch
GoLightly
principles
interface driven delegation
architecture agnostic
inspired by hardware techniques
decoupled components
scaling through specialisation
caveat

references current dev branch
fundamental changes from github
still evolving
next release due for Strange Loop
interfaces
type Executable interface {    type Comparable interface {
   Execute(p Processor)           Identical(v Value) bool
}                                 Compare(v Value) int
                               }
type Processor interface {
   Reset()                     type Value interface {
   Step()                         fmt.Stringer
   Jump(a Address)                Comparable
   Call(a Address)                Nil() Value
   Return()                       IsNil() bool
   Load(program Program)       }
   Run()
   Execute()                   type Program []Executable
   Sleep(n int64)
   Halt(n int)
   IsActive() bool
}
instructions

obey the Executable interface
expressed as separate types
no assumptions about semantics
not tied to a bytecode representation
flow control
type NoOp struct {}                      type Call Address
func (n *NoOp) String() string {         func (c Call) String() string {
   return "NOOP"                            return Sprint("CALL", Address(c))
}                                        }
func (n *NoOp) Execute(p Processor) {}   func (c Call) Execute(p Processor) {
                                            p.Call(Address(c))
type Halt struct {}                      }
func (h *Halt) String() string {
   return "HALT"                         type Return struct {}
}                                        func (r Return) String() string {
func (h *Halt) Execute(p Processor) {       return "RET"
   p.Halt(PROGRAM_TERMINATED)            }
}                                        func (r Return) Execute(p Processor) {
                                            p.Return()
type Jump Address                        }
func (j Jump) String() string {
   return Sprint("JMP", Address(j))
}
func (j Jump) Execute(p Processor) {
   p.Jump(Address(j))
}
bytecode
type ByteCode []int                          case 5:          / JMPZ n
                                                               /                  case 10:      / POP r
                                                                                                 /
func (b *ByteCode) String() string {             PC++                                 PC++
    return "BYTECODE"                            if C == 0 {                          R[b[PC]] = DS.Pop()
}                                                      PC++                       case 11:      / LOAD r, v
                                                                                                 /
func (b *ByteCode) Execute(p Processor) {              PC += b[PC] - 1                PC++
    var PC, C, W int                             } else {                             W = b[PC]
    var R [2]int                                       PC++                           PC++
    CS := new(vector.IntVector)                  }                                    R[W] = b[PC]
    DS := new(vector.IntVector)              case 6:          / JMPNZ n
                                                               /                  case 12:      / ADD r1, r2
                                                                                                 /
    for p.Active() {                             PC++                                 PC++
         switch b[PC] {                          if C != 0 {                          W = b[PC]
         case 0:        / NOOP
                         /                             PC++                           PC++
         case 1:        / NSLEEP n
                         /                             PC += b[PC] - 1                R[b[PC]] += R[W]
              PC++                               } else {                         default:
              p.Sleep(int64(b[PC]))                    PC++                           p.Halt(ILLEGAL_INSTRUCTION)
         case 2:        / SLEEP n
                         /                       }                                }
              PC++                           case 7:          / CALL n
                                                               /              }
              p.Sleep(int64(b[PC]) << 32)        PC++                     }
         case 3:        / HALT
                         /                       CS.Push(PC)
              p.Halt(USER_HALT)                  PC = b[PC]
              return                         case 8: / RET
                                                      /
         case 4:        / JMP n
                         /                       PC = CS.Pop
              PC++                           case 9: / PUSH r
                                                      /
              PC += b[PC] - 1                    PC++
                                                 DS.Push(R[b[PC]])
processors
typical Turing machines
support flexible dispatch
not tied to a given instruction set
memory model agnostic
ripe for specialisation
a scalar processor
type SProc struct {                 func (s *SProc) Sleep(i int64) {   func (s *SProc) Call(a Address){
    Running bool                        syscall.Sleep(i)                   PC := s.PC
    PC        int                   }                                      s.PC = int(a)
    R         IntBuffer                                                    for s.IsActive() {
    F         FloatBuffer           func (s *SProc) Halt(n int) {               s.Execute()
    DS        vector.IntVector          s.Running = false                       s.Step()
    Program []Executable            }                                      }
}                                                                          s.PC = PC
                                    func (s *SProc) IsActive() bool{   }
func (s *SProc) Run() {                 return s.Running && s.PC <
    s.Running = true                    len(s.Program)                 func (s *SProc) Return() {
    s.Call(0)                       }                                      s.PC = len(s.Program)
}                                                                      }
                                    func (s *SProc) Reset() {
func (s *SProc) Step() {                s.R.ClearAll()
    s.PC++                              s.PC = 0
}                                   }

func (s *SProc) Jump(a Address) {   func (s *SProc) Load(program
    s.PC += int(a)                  Program) {
}                                       s.Reset()
                                        s.Program = program
func (s *SProc) Execute() {         }
    s.Program[s.PC].Execute(s)
}
memory
based on allocated Values
aggregate as ValueStores
require boxing/unboxing
buffers for specific types
buffers are also ValueStores
benefits
encourages simple designs
many different VMs per executable
can run in separate goroutines
easily duplicated and serialised
split across processes or hosts
the future
single dispatch for vector operations
per vasive threading
runtime code rewriting
speculative loading
JIT compilation
find out more

http://github.com/feyeleanor/GoLightly
http://golightly.wikidot.com
t witter://#golightly

More Related Content

What's hot

Function
FunctionFunction
Function
venkatme83
 
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
Muhammad Ulhaque
 
To Infinity & Beyond: Protocols & sequences in Node - Part 2
To Infinity & Beyond: Protocols & sequences in Node - Part 2To Infinity & Beyond: Protocols & sequences in Node - Part 2
To Infinity & Beyond: Protocols & sequences in Node - Part 2Bahul Neel Upadhyaya
 
Rcpp11
Rcpp11Rcpp11
Python 如何執行
Python 如何執行Python 如何執行
Python 如何執行
kao kuo-tung
 
C++totural file
C++totural fileC++totural file
C++totural filehalaisumit
 
Introduction to go
Introduction to goIntroduction to go
Introduction to go
Jaehue Jang
 
Beauty and Power of Go
Beauty and Power of GoBeauty and Power of Go
Beauty and Power of Go
Frank Müller
 
Golang iran - tutorial go programming language - Preliminary
Golang iran - tutorial  go programming language - PreliminaryGolang iran - tutorial  go programming language - Preliminary
Golang iran - tutorial go programming language - Preliminary
go-lang
 
Bristol 2009 q1_wright_steve
Bristol 2009 q1_wright_steveBristol 2009 q1_wright_steve
Bristol 2009 q1_wright_steveObsidian Software
 
Maintainable go
Maintainable goMaintainable go
Maintainable go
Yu-Shuan Hsieh
 
Hacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 AutumnHacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 Autumn
Moriyoshi Koizumi
 
MeCC: Memory Comparison-based Code Clone Detector
MeCC: Memory Comparison-based Code Clone DetectorMeCC: Memory Comparison-based Code Clone Detector
MeCC: Memory Comparison-based Code Clone Detector
영범 정
 
Turbo basic commands
Turbo basic commandsTurbo basic commands
Turbo basic commandsjulviapretty
 
Gor Nishanov, C++ Coroutines – a negative overhead abstraction
Gor Nishanov,  C++ Coroutines – a negative overhead abstractionGor Nishanov,  C++ Coroutines – a negative overhead abstraction
Gor Nishanov, C++ Coroutines – a negative overhead abstraction
Sergey Platonov
 

What's hot (20)

Function
FunctionFunction
Function
 
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
 
C++ tutorial
C++ tutorialC++ tutorial
C++ tutorial
 
To Infinity & Beyond: Protocols & sequences in Node - Part 2
To Infinity & Beyond: Protocols & sequences in Node - Part 2To Infinity & Beyond: Protocols & sequences in Node - Part 2
To Infinity & Beyond: Protocols & sequences in Node - Part 2
 
Rcpp11
Rcpp11Rcpp11
Rcpp11
 
Python 如何執行
Python 如何執行Python 如何執行
Python 如何執行
 
C++totural file
C++totural fileC++totural file
C++totural file
 
Introduction to go
Introduction to goIntroduction to go
Introduction to go
 
OpenMP
OpenMPOpenMP
OpenMP
 
Beauty and Power of Go
Beauty and Power of GoBeauty and Power of Go
Beauty and Power of Go
 
Golang iran - tutorial go programming language - Preliminary
Golang iran - tutorial  go programming language - PreliminaryGolang iran - tutorial  go programming language - Preliminary
Golang iran - tutorial go programming language - Preliminary
 
Bristol 2009 q1_wright_steve
Bristol 2009 q1_wright_steveBristol 2009 q1_wright_steve
Bristol 2009 q1_wright_steve
 
Faster Python, FOSDEM
Faster Python, FOSDEMFaster Python, FOSDEM
Faster Python, FOSDEM
 
C++ aptitude
C++ aptitudeC++ aptitude
C++ aptitude
 
tokyotalk
tokyotalktokyotalk
tokyotalk
 
Maintainable go
Maintainable goMaintainable go
Maintainable go
 
Hacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 AutumnHacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 Autumn
 
MeCC: Memory Comparison-based Code Clone Detector
MeCC: Memory Comparison-based Code Clone DetectorMeCC: Memory Comparison-based Code Clone Detector
MeCC: Memory Comparison-based Code Clone Detector
 
Turbo basic commands
Turbo basic commandsTurbo basic commands
Turbo basic commands
 
Gor Nishanov, C++ Coroutines – a negative overhead abstraction
Gor Nishanov,  C++ Coroutines – a negative overhead abstractionGor Nishanov,  C++ Coroutines – a negative overhead abstraction
Gor Nishanov, C++ Coroutines – a negative overhead abstraction
 

Viewers also liked

Ordinanza di ingiunzione nei confronti di Google inc. 18 dicembre 2013
Ordinanza di ingiunzione nei confronti di Google inc. 18 dicembre 2013Ordinanza di ingiunzione nei confronti di Google inc. 18 dicembre 2013
Ordinanza di ingiunzione nei confronti di Google inc. 18 dicembre 2013
Filippo Bernardi
 
Lighting analysis LIBRARY ashutosh aniruddh
Lighting analysis LIBRARY ashutosh aniruddhLighting analysis LIBRARY ashutosh aniruddh
Lighting analysis LIBRARY ashutosh aniruddh
Aniruddh Jain
 
Career As A Librarian Pp
Career As A Librarian PpCareer As A Librarian Pp
Career As A Librarian Ppflowersb3896
 
Zur Dissertation von Nathalie Mertes
Zur Dissertation von Nathalie MertesZur Dissertation von Nathalie Mertes
Zur Dissertation von Nathalie MertesGuenter K. Schlamp
 
2025 Libraries
2025 Libraries2025 Libraries
2025 Libraries
dherman101
 

Viewers also liked (6)

Ordinanza di ingiunzione nei confronti di Google inc. 18 dicembre 2013
Ordinanza di ingiunzione nei confronti di Google inc. 18 dicembre 2013Ordinanza di ingiunzione nei confronti di Google inc. 18 dicembre 2013
Ordinanza di ingiunzione nei confronti di Google inc. 18 dicembre 2013
 
Lighting analysis LIBRARY ashutosh aniruddh
Lighting analysis LIBRARY ashutosh aniruddhLighting analysis LIBRARY ashutosh aniruddh
Lighting analysis LIBRARY ashutosh aniruddh
 
Planning a school library
Planning a school library Planning a school library
Planning a school library
 
Career As A Librarian Pp
Career As A Librarian PpCareer As A Librarian Pp
Career As A Librarian Pp
 
Zur Dissertation von Nathalie Mertes
Zur Dissertation von Nathalie MertesZur Dissertation von Nathalie Mertes
Zur Dissertation von Nathalie Mertes
 
2025 Libraries
2025 Libraries2025 Libraries
2025 Libraries
 

Similar to GoLightly: A Go Library For Building Virtual Machines

ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1Little Tukta Lita
 
4Developers 2018: The turbulent road to byte-addressable storage support at t...
4Developers 2018: The turbulent road to byte-addressable storage support at t...4Developers 2018: The turbulent road to byte-addressable storage support at t...
4Developers 2018: The turbulent road to byte-addressable storage support at t...
PROIDEA
 
Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and C
Eleanor McHugh
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2goMoriyoshi Koizumi
 
개발 과정 최적화 하기 내부툴로 더욱 강력한 개발하기 Stephen kennedy _(11시40분_103호)
개발 과정 최적화 하기 내부툴로 더욱 강력한 개발하기 Stephen kennedy _(11시40분_103호)개발 과정 최적화 하기 내부툴로 더욱 강력한 개발하기 Stephen kennedy _(11시40분_103호)
개발 과정 최적화 하기 내부툴로 더욱 강력한 개발하기 Stephen kennedy _(11시40분_103호)changehee lee
 
ANSimport java.util.Scanner; class Bina_node { Bina_node .pdf
ANSimport java.util.Scanner; class Bina_node { Bina_node .pdfANSimport java.util.Scanner; class Bina_node { Bina_node .pdf
ANSimport java.util.Scanner; class Bina_node { Bina_node .pdf
anukoolelectronics
 
CorePy High-Productivity CellB.E. Programming
CorePy High-Productivity CellB.E. ProgrammingCorePy High-Productivity CellB.E. Programming
CorePy High-Productivity CellB.E. Programming
Slide_N
 
Go ahead, make my day
Go ahead, make my dayGo ahead, make my day
Go ahead, make my day
Tor Ivry
 
81818088 isc-class-xii-computer-science-project-java-programs
81818088 isc-class-xii-computer-science-project-java-programs81818088 isc-class-xii-computer-science-project-java-programs
81818088 isc-class-xii-computer-science-project-java-programsAbhishek Jena
 
MeCC: Memory Comparison based Clone Detector
MeCC: Memory Comparison based Clone DetectorMeCC: Memory Comparison based Clone Detector
MeCC: Memory Comparison based Clone Detector
Sung Kim
 
Implementing Virtual Machines in Go & C
Implementing Virtual Machines in Go & CImplementing Virtual Machines in Go & C
Implementing Virtual Machines in Go & C
Eleanor McHugh
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_paper
vandna123
 
Computer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paperComputer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paperDeepak Singh
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
ESUG
 
Imugi: Compiler made with Python
Imugi: Compiler made with PythonImugi: Compiler made with Python
Imugi: Compiler made with Python
Han Lee
 
C++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorC++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorJussi Pohjolainen
 
Declarative Type System Specification with Statix
Declarative Type System Specification with StatixDeclarative Type System Specification with Statix
Declarative Type System Specification with Statix
Eelco Visser
 
Vladymyr Bahrii Understanding polymorphism in C++ 16.11.17
Vladymyr Bahrii Understanding polymorphism in C++ 16.11.17Vladymyr Bahrii Understanding polymorphism in C++ 16.11.17
Vladymyr Bahrii Understanding polymorphism in C++ 16.11.17
LogeekNightUkraine
 

Similar to GoLightly: A Go Library For Building Virtual Machines (20)

ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1
 
4Developers 2018: The turbulent road to byte-addressable storage support at t...
4Developers 2018: The turbulent road to byte-addressable storage support at t...4Developers 2018: The turbulent road to byte-addressable storage support at t...
4Developers 2018: The turbulent road to byte-addressable storage support at t...
 
Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and C
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2go
 
Stack
StackStack
Stack
 
개발 과정 최적화 하기 내부툴로 더욱 강력한 개발하기 Stephen kennedy _(11시40분_103호)
개발 과정 최적화 하기 내부툴로 더욱 강력한 개발하기 Stephen kennedy _(11시40분_103호)개발 과정 최적화 하기 내부툴로 더욱 강력한 개발하기 Stephen kennedy _(11시40분_103호)
개발 과정 최적화 하기 내부툴로 더욱 강력한 개발하기 Stephen kennedy _(11시40분_103호)
 
ANSimport java.util.Scanner; class Bina_node { Bina_node .pdf
ANSimport java.util.Scanner; class Bina_node { Bina_node .pdfANSimport java.util.Scanner; class Bina_node { Bina_node .pdf
ANSimport java.util.Scanner; class Bina_node { Bina_node .pdf
 
CorePy High-Productivity CellB.E. Programming
CorePy High-Productivity CellB.E. ProgrammingCorePy High-Productivity CellB.E. Programming
CorePy High-Productivity CellB.E. Programming
 
Go ahead, make my day
Go ahead, make my dayGo ahead, make my day
Go ahead, make my day
 
81818088 isc-class-xii-computer-science-project-java-programs
81818088 isc-class-xii-computer-science-project-java-programs81818088 isc-class-xii-computer-science-project-java-programs
81818088 isc-class-xii-computer-science-project-java-programs
 
MeCC: Memory Comparison based Clone Detector
MeCC: Memory Comparison based Clone DetectorMeCC: Memory Comparison based Clone Detector
MeCC: Memory Comparison based Clone Detector
 
Struct examples
Struct examplesStruct examples
Struct examples
 
Implementing Virtual Machines in Go & C
Implementing Virtual Machines in Go & CImplementing Virtual Machines in Go & C
Implementing Virtual Machines in Go & C
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_paper
 
Computer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paperComputer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paper
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Imugi: Compiler made with Python
Imugi: Compiler made with PythonImugi: Compiler made with Python
Imugi: Compiler made with Python
 
C++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorC++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operator
 
Declarative Type System Specification with Statix
Declarative Type System Specification with StatixDeclarative Type System Specification with Statix
Declarative Type System Specification with Statix
 
Vladymyr Bahrii Understanding polymorphism in C++ 16.11.17
Vladymyr Bahrii Understanding polymorphism in C++ 16.11.17Vladymyr Bahrii Understanding polymorphism in C++ 16.11.17
Vladymyr Bahrii Understanding polymorphism in C++ 16.11.17
 

More from Eleanor McHugh

[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf
Eleanor McHugh
 
Generics, Reflection, and Efficient Collections
Generics, Reflection, and Efficient CollectionsGenerics, Reflection, and Efficient Collections
Generics, Reflection, and Efficient Collections
Eleanor McHugh
 
The Relevance of Liveness - Biometrics and Data Integrity
The Relevance of Liveness - Biometrics and Data IntegrityThe Relevance of Liveness - Biometrics and Data Integrity
The Relevance of Liveness - Biometrics and Data Integrity
Eleanor McHugh
 
The Browser Environment - A Systems Programmer's Perspective [sinatra edition]
The Browser Environment - A Systems Programmer's Perspective [sinatra edition]The Browser Environment - A Systems Programmer's Perspective [sinatra edition]
The Browser Environment - A Systems Programmer's Perspective [sinatra edition]
Eleanor McHugh
 
The Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's PerspectiveThe Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's Perspective
Eleanor McHugh
 
Go for the paranoid network programmer, 3rd edition
Go for the paranoid network programmer, 3rd editionGo for the paranoid network programmer, 3rd edition
Go for the paranoid network programmer, 3rd edition
Eleanor McHugh
 
An introduction to functional programming with Go [redux]
An introduction to functional programming with Go [redux]An introduction to functional programming with Go [redux]
An introduction to functional programming with Go [redux]
Eleanor McHugh
 
An introduction to functional programming with go
An introduction to functional programming with goAn introduction to functional programming with go
An introduction to functional programming with go
Eleanor McHugh
 
Implementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 reduxImplementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 redux
Eleanor McHugh
 
Identity & trust in Monitored Spaces
Identity & trust in Monitored SpacesIdentity & trust in Monitored Spaces
Identity & trust in Monitored Spaces
Eleanor McHugh
 
Don't Ask, Don't Tell - The Virtues of Privacy By Design
Don't Ask, Don't Tell - The Virtues of Privacy By DesignDon't Ask, Don't Tell - The Virtues of Privacy By Design
Don't Ask, Don't Tell - The Virtues of Privacy By Design
Eleanor McHugh
 
Don't ask, don't tell the virtues of privacy by design
Don't ask, don't tell   the virtues of privacy by designDon't ask, don't tell   the virtues of privacy by design
Don't ask, don't tell the virtues of privacy by design
Eleanor McHugh
 
Anonymity, identity, trust
Anonymity, identity, trustAnonymity, identity, trust
Anonymity, identity, trust
Eleanor McHugh
 
Going Loopy - Adventures in Iteration with Google Go
Going Loopy - Adventures in Iteration with Google GoGoing Loopy - Adventures in Iteration with Google Go
Going Loopy - Adventures in Iteration with Google Go
Eleanor McHugh
 
Distributed Ledgers: Anonymity & Immutability at Scale
Distributed Ledgers: Anonymity & Immutability at ScaleDistributed Ledgers: Anonymity & Immutability at Scale
Distributed Ledgers: Anonymity & Immutability at Scale
Eleanor McHugh
 
Hello Go
Hello GoHello Go
Hello Go
Eleanor McHugh
 
Go for the paranoid network programmer, 2nd edition
Go for the paranoid network programmer, 2nd editionGo for the paranoid network programmer, 2nd edition
Go for the paranoid network programmer, 2nd edition
Eleanor McHugh
 
Going Loopy: Adventures in Iteration with Go
Going Loopy: Adventures in Iteration with GoGoing Loopy: Adventures in Iteration with Go
Going Loopy: Adventures in Iteration with Go
Eleanor McHugh
 
Finding a useful outlet for my many Adventures in go
Finding a useful outlet for my many Adventures in goFinding a useful outlet for my many Adventures in go
Finding a useful outlet for my many Adventures in go
Eleanor McHugh
 
Anonymity, trust, accountability
Anonymity, trust, accountabilityAnonymity, trust, accountability
Anonymity, trust, accountability
Eleanor McHugh
 

More from Eleanor McHugh (20)

[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf
 
Generics, Reflection, and Efficient Collections
Generics, Reflection, and Efficient CollectionsGenerics, Reflection, and Efficient Collections
Generics, Reflection, and Efficient Collections
 
The Relevance of Liveness - Biometrics and Data Integrity
The Relevance of Liveness - Biometrics and Data IntegrityThe Relevance of Liveness - Biometrics and Data Integrity
The Relevance of Liveness - Biometrics and Data Integrity
 
The Browser Environment - A Systems Programmer's Perspective [sinatra edition]
The Browser Environment - A Systems Programmer's Perspective [sinatra edition]The Browser Environment - A Systems Programmer's Perspective [sinatra edition]
The Browser Environment - A Systems Programmer's Perspective [sinatra edition]
 
The Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's PerspectiveThe Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's Perspective
 
Go for the paranoid network programmer, 3rd edition
Go for the paranoid network programmer, 3rd editionGo for the paranoid network programmer, 3rd edition
Go for the paranoid network programmer, 3rd edition
 
An introduction to functional programming with Go [redux]
An introduction to functional programming with Go [redux]An introduction to functional programming with Go [redux]
An introduction to functional programming with Go [redux]
 
An introduction to functional programming with go
An introduction to functional programming with goAn introduction to functional programming with go
An introduction to functional programming with go
 
Implementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 reduxImplementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 redux
 
Identity & trust in Monitored Spaces
Identity & trust in Monitored SpacesIdentity & trust in Monitored Spaces
Identity & trust in Monitored Spaces
 
Don't Ask, Don't Tell - The Virtues of Privacy By Design
Don't Ask, Don't Tell - The Virtues of Privacy By DesignDon't Ask, Don't Tell - The Virtues of Privacy By Design
Don't Ask, Don't Tell - The Virtues of Privacy By Design
 
Don't ask, don't tell the virtues of privacy by design
Don't ask, don't tell   the virtues of privacy by designDon't ask, don't tell   the virtues of privacy by design
Don't ask, don't tell the virtues of privacy by design
 
Anonymity, identity, trust
Anonymity, identity, trustAnonymity, identity, trust
Anonymity, identity, trust
 
Going Loopy - Adventures in Iteration with Google Go
Going Loopy - Adventures in Iteration with Google GoGoing Loopy - Adventures in Iteration with Google Go
Going Loopy - Adventures in Iteration with Google Go
 
Distributed Ledgers: Anonymity & Immutability at Scale
Distributed Ledgers: Anonymity & Immutability at ScaleDistributed Ledgers: Anonymity & Immutability at Scale
Distributed Ledgers: Anonymity & Immutability at Scale
 
Hello Go
Hello GoHello Go
Hello Go
 
Go for the paranoid network programmer, 2nd edition
Go for the paranoid network programmer, 2nd editionGo for the paranoid network programmer, 2nd edition
Go for the paranoid network programmer, 2nd edition
 
Going Loopy: Adventures in Iteration with Go
Going Loopy: Adventures in Iteration with GoGoing Loopy: Adventures in Iteration with Go
Going Loopy: Adventures in Iteration with Go
 
Finding a useful outlet for my many Adventures in go
Finding a useful outlet for my many Adventures in goFinding a useful outlet for my many Adventures in go
Finding a useful outlet for my many Adventures in go
 
Anonymity, trust, accountability
Anonymity, trust, accountabilityAnonymity, trust, accountability
Anonymity, trust, accountability
 

Recently uploaded

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 

Recently uploaded (20)

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 

GoLightly: A Go Library For Building Virtual Machines

  • 1. GoLightly A Go library for building Virtual Machines Eleanor McHugh
  • 2. Go
  • 3. a new language statically-typed and compiled object-oriented but no classes garbage collected concurrency via communication (CSP) type polymorphism via interfaces
  • 4. a new way of working the safety of a static type system the feel of a dynamic runtime the performance of a compiled language
  • 7. ...to perspiration simulation v. emulation instruction set design bytecodes memory abstraction operation dispatch
  • 9. principles interface driven delegation architecture agnostic inspired by hardware techniques decoupled components scaling through specialisation
  • 10. caveat references current dev branch fundamental changes from github still evolving next release due for Strange Loop
  • 11. interfaces type Executable interface { type Comparable interface { Execute(p Processor) Identical(v Value) bool } Compare(v Value) int } type Processor interface { Reset() type Value interface { Step() fmt.Stringer Jump(a Address) Comparable Call(a Address) Nil() Value Return() IsNil() bool Load(program Program) } Run() Execute() type Program []Executable Sleep(n int64) Halt(n int) IsActive() bool }
  • 12. instructions obey the Executable interface expressed as separate types no assumptions about semantics not tied to a bytecode representation
  • 13. flow control type NoOp struct {} type Call Address func (n *NoOp) String() string { func (c Call) String() string { return "NOOP" return Sprint("CALL", Address(c)) } } func (n *NoOp) Execute(p Processor) {} func (c Call) Execute(p Processor) { p.Call(Address(c)) type Halt struct {} } func (h *Halt) String() string { return "HALT" type Return struct {} } func (r Return) String() string { func (h *Halt) Execute(p Processor) { return "RET" p.Halt(PROGRAM_TERMINATED) } } func (r Return) Execute(p Processor) { p.Return() type Jump Address } func (j Jump) String() string { return Sprint("JMP", Address(j)) } func (j Jump) Execute(p Processor) { p.Jump(Address(j)) }
  • 14. bytecode type ByteCode []int case 5: / JMPZ n / case 10: / POP r / func (b *ByteCode) String() string { PC++ PC++ return "BYTECODE" if C == 0 { R[b[PC]] = DS.Pop() } PC++ case 11: / LOAD r, v / func (b *ByteCode) Execute(p Processor) { PC += b[PC] - 1 PC++ var PC, C, W int } else { W = b[PC] var R [2]int PC++ PC++ CS := new(vector.IntVector) } R[W] = b[PC] DS := new(vector.IntVector) case 6: / JMPNZ n / case 12: / ADD r1, r2 / for p.Active() { PC++ PC++ switch b[PC] { if C != 0 { W = b[PC] case 0: / NOOP / PC++ PC++ case 1: / NSLEEP n / PC += b[PC] - 1 R[b[PC]] += R[W] PC++ } else { default: p.Sleep(int64(b[PC])) PC++ p.Halt(ILLEGAL_INSTRUCTION) case 2: / SLEEP n / } } PC++ case 7: / CALL n / } p.Sleep(int64(b[PC]) << 32) PC++ } case 3: / HALT / CS.Push(PC) p.Halt(USER_HALT) PC = b[PC] return case 8: / RET / case 4: / JMP n / PC = CS.Pop PC++ case 9: / PUSH r / PC += b[PC] - 1 PC++ DS.Push(R[b[PC]])
  • 15. processors typical Turing machines support flexible dispatch not tied to a given instruction set memory model agnostic ripe for specialisation
  • 16. a scalar processor type SProc struct { func (s *SProc) Sleep(i int64) { func (s *SProc) Call(a Address){ Running bool syscall.Sleep(i) PC := s.PC PC int } s.PC = int(a) R IntBuffer for s.IsActive() { F FloatBuffer func (s *SProc) Halt(n int) { s.Execute() DS vector.IntVector s.Running = false s.Step() Program []Executable } } } s.PC = PC func (s *SProc) IsActive() bool{ } func (s *SProc) Run() { return s.Running && s.PC < s.Running = true len(s.Program) func (s *SProc) Return() { s.Call(0) } s.PC = len(s.Program) } } func (s *SProc) Reset() { func (s *SProc) Step() { s.R.ClearAll() s.PC++ s.PC = 0 } } func (s *SProc) Jump(a Address) { func (s *SProc) Load(program s.PC += int(a) Program) { } s.Reset() s.Program = program func (s *SProc) Execute() { } s.Program[s.PC].Execute(s) }
  • 17. memory based on allocated Values aggregate as ValueStores require boxing/unboxing buffers for specific types buffers are also ValueStores
  • 18. benefits encourages simple designs many different VMs per executable can run in separate goroutines easily duplicated and serialised split across processes or hosts
  • 19. the future single dispatch for vector operations per vasive threading runtime code rewriting speculative loading JIT compilation

Editor's Notes