Skip to content

johan-jnn/flylang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flylang

A programming language made to be as simple as powerful. It includes variable definitions, objects, OOP, function declarations, if/else, and way more ! Originaly written in NodeJS, I decided to re-write it in Rust to have better performances.

The ultimate goal

With this language I don't just want to have an interpreter, or compiler. I want to have the language being compilable into any other languages, or interpreted in different maniers.

Why ?

Because it could be cool for exemple programming language speed comparison to write a code in a single language, and by typing a command have the exact same program in different languages.

How ?

After finishing the lexer and parser, I want the compiling part to be used trough "add-ons" (at this time I don't really know how I'll achieve that). For exemple, you download a Flylang Add-On on a website (maybe the futur flylang's website ?), then you place it into a specific folder, and now the flylang cli will reconize it as an Add-On and with a command you can now compile your flylang program into the Add-On's one.

RoadMap

This roadmap may change in futur (because I surely forget some features)

Lexer

Points ending with * means the syntax may change in futur.

  • Literals
  • Scope naming (@name (...), @<+, @<positive-integer>)
  • Modifiers (#(modifier1, modifier2, ...) fn())
  • Typing syntax
  • Keywords
    • if
    • else
    • fn
    • cs
    • kind
    • use (use [(x, y, ...) from] "<module>" [in <variable>] - By just using use <mod>, all elements in <mod> will be global)
    • Breakers
      • stop [@loop-scope?] : stop (like "break") a loop
      • return [@fn-scope?] [value?] : return value to a function (default value too ())
      • pass [@scope?] : pass a scope (go the the end of it). This can be used to pass an if block, or to reloop
  • Loops (while, until & each)
  • Operations (_+, -, _, \*\*, /, //, %, &(and), ?(or), ~(xor), =(equal), <, >_)
  • Variable declarations (:, ::)
  • Objects/arrays ({, })

Parser

Element non implemented in the Lexer is not marked in the list bellow.

  • Literals
  • Function definition
  • Function call
  • Variable declaration
  • Operations and priorities
  • Class definition
  • Class instanciation
  • Class items' visibility
    • Public (default)
    • Private
    • Protected
    • Static
  • If/else
  • Loops
  • Objects (unstable)
  • Arrays
  • Scope naming
  • Modifiers
  • Single expression function as lambda (ex: fn foo(true) will always return true (and not ()) because it has only 1 instruction. To avoid this, use fn foo(true; ()))
  • Breakers
  • Use
    • Parsed syntax
    • Location resolver
    • Parsing

Analyser

TODO

Optimizer

TODO

Syntax

The goal of this language is to have a very minimalist syntax while being very powerful. At this time I'm too busy to re-write a documentation of the language's syntax, so you could go on my website to have more informations.

A better documentation is currently being written in the docs folder of this repository.

About

Source code of my dream programming language

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Contributors

Languages