Skip to content

NYAA: Not Yet Another Abstracted Programming Language

Notifications You must be signed in to change notification settings

SageTendo/NYAA-PL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NYAA-PL (Not Yet Another Abstracted Programming Language)

Introduction

NYAA-PL is a tree-walk interpreted programming language developed in Python (because why not :P),
created for fun and exploration in the realms of language and compiler design. Inspired by
anime, memes and the japanese language (borrowed and native words) references, this isn't
intended for real-world use.

Getting Started

Prerequisites

  • Python 3.10 🐍

Features

Built-ins

  • yomu: print line to console
    yomu("Hello, World!")
  • ohayo: get input from user
    name wa ohayo("Enter name: ")

Variables

name wa "NYAA"
age wa 1000
pi wa 3.142

yomu(name)
yomu(age)
yomu(pi)
Output
NYAA
1000
3.142

Conditionals

  • if Statement
    # If statement
    nani ( expression ) { body }
    
    # If-else statement
    nani ( expression ) { body }
    baka { body }
    
    # If-elif statement
    nani ( expression ) { body }
    nandesuka ( expression ) { body }
    
    # If-elif-else statement
    nani ( expression ) { body }
    nandesuka ( expression ) { body }
    baka { body }
  • Loops

    # While loop
    daijoubu ( expression ) { body }
    
    # For loop
    # '_' can be used in the same way as a variable within the for loop
    for _ => ( start, end ) { body }
    for i => ( start, end ) { body }

Functions

  • Defining a function
    Functions are defined before the program (main) block
    # One line function
    kawaii func_name(param1, param2, ...) => statement 
    
    # Multi-line function
    kawaii func_name(param1, param2, ...) => { body } 
  • Calling a function
    kawaii add(x, y) => {
      # return x + y 
      modoru x purasu y
    }
    
    uWu_nyaa() => {
      result wa add(1, 1)
    }

Code Examples

Hello_World.ny (single statement body)
# program block  
uWu_nyaa() => yomu("Hello, world!");  
Greet.ny
# function definition  
kawaii greet(name) {
	yomu("Hello,", name)
}  
  
# program block  
uWu_nyaa() => {  
	# Get input from user and assign it to name
	name wa ohayo("Enter name: ") 
	greet(name)
 }  

Acknowledgements

About

NYAA: Not Yet Another Abstracted Programming Language

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published