Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpreter in Typescript #735

Open
Darvass69 opened this issue Aug 30, 2024 · 1 comment
Open

Interpreter in Typescript #735

Darvass69 opened this issue Aug 30, 2024 · 1 comment

Comments

@Darvass69
Copy link

Darvass69 commented Aug 30, 2024

I am working on an interpreter written in typescript. It's still far from usable, but it works a little bit. You can see it here. It can do variables (but no lifetimes or anything fancy and const doesn't do anything) and if statements. It also supports most of JavaScript's operators.

@Darvass69
Copy link
Author

🎉Update🎉
I focused my efforts on parsing rather than interpreting. I changed the parser so it could parse any syntax we need using simple rules and abstract all the complexities from some lines of code having multiple valid interpretations. This also means I broke the runtime, so now we can only create an AST and not run it, but the runtime should not be too hard to fix.

We can now parse quite a lot of things, including that when we have 1, we parse it as both the number 1 and a variable named '1'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant