Skip to content
0:00 / 0:00

#racket#big-bang#functionalprogramming

"big-bang: the world, universe, and network in the programming language" by Matthias Felleisen

Strange Loop Conference

88K subscribers • 114 videos on Hallway • Conference channel

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by Matthias Felleisen, co-creator of Racket

Intermediate. Assumes working knowledge.

8K views11 years ago2 recommendations

Programming languagesFunctional programmingLisp and ClojureEvent-driven systems and messaging

Matthias Felleisen explains how Racket's Universe library and big-bang GUI framework are used to teach purely functional, event-driven programming.

How do you control communicating actors? How do you implement an SSH server in a truly functional style? How do you teach middle school students event-driven programming? How are these questions related? This talk will present a tour through Racket's world of thinking in a purely functional manner. It will start with the Universe library, which we use for reaching middle school students, and it will end with a sketch of the Network Calculus dialect, a natural research outgrowth of the Universe. Racket's Universe library is the foundation of the long-running Bootstrap and ProgramByDesign K-12 outreach projects. The library's exports make algebra come alive. With big-bang, a middle-school student's "hello world" program simulates a rocket lift-off: (define (lift-off t) (place-image rocket middle (- height t) background)) (define rocket .. some image ..) (define background .. some image ..) (define height (image-height background)) (define middle (/ (image-width background) 2)) ;; run program run (animate lift-off) More generally, middle school students can formulate interactive, graphical programs---animations, video games, or simple editors---with algebra. Even evaluating these programs uses nothing but algebraic calculations. The key to this approach is big-bang, which turns algebraic functions on numbers, booleans, images, and strings into event handlers and rendering functions: (big-bang height [to-draw lift-off] [on-tick sub1] [stop-when zero?]) A big-bang expression describes a world with functions. Precisely put, it associates functions with certain events. Each function consumes the state of the world and possibly some additional information; it returns the next state of the world or computes a property of the world. Naturally a world is not enough. Therefore Universe also exports a universe form, with which students can create a network of worlds. For example, they can turn the above animation into a remote-controlled one with just three lines of code added to the above: [register LOCALHOST] [on-key (lambda (w key) (make-package w 'reset))] [on-receive (lambda (s m) height)] A beginning student formulates the "universe" server as a top-level function instead of a lambda, but it still doesn't take more than 10 lines. Even though worlds connected in a universe still consist of algebraic descriptions of state, state transformation, and communication, network connectivity turns the resulting systems into a non-deterministic one. Our college freshmen routinely study and use this material to construct distributed programs at the end of their first semester. Finally, over the past couple of years, Universe programming has given rise to the idea of folding the network into the programming language. Here a network consists of communicating actors---each of which may be a network itself---and a coordinating messaging board on which actors publish messages and subscribe to them. The Network Calc

Why it's here

2 people recommend this

What people say. Recommended for showing how Racket is used to effectively teach functional programming and event-driven concepts to students.

u/tangled_zansin r/haskell • Recommends

On “Best programming language for high-school students”

Check out this video from one of the creators of Racket, talking about how they use it to teach programming to middle and high school students: link to this video Then there's the Code World project which aims to replicate Racket's success with Haskell, by teaching a simplified version of Haskell to students: link to this video I recommend checking out both projects even if you choose to go with another language.

u/agumonkeyin r/compsci • Recommends

On “ELI5: what is functional programming and how is it different from OOP”

Funny, M. Felleisen just gave a talk at StrangeLoop 2015, about teaching programming concepts from primary school level to graduate in a lisp. see: link to this video apparently kids enjoy it