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
A pure-Python codified rant aspiring to a world where numbers and types can work together.

Copyright and other protections apply. Please see the accompanying LICENSE file for rights and restrictions governing use of this software. All rights

Matt Bogosian 28 Sep 04, 2022
Open HW & SW for Scanning Electron Microscopes

OpenSEM Project Status: Preliminary The purpose of this project is to create a modern and open-source hardware and software platform for using vintage

Steven Lovegrove 7 Nov 01, 2022
A project for the Qvault Hackathon, 2022-01-17

musical-octo-engine Steps to run brew install python-tk brew install portaudio

Erik Kristofer Anderson 2 May 17, 2022
pythonOS: An operating system kernel made in python and assembly

pythonOS An operating system kernel made in python and assembly Wait what? It uses a custom compiler called snek that implements a part of python3.9 (

Abbix 69 Dec 23, 2022
A plugin for poetry that allows you to execute scripts defined in your pyproject.toml, just like you can in npm or pipenv

poetry-exec-plugin A plugin for poetry that allows you to execute scripts defined in your pyproject.toml, just like you can in npm or pipenv Installat

38 Jan 06, 2023
ToDo - A simple bot to keep track of things you need to do

ToDo A simple bot to keep track of things you need to do. Installation You will

3 Sep 18, 2022
Scientific Programming: A Crash Course

Scientific Programming: A Crash Course Welcome to the Scientific Programming course. My name is Jon Carr and I am a postdoc in Davide Crepaldi's lab.

Jon Carr 1 Feb 17, 2022
The purpose of this script is to bypass disablefund, provide some useful information, and dig the hook function of PHP extension.

The purpose of this script is to bypass disablefund, provide some useful information, and dig the hook function of PHP extension.

Firebasky 14 Aug 02, 2021
Gunakan Dengan Bijak!!

YMBF Made with ❤️ by ikiwzXD_ menu Results notice me: if you get cp results, save 3/7 days then log in. Install script on Termux $ pkg update && pkg u

Ikiwz 0 Jul 11, 2022
MySQL Connectivity based project. Contains various functions of a Store-Management-System

An Intermediate Level Python - MySQL Connectivity based project. Contains various functions of a Store-Management-System.

Yash Wadhvani 2 Nov 21, 2022
Import some key/value data to Prometheus custom-built Node Exporter in Python

About the app In one particilar project, i had to import some key/value data to Prometheus. So i have decided to create my custom-built Node Exporter

Hamid Hosseinzadeh 1 May 19, 2022
Arcpy Tool developed for ArcMap 10.x that checks DVOF points against TDS data and creates an output feature class as well as a check database.

DVOF_check_tool Arcpy Tool developed for ArcMap 10.x that checks DVOF points against TDS data and creates an output feature class as well as a check d

3 Apr 18, 2022
Test reproducibility of leiden/umap on different systems

Demonstrate that UMAP and Leiden analysis is not reproducible between different cpu architectures.

Gregor Sturm 2 Oct 16, 2021
Linux GUI app to codon optimize many single-fasta files with coding sequences , using many taxonomy ids

codon_optimize_cds_with_many_taxids_singlefasta Linux GUI app to codon optimize many single-fasta files with coding sequences, using many taxonomy ids

Olga Tsiouri 1 Jan 23, 2022
A web-based analysis toolkit for the System Usability Scale providing calculation, plotting, interpretation and contextualization utility

System Usability Scale Analysis Toolkit The System Usability Scale (SUS) Analysis Toolkit is a web-based python application that provides a compilatio

Jonas Blattgerste 3 Oct 27, 2022
An easy FASTA object handler, reader, writer and translator for small to medium size projects without dependencies.

miniFASTA An easy FASTA object handler, reader, writer and translator for small to medium size projects without dependencies. Installation Using pip /

Jules Kreuer 3 Jun 30, 2022
This is a Python package named - calculator

Calculator Python Package This is a Calculator Package of Python. How To Install The Package? Install calchundred with pip (Package Installer Of Pytho

Arinjoy_Programmer 1 Nov 21, 2021
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
Machine Learning powered app to decide whether a photo is food or not.

Food Not Food dot app ( 🍔 🚫 🍔 ) Code for building a machine Learning powered app to decide whether a photo is of food or not. See it working live a

Daniel Bourke 48 Dec 28, 2022
pvaPy provides Python bindings for EPICS pvAccess

PvaPy - PvAccess for Python The PvaPy package is a Python API for EPICS7. It supports both PVA and CA providers, all standard EPICS7 types (structures

EPICS Base 25 Dec 05, 2022