Skip to content

Commit

Permalink
Merge pull request #23 from ujjwal-kr/dev
Browse files Browse the repository at this point in the history
Dev - Ram 3.0 with new emulated memory and CPU
  • Loading branch information
ujjwal-kr authored Dec 15, 2022
2 parents 9e38755 + 410cfb1 commit cb08b5c
Show file tree
Hide file tree
Showing 49 changed files with 4,571 additions and 3,826 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Rust

on:
push:
branches: [ master ]
branches: [ master, dev ]
pull_request:
branches: [ master ]

Expand All @@ -19,6 +19,6 @@ jobs:
- name: Build
run: cargo build --verbose
- name: Run unit test
run: cargo run test --verbose
- name: E2E
run: cargo run ./examples/default.ram --verbose
run: cargo test --verbose
# - name: E2E
# run: cargo run ./examples/default.ram --verbose
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target
plan.txt
96 changes: 14 additions & 82 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 9 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[package]
name = "ram"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
rand = "0.8.4"
colored = "2.0.0"
[package]
name = "ram"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
rand = "0.8.4"
regex = "1.5"
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# The Ram programming language
A stack-based programming language developed to experiment with my language development skills. It is capable of making some mathematical formulation and logic. Written in the Rust programming language.
A stack-based programming language developed to experiment with my language development skills. Runs on a emulated virual machine, using custom memory, allocation and garbage collection methods.

## How to run
1. Download the [release binary](https://github.com/ujjwal-kr/ram/releases/download/v2.7/ram).
1. Download the [release binary](https://github.com/ujjwal-kr/ram/releases/latest) [Only for windows and linux].
2. Make it executable using `chmod +x ./ram`
3. Make a .ram file with the following contents at the same directory as the binary:

Expand All @@ -12,7 +12,8 @@ main:
ram 1
add
ram lx prev
print
print var lx
ram lx
ram 500
cmp
je halt:
Expand All @@ -24,15 +25,15 @@ halt:

4. run `./ram ./example.ram` and press enter.

## How to test
Run `cargo run test` to run the custom tests to test all the commands in the suit. Make sure to run this before pushing any PRs. The tests are automatically ran when there is a PR/commit on the master branch.
# Documentation

![tests](https://media.discordapp.net/attachments/867819380464680980/947347676503089172/unknown.png?width=350&height=510)
The documentation for using the language is available in the [wiki](https://github.com/ujjwal-kr/ram/wiki/Documentation-v3.0)

# Documentation
## How to test
Run `cargo test` to run all the tests. This is the output of the test runner:

The documentation for using the language is available in the [wiki](https://github.com/ujjwal-kr/ram/wiki/Documentation---v2.7)
![tests](https://cdn.discordapp.com/attachments/875733830542196768/1032414620377428059/unknown.png)

# Contributing
# Contribution

Im not accepting any braking changes to the specs, as the syntax of the language is still in development. But suggestions can be made using the issue tracker. All other types of contributions are welcome. Make sure to check the `dev` branch, PRs to che master branch wont be accepted.
Im not accepting any braking changes to the specs, as the syntax of the language is still in development. But suggestions can be made using the issue tracker. All other types of contributions are welcome. Make sure to check the `dev` branch, PRs to che master branch wont be accepted.
20 changes: 3 additions & 17 deletions ex.ram
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
include "ex2.ram"
include "ex3.ram

main:
var x int >> 10
var y int >> 20
jmp one:
jmp ok:
jmp add:
ram global_var sum
print

add:
ram var x
ram var y
add
global_var sum int >> 0
ram global_var sum prev
ram string = './ex2.ram'
stdfs open string = lxstring
print var lxstring
17 changes: 15 additions & 2 deletions ex2.ram
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
ok:
printc >> hello from ok
main:
ram lx
ram 1
add
ram lx prev
print var lx
ram lx
ram 1000
cmp
je halt:
jmp main:

halt:
dbg
halt
2 changes: 1 addition & 1 deletion ex3.ram
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
one:
printc >> hello from one
print hello from one
Loading

0 comments on commit cb08b5c

Please sign in to comment.