Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lassejlv/hotscript
Good programming language written in ChatGPT
https://github.com/lassejlv/hotscript
Last synced: 2 months ago
JSON representation
Good programming language written in ChatGPT
- Host: GitHub
- URL: https://github.com/lassejlv/hotscript
- Owner: lassejlv
- Created: 2024-04-03T21:46:29.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-04-03T21:52:09.000Z (9 months ago)
- Last Synced: 2024-04-17T03:57:56.071Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 16.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
> [!WARNING]
> This is a joke, chatgpt made all of this. Also the documention# Hotscript Language Documentation
Hotscript is a simple programming language designed to be easy to learn and use. It supports basic arithmetic operations, variable assignment, and printing.
## Getting Started
To write and run Hotscript code, follow these steps:
1. Write your Hotscript code in a file with a `.hs` extension.
2. Run the Hotscript interpreter using the provided Node.js script.### Example:
```plaintext
x = 10
y = 5
z = x + y
print(z)
```Save this code in a file named `example.hs`, and then run it using the Hotscript interpreter:
```
node hotscript.js example.hs
```This will output the result of the arithmetic operation, which is `15`.
## Syntax
### Variables
Variables in Hotscript are dynamically typed and can hold integer values or strings. Variable names can contain letters and numbers, but must start with a letter.
```plaintext
x = 10
name = "John"
```### Arithmetic Operations
Hotscript supports addition (`+`) and subtraction (`-`) operations on integers.
```plaintext
result = 10 + 5
```### Printing
You can use the `print()` function to output the value of a variable or expression.
```plaintext
x = 10
y = 5
z = x + y
print(z)
```## Comments
Single-line comments start with `//`.
```plaintext
// This is a comment
```## Error Handling
Hotscript will throw an error if it encounters unexpected tokens or undefined variables.
## Example Program
Here's a complete example program that demonstrates the basic features of Hotscript:
```plaintext
// Define variables
x = 10
y = 5
name = "John"// Perform arithmetic operation
z = x + y// Construct message
message = "Hello, " + name + "! The sum of x and y is " + z// Print message
print(message)
```Save this code in a file named `example.hs`, and then run it using the Hotscript interpreter as shown earlier.
## Conclusion
Hotscript is a simple yet powerful programming language suitable for beginners and small-scale projects. It provides essential features for arithmetic operations, variable handling, and printing output.
For more information and updates, visit the Hotscript GitHub repository.