👩🏼‍💻A simple compiled programming language


👩🏼‍💻 A simple compiled programming language.

The language is written in Go and the target language is C. The built-in library is written in C too. ⚠️ This project is a prototype Please consider it.


Example

Code example

6 console|println("the number must be contained between 0 and 6") - roll the dice and check if the given number is the same as the computer else computerNumber = rollDice() if *number == *computerNumber console|println("you won! same number as the computer!") else stdio|printf("you lost! the computer's number was %d" *computerNumber) end end ">
- returns a random number between 0 and 6
fn rollDice() int
    random|randInt(6)
end

- gets the user entry
console|println("Enter your name")
name = console|getStringEntry()

- uses pipe character to use multiple time built-in functions coming
- from the same package
console
    |print("Hello, ")
    |println(*name)
    |println("Please enter a number")

- asks the user to enter a number and prints the number given
number = console|getIntEntry()
stdio|printf("You've entered: %d\n" *number)

- check if the given number is in the 0-6 range
if *number < 0 or *number > 6
    console|println("the number must be contained between 0 and 6")
- roll the dice and check if the given number is the same as the computer
else
    computerNumber = rollDice()
    if *number == *computerNumber
        console|println("you won! same number as the computer!")
    else
        stdio|printf("you lost! the computer's number was %d" *computerNumber)
    end
end

Module file

mod "console"

fn println(string)
fn print(string)
fn getStringEntry() string
fn getIntEntry() int


Made by Hugo Lageneste

Owner
paco
A simple compiled programming language
paco
Similar Resources

A stack oriented esoteric programming language inspired by poetry and forth

paperStack A stack oriented esoteric programming language inspired by poetry and forth What is paperStack A stack oriented language An esoteric progra

Nov 14, 2021

Oak is an expressive, dynamically typed programming language

Oak 🌳 Oak is an expressive, dynamically typed programming language. It takes the best parts of my experience with Ink, and adds what I missed and rem

Dec 30, 2022

Besten programming language

Besten What holds this repository? Besten Lexer Besten Parser Besten Interpreter Besten Module Loader Besten Lexer Located in ./internal/lexer A set o

Jun 13, 2022

🎅 A programming language for Advent of Code.

🎅 Adventlang My blog post: Designing a Programming Language for Advent of Code A strongly typed but highly dynamic programming language interpreter w

Dec 28, 2022

An experimental programming language.

crank-lang An experimental & interpreted programming language written in Go. Features C like syntax Written in Golang Interpreted Statically Typed Dis

Dec 6, 2021

Gec is a minimal stack-based programming language

Gec is a minimal stack-based programming language

Sep 18, 2022

Functional programming library for Go including a lazy list implementation and some of the most usual functions.

functional A functional programming library including a lazy list implementation and some of the most usual functions. import FP "github.com/tcard/fun

May 21, 2022

Flow-based and dataflow programming library for Go (golang)

Flow-based and dataflow programming library for Go (golang)

GoFlow - Dataflow and Flow-based programming library for Go (golang) Status of this branch (WIP) Warning: you are currently on v1 branch of GoFlow. v1

Dec 30, 2022

A library for parallel programming in Go

pargo A library for parallel programming in Go Package pargo provides functions and data structures for expressing parallel algorithms. While Go is pr

Nov 28, 2022
Jan 4, 2022
Simple interface to libmagic for Go Programming Language

File Magic in Go Introduction Provides simple interface to libmagic for Go Programming Language. Table of Contents Contributing Versioning Author Copy

Dec 22, 2021
Unit tests generator for Go programming language
Unit tests generator for Go programming language

GoUnit GoUnit is a commandline tool that generates tests stubs based on source function or method signature. There are plugins for Vim Emacs Atom Subl

Jan 1, 2023
FreeSWITCH Event Socket library for the Go programming language.

eventsocket FreeSWITCH Event Socket library for the Go programming language. It supports both inbound and outbound event socket connections, acting ei

Dec 11, 2022
The Gorilla Programming Language
The Gorilla Programming Language

Gorilla Programming Language Gorilla is a tiny, dynamically typed, multi-engine programming language It has flexible syntax, a compiler, as well as an

Apr 16, 2022
Elastic is an Elasticsearch client for the Go programming language.

Elastic is an Elasticsearch client for the Go programming language.

Jan 9, 2023
Lithia is an experimental functional programming language with an implicit but strong and dynamic type system.

Lithia is an experimental functional programming language with an implicit but strong and dynamic type system. Lithia is designed around a few core concepts in mind all language features contribute to.

Dec 24, 2022
accessor methods generator for Go programming language

accessory accessory is an accessor generator for Go programming language. What is accessory? Accessory is a tool that generates accessor methods from

Nov 15, 2022
Http web frame with Go Programming Language

Http web frame with Go Programming Language

Oct 17, 2021
A modern programming language written in Golang.

MangoScript A modern programming language written in Golang. Here is what I want MangoScript to look like: struct Rectangle { width: number he

Nov 12, 2021