Coder Social home page Coder Social logo

sylphscript's Introduction

SylphScript ๐Ÿงš

Welcome to SylphScript! ๐ŸŽ‰

SylphScript is a programming language inspired by C#.

Features โœจ

  • Simplified Syntax: Enjoy a syntax similar to C#!
  • Everything expandable: Almost every aspect of SylphScript is extendable, allowing you to customize parsers, functions, types, and more with ease.
  • Interactive Interpreter: SylphScript functions as an interpreter, enabling rapid development and testing of your code.

Getting Started ๐Ÿš€

To start using SylphScript, follow these simple steps:

  1. Install SylphScript: Download the latest version of SylphScript interpreter.
  2. Write Your Code: Craft your SylphScript code using your favorite text editor.
  3. Run the Interpreter: Execute your SylphScript code using the interpreter to see it in action!

Example Code ๐Ÿ’ป

You can find more examples here.

Fibonacci numbers:

[Code image]

Function Registration ๐Ÿ“

Before using functions in SylphScript, make sure to register them. Here's how you can do it:

string addTest(string str){
    return "Test: " + str
}

Classes and Objects ๐Ÿ—๏ธ

Classes in SylphScript support object-oriented programming principles. Here's an example of defining and using a class:

class Vector{
	int X = 0
	int Y = 0
	
	Vector Vector(){}
	
	Vector Vector(int x, int y){
		Vector v = Vector()
		v.X = x
		v.Y = y
		return v
	}
	
	static Vector Add(Vector v1, Vector v2){
		return Vector(v1.X + v2.X, v1.Y + v2.Y)
	}
}

Vector vec = Vector(3, 5)
int x = Vector.Add(vec, Vector(2, 7)).X
print("X:" + x)

Value/Reference Semantics ๐Ÿ”„

SylphScript supports value and reference semantics, allowing efficient handling of variables:

string tstr1 = "Test"       // variable initialization
string tstr2 = tstr1        // Value would be copied
string tstr3 =* tstr1       // Reference would be copied
tstr1 =+ tstr1 + "1"        // Assignment of a new value for "tstr1" but also for all references! If you change "=+" to "=" just "tstr1" would be overwritten.

License ๐Ÿ“„

SylphScript is licensed under the MIT License.

Disclaimer

This programming language isn't finished and can contain bugs.

sylphscript's People

Contributors

finn-freitag avatar

Watchers

 avatar

sylphscript's Issues

Reference semantics

The value that is saved in VariableHolder must just be a reference to a value in a variable value list.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.