https://github.com/marc2332/ham
π ham, general purpose programming language
https://github.com/marc2332/ham
interpreted programming-language rust
Last synced: 9 months ago
JSON representation
π ham, general purpose programming language
- Host: GitHub
- URL: https://github.com/marc2332/ham
- Owner: marc2332
- License: mit
- Created: 2021-06-10T15:14:49.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-19T19:31:39.000Z (over 4 years ago)
- Last Synced: 2024-10-19T13:17:46.500Z (over 1 year ago)
- Topics: interpreted, programming-language, rust
- Language: Rust
- Homepage:
- Size: 1.35 MB
- Stars: 22
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
π ham, a programming language made in Rust
**NOTE: I'm learning rust, I am still a noob**
status: **alpha**
You can **download** it from [here](https://github.com/marc2332/ham/releases).
### Goals
- Speed
- Security
- Comfort
### Language Ideas
- Rust interoperability
- Manifest file
- Ability to import files from:
- Local file system
- HTTP urls
- By name (this would use some kind of remote registry to translate it to HTTP urls)
- std library
- Low-level (networking, file system...) APIs
### Project ideas
- CD integration to release a new version in each commit
- More unit tests
### Example
```rust
fn calc(value){
// If the value is 5 end the function
if value == 5 {
return 0
}
// Add 1
value.mut_sum(1)
// Print it's value
println(format("Value is {}", value))
// Call the function again with the latest value
return calc(value)
}
// This will print from `Value is 1` to `Value is 5`
let _ = calc(0)
```
There are more examples in /examples.
### About
ham is a general purpose language. It is heavily inspired by Rust and TypeScript.
### Usage
Built-in repl:
```shell
ham repl
```
Run files:
```shell
ham run examples/demo.ham
```
Run a project (This will run `1_project/src/main.ham` automatically):
```shell
ham run examples/1_project
```
### Contribuding
Compiling:
```shell
cargo build --release
```
Linting:
```shell
cargo clippy
```
Formatting:
```shell
cargo fmt
```
Testing:
```shell
cargo test
```
Install mdbook:
```shell
cargo install mdbook
```
Build the book:
```shell
mdbook build
```
Watch for changes on the book:
```shell
mdbook watch
```
Running directly:
```shell
cargo run -- run examples/demo.ham
```
Made by Marc EspΓn Sanz
MIT License