Implementation cho ngôn ngữ Lox từ quyển sách Crafting Interpreters bằng ngôn ngữ Scala 3.
Đây cũng là một trong các hoạt động của team fundamental.
Vui lòng vào website để tìm hiểu thêm.
A fully functional Interpreter for Lox in Scala 3 (WIP).
Home Page: https://grokking-vietnam.github.io/grox
License: GNU General Public License v2.0
Implementation cho ngôn ngữ Lox từ quyển sách Crafting Interpreters bằng ngôn ngữ Scala 3.
Đây cũng là một trong các hoạt động của team fundamental.
Vui lòng vào website để tìm hiểu thêm.
Because in Scalajs, Console
just prints thing in browser's console which is not what we want.
We need executor returns output which we can use and set to some textview.
Cần thông tin về location bao gồm line (và column) trong trait Token
để có thế show lỗi của chương trình chi tiết hơn ở những bước tiếp theo.
http://craftinginterpreters.com/statements-and-state.html#assignment-syntax
var x = 2;
x + 3 > x +2;
if(true)
print(1);
else
print(2);
Expr
needs to carry location information in order to show more specific errors to users.
Error messages should tell where and why error happen
After #101 get merged
Tương tự như TokenGen. Chúng ta có thể viết một ExprGen
và dùng nó để test với Parser, Show, eval Expr.
Split compiler
module into several sub modules:
compiler
module: core logic of compiler can be publish as libraries (JVM/Javascript)cli
module: cli interface (JVM/Javascript)web playground
: an interactive playground (javascript)Use Decline and cats-effect to implement our CLI interface.
Should start with just help
command line. Will integrate with other parts later.
Goal: able to execute the code below
var a = "global a";
var b = "global b";
var c = "global c";
{
var a = "outer a";
var b = "outer b";
{
var a = "inner a";
print a;
print b;
print c;
}
print a;
print b;
print c;
}
print a;
print b;
print c;
Gnu2 | Gnu3 | mit | ????
Tính toán giá trị biểu thức từ parser và show runtime error khi không tính được.
Make sure the code in the end of chapter 9 works:
var a = 0;
var temp;
for (var b = 1; a < 10000; b = temp + b) {
print a;
temp = a;
a = b;
}
Or fix this warning when compiling
[warn] |Use of
scala.reflect.ClassTag
for type testing may be unsound. Consider usingscala.reflect.TypeTest
instead.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.