Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jweinst1/hljs
JavaScript in Lisp Syntax
https://github.com/jweinst1/hljs
javascript js lisp
Last synced: 6 days ago
JSON representation
JavaScript in Lisp Syntax
- Host: GitHub
- URL: https://github.com/jweinst1/hljs
- Owner: jweinst1
- License: mit
- Created: 2017-03-25T01:14:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-03-25T01:47:22.000Z (over 7 years ago)
- Last Synced: 2024-09-16T12:29:34.643Z (about 2 months ago)
- Topics: javascript, js, lisp
- Language: TypeScript
- Size: 28.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
#HLJS
HLJS, which stands for Hyper Lisp JavaScript, is a lisp-dialect that acts a code-as-data language to write javascript in.
It allows you to write javascript the exact same way you normally would, except in lisp format.##Installation
To install, run the following shell command:
`$ npm install -g hl-js`
To transcompile a `.hljs` file, use the following command
`$ HLJS yourfilename.hljs`
Or, you can use it inside your javascript
```javascript
var hljs = require('hljs');
hljs.Compile('(= (var x) 4) (console.log x)');
```##Guide
Here is a quick guide to the language and how it paralells to JavaScript.
###Variables and assignments
You can declare variables like this:
```
(var x)
(var a y z e)
```
and assign them like this```
(= a (function () (return 3)))
(= (var d) 4)
```###Operators
HLJS has all the javascript operators, like `+`, or `-`, etc.
```
(+ 3 4 5)
(- 3 (+ 4 5) (* 3 2 1))
(% 3 4 5 6)
```HLJS also has all the logical operators and conditionals of javascript
```
(=== 7 true)
(== 0 0 0)
```