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 = [email protected]_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

    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
Sudoku-Solver

Sudoku-Solver This is a personal project, that put all my today knowledges to the test, is a project that im developing alone with a lot of effort and

Carlos Ismael Gitto Bernales 5 Nov 08, 2021
A web interface for a soft serve Git server.

Soft Serve monitor Soft Sevre is a very nice git server. It offers a really nice TUI to browse the repositories on the server. Unfortunately, it does

Maxime Bouillot 5 Apr 26, 2022
Tracking stock volatility.

SP500-highlow-tracking Track stock volatility. Being a useful indicator of the stock price volatility, High-Low gap represents the price range of the

Thong Huynh 13 Sep 07, 2022
Programming in Bioinformatics, Block 3

Programming in Bioinformatics - Block 3 I. Setting up Environment and Running the Code Create the environment using the pibi_block3.yml file with the

2 Dec 10, 2021
A not exist cat image generator python package

A not exist cat image generator python package

Fayas Noushad 2 Dec 03, 2021
Hopefully it'll become a very annoying desktop pet

AnnoyingPet Basic Tutorial: https://seebass22.github.io/python-desktop-pet-tutorial/ Handling Mouse Input: https://pythonhosted.org/pynput/mouse.html

1 Jun 08, 2022
Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero.

Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero. Print the decimal value of each fraction on a new line with places after the decimal.

Shruti Dhave 2 Nov 29, 2021
Explore related sequences in the OEIS

OEIS explorer This is a tool for exploring two different kinds of relationships between sequences in the OEIS: mentions (links) of other sequences on

Alex Hall 6 Mar 15, 2022
A Blender addon to align the origin to the top, center or bottom of a mesh object

Align Origin Blender Addon. Align Origin Blender Addon. What? This simple addon lets you align the origin to the top, center or bottom of a mesh objec

VA79 7 Nov 30, 2022
Load, explore and analyse data from Scotland and rest of the world related to Covid19.

Streamlit Examples This is my first attempt with Streamlit. It is an open-source framework, free, Python-based and easy to use tool to build and deplo

Eyad Elyan 12 Mar 01, 2021
JD-backup is an advanced Python script, that will extract all links from a jDownloader 2 file list and export them to a text file.

JD-backup is an advanced Python script, that will extract all links from a jDownloader 2 file list and export them to a text file.

Kraken.snv 3 Jun 07, 2022
4Geeks Academy Full-Stack Developer program final project.

Final Project Chavi, Clara y Pablo 4Geeks Academy Full-Stack Developer program final project. Authors Javier Manteca - Coding - chavisam Clara Rojano

1 Feb 05, 2022
Access Modbus RTU via API call to Sungrow WiNet-S

SungrowModbusWebClient Access Modbus RTU via API call to Sungrow WiNet-S Class based on pymodbus.ModbusTcpClient, completely interchangeable, just rep

8 Oct 30, 2022
CEI Natural Disaster Tracking Portal

CEI Natural Disaster Tracking Portal (cc) Climatic Eye of ISCI We are an initiative that conducts studies in the field of Space Science, publishes pro

Baris Dincer 7 Dec 24, 2022
CRC Reverse Engineering Tool in Python

CRC Beagle CRC Beagle is a tool for reverse engineering CRCs. It is designed for commnication protocols where you often have several messages of the s

Colin O'Flynn 51 Jan 05, 2023
A supercharged version of paperless: scan, index and archive all your physical documents

Paperless-ng Paperless (click me) is an application by Daniel Quinn and contributors that indexes your scanned documents and allows you to easily sear

Jonas Winkler 5.3k Jan 09, 2023
Alerts for Western Australian Covid-19 exposure locations via email and Slack

WA Covid Mailer Sends alerts from Healthy WA's Covid19 Exposure Locations via email and slack. Setup Edit the configuration items in wacovidmailer.py

13 Mar 29, 2022
Penelope Shell Handler

penelope Penelope is an advanced shell handler. Its main aim is to replace netcat as shell catcher during exploiting RCE vulnerabilities. It works on

293 Dec 30, 2022
Generate your personal 8-bit avatars using Cellular Automata, a mathematical model that simulates life, survival, and extinction

Try the interactive demo here ✨ ✨ Sprites-as-a-Service is an open-source web application that allows you to generate custom 8-bit sprites using Cellul

Lj Miranda 265 Dec 26, 2022
The fetch of the delegator list and the input of the epoch nonce need to be done independently

raffle The fetch of the delegator list and the input of the epoch nonce need to be done independently. Get the list of delegators at the epoch change.

1 Dec 15, 2021