Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zuluoaaa/makeJs
A sub Javascript interpreter for interpreting itself
https://github.com/zuluoaaa/makeJs
interpreter javascript-interpreter makejs
Last synced: 4 months ago
JSON representation
A sub Javascript interpreter for interpreting itself
- Host: GitHub
- URL: https://github.com/zuluoaaa/makeJs
- Owner: zuluoaaa
- License: mit
- Created: 2020-03-02T03:47:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-05-13T10:07:20.000Z (about 4 years ago)
- Last Synced: 2024-01-17T07:17:46.623Z (6 months ago)
- Topics: interpreter, javascript-interpreter, makejs
- Language: JavaScript
- Homepage:
- Size: 574 KB
- Stars: 337
- Watchers: 11
- Forks: 31
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-javascript-interpreters - zuluoaaa/makeJs - commit/zuluoaaa/makeJs) | (javascript interpreters / old projects)
README
# makeJs
For leaning how to do a interpreter.
So I make a sub Javascript interpreter for interpreting itself.
(No dependence any third-party)# In developing
Now support:
* define variables
* simple expression
* compares
* if statement
* while loop
* Function
* Array![demo.jpg](/demo.gif)
```js
function quickSort(list,len) {
let a = 0;
let b = len-1;
let c = list[a];
while (a < b){
while (list[b]>c && a < b){
b = b-1;
}
if(list[b] < c){
list[a] = list[b];
list[b] = c;
b = b-1;
c = list[b];
}
while (list[a] < c && a < b){
a = a + 1;
}
if(list[a] > c){
list[b] = list[a];
list[a] = c;
a = a + 1;
c = list[a];
}
}
return list;
}let arr = [9,3,2,1,5,-2,6];
quickSort(arr,7);```
See the test folder for more examples
# Future support:
* Object
* ...