Great question! If you're looking for programming languages with excellent REPLs (Read-Eval-Print Loops) that also support saving and reloading the full state, here are some of the best options, along with their capabilities:
🔥 Top Languages with Great REPLs and State Persistence
1. Common Lisp
2. Clojure
- REPL Quality: Very high, especially when used with nREPL, CIDER (Emacs), or Portal/REBL.
- State Saving:
- Not built-in for full JVM image saving like Lisp.
- Can serialize data and reload it.
- Third-party tools like
stasis, nippy, or use Dublin serialization snapshots.
- Advantages:
- Live code reloading – great with tools like Figwheel, Mount, or Component.
- Use Case: Web development, data science, functional programming.
3. Smalltalk (ex: Pharo, Squeak)
- REPL Quality: Elite tier.
- State Saving: Core feature!
- Entire environment—including code, objects, GUI state—can be saved and resumed.
- Tooling:
- Pharo IDE is itself a live Smalltalk system.
- Use Case: Live desktop/mobile apps, GUI innovation, educational environments.
4. Forth / Factor
5. Racket (a Lisp/Scheme dialect)
- REPL Quality: Excellent, especially in DrRacket.
- State Saving:
- Can serialize values easily with
serialize, deserialize.
- Less about full VM / image saving, more about modular state persistence.
- Use Case: Teaching, DSLs, scripting, research.
6. Python (with limitations)
- REPL Quality: Good (especially with IPython / Jupyter).
- State Saving:
- Can pickle variables (
pickle, joblib, dill) but not the full interpreter state.
- Jupyter Notebooks preserve outputs and code but not real-time execution flow or side-effects.
- Use Case: Data science, web development, automation.
7. Julia
- REPL Quality: Very good.
- State Saving:
- No full system image saving yet (pluggable workspaces are partially supported via
Revise.jl).
- Can serialize data and modules (
JLD, BSON.jl).
- Use Case: Scientific computing, numerical analysis.
8. Wolfram Language / Mathematica
- REPL Quality: Extremely high—in fact, everything is a notebook, which acts like a history-aware REPL.
- State Saving:
- Entire notebook sessions preserve full evaluation history and variable scope.
- Can serialize full data structures and environments.
- Use Case: Symbolic math, research, computational documents.
9. Tcl
- REPL Quality: Surprisingly good.
- State Saving:
- Can dump most of the interpreter state to variables/scripts.
- Not as holistic as Lisp or Smalltalk.
- Use Case: Embedded systems, GUI scripting (with Tk).
Honorable Mentions
| Language | REPL | State Saving |
|---|
| Elixir | IEx REPL + LiveView | Limited (can serialize state) |
| Haskell | GHCi | Limited (no system image) |
| Ruby | IRB / Pry REPL | Can dump with Marshal |
| Scala | Ammonite REPL | Can save sessions via scripts |
| JavaScript | Node.js REPL | Can use JSON for state |
🧠 Summary: Best for Full-State Save/Reload
| Full State Save (Image-based) | Partial State Serialize |
|---|
| Common Lisp | Python (pickle, dill, joblib) |
| Smalltalk (Pharo/Squeak) | Julia (JLD, BSON) |
| Factor | Clojure (data only, not JVM state) |
| Racket (partial) | JavaScript (localStorage, JSON dumps) |
| Wolfram Language | Haskell (using static values via Store) |
✅ Recommendation:
If you want full, smooth REPL-driven dev with snapshotting, consider:
- Common Lisp (for power and ecosystem)
- Pharo (Smalltalk) if you want a "live OS"/environment feel
- Factor for something unique and interactive
If you just want to serialize working state, Clojure, Python, and Julia work very well.
Let me know your use case if you want help choosing!