Skip to content
The Chat Archive
claude-3-7-sonnet-20250219· Anthropic LMArena Human Preference 140K

Which programming languages have repls where I can easily save all defined variables and…

  1. User

    Which programming languages have repls where I can easily save all defined variables and functions and reload them again? I do not need it to work for ffi or imported modules.

  2. Assistant

    Python, JavaScript, Ruby, and Lisp dialects like Clojure all have good REPL environments with session persistence capabilities.

    Python's pickle module lets you serialize variables and functions:

    import pickle
    
    # Save state
    with open('session.pkl', 'wb') as f:
        pickle.dump((my_var, my_function), f)
    
    # Restore state
    with open('session.pkl', 'rb') as f:
        my_var, my_function = pickle.load(f)
    

    JavaScript has localStorage in browser REPLs, and Node.js REPLs support .save and .load commands.

    Ruby's IRB has Marshal.dump/load for serialization, and Clojure has excellent persistence with its REPL state.

    Would you like me to explain any of these approaches in more detail?

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.

Which programming languages have repls where I can easily… · The Chat Archive