Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

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

AOT compiled object oriented programming language

License

NotificationsYou must be signed in to change notification settings

Blazify/blazex

Repository files navigation

An object orineted AOT compiled language which is gradual typed

Installing

$ git clone https://github.com/BlazifyOrg/blazex.git$cd blazex$ make$cd ..# Set $HOME/.blazex to PATH

Confirm Installation

$ blazex
error: The following required arguments were not provided:    <path>USAGE:    blazex [FLAGS] [OPTIONS] <path>For more information try --help

Example

  • Printing the famous "Hello World"
extern variadic fun printf(string): int;printf("Hello World!") @ yep as simple as that
  • Comments
@ single line comment@@multi-line comment@@
  • Creating and calling functions
fun sum(a, b) {    var c = a + b;    return c;}println("%i", sum(2, 2));
  • Working around with objects
var obj = {    prop: 5 @ properties should be Identifier or there will be Invalid Syntax Error}println("%i", obj.prop); @ accessing object propertyobj.prop = 10; @ editing object property valueprintln("%i", obj.prop) @ 10
  • Classes
class Main {    var a = 10; @ this is a property    @ this is constructor    fun() {        soul.a = 5; @ soul is the current object it's operating on     }    @ this is a method    fun sum_to_a(b) {        soul.a = soul.a + b;        return soul.a;    }}var ins = new Main(); @ creating/initializing a class, returns a object with the propertiesprintln("%i", ins.sum_to_a(5));

Dependencies

  • llvm_sys (Interacting with LLVM)
  • codespan-reporting (Errors)
  • mimalloc (Memory allocation)
  • structopt (Argument parsing)
  • notify (Look for file changes)

Contributing

  • Fork the repository
  • Create a branch with the patch/feature you want
  • Make Changes to the code
  • Commit the code (Use theEmoji Commit Style) and the message should **NOT** contain the word "release"
  • Finally, push the code and make a pull request

Project Structure

CrateDescription
blazexThe binary
bzxc_lexerLexer for Tokenizing
bzxc_parserParser for AST Tree
bzxc_type_systemType System
bzxc_llvmLLVM IR Code Generation
bzxc_sharedThings Shared among crates

TODO

  • Type System
  • LLVM
  • Errors
    • Lexer
    • Parser
    • Type System
    • LLVM
  • Reading from file
  • Lexer
  • Parser
  • AST

Author

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp