A general-purpose programming language, focused on simplicity, safety and stability.

Overview
Rivet logo

The Rivet programming language

issues status license

A general-purpose programming language, focused on simplicity, safety and stability.

Rivet's goal is to be a very powerful programming language and at the same time easy to use, with a syntax inspired mainly by Rust and C# (which are the coolest languages I've ever seen), and by other languages such as Python, Lua, TypeScript, etc.

It is true that there are many programming languages and each of them specialized in a field; some with strange syntax in my opinion (like Lisp) and others with a high learning curve, but Rivet tries to be an exception by trying to become a unique language with a clear and simple syntax and a low learning curve.

NOTE: Rivet is still in the development phase.

Features

  • Easy-to-learn syntax: A syntax without overload of unnecessary elements.
  • Easy error handling: Via result types: fn alloc() !.
  • Named and optional arguments: Very useful.
  • Struct inheritance and polymorphism: Traits and Tagged Unions are also supported.
  • Ownership and Borrowing: Rivet has a very simplified version of Rust's Ownership and Borrowing system. The lifetimes are inferred by the compiler.
  • Templates: Reuse (and specialize) the same code for different types!.

Dependencies

The Rivet compiler currently generates C code, so a C compiler, which supports C11, is required to generate executables. Over time the compiler will add support for generating binaries directly without the need for a C compiler.

Run the compiler

NOTE: To run the compiler you must have Python 3.

NOTE: Only LINUX for now.

Just execute python3 rivetc.py.


Copyright (C) 2022 The Rivet Team

You might also like...
General purpose GPU compute framework for cross vendor graphics cards (AMD, Qualcomm, NVIDIA & friends)
General purpose GPU compute framework for cross vendor graphics cards (AMD, Qualcomm, NVIDIA & friends)

General purpose GPU compute framework for cross vendor graphics cards (AMD, Qualcomm, NVIDIA & friends). Blazing fast, mobile-enabled, asynchronous and optimized for advanced GPU data processing usecases. Backed by the Linux Foundation.

PyTorch implementation of Progressive Growing of GANs for Improved Quality, Stability, and Variation.
PyTorch implementation of Progressive Growing of GANs for Improved Quality, Stability, and Variation.

PyTorch implementation of Progressive Growing of GANs for Improved Quality, Stability, and Variation. Warning: the master branch might collapse. To ob

This project provides the proof of the uniqueness of the equilibrium and the global asymptotic stability.

Delayed-cellular-neural-network This project provides the proof of the uniqueness of the equilibrium and the global asymptotic stability. There is als

tsai is an open-source deep learning package built on top of Pytorch & fastai focused on state-of-the-art techniques for time series classification, regression and forecasting.
tsai is an open-source deep learning package built on top of Pytorch & fastai focused on state-of-the-art techniques for time series classification, regression and forecasting.

Time series Timeseries Deep Learning Pytorch fastai - State-of-the-art Deep Learning with Time Series and Sequences in Pytorch / fastai

The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.
The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.

The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.

TensorFlow Similarity is a python package focused on making similarity learning quick and easy.
TensorFlow Similarity is a python package focused on making similarity learning quick and easy.

TensorFlow Similarity is a python package focused on making similarity learning quick and easy.

ManimML is a project focused on providing animations and visualizations of common machine learning concepts with the Manim Community Library.
ManimML is a project focused on providing animations and visualizations of common machine learning concepts with the Manim Community Library.

ManimML ManimML is a project focused on providing animations and visualizations of common machine learning concepts with the Manim Community Library.

Code for ACL 21: Generating Query Focused Summaries from Query-Free Resources

marge This repository releases the code for Generating Query Focused Summaries from Query-Free Resources. Please cite the following paper [bib] if you

Automatic tool focused on deriving metallicities of open clusters

