js-slang
js-slang copied to clipboard
Remove src/interpreter/interpreter.ts
I think src/ec-evaluator is replacing src/interpreter/interpreter.ts, so the latter is dead code.
Background: The interpreter used to be the workhorse implementation in SA, prior to the transpiler. After the transpiler was introduced, it became the implementation behind the environment visualizer. Now the environment visualizer uses ec-evaluator, which means that the interpreter is unemployed.
I suggest we should remove src/interpreter/interpreter.ts from js-slang, and leave some breadcrumbs in the wiki. It is bound to decay over time and cause extra work.
See also https://github.com/source-academy/js-slang/issues/1695
I think we should proceed with the removal. The only references to src/interpreter/interpreter.ts
are as follows:
-
https://github.com/source-academy/js-slang/blob/9b489441ac30fab86b5e72cdbd63bb46fc47dfe6/src/interpreter/closure.ts#L15-L20
-
https://github.com/source-academy/js-slang/blob/9b489441ac30fab86b5e72cdbd63bb46fc47dfe6/src/runner/sourceRunner.ts#L115-L127
-
https://github.com/source-academy/js-slang/blob/9b489441ac30fab86b5e72cdbd63bb46fc47dfe6/src/mocks/context.ts#L5
Perhaps we can just replace this with
import { createBlockEnvironment } from '../ec-evaluator/utils'
How are would it be to completely remove it?
I think we should completely remove it. It's a confusing legacy component at this point. Where are these "mocks" used?
I think we should completely remove it. It's a confusing legacy component at this point. Where are these "mocks" used?
The mocks in the last bullet point are used in test files. I'll make a PR with the necessary changes.