Skip to content

HeartofTheForce/HeartScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HeartScript

C-like IL compiled custom language

Functionality

  • Control-flow (if-else, for loop, while loop, do while loop)
  • Primtive types int, double, bool
  • Arrays
  • Methods, Method Overloading
  • .NET Method injection
  • Arithmetic Operators

Example

dotnet run --project ./src/HeartScript.Cli ./src/demo.hs

  • Quicksort implementation demo.hs
  • Grammar used to parse the language demo.hg

How it works

  • Generate a Parse Tree using Heart.Parsing
  • Rewrite Parse Tree into an Abstract Syntax Tree
  • Emit IL while traversing Abstract Syntax Tree

Missing things

  • User friendly error reporting, invalid operations will not provide the relevant location in the source file
  • Definite assignment analysis No error checking for definite assignment, variables are initialized to their default value
  • Data-flow analysis No error checking for returns values (returns default value of method return type)

Further Reading

About

C-like IL compiled custom language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published