RAPID Rapid API Dialect The Team Nate Brennand Benjamin Edelstein - - PowerPoint PPT Presentation

rapid
SMART_READER_LITE
LIVE PREVIEW

RAPID Rapid API Dialect The Team Nate Brennand Benjamin Edelstein - - PowerPoint PPT Presentation

RAPID Rapid API Dialect The Team Nate Brennand Benjamin Edelstein Brendon Fish Dan Schlosser Brian (Dong Hee) Shin Motivation Rapidly prototype and develop an API server, using strong typing to provide some guarantees about


slide-1
SLIDE 1

RAPID

Rapid API Dialect

slide-2
SLIDE 2

The Team

  • Nate Brennand
  • Benjamin Edelstein
  • Brendon Fish
  • Dan Schlosser
  • Brian (Dong Hee) Shin
slide-3
SLIDE 3

Motivation

Rapidly prototype and develop an API server, using strong typing to provide some guarantees about API functionality.

slide-4
SLIDE 4

Hello World

println("Hello world");

slide-5
SLIDE 5

Hello World via API

http () string { return "Hello World"; }

slide-6
SLIDE 6

GCD Calculator

func gcd(int p, int q) int { while (q != 0) { int temp = q; q = p % q; p = temp; } return p; }

slide-7
SLIDE 7

Let’s Make it a Server!

namespace gcd { param int a { param int b { http (int a, int b) int { int res = gcd(a, b); return res; } } } }

slide-8
SLIDE 8

OOP in RAPID

class User { int age; string name = "Stephen";

  • ptional int height;

instance my { func is_old() boolean { return (my.age >= 30); } func make_older() { my.age = my.age + 1; } } } User stephen = new User(age=29); println(stephen.age); stephen.height = 73; println(stephen.height); if (stephen.is_old()) { println("Stephen is old"); } else { println("Stephen is young"); } stephen.make_older(); if (stephen.is_old()) { println("Stephen is old"); }

slide-9
SLIDE 9

Types

  • Ints
  • Floats
  • Strings
  • Booleans
  • Classes
  • Lists
slide-10
SLIDE 10

Functions

  • Instance functions
  • Standalone functions
  • Multiple return types
  • Type checked args
  • Optional args with default values
slide-11
SLIDE 11

Compiler Pipeline

Source Code Parser Translator AST Semantic Checker (2-pass) Unsafe Semantic AST Generator Semantic AST Go Compiler Generated Go Code

slide-12
SLIDE 12

Lessons Learned

  • Set smaller milestones and stick to
  • them. Meet more regularly to work.
  • Programming a sizeable project in a

new programming language takes longer than expected.

  • Rigorous code review, and testing

are important!

  • Focus. Our LRM was ambitious
slide-13
SLIDE 13

Demos

  • GCD Server
  • OOP