Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jesperkha/fizz
Interpreted programming language built with Go
https://github.com/jesperkha/fizz
go golang interpreter language programming-language scripting tool
Last synced: about 2 months ago
JSON representation
Interpreted programming language built with Go
- Host: GitHub
- URL: https://github.com/jesperkha/fizz
- Owner: jesperkha
- License: mit
- Created: 2021-10-29T16:36:52.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-23T00:30:10.000Z (over 2 years ago)
- Last Synced: 2024-06-21T08:58:39.491Z (7 months ago)
- Topics: go, golang, interpreter, language, programming-language, scripting, tool
- Language: Go
- Homepage:
- Size: 1.76 MB
- Stars: 17
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
Fizz, the programming language
Interpreted dynamic programming language built with Go.
Documentation ยป
Examples
ยท
Report Bug
ยท
Download
Table of Contents
## About
Fizz is a dynamic and interpreted programming language built with Go. It is strongly typed and comes with very readable and accurate error messages. Fizz has most of the standard functionality that you would expect from modern programming languages. The library system also allows the user to implement their own features as Go functions and port them directly into Fizz. If you like this project, consider giving it a star ๐
### Features
- Variables, conditionals, and loops
- Functions, arrays, and objects
- File imports and libraries
- Clean syntax and simple grammar
## Installation
Prebuilt binary of the [latest release (v1.1.0)](https://github.com/jesperkha/Fizz/releases/tag/v1.1.0).
You can also build from source. However, building from source from a non-release branch does not guarantee that everything works as expected as some things may be undergoing changes.
1. Clone repo
2. Run the `build.sh` file
### Syntax highlighting
Finally, there is also optional, but recommended, [syntax highlighting](https://github.com/jesperkha/fizz-extensions) extensions for both Visual Studio Code and micro.
## Documentation
You can read the [full language documentation](./docs/lang.md) to learn about all of Fizz's syntax. It is also recommended to quickly skim over [the language grammar](./docs/grammar.md) to make sure you undestand the basics of how Fizz is structured (don't worry, it's _very_ similar to most modern programming languages).
Make sure to check out [the command-line basics](./docs/cmd.md) too so you know how to run your code and also which configurations you can apply.
## Running a program
[Full documentation on command-line basics](./docs/cmd.md)
### Terminal mode
Running the interpreter without giving a filename will run the terminal mode where you can run any valid Fizz code live. Errors are printed but the program is not terminated. Newlines are supported for blocks and the code will not be executed until the block is closed.
### Run file
Running the interpreter and giving a filename simply runs the code in the file and halts if an error occurs. Fizz files must end with the `.fizz` suffix. Both of the following are valid:
```console
$ ./fizz myFile.fizz
$ ./fizz myFile
```
## Code examples
Some simple code examples written in Fizz. There are more and bigger examples in the `examples` directory. All of the features used here and many more are thoroughly documented in the [documentation page](./docs/lang.md).
Write to a file:
```go
include "io";
include "str";
define Person {
name, age
}
func writePerson(person) {
if person == nil : person.name == "" {
error "Please enter a valid person";
}
io.appendFile("names.txt", str.format(person));
}
john := Person("John", 59);
writePerson(john);
```
Find max and min numbers in array:
```go
include "str";
arr := [5, 3, 7.5, 8, 2];
max := 0;
min := 999;
range n in arr {
if n > max {
max = n;
}
if n < min {
min = n;
}
}
print "Max: " + str.toString(max);
print "Min: " + str.toString(min);
```