metalcode Automatic tool focused on deriving metallicities of open clusters. Based on the method described in Pöhnl & Paunzen (2010, https://ui.adsabs

Comments
  • The same compilation error will be mentioned many times

    The same compilation error will be mentioned many times

    Rivet version: main OS: Windows11

    test.ri:3:13: error: expected name, found token `++` 
        |
      3 |     let v = ++x;
        |             ^
    test.ri:3:15: error: expected `;`, found name `x` 
        |
      3 |     let v = ++x;
        |               ^
    rivetc: error: could not compile package `core`, aborting due to 2 previous errors
    

    It doesn't need to be fixed soon, the issue just track the problem Maybe we should solve these problems after self hosted as soon as possible

    Bug 
    opened by C-BJ 1
  • Infinite output of error information

    Infinite output of error information

    Rivet version: Main OS: Windows 11


    fn main() {
        let x = 0;
        x++;python rivetc.py test.ri
        println("{}", x);
    }
    

    Infinite output:

    test.ri:3:26: error: expected `;`, found keyword `test` 
        |
      3 |     x++;python rivetc.py test.ri
        |         
    

    Output after forced exit:

    Traceback (most recent call last):
      File "C:\Users\Austen\Desktop\rivet\rivetc.py", line 9, in <module>
        src.main(sys.argv[1:])
      File "C:\Users\Austen\Desktop\rivet\src\__init__.py", line 417, in main
        comp.build_package()
      File "C:\Users\Austen\Desktop\rivet\src\__init__.py", line 70, in build_package
        self.parse_files()
      File "C:\Users\Austen\Desktop\rivet\src\__init__.py", line 197, in parse_files
        self.source_files = parser.Parser(self).parse_pkg()
      File "C:\Users\Austen\Desktop\rivet\src\parser.py", line 32, in parse_pkg
        return self.parse_module_files()
      File "C:\Users\Austen\Desktop\rivet\src\parser.py", line 37, in parse_module_files
        source_files.append(self.parse_file(input))
      File "C:\Users\Austen\Desktop\rivet\src\parser.py", line 49, in parse_file
        return ast.SourceFile(file, self.parse_decls(), self.comp.mod_sym)
      File "C:\Users\Austen\Desktop\rivet\src\parser.py", line 107, in parse_decls
        decls.append(self.parse_decl())
      File "C:\Users\Austen\Desktop\rivet\src\parser.py", line 473, in parse_decl
        return self.parse_fn_decl(
        left = self.parse_shift_expr()
      File "C:\Users\Austen\Desktop\rivet\src\parser.py", line 737, in parse_shift_expr
        left = self.parse_additive_expr()
      File "C:\Users\Austen\Desktop\rivet\src\parser.py", line 758, in parse_additive_expr
        left = self.parse_multiplicative_expr()
      File "C:\Users\Austen\Desktop\rivet\src\parser.py", line 770, in parse_multiplicative_expr
        left = self.parse_unary_expr()
      File "C:\Users\Austen\Desktop\rivet\src\parser.py", line 791, in parse_unary_expr
        expr = self.parse_primary_expr()
      File "C:\Users\Austen\Desktop\rivet\src\parser.py", line 860, in parse_primary_expr
        elif self.tok.kind in (Kind.KeyUnsafe, Kind.Lbrace):
    
    Bug 
    opened by C-BJ 1
  • feat: basic support for generic functions

    feat: basic support for generic functions

    This PR adds basic support for generic functions. For now the compiler will support generic functions and structs, since that is all that is needed to develop the self-hosted compiler.

    The syntax is similar to Rust:

    fn gen<T>() { ... }
    
    fn main() {
        gen::<i32>();
    }
    

    Note: generic type inference will be available in self-hosted, the syntax will be:

    fn join<T>(arr: [T], sep: str = ", ") String { ... }
    
    fn main() {
        println("{}", join::<>([1, 2, 3, 4]));
    }
    
    opened by StunxFS 0
Owner
The Rivet programming language
A general-purpose programming language, focused on simplicity, safety and stability.
The Rivet programming language
A task-agnostic vision-language architecture as a step towards General Purpose Vision

Towards General Purpose Vision Systems By Tanmay Gupta, Amita Kamath, Aniruddha Kembhavi, and Derek Hoiem Overview Welcome to the official code base f

AI2 79 Dec 23, 2022
SSD: Single Shot MultiBox Detector pytorch implementation focusing on simplicity

SSD: Single Shot MultiBox Detector Introduction Here is my pytorch implementation of 2 models: SSD-Resnet50 and SSDLite-MobilenetV2.

Viet Nguyen 149 Jan 7, 2023
An Efficient Training Approach for Very Large Scale Face Recognition or F²C for simplicity.

Fast Face Classification (F²C) This is the code of our paper An Efficient Training Approach for Very Large Scale Face Recognition or F²C for simplicit

null 33 Jun 27, 2021
Paaster is a secure by default end-to-end encrypted pastebin built with the objective of simplicity.

Follow the development of our desktop client here Paaster Paaster is a secure by default end-to-end encrypted pastebin built with the objective of sim

Ward 211 Dec 25, 2022
ImVoxelNet: Image to Voxels Projection for Monocular and Multi-View General-Purpose 3D Object Detection

ImVoxelNet: Image to Voxels Projection for Monocular and Multi-View General-Purpose 3D Object Detection This repository contains implementation of the

Visual Understanding Lab @ Samsung AI Center Moscow 190 Dec 30, 2022
A general-purpose, flexible, and easy-to-use simulator alongside an OpenAI Gym trading environment for MetaTrader 5 trading platform (Approved by OpenAI Gym)

gym-mtsim: OpenAI Gym - MetaTrader 5 Simulator MtSim is a simulator for the MetaTrader 5 trading platform alongside an OpenAI Gym environment for rein

Mohammad Amin Haghpanah 184 Dec 31, 2022
Unofficial PyTorch implementation of MobileViT based on paper "MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer".

MobileViT RegNet Unofficial PyTorch implementation of MobileViT based on paper MOBILEVIT: LIGHT-WEIGHT, GENERAL-PURPOSE, AND MOBILE-FRIENDLY VISION TR

Hong-Jia Chen 91 Dec 2, 2022
a general-purpose Transformer based vision backbone

Swin Transformer By Ze Liu*, Yutong Lin*, Yue Cao*, Han Hu*, Yixuan Wei, Zheng Zhang, Stephen Lin and Baining Guo. This repo is the official implement

Microsoft 9.9k Jan 8, 2023
BYOL for Audio: Self-Supervised Learning for General-Purpose Audio Representation

BYOL for Audio: Self-Supervised Learning for General-Purpose Audio Representation This is a demo implementation of BYOL for Audio (BYOL-A), a self-sup

NTT Communication Science Laboratories 160 Jan 4, 2023
ZSL-KG is a general-purpose zero-shot learning framework with a novel transformer graph convolutional network (TrGCN) to learn class representation from common sense knowledge graphs.

ZSL-KG is a general-purpose zero-shot learning framework with a novel transformer graph convolutional network (TrGCN) to learn class representa

Bats Research 94 Nov 21, 2022