What is Racket?

Sololearn
Sololearn
Published in
5 min readJan 11, 2022
Programming language — Racket

While not the most popular programming language, Racket is a language worth getting to know, especially if you are interested in learning more about computer science in-depth. Where did Racket come from? What is it used for? We’ll discuss the answers to those questions in this article.

Understanding The History Of Lisp And Racket

Racket is a dialect of the Lisp family of programming languages. Lisp is one of the oldest programming languages, developed in 1958 at the Massachusetts Institute of Technology. It was originally designed as a system of mathematical notation for computers, but it evolved into a full programming language that was used by many of the pioneers of computer science.

Lisp is unique in that it uses prefix notation, also known as reverse Polish notation. In prefix notation, the operator comes before the operands. For example, the expression (1 + 2 + 3) would instead be written as (+ 1 2 3). This syntax is used for all Lisp programming, including functions. A function foo that takes two arguments would be written as (foo arg1 arg2). Expressions can be nested inside of each other and called recursively — that is, referring to themselves.

While this syntax can be confusing at first, it allows Lisp to be used to tackle complex mathematical and logical problems while the code remains relatively simple. This led to Lisp being used to invent some of the most important advancements in programming and computer science.

Computer Science Advancements In Lisp

Because of its popularity with computer scientists at MIT and other research institutions, many of the fundamental concepts of computer science that we take for granted were first developed in Lisp. These include:

Conditionals

These include if-then statements and other basic building blocks of logic.

Dynamic Typing

Where variables can hold any type of data (integers, strings, etc.) and switch between them automatically.

Recursion

Where functions and expressions can call themselves.

Garbage collection

Automatically freeing unused memory storage locations.

Self-hosting compilers

Where a compiler is written in the same language that it targets and can compile itself.

At first, Lisp was written on punch cards and fed into machines like the IBM 704. Eventually, Lisp became so popular that Lisp machines were developed. These were computers optimized to run Lisp code. Researchers at the MIT AI Laboratory used Lisp machines throughout the 1970s and 80s to develop these and other computer science advancements.

Common Lisp vs. Scheme

Nowadays, the two main branches of Lisp development are represented by Common Lisp and Scheme.

Common Lisp is a general-purpose programming language, and includes a large number of features that you would expect to find in any programming language, such as data types and built-in functions.

Scheme, on the other hand, is a minimalist interpretation of Lisp. It includes fewer standard features, but it includes tools to implement these features. This makes Scheme ideal for implementing other programming languages that are better suited to a specific purpose. This, in part, is where Racket came from.

The History Of Racket

Racket traces its history to 1995, when a company called PLT began developing learning materials for programming. They wanted to build an environment that could be used to teach Scheme programming to beginners, so they created an offshoot called PLT Scheme.

Over the years, PLT Scheme added more and more features. In 2010, Version 5.0 was released, and the project was renamed to Racket.

Racket is now a moderately popular language, with thousands of projects written in Racket posted on GitHub. Racket programs can be run as scripts, but they can also be compiled to executables that can be run directly on Windows and other OSes without an interpreter. This makes Racket useful for more than just educational purposes.

How Racket Is Used

Racket is designed to be used for programming language design and development. This means that it can be used to dig into not just the how of writing programs, but the why of computer science.

Learning Computer Science with Racket

Some computer science courses use Racket to teach the fundamentals of how computers and programming languages work. You can use Racket to work through all of the whys that go into designing a programming language — and then build a language that meets those needs. Then, you can write programs in that language, compile, and run them. In doing so, you’ll gain a deeper understanding of the low-level decisions and techniques that make up computer programming and software design in general.

Writing New Languages With Racket

Creating new programming languages is useful even outside of pure computer science theory. Programming languages like C, Java and Python are general-purpose programming languages. This means they have to be good at everything — which makes them complex and difficult to use for specialized applications.

With Racket, however, you can create an entirely new programming language that is designed to do one thing — and to do it well. While your language might not be able to do everything, it can focus on doing what it needs to do efficiently, making it simpler to learn and use for that purpose.

For example, imagine you were creating a video game, and you wanted to have a way for players to add their own scenarios or game elements in a pre-defined way. You could create an API that would let users write Python or C programs and import them into your game. Or you could use Racket to create a simplified scripting language that was designed specifically for the needs of your game environment. By doing so, you’ll create a better experience for your users and will help them to create the content they want to see in your game more quickly.

Is Racket Right For Me?

If you have already completed some coding courses, and you would like to better understand the internals of computer science, then learning Racket may be a good choice for you. Senior software developers and engineers are expected not only to know how to code, but to know the ins and outs of software design so that they can take the lead on a large software project. So digging deeper into computer science by means of a language like Racket may be a good choice for you. Additionally, many data scientists and engineers specializing in AI and machine learning use Racket, Scheme, and other Lisp-family languages to design algorithms that are used in self-driving cars, voice recognition, and big-data analysis.

However, Racket is not a popular language for commercial software development. Most companies use more popular languages like Java, C++, and Python to develop their products and internal software. So while knowledge of Racket can be useful, it’s not essential for a career in coding. So if you want to build your knowledge of computer science, Racket may be a good choice. Or you can start with any of the free courses on Sololearn to jump start your learning journey.

--

--

Sololearn
Sololearn

The #1 platform to learn to code · Available anytime & anywhere for free · Join our community of millions of learners worldwide where no questions go unanswered