GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - JBrosDevelopment/Norma: Norma is a small custom programming language made as an example for my blog.

BranchesTags
Open more actions menu

Latest commit

 

History

34 Commits
34 Commits

Folders and files

NameName
Last commit message
Last commit date
Bear Bootstrap
Bear Bootstrap
 
 
Projects
Projects
 
 
code extension
code extension
 
 
images
images
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
Code.norm
Code.norm
 
 
Define.cs
Define.cs
 
 
Execution.cs
Execution.cs
 
 
FunctionTesting.norm
FunctionTesting.norm
 
 
Functions.cs
Functions.cs
 
 
Interprete.cs
Interprete.cs
 
 
LISENCE
LISENCE
 
 
Lexer.cs
Lexer.cs
 
 
Norma.csproj
Norma.csproj
 
 
NormaLanguage.sln
NormaLanguage.sln
 
 
Parser.cs
Parser.cs
 
 
Program.cs
Program.cs
 
 
README.md
README.md
 
 
Statements.cs
Statements.cs
 
 
Struct.cs
Struct.cs
 
 
Variable.cs
Variable.cs
 
 

Repository files navigation

Norma Programming Language

**Find Article about making it HashNode**

Norma is a programming language built in C# made to be extremely simple. It's syntax is similar to Python and JavaScript, but has my own custom spin on it.

Here is the Nuget Package if you want to add it to your C# project

dotnet add package Norma

icon

Norma is a very simple language. To define a variable, use:

var x = 10

To access the variable put it in between $

var y = $x$

To create a pointer to that variable, use the point keyword.

var z = point: $x$

To call a function, don't use parenthesis.

print "Hello World"

Strings have automatic interpolation with variables using the $ syntax.

print "X is equal to $x$ and y is equal to $y$"

To define a function, use def

def add: left, right {
    return ($left$ + $right$)
}

add 5, 6

Any equations must be inside ( ).

var x = ($y$ * $z$)

To manipulate a variable, use + instead of += where + can be any operator

var x = 10
x + 5
x - 4
x * 3
x / 2
x = 1

print $x$

Comments are very simple

// Line Comment
/*
    Block Comment
*/

Arrays are also allowed in this language

var y = [0, 1, 2]

They are typeless and can hold anything including pointers

y = [0, "yes", ["no", $z$], point: $x$]

Structs are the next main feature

struct Vector { X, Y, Z }

var vec = Vector: 100, 5.23, 99

They can be accessed and modified easily,

vec.X = 150
vec.Y = $vec.X$

The values are also typeless and can be anything

vec.X = "Hello World"
vec.Y = point: $z$
vec.Z = [1, 2, 3]

Statements are straightforward as well

if x > 55 { 
    print "X is big"
}
elif x < 0 {
    print "X is negative"
}
else { 
    print "x is small"
}

There are loops as well

while true {
    print "yes"
}
for i in 150 {
    print $i$
}

For loops can also use arrays

for value in $array$ {
    print $value$
}

There are many built in functions as well (Test file):

  • print "text"
  • input
  • clear
  • exit
  • substring "text", $start$, $len$
  • indexOf "text", "e"
  • toLower "Text"
  • toUpper "text"
  • trim " text "
  • revere "string or array"
  • length ["string", "or", "array"]
  • append [0, 1], 5
  • remove $index$
  • insert $array$, $index$, $value$
  • slice [99, 98, 97, 96, 95], $start$, $len$
  • concat $array$, [0, 1, 2, 3]
  • sort [9, 5, 7, 2, 0]
  • runCode $code$
  • readFile "path/to/file.txt"
  • writeFile "path/to/file.txt", "text"
  • createFile "path/to/file.txt"
  • deleteFile "path/to/file.txt"

About

Norma is a small custom programming language made as an example for my blog.

jbrosdev.hashnode.dev/guide-to-building-your-own-programming-language-with-c

Topics

customlanguagenormaprogrammingprogramming-language

Resources

Readme
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.