Urgent.News

What's breaking now, across thousands of outlets.

Tech

A Friendly Introduction to Racket

The merit of this one compared to others of this kind (a legion) is its conciseness and fast pace. Comments

Welcome to a friendly introduction to Racket, a language that's part of one of programming's oldest and most unique families. Created by John McCarthy in 1958, Lisp is the second-oldest high-level language still in use today, with several modern concepts having their roots in its early development.

Initially the language of artificial intelligence, Lisp saw a decline in the 80s due to the "AI winter" and funding cuts. However, ideas that were once considered radical continued to evolve and mutated, leading to the creation of Scheme in 1975. Scheme became the go-to language for teaching programming in academia, with the influential book "Structure and Interpretation of Computer Programs" written in Scheme.

In 1995, Matthias Felleisen's group developed PLT Scheme, a Scheme designed for education and programming language research. Renamed to Racket in 2010, Racket has grown beyond being just a Scheme, becoming a language for building languages. Its motto is "language-oriented programming," allowing you to create a language in an afternoon when your problem requires its own language.

Racket's REPL (Read-Eval-Print Loop) consists of two areas: the top for writing definitions or your program, and the bottom for live experimentation through the REPL. To specify the language, write a single line at the top of your code. For terminal users, the command "racket" opens the REPL, while "raco" is the package manager and tooling command.

In Racket, all code follows a consistent structure: (operator argument1 argument2 ...). There's no operator precedence to memorize, and no special syntax for anything. Lisp, short for LISt Processing, uses lists as the fundamental structure. The quote mark, denoted by a single quote ('), tells Racket not to evaluate an expression but to treat it as data.

The beauty of Racket lies in its ability to pass functions to other functions, making it natural to apply functions like map, filter, and foldl to solve list problems without traditional loops. You can think of your program as a list, which means you can build programs with programs, a concept known as homoiconicity. This is why Racket has real macros, which are functions that receive code and return code, before anything runs.

Interestingly, Racket doesn't have a while loop of its own. However, you can easily create one, illustrating the power and flexibility of Lisp: the syntax is yours, and the core principles of software development can be derived from a tiny, core set of ideas.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

This story

This is one outlet's version. Read the fullest account.

Read the original at geometridae.bearblog.dev →

More in Tech

Why Fixed-Window Rate Limiters Fail (And How to Fix Them with Math)

If you’ve ever built an Express API, you’ve probably reached for standard rate-limiting middleware to protect your login or payment endpoints from DDoS and brute-force attacks.

  • Fixed-Window Counter method vulnerable to burst attacks
  • Exploits minute reset, allowing 200 requests in 2 seconds
  • Sliding Window Counter prevents boundary spikes

When Python is Too Slow

Python is a perfect language for Agile development, where requirements might change on the go. Especially if you are in a startup business, you will need to experiment and change things fast.

  • Python's interpreted nature may lack performance for certain tasks
  • Rust bindings create binary code that can be integrated with Python
  • Rust bindings can speed up processing large CSV files by 4.3x

About Me: Afee Muhammod Wafy

Hello world! 👋 I'm Afee Muhammod Wafy , though most people know me simply as Wafy . I am a science student and self-taught web developer from Rangpur, Bangladesh.

  • Wafy is a science student and self-taught web developer from Rangpur, Bangladesh.
  • Passion for technology driven by curiosity and fundamental understanding.
  • Shares journey and insights on dev.to journal about balancing learning methods.

More from Sunday 23 August →