Save 37% off PRO during our Black Friday Sale! »

How to Create a New JVM Language [Devoxx US`17]

How to Create a New JVM Language [Devoxx US`17]

In this session, we'll create a new programming language called DevoxxLang! We'll construct its grammar, semantics, operations and the interpreter for the language. Additionally, we'll learn about parsers and how to perform simple optimizations, both at compile time and otherwise. Most importantly we'll tackle the interoperability problem with the underlying platform, which in our case is the JVM.

This session will briefly discuss type systems, optimizations, memory management and concurrency issues that programming languages all encounter. Have you ever wanted to create a programming language of your own? After this session, you will have seen all the tools you need to do so and will understand more about how are programming languages work including the challenges you’ll face.

5d01eb7205b787b5991db85a11ee5e68?s=128

Oleg Šelajev

March 22, 2017
Tweet

Transcript

  1. Oleg Šelajev @shelajev ZeroTurnaround How to create a new JVM

    language
  2. @shelajev

  3. None
  4. And you won’t believe how easy it is and where

    it’ll take you! How to Create a New JVM Language in Under an Hour
  5. None
  6. General programming language or special purpose? Fast execution vs. fast

    development Flexibility, maintainability and consistency
  7. Piet is a programming language in which programs look like

    abstract paintings. The language is named after Piet Mondrian, who pioneered the field of geometric abstract art. I would have liked to call the language Mondrian, but someone beat me to it with a rather mundane-looking scripting language. Oh well, we can't all be esoteric language writers I suppose. http://www.dangermouse.net/esoteric/piet.html
  8. CREATING A NEW LANGUAGE IN 20 EASY STEPS http://jakubdziworski.github.io/categories.html#Enkel-ref

  9. None
  10. LEXER https://courses.engr.illinois.edu/cs421/sp2013/lectures/lecture5-6ann.pdf

  11. PARSER https://courses.engr.illinois.edu/cs421/sp2013/lectures/lecture7-8ann.pdf

  12. COMPILER

  13. None
  14. WRITING YOUR OWN LANGUAGE Prototype > Create semantics, parser, AST,

    interpreter Write a VM > In low level language, spending tons of time People start using it People complain about performance > Define a bytecode, write an interpreter Performance is still bad > Write a JIT compiler, improve the GC https://lafo.ssw.uni-linz.ac.at/pub/papers/2016_PLDI_Truffle.pdf
  15. None
  16. None
  17. WRITE YOUR OWN LANGUAGE Prototype language in Java > Create

    semantics, parser & AST interpreter Write a VM > In low level language, spending tons of time People start using it > It’s already fast! > And it integrates with other languages and tools Performance is still bad > Write a JIT compiler, improve the GC https://lafo.ssw.uni-linz.ac.at/pub/papers/2016_PLDI_Truffle.pdf
  18. GRAAL dynamic compiler & interpreter for a language runtime TRUFFLE

    language implementation framework
  19. GRAAL dynamic compiler & interpreter for a language runtime TRUFFLE

    language implementation framework
  20. None
  21. GETTING GRAAL Download GraalVM http://www.oracle.com/technetwork/oracle-labs/program-languages/overview/index.html

  22. None
  23. RESULTS (2+3) * 4.0 / (3 - 1) 10.0

  24. RESULTS JVM IS AWESOME! https://lafo.ssw.uni-linz.ac.at/pub/papers/2016_PLDI_Truffle.pdf

  25. None
  26. TYPES

  27. INTEROP

  28. CONCURRENCY

  29. GARBAGE COLLECTION Pro tip: focus on one of these and

    reuse the existing other
  30. COMPILER Pro tip: focus on one of these and reuse

    the existing other
  31. LANGUAGE: RUNTIME + LIBRARY Pro tip: focus on one of

    these and reuse the existing other
  32. https://toggl.com/programming-princess

  33. oleg@zeroturnaround.com @shelajev Find me and chat with me!