The UwU's Scripting language. Made with love for UwU Nyanny Commuwiwwy!

UwUscript

UwUscript is a scripting language.

Installation

Prerequisite

  • LLVM 10.0
  • flex and bison.
  • CMake 3.10

Build

  1. Clone this repository.
git clone https://github.com/uwussimo/uwuscript.git
  1. Create a build directory
mkdir build
  1. Change to the build directory and run cmake
cd build
cmake ..

Make sure all variables are set properly and then generate the build. One can use ccmake (GUI) to change or check the variables.

  1. Run the make
make

or

make install
  1. That's it.

Windows

After cmake was run the solution file is in the build directory. Start Visual Studio and you are ready to compile it.

Usage

owo script-file -h -d -v -q -ipath1;path2...;pathn

where

  • h help: shows the usage.
  • d debug: Disables the code optimizer.
  • v verbose: print a lot of information.
  • q quiet: don't show any output.
  • i defines a list of additional path to look for files to import.

UwUscript does parse the file, generates the code in memory and runs it.

Examples

./owo test.owo
./owo test.owo -q
./owo test.owo -v -d -i import/path;import/other/path

Language Syntax

Literals

Can be any literal word including -_%$? and digits. It must start with a letter or an underscore.

a-b
otto4all
price?
_makeNew!

This can be used for symbols as variable names, function name etc.

Strings

A string is enclosed in " or '. A quote in a string must be escaped by a \.

"This is a string."
"This is
a multiple
line string."
'The man said:"This is a string." and left the place.'
"But \"here\" we need them."

Numbers

Simple Integer numbers, decimal numbers. Currently no binary and hex format is supported.

5
230
-88
27.5
0.345
.1
-1234.56
1.2e2
1.2e+2
1.2e-2

Boolean

A boolean can take the symbol true or false.

Array

An array is a container which can hold elements of arbitrary types.

var array = [1,2,3,4]

The elements don't have to be of the same type.

var list = [1+2, 'Otto', true]

Hint: Currently only valid with a var declaration and an assignment.

Adding an element to the array above

list << 5

results in [3, 'Otto', true, 5]

Note This feature is currently under construction and not stable.

Comments

One Line

One line comment starts with #. All characters after that symbol are ignored until the end of line symbol.

Multiple Lines

A comment starts with @{ and ends with @}. All text in between is ignored.

Variable

Name

The same rules apply as for literals.

Declaration

Variables can be declared as integer, number, boolean or string.

int i
double d
string text
boolean b

And they can get an initial value:

int _abc = 1
int a = 1
int b = 2 
int a-b = a - b
boolean b = true
string text = 'This is a string.'

The var keyword is used to auto deduce the type of a variable.

var abc = 1     # deduce to int
var s = "Hello" # deduce to string.
var something   # type deduce will take place with the next assignment.

Program

A program consists of several program blocks and each program block consists of statements. Each statement can be

  • a control expression
  • an assignment
  • a function declaration
  • a variable declaration
  • a return statements

and so on.

Program Block

Program blocks are defined by the indention (similar to python).

block1
  block2
    block3
  block2
block1	

Control Expressions

if

if bool-expression 
  statements
else
  statements

while

while id > 0
  id = id - 1
  do-something
else
  display("upps nix\n")

return

return expression

Assignment

var a = 5

Function

Functions are defined as followed:

def aFunction( type param1, type param2 ) : return-type
  statements
  return expression

or if no return value is provided:

def aFunction( type param1, type param2 )
  statements

or with return type deduction:

def aFunction( type param1, type param2 )
  statements
  return expression

or if no parameter is needed:

def aFunction()
  statements

or if parameter type can/should be deduced at call time:

def aFunction(var param1, var param2)
  statements
  return expression

and any combination.

Calling a function

aFunction( 1, "text" )
aFunction()
int i = aFunction( 23 )

Class

def classname
    type instance-variable
    def method
        method-body

Hint: The keyword var can't be used to declare an instance variable.

Creating an object of a class

classname variable

The current class instance can be accesses via the keyword self. This is obligate if a class instance variable will be accessed.

Example:

def simple
    int myint = 5
    def get() : int
        return self.myint

simple p

int i = p.get()

Miscellaneous

Any class method can be declared outside a class declaration if the first argument is the class instance object.

def set(simple s, int val)
    s.myint = val

On the other side each method of a class can be called in two ways

simple p
int i = p.get()

or

int i = get(p)

Importing other script files can be done via the import keyword.

import some-other-file
Owner
UwUssimo Robinson
Ex @genemators. Senior UwU Enthusiast!
UwUssimo Robinson
Similar Resources

