pveyes / naskah Goto Github PK
View Code? Open in Web Editor NEWBahasa pemrograman dengan sintaks Bahasa Indonesia (Programming language with Indonesian syntax) ๐ฎ๐ฉ
Home Page: https://naskah.vercel.app
License: MIT License
Bahasa pemrograman dengan sintaks Bahasa Indonesia (Programming language with Indonesian syntax) ๐ฎ๐ฉ
Home Page: https://naskah.vercel.app
License: MIT License
There's no >=
and <=
yet
We can name them Operator::Gte
and Operator::Lte
We need to list what we're planning to add to the language, not necessarily implement it in parser/printer
Good reference https://github.com/jamiebuilds/ghost-lang
Now that now-rust is moved from official package (and have few issues) let's move build & deployment to GitHub action + GitHub pages
In JS exponentiation operator is denoted as **
instead of ^
So x ^ 2
should be compiled to x ** 2
in JS
Addition / removal of some newline causes different bug
Case 1: newline required at the end of statement
misal x = 2; // no newline
Output:
salah sintaks
Expected:
var x = 2;
Case 2: Newline between statements
misal x = 2;
misal y = 4;
Output:
var x = 2;
Expected:
var x = 2;
var y = 4;
Currently typical demo build took ~5 mins. Maybe we can improve it by using
@actions/cache
for target
directorywasm-pack
via cURL instead of cargo`TODO list before OSS
misal x = 2;
misal x = "abc";
misal y = benar;
misal y = kosong;
2 + 2;
1 - 2 + 5
misal x = 2 + 3
{ statement; }
jika x == 2 { }
tulis(y);
jika x kosong
, jika x benar
, jika x salah
jika x == 2 { } atau { }
jika x == 2 { } atau jika x > 3 { }
ulang { statement; }
berhenti;
lanjut;
x = x + 1
x;
Currently we didn't track depth level when writing compiled JS code. The solution can be implemented by passing depth as 2nd function argument
fn print_literal(l: Literal, depth: u8) -> String {
...
}
Input:
jika x benar {
menang();
}
Output:
if (x == true) {
menang();
}
Expected:
if (x == true) {
menang();
}
It's shorter and more explicit. Just my 2 cents.
from
misal x = 4;
misal y = x;
to
ada x = 4;
ada y = x;
Knowing strict equality is better for beginner because some errors are due to not knowing how equality work in JS
Reproducible on example page
This should works
jika a benar {
x = x + 1;
menang();
}
Currently we have to omit semicolon
jika a benar {
x = x + 1
menang()
}
And even the output is wrong (notice the double semicolon on AssignmentExpression
)
if (a == true) {
x = x + 1;;
menang();
}
according to KBBI, javascript const
which is constant
in english, mean "konstan(t)" in indonesian
also, because javascript "let" is more scoped var, what if we named let to be "variable" instead of using "misal"
Currently we can use any reserved word/token (such as var
, if
, etc) as identifier in naskah which won't be valid JS. The simplest thing we can do is add underscore before printing the identifier if it's a reserved word in JS
So that:
misal x = 3;
misal var = 2;
jika while benar {
}
should be compiled to
var x = 3;
var _var = 2;
if (_while == true) {
}
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.