ALOE = Scheme + Smalltalk + Types

Hey y'all :man_raising_hand:

In Scheme, we have:

(proc arg ...)

In ALOE, it's:

(obj msg arg ...)

It's an experiment in making everything about calling methods on objects instead of applying functions. And throwing types in the mix too.

Small interpreter in 2000 lines of Racket:

It doesn't even have strings yet!
But it can simulate a flock of 3 boids:

Spec:

Ed

1 Like

Isn't that what Java did already? what is being tested in this experiment?

Hi Ed,

This is really cool.

It makes me think of another experiment: Purely-functional Object-Oriented System

Thanks for sharing

Stephen

1 Like

Hey @spdegabrielle :man_raising_hand:

Thanks for checking it out!

Yes, experimenting with the various object systems grown in Scheme has influenced ALOE.

1 Like

OK, ALOE 0.2 is out.

For this release, the aim was to implement a basic computer algebra simplifier.

To implement that, I needed two things added to the ALOE core language:

  • Protocols (class interfaces)
  • Method overloading

Core language is around 2600 lines of Racket.

In ALOE, since we have

(obj method arg ...)

and we have type inference, we can get code completion for methods after typing an object expression.

Here's a video demo of this using vscode:

We're getting this via LSP support in ALOE.

1 Like

I've been messing around with aloemacs, an emacs-like editor written in ALOE:

It's extremely rudimentary right now.
Mostly serving as an exploration of the ALOE language.
Not currently intended for regular use.

Currently around 2632 lines of ALOE.

Source:

Besides GNU Emacs, a lot of design influence came from E, an emacs-like written in Chez Scheme:

As well as legmacs, an emacs-like written in a dialect of clojure:

2 Likes

Hi, @dharmatech.

This looks so clean!

I notice in your recording that (List empty) is a constructor for an empty list, but then later on you use (Point new ...).

You explain that the syntax is (obj method arg ...), which implies that the classes/types are objects--I am guessing--but is there an underlying construct for, you know, constructing things, that gets wrapped in these specialized methods?

The editor looks pretty cool, too, well done. What font are you using, by the way?

1 Like

Thanks for checking it out @bakgatviooldoos :man_raising_hand:

In that screenshot, aloemacs is running in a terminal window on Ubuntu 26.04.1.

I'm using the default terminal that comes with Ubuntu.
(I believe the terminal is ptyxis).

I believe the default fixed width font is Ubuntu Monospace:

https://design.ubuntu.com/font

1 Like

@dharmatech, do you explain somewhere in the repo where the name comes from? I skimmed it, but I didn't see anything obvious. I have kind of a hermeneutic bent, so I always find such things very interesting.

If you use define-class with fields, you get one constructor, named new.

dharmatech@X1E:~/journal/2026-09-02-aloe-racket$ rlwrap ./bin/aloe 
aloe> (define-class Pt (fields (x Int) (y Int)) (methods))
aloe> Pt
#<class Pt>
aloe> (Pt new 10 20)
#<Pt 10 20>

But instead of fields, you can list the constructors yourself:

(define-class Shape
  (constructors
    (Circle (fields (radius Float)))
    (Rect (fields (width Float) (height Float))))
  (methods
    (area () Float
      (self case
        (Circle (r) (3.14159 * (r * r)))
        (Rect (w h) (w * h))))))

Then you can do:

aloe> (Shape Circle 1.0)
#<Shape 1.0>
aloe> (Shape Rect 3.0 4.0)
#<Shape 3.0 4.0>
aloe> ((Shape Circle 1.0) area)
3.14159
aloe> ((Shape Rect 3.0 4.0) area)
12.0

List empty and List of are built-ins. Right now, List is sort of a primitive.

That's cool, reminds me of Haskell (because this is my only experience with something similar). Seems like a nice way to address the expression-problem, to some degree.

1 Like

I have a bunch of earlier prototypes of the language.
Somewhere along the way I think I had an acronym like:

Associative Language of Objects and Environments

I almost called it:

CARL (Contextual Associative Receiver Language, a nod to Carl Hewitt)

There's no official acronym right now. :grin:

1 Like

TIL about Carl Hewitt. Go figure, a big inspiration for Prolog, coming via Micro-Planner.

Planner has been described as "extremely ambitious".

:laughing:

1 Like

Guy Steele talked about "growing a language":

So there's that influence as well; growing aloe vera plants.

2 Likes

By the way,
aloemacs is using the excellent tui/term package by @dominik.pantucek :

Thank you Dominik!

1 Like