Skip to content

MekahimeAkari/foxscream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

foxscream

Intro

Foxscream is a language mostly for hacking/scripting language inspired by Python but with syntax closer to Swift with a inspiration from Zig and Rust. The intention is to produce an easy to use, easy to read language that can replace Python for hacking out small programs. It is not intended to be fast, but one of the goals is a cannonical compiled form.

A description of the syntax can be found at SYNTAX.md. When finished, an discussion of the type system will be in TYPES.md.

Foxscream scripts use ".ff" as the extension as ".fs" is used by F# and I have no desire to compete! "ff" stands for "Fuwa Fuwa" which is "fluffy" in Japanese (like my tail!).

Example

There are examples in the ex/ directory (also used at the moment for testing the language implementation) but a simple example of a foxscream script:

# comment

fn func(a, b)
{
    while a > b
    {
        print(a)
        a = a - 1
    }
}

fn func2(a)
{
    for i in [a] print(a) # will just print a but illustrates for loop
}

fn func3(a, b)
{
    do
    {
        print(b) # prints the value of b, then continues until b == a
        b = b - 1
    } while b > a
}

a = 3
b = 1
if a > b
{
    func(a, b) # prints "3", "2"
}
elif a == b
{
    func2(a) # prints a if a == b
}
else
{
    func3(a, b)
}

More information can be found in SYNTAX.md.

Usage

Use interp.py to try out the language. If you run it without any arguments, you'll get the REPL. Otherwise, you can write a script and provide it as the first argument (try out ex/ex8.ff as an example!)

Example status

Progress

Basic language structure

  • comments
  • basic arithmetic
  • basic comparisons
  • assignment
  • if expressions
  • while loops
  • for loops
  • functions
  • basic classes
  • basic inheritance
  • return
  • break
  • continue
  • defer
  • leave
  • control expressions to labels
  • closures
  • functions or classes returned/assigned
  • match expressions
  • elfor/elwhile (works with if/else)
  • exceptions/error handling syntax
  • tuples
  • import
  • namespaces
  • using
  • augmented assignment
  • array operators
  • operator overloading
  • function overloading
  • string formatting
  • regex syntax
  • grammar syntax
  • complex numbers?
  • vectors/matrices?
  • typing system
    • type syntax
  • user input
  • ffi
    • C ffi
    • C++ ffi
    • Python ffi
    • others?
  • shell interaction
  • multiline comments?
  • docstrings/help?

Standard library

  • A standard library
    • Actually write down what needs to be in the standard library

Interpreter

  • Python implementation
    • REPL
    • Run scripts
    • package correctly
    • help
    • import system
    • ffi
    • bytecode
    • compliation?
    • comment better
  • C implementation
  • remove old/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages