Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mohammad-al-refai/jsx-language
Stack-oriented programming language that feels like JSX
https://github.com/mohammad-al-refai/jsx-language
go programming-language
Last synced: about 7 hours ago
JSON representation
Stack-oriented programming language that feels like JSX
- Host: GitHub
- URL: https://github.com/mohammad-al-refai/jsx-language
- Owner: Mohammad-Al-Refai
- Created: 2024-04-10T19:40:36.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-08-23T08:37:10.000Z (3 months ago)
- Last Synced: 2024-08-23T09:38:28.137Z (3 months ago)
- Topics: go, programming-language
- Language: Go
- Homepage:
- Size: 105 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jsx-language
## Overview
Have you ever wondered how programming languages actually work under the hood? Do you believe that languages are just magical entities?
In this project, I set out to create a simple stack-oriented programming language and its syntax looks like JSX (because I love react js 😊) and all of that using the Go programming language with 0 dependencies. Inspired by my curiosity and desire to understand the inner workings of languages, this project served as an educational endeavor to demystify the magic behind programming languages, even it just an interpreted language not a compiled language but it worth it.
## Getting Started
Download jsx-language from the [releases](https://github.com/Mohammad-Al-Refai/jsx-language/releases) then create a file and run:```bash
./jsx-language [file path]
```### How it works?
![image](https://github.com/Mohammad-Al-Refai/ht/assets/55941955/8afca54b-c5d1-4e18-afd0-b16b339c9e4e)### Comment
start with `#`### Variables
Math operations: `+` & `-` & `*` & `/` & `%`
Supported values:
- `string`
- `number`
- `array`
- `boolean`
- object member call
```jsx
```
## If statement
Logical operators:
- `==`
- `!=`
- `greater` like `>`
- `smaller` like `<`
```jsx
...
```
## Loop
```jsx
```
### Break
```jsx
```
### Continue
```jsx
```
## Function
```jsx
```
## Function call
```jsx
```
## Array
```jsx
// [array] array.length()
```
```jsx
// [array] [index] array.at()
```
```jsx
// [array] [value] array.push()
```
```jsx
// [array] array.pop()
```
[Examples](https://github.com/Mohammad-Al-Refai/ht/tree/main/examples)
## Recurses I learnt from
- [Making Programming Language in Python -- Porth](https://www.youtube.com/watch?v=8QP2fDBIxjM&list=PLpM-Dvs8t0VbMZA7wW9aR3EtBqe2kinu4)
- [How To Build A Programming Language From Scratch](https://www.youtube.com/watch?v=8VB5TY1sIRo&list=PL_2VhOvlMk4UHGqYCLWc6GO8FaPl8fQTh&pp=iAQB)
- [Stack orinted programming](https://en.wikipedia.org/wiki/Stack-oriented_programming)