An easy-to-learn, dynamic, interpreted, procedural programming language

Overview

Gen Programming Language

WARNING!! THIS LANGUAGE IS IN DEVELOPMENT. ANYTHING CAN CHANGE AT ANY MOMENT.

Gen is a dynamic, interpreted, procedural programming language.

See the documentation
日本語はこっちです。

Almost everything (for, if, and more) can be written in just one line. But it is pretty wordy, so it's also easy to learn.

TODO List

  • Built-in functions
  • Map (dictionary in Python)
  • Import other files
  • Reading files with extention .gen (meaning allowing multi-line statements)

Installation

git clone https://github.com/Gen-lang/Gen.git
cd PyGen/pygen

Then you can run Makefile:

make install

Then you can use gen:

gen some_file.gen

Hello World

println("Hello World")

Example

For examples, see examples directory.

# Fizzbuzz

for fizzbuzz = 0 through 51 then
	if fizzbuzz % 3 == 0 and fizzbuzz % 5 == 0 then
		println("fizzbuzz")
		continue
	elseif fizzbuzz % 3 == 0 then
		println("fizz")
		continue
	elseif fizzbuzz % 5 == 0 then
		println("buzz")
		continue
	end
end

Contributing

Contributions are welcome! Especially, I need an assist on Makefile to make Gen available to Windows users.

Reports

If you found a bug, please open a new issue and paste the error message and your code that caused the bug.

Credits

I learned a lot from this series and T# programming language.

