• Squirrel is a lightweight object oriented programming language.


  • very simple stand alone interpreter
  • can compile or run squirrel script
  • has interactive interface
  • getting arguments passed
    • 2.x.x: ARGV variable
    • 3.x.x: vargv(used in variable length arguments) value
  • options
    • -c: compiles the file to bytecode(default output 'out.cnut')
      • if this option is passed only compiles the passed files
    • -o: specifies output file for the -c option
    • -d: generates debug infos
    • -v: displays version infos
    • -h: prints help



  • Sqrat

Virtual Machine InternalEdit

  • stack based machine.
  • coroutine == lightweight thread
    • Suspend just returns SQ_SUSPEND_FLAG
    • when CallNative receives SQ_SUSPEND_FLAG it will go out the vm loop immediatlly
    • created by newthread
    • suspend/wakeup
  • SQVM::Execute
    • ExecutionType
      • By default ET_CALL
      • ET_RESUME_VM: if raise error is false
      • ET_RESUME_THROW_VM: if raise error is true
      • ET_RESUME_GENERATOR: used in generator