Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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)