Comments
  • Make another gen implementation(Optional)

    Make another gen implementation(Optional)

    I think it will be good to have another gen implementation in other languages since the pygen implementation can be slow and it is also memory inefficient. I do think it needs to have a VM(virtual machine, python, java and other more languages use this), JIT(just in time) compiler or other more like AOT compiler(ahead of time). I think a VM is enough for portability since JIT compilers can compile to the target architectures that they only can support. This is only optional since performance and memory usage sometimes don't matter. Please correct me if I'm wrong.

    enhancement 
    opened by GalaxianMonster 24
  • Suggestions for the import feature

    Suggestions for the import feature

    My suggestions for the import feature:

    • Make it a function like:
    import("library file")
    

    or just a keyword:

    import "library file"
    
    • Make import return a map of the library
    • "library file" should be the path to the file

    That's all :)))

    enhancement 
    opened by GalaxianMonster 10
  • Library readline not available for Windows

    Library readline not available for Windows

    So I tested pygen on Windows. I needed to install readline in order to make gen.exe work. When installing readline on Windows using:

    pip install readline
    

    It does not work. One of the errors:

    error: this module is not meant to work on Windows
    

    That's all.

    help wanted 
    opened by GalaxianMonster 8
  • Building for Windows (Needs some fix, See comments below)

    Building for Windows (Needs some fix, See comments below)

    The issue is there are no builds for Windows. You can do that with simply this:

    pip install pyinstaller
    pyinstaller ./main.py --onefile
    COPY ./dist/main.exe ./pygen.exe
    

    Python's CLI is the same as Python Linux build CLI. Pyinstaller needs to be in windows in order to build it to .EXE file. So it's up to you now on how to build it on windows while on Linux. You need to add it on PATH environment variable though if you want to access with only "pygen" and not the whole path to the application, which I don't know how.

    I'm not an expert on Windows so I might be wrong.

    (Nice programming language btw)

    enhancement 
    opened by GalaxianMonster 8
  • Iterate an array

    Iterate an array

    I just wanted to ask you guys if creating another loop just for arrays:

    iterate arr as i then
        println(i)
    end
    

    Or should I just create the in keyword?

    for i in arr then
        println(i)
    end
    
    enhancement 
    opened by bichanna 4
  • About the import function

    About the import function

    Currently, this is how to use the import function:

    import("examples/bubble_sort.gen")
    
    arr = bubble_sort([12, 43, 23, 44])
    println(arr)
    

    But would you prefer something like this?

    imported = import("examples/bubble_sort.gen")
    
    arr = (imported@"bubble_sort")([12, 43, 23, 44])
    # or if possible, I may make it like this:
    # arr = imported@bubble_sort([12, 43, 23, 44])
    println(arr)
    

    I'm still experimenting with the latter.

    question 
    opened by bichanna 3
  • If statement does not work with complicated variable access

    If statement does not work with complicated variable access

    This if statement does not work:

    if arr@i == arr@j then # do_something
    

    So, to solve this, just assign them to new variables for now:

    a = arr@i
    b = arr@j
    if a == b then # do_something
    

    Update See the comment below, which is way better.

    invalid 
    opened by bichanna 3
  • Gen extend standard library

    Gen extend standard library

    The gen standard library is a bit small since it only has limited features. I think it will be good for it to have file I/O. You should also store file I/O functions in a "file" global map.

    That's all.

    enhancement 
    opened by GalaxianMonster 2
  • Implementation in Crystal lang

    Implementation in Crystal lang

    I do think Gen written in Python is slow, so I think creating an implementation of Gen written in Crystal is nice because it is fast, and its syntax is similar to Ruby (which I don't know much tough).

    enhancement 
    opened by bichanna 1
Releases(0.3.0)
Owner
Gen Programming Language
An easy-to-learn, dynamic, interpreted, procedural programming language
Gen Programming Language
Rick Astley Language is a rick roll oriented, dynamic, strong, esoteric programming language.

Rick Roll Language / Rick Astley Language A rick roll oriented, dynamic, strong, esoteric programming language. Prolegomenon The reasons that I made t

Rick Roll Programming Language 658 Jan 9, 2023
Procedural 3D data generation pipeline for architecture

Synthetic Dataset Generator Authors: Stanislava Fedorova Alberto Tono Meher Shashwat Nigam Jiayao Zhang Amirhossein Ahmadnia Cecilia bolognesi Dominik

Computational Design Institute 49 Nov 25, 2022
Automated, progress quest-inspired procedural adventuring

Tales of an Endless Journey (TEJ) Automated, progress quest-inspired procedural adventuring What is this project? Journey is the result of many, many

null 8 Dec 14, 2021
Procedural modeling of fruit and sandstorm in Blender (bpy).

SandFruit Procedural modelling of fruit and sandstorm. Created by Adriana Arcia and Maya Boateng. Last updated December 19, 2020 Goal & Inspiration Ou

Adriana Arcia 2 Mar 20, 2022
Pdraw - Generate Deterministic, Procedural Artwork from Arbitrary Text

pdraw.py: Generate Deterministic, Procedural Artwork from Arbitrary Text pdraw a

Brian Schrader 2 Sep 12, 2022
A small project of two newbies, who wanted to learn something about Python language programming, via fun way.

HaveFun A small project of two newbies, who wanted to learn something about Python language programming, via fun way. What's this project about? Well.

Patryk Sobczak 2 Nov 24, 2021
Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.

Advent Of Code 2021 - Python English Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels th

Coral Izquierdo Muñiz 2 Jan 9, 2022
Built with Python programming language and QT library and Guess the number in three easy, medium and hard rolls

guess-the-numbers Built with Python programming language and QT library and Guess the number in three easy, medium and hard rolls Number guessing game

Amir Hussein Sharifnezhad 5 Oct 9, 2021
Built with Python programming language and QT library and Guess the number in three easy, medium and hard rolls

password-generator Built with Python programming language and QT library and Guess the number in three easy, medium and hard rolls Password generator

Amir Hussein Sharifnezhad 3 Oct 9, 2021
"Cambio de monedas" Change-making problem with Python, dynamic programming best solutions,

Change-making-problem / Cambio de monedas Entendiendo el problema Dada una cantidad de dinero y una lista de denominaciones de monedas, encontrar el n

Juan Antonio Ayola Cortes 1 Dec 8, 2021
PyGo custom language, New but similar language programming

New but similar language programming. Now we are capable to program in a very similar language to Python but at the same time get the efficiency of Go.

Fernando Perez 4 Nov 19, 2022
Source code for Learn Programming: Python

This repository contains the source code of the game engine behind Learn Programming: Python. The two key files are game.py (the main source of the ga

Niema Moshiri 25 Apr 24, 2022
Projeto-menu - This project is designed to learn more about control mechanisms in Python programming

Projeto-menu - This project is designed to learn more about control mechanisms in Python programming

Henrik Ricarte 2 Mar 1, 2022
A modern python module including many useful features that make discord bot programming extremely easy.

discord-super-utils Documentation Secondary Documentation A modern python module including many useful features that make discord bot programming extr

null 106 Dec 19, 2022
Learn to code in any language. If

Learn to Code It is an intiiative undertaken by Student Ambassadors Club, Jamshoro for students who are absolute begineers in programming and want to

Student Ambassadors' Club at Mehran UET 15 Oct 19, 2022
lets learn Python language with basic examples. highly recommended for beginners who just start coding.

Lets Learn Python ?? Learn python from basic programs. learn python from scratch. 1.Online python compiler: https://www.onlinegdb.com/online_python_co

Subhranshu Choudhury 1 Jan 18, 2022
Short, introductory guide for the Python programming language

100 Page Python Intro This book is a short, introductory guide for the Python programming language.

Sundeep Agarwal 185 Dec 26, 2022
sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character.

ꦱꦮ sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character. sawa iku

Rony Lantip 307 Jan 7, 2023
The Zig programming language, packaged for PyPI

Zig PyPI distribution This repository contains the script used to repackage the releases of the Zig programming language as Python binary wheels. This

Zig Programming Language 100 Nov 4, 2022