A new, simple and fun programming language built in native Swift
Branch: swizzle-1.0
Clone or download

README.md

Swizzle Banner

extend Sequence {
  func prefix(length: Int) -> PrefixSequence<E> {
    return PrefixSequence<E>(self, length);
  }
}

var array: Buffer<Int>;
array = ...;
print(array.reversed().prefix(5));
print(&array.address());

Some code in Swizzle

Build Status Swift Version license:MIT

Quick Links

Roadmap

  • Basic
    • Implement lexer
      • Speed up lexer
    • Parsing
  • Analysis
    • Static type checking
    • Scope resolution
  • Compiling
    • Compile time custom phases
    • Building the IR
  • Executing
    • Stage 2 Compiler
    • Virtual Machine

What is it?

Swizzle is a fast, static typed programming language that is all new and all fun. Swizzle has a syntax that is similar to other popular programming languages.

Though Swizzle is still in development, I would say it is slightly functional.

Here is a (small) list of Swizzle's functionality.

  • Variables and constants
  • User defined functions
  • Control flow (if, while, for)
  • Operators
  • Custom structures
  • Extension of structures
  • Protocols

For more, visit the documentation.

The Goal

Swizzle attempts to fill in a niche for graphics programming. There are not many simple, powerful and fast compiled langauges for this purpose. Swizzle hopes to succeed in all those categories.

Tutorials:

Similar to many languages, Swizzle requires semicolons to terminate statements. Even though this may be annoying, it actually helps make the error messages better so you can write cleaner and safer code. See this pull request if you do not want to use semicolons.

What is included?

Swizzle comes with an compiler and virtual machine, using a modified version of BytecodeVM. It uses 2 stages in compiling. One stage is for turning the AST into an IR. This is where Swizzle checka to make sure you did not write anything wrong. The next stage is turning the IR into bytecode, which can be interpreted by the vm. Swizzle is written in Swift so there is not much of a performance loss in all these stages.

How can I use it?

You cannot use it as of now because the source code is still in active development. The source code is not up here because of this issue.

Contributing

Swizzle is not perfect. Or rather only as perfect as the people who help. If you want to make Swizzle a better language or want to see a feature added/report a bug, see the contributing guidelines!

Versions

The latest feature release is v0.4. The latest small release is v0.4.0.

For more information on releases, go here.

Beyond Swizzle

Requirements

You will need Xcode 9 or higher, and Swift 4 or higher.

License

Swizzle is released under the MIT License

Code of Conduct

We will not tolerate unacceptable behavior. If you feel that someone has made an action that is not appropreiate, be sure to contact me at safelyswift@gmail.com.

Read the full document for more details.