Dynamic 3D cellular automata engine with lua scripting support

Dynamic 3D cellular automata engine with lua scripting support

Cell3D Cell3D is a dynamic 3D cellular automata engine with lua scripting support Installation Dependencies: Lua 5.3 Raylib Simplest possible build co

Oct 7, 2022

Unity Scripting in C++

Unity Native Scripting A library to allow writing Unity scripts in native code: C, C++, assembly. Purpose This project aims to give you a viable alter

Dec 27, 2022

An REFramework plugin that adds Direct2D scripting APIs

REFramework Direct 2D This is an REFramework plugin that adds a Direct2D scripting API. Building Currently suggest building in RelWithDebInfo so that

Oct 24, 2022

Take Damage hook hook made to increase weapon damage, the game I made is Free Fire in version 1.65

Take-Damage Simple Take Damage hook hook made to increase weapon damage, the game I made is Free Fire in version 1.65 Bool bool isTakeDemageBool = fal

Jan 1, 2022

A programming language made in C

1. Fang A programming language made in C 1.1. Meaning Fang stands for "Feline Language". In hopes of it being cool like a cat! On top of it, you can b

Apr 8, 2021

I made this programming language at 2 AM out of boredom. This is the repository for its interpreter.

I made this programming language at 2 AM out of boredom. This is the repository for its interpreter.

Cy Another programming language How to install the interpreter Install the dependencies (git, g++, make and sudo) For Debian and Ubuntu: sudo apt inst

Jan 23, 2022

C/C++ language server supporting multi-million line code base, powered by libclang. Emacs, Vim, VSCode, and others with language server protocol support. Cross references, completion, diagnostics, semantic highlighting and more

Archived cquery is no longer under development. clangd and ccls are both good replacements. cquery cquery is a highly-scalable, low-latency language s

Jan 2, 2023

A concatenative functional language to be used as a sidekick for the mlatu language

gerku _, | | __ _, ___ ,_ __ | | __ _, _, /\___ / _` | / _ \| '__)| |

Jan 14, 2022
C and Assembly System (protogen uwu)

ProtogenOS C and Assembly System (protogen uwu) Installation for Windows: ------------- git clone Edouard127/ProtogenOS cd ./ProtogenOS curl -O https:

Feb 17, 2022
The Wren Programming Language. Wren is a small, fast, class-based concurrent scripting language.

Wren is a small, fast, class-based concurrent scripting language Think Smalltalk in a Lua-sized package with a dash of Erlang and wrapped up in a fami

Dec 30, 2022
Calculator that I Love O' so very much
Calculator that I Love O' so very much

cilo Calculator that I Love O' so very much Why C? Honestly? I enjoy programming in C and the high performance is always a bonus. The lower level of C

Sep 15, 2022
Love 6's Regular Expression Engine. Support Concat/Select/Closure Basic function. Hope u can enjoy this tiny engine :)
Love 6's Regular Expression Engine. Support Concat/Select/Closure Basic function. Hope u can enjoy this tiny engine :)

Regex_Engine Love 6's Blog Website: https://love6.blog.csdn.net/ Love 6's Regular Expression Engine Hope u can love my tiny regex engine :) maybe a fe

May 24, 2022
This repo contains solution of 450 DSA sheet by love babbar

450DSA This repo contains solution of 450 DSA sheet by love babbar . Here is the link for that list : https://450dsa.com/ Guidlines to be followed Onl

Aug 14, 2022
🎩 An interpreted general-purpose scripting language 🔨

Dunamis Version 0.0.0.2 - Alpha Version 1.1 An interpreted general-purpose programming language Contents Syntax Functions Variables Objects Enums Incl

Dec 21, 2021
a C++ scripting language

/>mpl setup />mpl requires CMake and a C++ compiler to build, rlwrap is highly recommended for running the REPL. $ cd ampl $ mkdir build $ cd build $

Nov 6, 2021
A scripting language written in C

News KGScript will be rewritten from scratch in C or C++ (a big update) Usage Usage: ./KGScript file.kgs [options] Examples prints("Example") printi(1

Nov 12, 2021
Simple, fast, JIT-compiled scripting language for game engines.
Simple, fast, JIT-compiled scripting language for game engines.

Aftel Aftel (acronym for «A Far Too Easy Language») is a programming language, primarily intended to serve as an embeddable scripting language for gam

May 20, 2022
ArkScript is a small, fast, functional and scripting language for C++ projects
ArkScript is a small, fast, functional and scripting language for C++ projects

ArkScript Documentation Discord server: invite link, to discuss the specification of the language and receive help Modules Nota bene: the project is r

Jan 1, 2023