3 min read

Racket programming language has a new version update, Racket 7.0. Users might not see huge differences between the previous version of Racket, v6.12 released in January 2018. However, v7.0 differs in the internals significantly.

Racket or Racket lang is a multi-paradigm programming language–with an emphasis on functional programming–in the Lisp-Scheme family. Though not a popular one, Racket is considered as one of the easiest programming language. Languages such as Python, C#, Assembly, and so on are often talked about in the easy-categories; however, Racket lang is also a great choice as a starter language.

What’s new in Racket 7.0?

Updated Runtime

This version includes a substantial change in its current runtime system and supports multiple runtime systems.

New macro expander

Version 7.0 replaces about ⅛ of the core v6.12 implementation with a new macro expander that bootstraps itself. The expander turns out to be about 40% of the new code needed to replace Racket’s core with Chez Scheme. Most of the other 60% is also implemented, but it is not included in this release. However, Racket-on-Chez will be ready for production use later in the v7.x series.


Updates to DrRacket, the programming environment for Racket

DrRacket’s “Create Executable” option for the teaching language (Beginner Student, etc.) uses –embed-dlls to create single-file, standalone “.exe”s on Windows.

Improved supports within TypedRacket

TypedRacket is Racket’s gradually-typed sister language which allows the incremental addition of statically-checked type annotations.

TypedRacket’s support for prefab structs is significantly improved. This supports using prefab structs more polymorphically and fixes significant bugs in the current implementation. Programs which currently use predicates for prefab structs on unknown data may need to be revised since previous versions of Typed Racket allowed potentially buggy programs to type check. Check out Typed Racket RFC 1 and prefab Changes doc for more details on this change and on how to fix programs affected by it.

Typed Racket also supports #:rest-star in the ->* type constructor, which allows function types to specify rest arguments with more complex patterns of types, such as the hash function.

Other features in the Racket 7.0 include:

  • The syntax (#’) form supports new template subforms: [email protected] for splicing and ~? for choosing between subtemplates based on whether pattern variables have “absent” value (from an ~optional pattern in syntax-parse, for example). The syntax/parse/experimental/templatelibrary, where these features originated, re-exports the new forms under old names for compatibility.
  • On Windows, an –embed-dlls flag for raco exe creates a truly standalone, single-file “.exe” that embeds Racket’s DLLs.
  • Interactive overlays can be added to plots produced by plot-snip. This allows constructing interactive plots or displaying additional information when the mouse hovers over the plot area. Examples of how to use this feature can be found on Alex Harsanyi’s blog
  • racket/plot provides procedures for displaying candlestick charts for use in financial time series analysis.
  • Added contract-equivalent?, a way to check whether two contracts are mutually stronger than each other without the exponential slowdown that two calls to contract-stronger? brings.
  • Lazy Racket supports functions with keyword arguments.

Read more about Racket 7.0 on the Racket official blog.

Read Next

What is the difference between functional and object-oriented programming?

Putting the Function in Functional Programming

Elixir Basics – Foundational Steps toward Functional Programming


Subscribe to the weekly Packt Hub newsletter. We'll send you the results of our AI Now Survey, featuring data and insights from across the tech landscape.

LEAVE A REPLY

Please enter your comment!
Please enter your name here