Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Nova is a structured and strongely typed programming language with a high level of abstraction. This repository contains the nova's virtual machine written in C++ (iso 17)

NotificationsYou must be signed in to change notification settings

Skinz3/Nova.VirtualMachine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Nova is a programming language with a high level of abstraction. This repository contains a compiler in C# (.NET) and a virtual machine in C++ (iso 17)

Paradigms:
  • Compiled (into bytecode, no JIT for now)
  • Structured
  • Imperative
  • Functional
  • Strong typing
Example:
using <nova> // Nova std library// This code is written in Nova !class MyClass{  public int Main()  {      Human human = -> Human("Freddy",18)      human.PrintAge()      Vector myVect = [7,8,9,10]      myVect.Add(5)      myVect.Print() // Print '7,8,9,10,5'  }}struct Human{  public string Name  public int Age    -> Human(string name,int age) // Human constructor  {      Name = name      Age = age  }  public void PrintAge()  {      Nova.PrintLine(Name + " is " + Age + " years old")  }}
How is the language working ?
  • Once your nova file(s) source code is written. Just give it to the C# compiler.
  • The compiler will generate a .nov file (sources to bytecode)
  • Give the .nov to the C++ virtual machine and it will run your program from Main() function.
Builder

builder

NOV File

NOV Files

How to run
  • git clonehttps://github.com/Skinz3/Nova.git
  • Build Nova.Compiler & Nova.VM
  • ./Nova.Compiler mySourceFile.nv output.nov ---> myScript.nv must have a main point entry.
  • ./Nova.VM output.nov ----> execute the program

Nova Bytecode

OpCodeResult
addAdd two numbers on top of the stack
compcompare two éléments on top of the stack (passing operator as arg)
ctorCallCall the constructor of the struct on top of the stack
divDivide two numbers on top of the stack
dupDuplicate element on top of the stack, and put it on tos
jumpDefine instruction pointer value
jumpIfFalseDefine instruction pointer if condition is false on tos
loadLoad local value
loadGlobalLoad static element on top of the stack
callCall a method / function
mulMultiply two numbers on top of the stack
natCall a native method(Network, IO, kernel, all system calls in general)
pushConstPush constant value on top of the stack
pushIntPush integer on top of the stack (unused)
pushNullPush a Null value (nova semantics) on the top of the stack
returnSet instruction ptr = instructions.length
storeStore a local value
storeGlobalStore a static value
structCallMethodCall a struct method
structCreateCreate a new Struct an put it on tos (typeId as parameter)
structLoadMemberLoad a structure member and put it on tos
structPushCurrentPush current executing structure on top of the stack
structStoreMemberStore tos as a structure member value
subSubstract two numbers
vectCreateCreate a Vector and put it on tos

Thanks

Thanks to Uriopass (https://github.com/Uriopass) for his precious help

Contacts

My discord is:Skinz#1128

About

Nova is a structured and strongely typed programming language with a high level of abstraction. This repository contains the nova's virtual machine written in C++ (iso 17)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp