Skip to content
vulpin-langPublic

Latest commit

 

History

156 Commits

Folders and files

Repository files navigation

Banner

Vulpin is a tiny, single character command scripting language that runs on top of C!
It was designed to let you write the smallest possible program's.



installation Installation

  • Go to Vulpin Website

  • Then tab to the Download button on novbar

  • Download and Install the version of Vulpin that you want!

or Download source!

Notice: Run as root

python setup.py

If you got Permission Denied, You didn't run them as Root.

Quick Start Quick Start

  1. Create a .vul file. Like hello.vul:
    G "Hello World!"
    G 'Hello World :D'
    G '''
     Hello World??
     I can print more text
     here!!!
    '''
  2. Run it:
    vulpin hello.vul

Tip

You can remove spaces in your app! dont worry about it! Because if you do that you can build your smallest program like this:

G"Hello World"


basic syntax Basic Syntax

name="Armin"
G"Hello"           # Prints with newline
P"Loading..."      # Prints without newline
G 5 + 3            # Prints 8
Gname            # Prints value of variable name

Note

Dividing two integers gives an integer, truncated toward zero: G 7/2 prints 3 and G -7/2 prints -3. Use a float for a fractional result (G 7.0/2 prints 3.5), and math.floor() to round a float down.


output Output

Hello
Loading...8
Armin

input Input

K user "Your name: "
G"Hi, " + user

# Typed input (invalid → default value)
K age"Age: "I        # Integer (default 0)
K price"Price: "F    # Float (default 0.0)
K letter"Guess: "L   # Single letter (default "")

Kinput"K can write like this! :)"

Type characters for K:

Char Type Default if invalid
I Integer 0
F Float 0.0
N Number (int/float) 0
L Single letter ""
W Word (letters only) ""
E Lowercase only ""
U Uppercase only ""
A Letters + spaces ""
P Alphanumeric + spaces ""

vars Variables

x=10               # Direct assignment
name="Vul"

A"x"+5             # x = x + 5
S"name""Vul""VUL"  # Replace in string
D"y"               # Delete variable

String shortcuts:

Shortcut Method Example ($msg.S)
.U upper() "hello".U → "HELLO"
.L lower() "HELLO".L → "hello"
.S strip() " hi ".S → "hi"
.T title() "hi there".T → "Hi There"
.C capitalize() "hello".C → "Hello"

lists dicts sets Lists, Dicts & Sets

l=[1, 2, 3]
G l              # [1, 2, 3]
G l[0]           # 1
G l[-1]          # 3 (negative index counts from the end)
l[0]=99          # index assignment
G l              # [99, 2, 3]

d={"a":1, "b":2}
G d["a"]         # 1
d["c"]=3         # add/overwrite a key
G d              # {"c": 3, "b": 2, "a": 1}  (Dict/Set order is unspecified)

s={1, 2, 3}      # a set is just a brace-list with no ":"
G s+{4}          # union
G s-{2}          # difference

empty={}         # empty braces are always an empty Dict

Membership, with in:

? 2 in s
    G"found it"
;

Built-in functions:

Function Does Example
len(x) length of a List/Dict/Set/Str len(l) → 3
push(l, v) append v to List l (mutates) push(l, 4)
pop(l) remove & return the last item pop(l)
keys(d) List of a Dict's keys keys(d)
values(d) List of a Dict's values values(d)

Note

Lists, Dicts and Sets are references, same as in Python — assigning or passing one around shares the same data, so push/pop/index-assign inside a function are visible to the caller.


delay Delay

D1          # wait 1 second
D0.5        # wait 0.5 seconds
D delay    # wait the value of variable

modules Imports

You can Import Vulpin Modules with using U.

G os.getcwd()
os.system("echo Hello")
os.system(ls)
U"math"
G math.sqrt(16)
Fun Fact

os.system() and os() and o() are the same! and you can write like: o"echo hi"!! with no ()!!

control flow Control Flow

if else If / Else

score=85
? score m 90 # m means >=
    G"A"
:
? score m 80 # m means >=
    G"B"
:
    G"C"
;
;

and also <= means l if you want to use.

jump Conditional Jump

x=5
? x > 3 J skip
G"Not printed"
L skip
G"Printed"

while While Loop

i=0
@ i < 5
    G i
    i=i+1
&

infinite loop Infinite Loop

@1
    G"Running forever..."
&

for range For‑Range Loop

O i 0 5            # 0,1,2,3,4
    G i # or Gi
&

O x 10 0 -2        # 10,8,6,4,2
    G x # or Gx
&

switch case Switch / Case

fruit="apple"
W fruit
V"banana"
G"yellow"
V"apple"
G"red or green"
N
G"unknown"
Z

lables and jumps Labels & Jumps

J end
G"Skipped"
L end
G"Done"

Functions Functions

F add(a, b)
    R a + b
~

G add(3, 4)       # 7

F greet(name)
    G"Hello " + name
~

greet("World")

error handling Error Handling

T
    x=10
    y=0
    G x/y        # division by zero!
C"err"
    G"Error: " + err
Y
G"Continues..."

output Output

Error: division by zero
Continues...

basic syntax Inline Commands

You can write all of your commands just in a line by using ;!!

For example:

a=5;?a==5;G"yes it is!";

In a word: ; breaks each command's


complete examples Complete Examples

hello world Hello World

G"Hello World"

guess Guessing Game

U"random"
secret=random.randint(1,10)
tries=0
L guess
Knum"Guess (1-10): ""I"
tries=tries+1
? num=secret
    G"Correct! Tries: "+tries
    Q
:? num<secret G"Higher"
: G"Lower"
;
J guess

factory Factorial

F factorial(n)
    ? n<=1
        R 1
    ;
    R n*factorial($n-1)
~

G factorial(5)   # 120

information Checking vul version

To check the version of Vul you are running:

vulpin version

Output:

Vulpin 1.0.1

fix Troubleshooting

Let's fix your problems!

  • Python Type Hint Syntax Error: this is known error in new Vulpin version like you can see it at most in version 0.5 but thats easy to fix!

sotn Some of the notes

  • Spaces are optional after commands. G"Hi" and G "Hi" both work.
  • The dot operator (like os.name) works correctly in the latest release. If you encounter issues, use the --debug flag to see detailed parser output.

licence License

MIT LICENCE. CHECK OUT LICENCE. ICONS ARE UNDER LICENCE TOO.


party popper

Happy coding with Vulpin!

Sponsers:

FluxCast

Releases

Contributors

Languages