moonad-archive / formality-javascript Goto Github PK
View Code? Open in Web Editor NEWAn implementation of the Formality language in JavaScript
License: MIT License
An implementation of the Formality language in JavaScript
License: MIT License
The setup
I went to the wiki and followed the step in "0. Installation" successfully:
>> node -v
v8.16.0
>> npm -v
6.4.1
>> fmc
Formality-Core
...
Note: fmc will automatically import any local file ending in .fmc
.
>> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
The hello world file main.fmc:
def main:
"Hello, world!"
The error
>> fmc main
/home/dan/opt/npm/lib/node_modules/formality-core/fm-core.js:819
var bytes = [].slice.call(new TextEncoder("utf-8").encode(text), 0);
^
ReferenceError: TextEncoder is not defined
at text_to_term (/home/dan/opt/npm/lib/node_modules/formality-core/fm-core.js:819:33)
at parse_term (/home/dan/opt/npm/lib/node_modules/formality-core/fm-core.js:171:14)
at Object.parse (/home/dan/opt/npm/lib/node_modules/formality-core/fm-core.js:287:18)
at Object. (/home/dan/opt/npm/lib/node_modules/formality-core/main.js:57:28)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
The error seems to appear also when called on a file that does not exist
>> fmc doesnotexist
/home/dan/opt/npm/lib/node_modules/formality-core/fm-core.js:819
var bytes = [].slice.call(new TextEncoder("utf-8").encode(text), 0);
^
ReferenceError: TextEncoder is not defined
at text_to_term (/home/dan/opt/npm/lib/node_modules/formality-core/fm-core.js:819:33)
at parse_term (/home/dan/opt/npm/lib/node_modules/formality-core/fm-core.js:171:14)
at Object.parse (/home/dan/opt/npm/lib/node_modules/formality-core/fm-core.js:287:18)
at Object. (/home/dan/opt/npm/lib/node_modules/formality-core/main.js:57:28)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
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.